From xen-changelog-bounces@lists.xen.org Mon Jan 04 15:44:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Jan 2016 15:44:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aG7In-0005Dg-Bs; Mon, 04 Jan 2016 15:44:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7Im-0005DU-61
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:08 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	5A/95-27104-7439A865; Mon, 04 Jan 2016 15:44:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1451922244!8324859!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12317 invoked from network); 4 Jan 2016 15:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2016 15:44:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7Ii-0002L6-52
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7Ih-0001PN-PU
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:04 +0000
Date: Mon, 04 Jan 2016 15:44:03 +0000
Message-Id: <E1aG7Ih-0001PN-PU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional master] MSI-X: avoid array
	overrun upon MSI-X table writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 569eac99e8ddccd15fe78e8a3af5622afe780e3b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 4 15:34:29 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:34:29 2016 +0000

    MSI-X: avoid array overrun upon MSI-X table writes
    
    pt_msix_init() allocates msix->msix_entry[] to just cover
    msix->total_entries entries. While pci_msix_readl() resorts to reading
    physical memory for out of bounds reads, pci_msix_writel() so far
    simply accessed/corrupted unrelated memory.
    
    pt_iomem_map()'s call to cpu_register_physical_memory() registers a
    page granular region, which is necessary as the Pending Bit Array may
    share space with the MSI-X table (but nothing else is allowed to). This
    also explains why pci_msix_readl() actually honors out of bounds reads,
    but pci_msi_writel() doesn't need to.
    
    This is XSA-164.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 hw/pt-msi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 3f5f94b..c6baea9 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -440,6 +440,13 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
         return;
     }
 
+    if ( addr - msix->mmio_base_addr >= msix->total_entries * 16 )
+    {
+        PT_LOG("Error: Out of bounds write to MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
+        return;
+    }
+
     entry_nr = (addr - msix->mmio_base_addr) / 16;
     entry = &msix->msix_entry[entry_nr];
     offset = ((addr - msix->mmio_base_addr) % 16) / 4;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Jan 04 15:44:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Jan 2016 15:44:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aG7In-0005Dg-Bs; Mon, 04 Jan 2016 15:44:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7Im-0005DU-61
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:08 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	5A/95-27104-7439A865; Mon, 04 Jan 2016 15:44:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1451922244!8324859!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12317 invoked from network); 4 Jan 2016 15:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2016 15:44:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7Ii-0002L6-52
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7Ih-0001PN-PU
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:04 +0000
Date: Mon, 04 Jan 2016 15:44:03 +0000
Message-Id: <E1aG7Ih-0001PN-PU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional master] MSI-X: avoid array
	overrun upon MSI-X table writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 569eac99e8ddccd15fe78e8a3af5622afe780e3b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 4 15:34:29 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:34:29 2016 +0000

    MSI-X: avoid array overrun upon MSI-X table writes
    
    pt_msix_init() allocates msix->msix_entry[] to just cover
    msix->total_entries entries. While pci_msix_readl() resorts to reading
    physical memory for out of bounds reads, pci_msix_writel() so far
    simply accessed/corrupted unrelated memory.
    
    pt_iomem_map()'s call to cpu_register_physical_memory() registers a
    page granular region, which is necessary as the Pending Bit Array may
    share space with the MSI-X table (but nothing else is allowed to). This
    also explains why pci_msix_readl() actually honors out of bounds reads,
    but pci_msi_writel() doesn't need to.
    
    This is XSA-164.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 hw/pt-msi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 3f5f94b..c6baea9 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -440,6 +440,13 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
         return;
     }
 
+    if ( addr - msix->mmio_base_addr >= msix->total_entries * 16 )
+    {
+        PT_LOG("Error: Out of bounds write to MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
+        return;
+    }
+
     entry_nr = (addr - msix->mmio_base_addr) / 16;
     entry = &msix->msix_entry[entry_nr];
     offset = ((addr - msix->mmio_base_addr) % 16) / 4;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Jan 04 15:44:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Jan 2016 15: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 1aG7Iy-0005Fl-HD; Mon, 04 Jan 2016 15: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 1aG7Ix-0005Ey-Cr
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:19 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	84/D5-27104-2539A865; Mon, 04 Jan 2016 15:44:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1451922255!8452496!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55943 invoked from network); 4 Jan 2016 15:44:16 -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;
	4 Jan 2016 15:44:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7It-0002LM-By
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7It-0001QA-4i
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:15 +0000
Date: Mon, 04 Jan 2016 15:44:15 +0000
Message-Id: <E1aG7It-0001QA-4i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] MSI-X: avoid
	array overrun upon MSI-X table writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7457f4beae2583a106a4176949514e81248fc22d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 4 15:34:29 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:35:42 2016 +0000

    MSI-X: avoid array overrun upon MSI-X table writes
    
    pt_msix_init() allocates msix->msix_entry[] to just cover
    msix->total_entries entries. While pci_msix_readl() resorts to reading
    physical memory for out of bounds reads, pci_msix_writel() so far
    simply accessed/corrupted unrelated memory.
    
    pt_iomem_map()'s call to cpu_register_physical_memory() registers a
    page granular region, which is necessary as the Pending Bit Array may
    share space with the MSI-X table (but nothing else is allowed to). This
    also explains why pci_msix_readl() actually honors out of bounds reads,
    but pci_msi_writel() doesn't need to.
    
    This is XSA-164.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 569eac99e8ddccd15fe78e8a3af5622afe780e3b)
---
 hw/pt-msi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 3f5f94b..c6baea9 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -440,6 +440,13 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
         return;
     }
 
+    if ( addr - msix->mmio_base_addr >= msix->total_entries * 16 )
+    {
+        PT_LOG("Error: Out of bounds write to MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
+        return;
+    }
+
     entry_nr = (addr - msix->mmio_base_addr) / 16;
     entry = &msix->msix_entry[entry_nr];
     offset = ((addr - msix->mmio_base_addr) % 16) / 4;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Mon Jan 04 15:44:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Jan 2016 15: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 1aG7Iy-0005Fl-HD; Mon, 04 Jan 2016 15: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 1aG7Ix-0005Ey-Cr
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:19 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	84/D5-27104-2539A865; Mon, 04 Jan 2016 15:44:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1451922255!8452496!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55943 invoked from network); 4 Jan 2016 15:44:16 -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;
	4 Jan 2016 15:44:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7It-0002LM-By
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7It-0001QA-4i
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:15 +0000
Date: Mon, 04 Jan 2016 15:44:15 +0000
Message-Id: <E1aG7It-0001QA-4i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.6] MSI-X: avoid
	array overrun upon MSI-X table writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7457f4beae2583a106a4176949514e81248fc22d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 4 15:34:29 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:35:42 2016 +0000

    MSI-X: avoid array overrun upon MSI-X table writes
    
    pt_msix_init() allocates msix->msix_entry[] to just cover
    msix->total_entries entries. While pci_msix_readl() resorts to reading
    physical memory for out of bounds reads, pci_msix_writel() so far
    simply accessed/corrupted unrelated memory.
    
    pt_iomem_map()'s call to cpu_register_physical_memory() registers a
    page granular region, which is necessary as the Pending Bit Array may
    share space with the MSI-X table (but nothing else is allowed to). This
    also explains why pci_msix_readl() actually honors out of bounds reads,
    but pci_msi_writel() doesn't need to.
    
    This is XSA-164.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 569eac99e8ddccd15fe78e8a3af5622afe780e3b)
---
 hw/pt-msi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 3f5f94b..c6baea9 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -440,6 +440,13 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
         return;
     }
 
+    if ( addr - msix->mmio_base_addr >= msix->total_entries * 16 )
+    {
+        PT_LOG("Error: Out of bounds write to MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
+        return;
+    }
+
     entry_nr = (addr - msix->mmio_base_addr) / 16;
     entry = &msix->msix_entry[entry_nr];
     offset = ((addr - msix->mmio_base_addr) % 16) / 4;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Mon Jan 04 15:44:32 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Jan 2016 15:44: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 1aG7JA-0005Hd-La; Mon, 04 Jan 2016 15:44: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 1aG7J9-0005HM-3Y
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:31 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	CC/6A-00475-E539A865; Mon, 04 Jan 2016 15:44:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1451922266!14617661!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42295 invoked from network); 4 Jan 2016 15:44:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2016 15:44:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7J4-0002LX-Es
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7J4-0001Qv-Aa
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:26 +0000
Date: Mon, 04 Jan 2016 15:44:26 +0000
Message-Id: <E1aG7J4-0001Qv-Aa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.5] MSI-X: avoid
	array overrun upon MSI-X table writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f5bf3ed6eaa752d91e4d1fb1675b4c3e9f984c71
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 4 15:34:29 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:36:03 2016 +0000

    MSI-X: avoid array overrun upon MSI-X table writes
    
    pt_msix_init() allocates msix->msix_entry[] to just cover
    msix->total_entries entries. While pci_msix_readl() resorts to reading
    physical memory for out of bounds reads, pci_msix_writel() so far
    simply accessed/corrupted unrelated memory.
    
    pt_iomem_map()'s call to cpu_register_physical_memory() registers a
    page granular region, which is necessary as the Pending Bit Array may
    share space with the MSI-X table (but nothing else is allowed to). This
    also explains why pci_msix_readl() actually honors out of bounds reads,
    but pci_msi_writel() doesn't need to.
    
    This is XSA-164.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 569eac99e8ddccd15fe78e8a3af5622afe780e3b)
    (cherry picked from commit 7457f4beae2583a106a4176949514e81248fc22d)
---
 hw/pt-msi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 3f5f94b..c6baea9 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -440,6 +440,13 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
         return;
     }
 
+    if ( addr - msix->mmio_base_addr >= msix->total_entries * 16 )
+    {
+        PT_LOG("Error: Out of bounds write to MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
+        return;
+    }
+
     entry_nr = (addr - msix->mmio_base_addr) / 16;
     entry = &msix->msix_entry[entry_nr];
     offset = ((addr - msix->mmio_base_addr) % 16) / 4;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Mon Jan 04 15:44:32 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Jan 2016 15:44: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 1aG7JA-0005Hd-La; Mon, 04 Jan 2016 15:44: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 1aG7J9-0005HM-3Y
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:31 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	CC/6A-00475-E539A865; Mon, 04 Jan 2016 15:44:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1451922266!14617661!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42295 invoked from network); 4 Jan 2016 15:44:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2016 15:44:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7J4-0002LX-Es
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7J4-0001Qv-Aa
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:26 +0000
Date: Mon, 04 Jan 2016 15:44:26 +0000
Message-Id: <E1aG7J4-0001Qv-Aa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.5] MSI-X: avoid
	array overrun upon MSI-X table writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f5bf3ed6eaa752d91e4d1fb1675b4c3e9f984c71
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 4 15:34:29 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:36:03 2016 +0000

    MSI-X: avoid array overrun upon MSI-X table writes
    
    pt_msix_init() allocates msix->msix_entry[] to just cover
    msix->total_entries entries. While pci_msix_readl() resorts to reading
    physical memory for out of bounds reads, pci_msix_writel() so far
    simply accessed/corrupted unrelated memory.
    
    pt_iomem_map()'s call to cpu_register_physical_memory() registers a
    page granular region, which is necessary as the Pending Bit Array may
    share space with the MSI-X table (but nothing else is allowed to). This
    also explains why pci_msix_readl() actually honors out of bounds reads,
    but pci_msi_writel() doesn't need to.
    
    This is XSA-164.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 569eac99e8ddccd15fe78e8a3af5622afe780e3b)
    (cherry picked from commit 7457f4beae2583a106a4176949514e81248fc22d)
---
 hw/pt-msi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 3f5f94b..c6baea9 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -440,6 +440,13 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
         return;
     }
 
+    if ( addr - msix->mmio_base_addr >= msix->total_entries * 16 )
+    {
+        PT_LOG("Error: Out of bounds write to MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
+        return;
+    }
+
     entry_nr = (addr - msix->mmio_base_addr) / 16;
     entry = &msix->msix_entry[entry_nr];
     offset = ((addr - msix->mmio_base_addr) % 16) / 4;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Mon Jan 04 15:44:40 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Jan 2016 15: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 1aG7JI-0005JW-Pf; Mon, 04 Jan 2016 15:44: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 1aG7JI-0005JE-0t
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:40 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	FB/70-13487-7639A865; Mon, 04 Jan 2016 15:44:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1451922277!13598947!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41290 invoked from network); 4 Jan 2016 15:44:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2016 15:44:38 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7JF-0002Lf-Ni
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7JF-0001S8-Dw
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:37 +0000
Date: Mon, 04 Jan 2016 15:44:37 +0000
Message-Id: <E1aG7JF-0001S8-Dw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.4] MSI-X: avoid
	array overrun upon MSI-X table writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2bbe49494f5e910c6fb49f6800d143cae9eb5758
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 4 15:34:29 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:36:18 2016 +0000

    MSI-X: avoid array overrun upon MSI-X table writes
    
    pt_msix_init() allocates msix->msix_entry[] to just cover
    msix->total_entries entries. While pci_msix_readl() resorts to reading
    physical memory for out of bounds reads, pci_msix_writel() so far
    simply accessed/corrupted unrelated memory.
    
    pt_iomem_map()'s call to cpu_register_physical_memory() registers a
    page granular region, which is necessary as the Pending Bit Array may
    share space with the MSI-X table (but nothing else is allowed to). This
    also explains why pci_msix_readl() actually honors out of bounds reads,
    but pci_msi_writel() doesn't need to.
    
    This is XSA-164.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 569eac99e8ddccd15fe78e8a3af5622afe780e3b)
    (cherry picked from commit 7457f4beae2583a106a4176949514e81248fc22d)
    (cherry picked from commit f5bf3ed6eaa752d91e4d1fb1675b4c3e9f984c71)
---
 hw/pt-msi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 3f5f94b..c6baea9 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -440,6 +440,13 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
         return;
     }
 
+    if ( addr - msix->mmio_base_addr >= msix->total_entries * 16 )
+    {
+        PT_LOG("Error: Out of bounds write to MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
+        return;
+    }
+
     entry_nr = (addr - msix->mmio_base_addr) / 16;
     entry = &msix->msix_entry[entry_nr];
     offset = ((addr - msix->mmio_base_addr) % 16) / 4;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Mon Jan 04 15:44:40 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Jan 2016 15: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 1aG7JI-0005JW-Pf; Mon, 04 Jan 2016 15:44: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 1aG7JI-0005JE-0t
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:40 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	FB/70-13487-7639A865; Mon, 04 Jan 2016 15:44:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1451922277!13598947!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41290 invoked from network); 4 Jan 2016 15:44:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2016 15:44:38 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7JF-0002Lf-Ni
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7JF-0001S8-Dw
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:37 +0000
Date: Mon, 04 Jan 2016 15:44:37 +0000
Message-Id: <E1aG7JF-0001S8-Dw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.4] MSI-X: avoid
	array overrun upon MSI-X table writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2bbe49494f5e910c6fb49f6800d143cae9eb5758
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 4 15:34:29 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:36:18 2016 +0000

    MSI-X: avoid array overrun upon MSI-X table writes
    
    pt_msix_init() allocates msix->msix_entry[] to just cover
    msix->total_entries entries. While pci_msix_readl() resorts to reading
    physical memory for out of bounds reads, pci_msix_writel() so far
    simply accessed/corrupted unrelated memory.
    
    pt_iomem_map()'s call to cpu_register_physical_memory() registers a
    page granular region, which is necessary as the Pending Bit Array may
    share space with the MSI-X table (but nothing else is allowed to). This
    also explains why pci_msix_readl() actually honors out of bounds reads,
    but pci_msi_writel() doesn't need to.
    
    This is XSA-164.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 569eac99e8ddccd15fe78e8a3af5622afe780e3b)
    (cherry picked from commit 7457f4beae2583a106a4176949514e81248fc22d)
    (cherry picked from commit f5bf3ed6eaa752d91e4d1fb1675b4c3e9f984c71)
---
 hw/pt-msi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 3f5f94b..c6baea9 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -440,6 +440,13 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
         return;
     }
 
+    if ( addr - msix->mmio_base_addr >= msix->total_entries * 16 )
+    {
+        PT_LOG("Error: Out of bounds write to MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
+        return;
+    }
+
     entry_nr = (addr - msix->mmio_base_addr) / 16;
     entry = &msix->msix_entry[entry_nr];
     offset = ((addr - msix->mmio_base_addr) % 16) / 4;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Mon Jan 04 15:44:53 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Jan 2016 15:44: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 1aG7JU-0005MI-V2; Mon, 04 Jan 2016 15:44:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7JT-0005Lt-5j
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:51 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	CB/78-25438-2739A865; Mon, 04 Jan 2016 15:44:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1451922288!14614084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11187 invoked from network); 4 Jan 2016 15:44:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2016 15:44:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7JQ-0002Ls-Ln
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7JQ-0001Sz-Hz
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:48 +0000
Date: Mon, 04 Jan 2016 15:44:48 +0000
Message-Id: <E1aG7JQ-0001Sz-Hz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.3] MSI-X: avoid
	array overrun upon MSI-X table writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b96625e17169a7958575c2fb41499bb9ea2c212e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 4 15:34:29 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:36:38 2016 +0000

    MSI-X: avoid array overrun upon MSI-X table writes
    
    pt_msix_init() allocates msix->msix_entry[] to just cover
    msix->total_entries entries. While pci_msix_readl() resorts to reading
    physical memory for out of bounds reads, pci_msix_writel() so far
    simply accessed/corrupted unrelated memory.
    
    pt_iomem_map()'s call to cpu_register_physical_memory() registers a
    page granular region, which is necessary as the Pending Bit Array may
    share space with the MSI-X table (but nothing else is allowed to). This
    also explains why pci_msix_readl() actually honors out of bounds reads,
    but pci_msi_writel() doesn't need to.
    
    This is XSA-164.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 569eac99e8ddccd15fe78e8a3af5622afe780e3b)
    (cherry picked from commit 7457f4beae2583a106a4176949514e81248fc22d)
    (cherry picked from commit f5bf3ed6eaa752d91e4d1fb1675b4c3e9f984c71)
    (cherry picked from commit 2bbe49494f5e910c6fb49f6800d143cae9eb5758)
---
 hw/pt-msi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 3f5f94b..c6baea9 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -440,6 +440,13 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
         return;
     }
 
+    if ( addr - msix->mmio_base_addr >= msix->total_entries * 16 )
+    {
+        PT_LOG("Error: Out of bounds write to MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
+        return;
+    }
+
     entry_nr = (addr - msix->mmio_base_addr) / 16;
     entry = &msix->msix_entry[entry_nr];
     offset = ((addr - msix->mmio_base_addr) % 16) / 4;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Mon Jan 04 15:44:53 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 Jan 2016 15:44: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 1aG7JU-0005MI-V2; Mon, 04 Jan 2016 15:44:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7JT-0005Lt-5j
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:51 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	CB/78-25438-2739A865; Mon, 04 Jan 2016 15:44:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1451922288!14614084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11187 invoked from network); 4 Jan 2016 15:44:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jan 2016 15:44:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7JQ-0002Ls-Ln
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aG7JQ-0001Sz-Hz
	for xen-changelog@lists.xensource.com; Mon, 04 Jan 2016 15:44:48 +0000
Date: Mon, 04 Jan 2016 15:44:48 +0000
Message-Id: <E1aG7JQ-0001Sz-Hz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional stable-4.3] MSI-X: avoid
	array overrun upon MSI-X table writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b96625e17169a7958575c2fb41499bb9ea2c212e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 4 15:34:29 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:36:38 2016 +0000

    MSI-X: avoid array overrun upon MSI-X table writes
    
    pt_msix_init() allocates msix->msix_entry[] to just cover
    msix->total_entries entries. While pci_msix_readl() resorts to reading
    physical memory for out of bounds reads, pci_msix_writel() so far
    simply accessed/corrupted unrelated memory.
    
    pt_iomem_map()'s call to cpu_register_physical_memory() registers a
    page granular region, which is necessary as the Pending Bit Array may
    share space with the MSI-X table (but nothing else is allowed to). This
    also explains why pci_msix_readl() actually honors out of bounds reads,
    but pci_msi_writel() doesn't need to.
    
    This is XSA-164.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 569eac99e8ddccd15fe78e8a3af5622afe780e3b)
    (cherry picked from commit 7457f4beae2583a106a4176949514e81248fc22d)
    (cherry picked from commit f5bf3ed6eaa752d91e4d1fb1675b4c3e9f984c71)
    (cherry picked from commit 2bbe49494f5e910c6fb49f6800d143cae9eb5758)
---
 hw/pt-msi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 3f5f94b..c6baea9 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -440,6 +440,13 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
         return;
     }
 
+    if ( addr - msix->mmio_base_addr >= msix->total_entries * 16 )
+    {
+        PT_LOG("Error: Out of bounds write to MSI-X table,"
+               " addr %016"PRIx64"\n", addr);
+        return;
+    }
+
     entry_nr = (addr - msix->mmio_base_addr) / 16;
     entry = &msix->msix_entry[entry_nr];
     offset = ((addr - msix->mmio_base_addr) % 16) / 4;
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Jan 09 14:11:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aHuEb-0003RA-IQ; Sat, 09 Jan 2016 14:11: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 1aHuEW-0003R5-8O
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:08 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	00/F5-28791-BF411965; Sat, 09 Jan 2016 14:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1452348665!15677315!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12623 invoked from network); 9 Jan 2016 14:11:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:11:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEc-0001UF-0J
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuES-00075I-1X
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:04 +0000
Date: Sat, 09 Jan 2016 14:11:04 +0000
Message-Id: <E1aHuES-00075I-1X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] VMX: fix/adjust trap 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 b56ae5b48c3890b0c52f5676d0c29e3b4a5545e9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 15 15:21:41 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:21:41 2015 +0100

    VMX: fix/adjust trap injection
    
    In the course of investigating the 4.1.6 backport issue of the XSA-156
    patch I realized that #DB injection has always been broken, but with it
    now getting always intercepted the problem has got worse: Documentation
    clearly states that neither DR7.GD nor DebugCtl.LBR get cleared before
    the intercept, so this is something we need to do before reflecting the
    intercepted exception.
    
    While adjusting this (and also with 4.1.6's strange use of
    X86_EVENTTYPE_SW_EXCEPTION for #DB in mind) I further realized that
    the special casing of individual vectors shouldn't be done for
    software interrupts (resulting from INT $nn).
    
    And then some code movement: Setting of CR2 for #PF can be done in the
    same switch() statement (no need for a separate if()), and reading of
    intr_info is better done close the the consumption of the variable
    (allowing the compiler to generate better code / use fewer registers
    for variables).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 81a28f14009f4d8577a81b28dd06f6828112054b
    master date: 2015-11-24 12:30:31 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index d3fa78f..f78dc9d 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1508,16 +1508,7 @@ static void vmx_inject_trap(struct hvm_trap *trap)
     struct vcpu *curr = current;
     struct hvm_trap _trap = *trap;
 
-    if ( (_trap.vector == TRAP_page_fault) &&
-         (_trap.type == X86_EVENTTYPE_HW_EXCEPTION) )
-        curr->arch.hvm_vcpu.guest_cr[2] = _trap.cr2;
-
-    if ( nestedhvm_vcpu_in_guestmode(curr) )
-        intr_info = vcpu_2_nvmx(curr).intr.intr_info;
-    else
-        __vmread(VM_ENTRY_INTR_INFO, &intr_info);
-
-    switch ( _trap.vector )
+    switch ( _trap.vector | -(_trap.type == X86_EVENTTYPE_SW_INTERRUPT) )
     {
     case TRAP_debug:
         if ( guest_cpu_user_regs()->eflags & X86_EFLAGS_TF )
@@ -1525,6 +1516,16 @@ static void vmx_inject_trap(struct hvm_trap *trap)
             __restore_debug_registers(curr);
             write_debugreg(6, read_debugreg(6) | DR_STEP);
         }
+        if ( !nestedhvm_vcpu_in_guestmode(curr) ||
+             !nvmx_intercepts_exception(curr, TRAP_debug, _trap.error_code) )
+        {
+            unsigned long val;
+
+            __vmread(GUEST_DR7, &val);
+            __vmwrite(GUEST_DR7, val & ~DR_GENERAL_DETECT);
+            __vmread(GUEST_IA32_DEBUGCTL, &val);
+            __vmwrite(GUEST_IA32_DEBUGCTL, val & ~IA32_DEBUGCTLMSR_LBR);
+        }
         if ( cpu_has_monitor_trap_flag )
             break;
         /* fall through */
@@ -1535,8 +1536,19 @@ static void vmx_inject_trap(struct hvm_trap *trap)
             domain_pause_for_debugger();
             return;
         }
+        break;
+
+    case TRAP_page_fault:
+        ASSERT(_trap.type == X86_EVENTTYPE_HW_EXCEPTION);
+        curr->arch.hvm_vcpu.guest_cr[2] = _trap.cr2;
+        break;
     }
 
+    if ( nestedhvm_vcpu_in_guestmode(curr) )
+        intr_info = vcpu_2_nvmx(curr).intr.intr_info;
+    else
+        __vmread(VM_ENTRY_INTR_INFO, &intr_info);
+
     if ( unlikely(intr_info & INTR_INFO_VALID_MASK) &&
          (MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK) ==
           X86_EVENTTYPE_HW_EXCEPTION) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:11:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aHuEb-0003RA-IQ; Sat, 09 Jan 2016 14:11: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 1aHuEW-0003R5-8O
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:08 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	00/F5-28791-BF411965; Sat, 09 Jan 2016 14:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1452348665!15677315!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12623 invoked from network); 9 Jan 2016 14:11:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:11:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEc-0001UF-0J
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuES-00075I-1X
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:04 +0000
Date: Sat, 09 Jan 2016 14:11:04 +0000
Message-Id: <E1aHuES-00075I-1X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] VMX: fix/adjust trap 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 b56ae5b48c3890b0c52f5676d0c29e3b4a5545e9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 15 15:21:41 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:21:41 2015 +0100

    VMX: fix/adjust trap injection
    
    In the course of investigating the 4.1.6 backport issue of the XSA-156
    patch I realized that #DB injection has always been broken, but with it
    now getting always intercepted the problem has got worse: Documentation
    clearly states that neither DR7.GD nor DebugCtl.LBR get cleared before
    the intercept, so this is something we need to do before reflecting the
    intercepted exception.
    
    While adjusting this (and also with 4.1.6's strange use of
    X86_EVENTTYPE_SW_EXCEPTION for #DB in mind) I further realized that
    the special casing of individual vectors shouldn't be done for
    software interrupts (resulting from INT $nn).
    
    And then some code movement: Setting of CR2 for #PF can be done in the
    same switch() statement (no need for a separate if()), and reading of
    intr_info is better done close the the consumption of the variable
    (allowing the compiler to generate better code / use fewer registers
    for variables).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 81a28f14009f4d8577a81b28dd06f6828112054b
    master date: 2015-11-24 12:30:31 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index d3fa78f..f78dc9d 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1508,16 +1508,7 @@ static void vmx_inject_trap(struct hvm_trap *trap)
     struct vcpu *curr = current;
     struct hvm_trap _trap = *trap;
 
-    if ( (_trap.vector == TRAP_page_fault) &&
-         (_trap.type == X86_EVENTTYPE_HW_EXCEPTION) )
-        curr->arch.hvm_vcpu.guest_cr[2] = _trap.cr2;
-
-    if ( nestedhvm_vcpu_in_guestmode(curr) )
-        intr_info = vcpu_2_nvmx(curr).intr.intr_info;
-    else
-        __vmread(VM_ENTRY_INTR_INFO, &intr_info);
-
-    switch ( _trap.vector )
+    switch ( _trap.vector | -(_trap.type == X86_EVENTTYPE_SW_INTERRUPT) )
     {
     case TRAP_debug:
         if ( guest_cpu_user_regs()->eflags & X86_EFLAGS_TF )
@@ -1525,6 +1516,16 @@ static void vmx_inject_trap(struct hvm_trap *trap)
             __restore_debug_registers(curr);
             write_debugreg(6, read_debugreg(6) | DR_STEP);
         }
+        if ( !nestedhvm_vcpu_in_guestmode(curr) ||
+             !nvmx_intercepts_exception(curr, TRAP_debug, _trap.error_code) )
+        {
+            unsigned long val;
+
+            __vmread(GUEST_DR7, &val);
+            __vmwrite(GUEST_DR7, val & ~DR_GENERAL_DETECT);
+            __vmread(GUEST_IA32_DEBUGCTL, &val);
+            __vmwrite(GUEST_IA32_DEBUGCTL, val & ~IA32_DEBUGCTLMSR_LBR);
+        }
         if ( cpu_has_monitor_trap_flag )
             break;
         /* fall through */
@@ -1535,8 +1536,19 @@ static void vmx_inject_trap(struct hvm_trap *trap)
             domain_pause_for_debugger();
             return;
         }
+        break;
+
+    case TRAP_page_fault:
+        ASSERT(_trap.type == X86_EVENTTYPE_HW_EXCEPTION);
+        curr->arch.hvm_vcpu.guest_cr[2] = _trap.cr2;
+        break;
     }
 
+    if ( nestedhvm_vcpu_in_guestmode(curr) )
+        intr_info = vcpu_2_nvmx(curr).intr.intr_info;
+    else
+        __vmread(VM_ENTRY_INTR_INFO, &intr_info);
+
     if ( unlikely(intr_info & INTR_INFO_VALID_MASK) &&
          (MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK) ==
           X86_EVENTTYPE_HW_EXCEPTION) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:11:23 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aHuEk-0003Ra-Gy; Sat, 09 Jan 2016 14:11:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEh-0003RR-6E
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:19 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	BF/EC-13487-60511965; Sat, 09 Jan 2016 14:11:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1452348677!14835507!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51044 invoked from network); 9 Jan 2016 14:11:17 -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;
	9 Jan 2016 14:11:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEn-0001UJ-NS
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEd-00075n-P9
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:15 +0000
Date: Sat, 09 Jan 2016 14:11:15 +0000
Message-Id: <E1aHuEd-00075n-P9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] sched: fix locking for
	insert_vcpu() in credit1 and RTDS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 880b5f3012893ded410a05522cc50ad94b02d890
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Dec 15 15:22:29 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:22:29 2015 +0100

    sched: fix locking for insert_vcpu() in credit1 and RTDS
    
    The insert_vcpu() hook is handled with inconsistent locking.
    In fact, schedule_cpu_switch() calls the hook with runqueue
    lock held, while sched_move_domain() relies on the hook
    implementations to take the lock themselves (and, since that
    is not done in Credit1 and RTDS, such operation is not safe
    in those cases).
    
    This is fixed as follows:
     - take the lock in the hook implementations, in specific
       schedulers' code;
     - avoid calling insert_vcpu(), for the idle vCPU, in
       schedule_cpu_switch(). In fact, idle vCPUs are set to run
       immediately, and the various schedulers won't insert them
       in their runqueues anyway, even when explicitly asked to.
    
    While there, still in schedule_cpu_switch(), locking with
    _irq() is enough (there's no need to do *_irqsave()).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: ae2f41e3d7e7798537b7ea6dbb9a0c6aeb1179e3
    master date: 2015-11-24 14:48:34 +0100
---
 xen/common/sched_credit.c |    6 ++++++
 xen/common/sched_rt.c     |    3 +++
 xen/common/schedule.c     |    6 ++----
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 57967c1..507e957 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -905,9 +905,15 @@ static void
 csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 {
     struct csched_vcpu *svc = vc->sched_priv;
+    spinlock_t *lock;
+    unsigned long flags;
+
+    lock = vcpu_schedule_lock_irqsave(vc, &flags);
 
     if ( !__vcpu_on_runq(svc) && vcpu_runnable(vc) && !vc->is_running )
         __runq_insert(vc->processor, svc);
+
+    vcpu_schedule_unlock_irqrestore(lock, flags, vc);
 }
 
 static void
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 4372486..da590ee 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -622,16 +622,19 @@ rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 {
     struct rt_vcpu *svc = rt_vcpu(vc);
     s_time_t now = NOW();
+    spinlock_t *lock;
 
     /* not addlocate idle vcpu to dom vcpu list */
     if ( is_idle_vcpu(vc) )
         return;
 
+    lock = vcpu_schedule_lock_irq(vc);
     if ( now >= svc->cur_deadline )
         rt_update_deadline(now, svc);
 
     if ( !__vcpu_on_q(svc) && vcpu_runnable(vc) && !vc->is_running )
         __runq_insert(ops, svc);
+    vcpu_schedule_unlock_irq(lock, vc);
 
     /* add rt_vcpu svc to scheduler-specific vcpu list of the dom */
     list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 3eefed7..49bced4 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1488,7 +1488,6 @@ void __init scheduler_init(void)
 
 int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
 {
-    unsigned long flags;
     struct vcpu *idle;
     spinlock_t *lock;
     void *ppriv, *ppriv_old, *vpriv, *vpriv_old;
@@ -1509,7 +1508,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
         return -ENOMEM;
     }
 
-    lock = pcpu_schedule_lock_irqsave(cpu, &flags);
+    lock = pcpu_schedule_lock_irq(cpu);
 
     SCHED_OP(old_ops, tick_suspend, cpu);
     vpriv_old = idle->sched_priv;
@@ -1518,9 +1517,8 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
     ppriv_old = per_cpu(schedule_data, cpu).sched_priv;
     per_cpu(schedule_data, cpu).sched_priv = ppriv;
     SCHED_OP(new_ops, tick_resume, cpu);
-    SCHED_OP(new_ops, insert_vcpu, idle);
 
-    pcpu_schedule_unlock_irqrestore(lock, flags, cpu);
+    pcpu_schedule_unlock_irq(lock, cpu);
 
     SCHED_OP(old_ops, free_vdata, vpriv_old);
     SCHED_OP(old_ops, free_pdata, ppriv_old, cpu);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:11:23 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aHuEk-0003Ra-Gy; Sat, 09 Jan 2016 14:11:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEh-0003RR-6E
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:19 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	BF/EC-13487-60511965; Sat, 09 Jan 2016 14:11:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1452348677!14835507!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51044 invoked from network); 9 Jan 2016 14:11:17 -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;
	9 Jan 2016 14:11:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEn-0001UJ-NS
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEd-00075n-P9
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:15 +0000
Date: Sat, 09 Jan 2016 14:11:15 +0000
Message-Id: <E1aHuEd-00075n-P9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] sched: fix locking for
	insert_vcpu() in credit1 and RTDS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 880b5f3012893ded410a05522cc50ad94b02d890
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Dec 15 15:22:29 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:22:29 2015 +0100

    sched: fix locking for insert_vcpu() in credit1 and RTDS
    
    The insert_vcpu() hook is handled with inconsistent locking.
    In fact, schedule_cpu_switch() calls the hook with runqueue
    lock held, while sched_move_domain() relies on the hook
    implementations to take the lock themselves (and, since that
    is not done in Credit1 and RTDS, such operation is not safe
    in those cases).
    
    This is fixed as follows:
     - take the lock in the hook implementations, in specific
       schedulers' code;
     - avoid calling insert_vcpu(), for the idle vCPU, in
       schedule_cpu_switch(). In fact, idle vCPUs are set to run
       immediately, and the various schedulers won't insert them
       in their runqueues anyway, even when explicitly asked to.
    
    While there, still in schedule_cpu_switch(), locking with
    _irq() is enough (there's no need to do *_irqsave()).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: ae2f41e3d7e7798537b7ea6dbb9a0c6aeb1179e3
    master date: 2015-11-24 14:48:34 +0100
---
 xen/common/sched_credit.c |    6 ++++++
 xen/common/sched_rt.c     |    3 +++
 xen/common/schedule.c     |    6 ++----
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 57967c1..507e957 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -905,9 +905,15 @@ static void
 csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 {
     struct csched_vcpu *svc = vc->sched_priv;
+    spinlock_t *lock;
+    unsigned long flags;
+
+    lock = vcpu_schedule_lock_irqsave(vc, &flags);
 
     if ( !__vcpu_on_runq(svc) && vcpu_runnable(vc) && !vc->is_running )
         __runq_insert(vc->processor, svc);
+
+    vcpu_schedule_unlock_irqrestore(lock, flags, vc);
 }
 
 static void
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 4372486..da590ee 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -622,16 +622,19 @@ rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 {
     struct rt_vcpu *svc = rt_vcpu(vc);
     s_time_t now = NOW();
+    spinlock_t *lock;
 
     /* not addlocate idle vcpu to dom vcpu list */
     if ( is_idle_vcpu(vc) )
         return;
 
+    lock = vcpu_schedule_lock_irq(vc);
     if ( now >= svc->cur_deadline )
         rt_update_deadline(now, svc);
 
     if ( !__vcpu_on_q(svc) && vcpu_runnable(vc) && !vc->is_running )
         __runq_insert(ops, svc);
+    vcpu_schedule_unlock_irq(lock, vc);
 
     /* add rt_vcpu svc to scheduler-specific vcpu list of the dom */
     list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 3eefed7..49bced4 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1488,7 +1488,6 @@ void __init scheduler_init(void)
 
 int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
 {
-    unsigned long flags;
     struct vcpu *idle;
     spinlock_t *lock;
     void *ppriv, *ppriv_old, *vpriv, *vpriv_old;
@@ -1509,7 +1508,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
         return -ENOMEM;
     }
 
-    lock = pcpu_schedule_lock_irqsave(cpu, &flags);
+    lock = pcpu_schedule_lock_irq(cpu);
 
     SCHED_OP(old_ops, tick_suspend, cpu);
     vpriv_old = idle->sched_priv;
@@ -1518,9 +1517,8 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
     ppriv_old = per_cpu(schedule_data, cpu).sched_priv;
     per_cpu(schedule_data, cpu).sched_priv = ppriv;
     SCHED_OP(new_ops, tick_resume, cpu);
-    SCHED_OP(new_ops, insert_vcpu, idle);
 
-    pcpu_schedule_unlock_irqrestore(lock, flags, cpu);
+    pcpu_schedule_unlock_irq(lock, cpu);
 
     SCHED_OP(old_ops, free_vdata, vpriv_old);
     SCHED_OP(old_ops, free_pdata, ppriv_old, cpu);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:11:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:11: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 1aHuEz-0003TR-Fr; Sat, 09 Jan 2016 14:11:37 +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 1aHuEr-0003Sy-MX
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:31 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	D1/54-02940-01511965; Sat, 09 Jan 2016 14:11:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1452348687!14868278!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58072 invoked from network); 9 Jan 2016 14:11:28 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:11:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEy-0001UR-Uf
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEp-00076J-1E
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:27 +0000
Date: Sat, 09 Jan 2016 14:11:27 +0000
Message-Id: <E1aHuEp-00076J-1E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/vPMU: document as unsupported
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 499886c800ef88263f17a6b861e7cef2c707a221
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 15 15:22:58 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:22:58 2015 +0100

    x86/vPMU: document as unsupported
    
    This is XSA-163.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: c03480cf5c4e96fb4afb2237ad0a3cac7162564a
    master date: 2015-11-24 18:32:20 +0100
---
 docs/misc/xen-command-line.markdown |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 26ee8e0..7c936c1 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1474,8 +1474,8 @@ feature is switched on on Intel processors supporting this feature.
 Note that if **watchdog** option is also specified vpmu will be turned off.
 
 *Warning:*
-As the BTS virtualisation is not 100% safe and because of the nehalem quirk
-don't use the vpmu flag on production systems with Intel cpus!
+As the virtualisation is not 100% safe, don't use the vpmu flag on
+production systems (see http://xenbits.xen.org/xsa/advisory-163.html)!
 
 ### watchdog
 > `= force | <boolean>`
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:11:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:11: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 1aHuEz-0003TR-Fr; Sat, 09 Jan 2016 14:11:37 +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 1aHuEr-0003Sy-MX
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:31 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	D1/54-02940-01511965; Sat, 09 Jan 2016 14:11:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1452348687!14868278!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58072 invoked from network); 9 Jan 2016 14:11:28 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:11:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEy-0001UR-Uf
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEp-00076J-1E
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:27 +0000
Date: Sat, 09 Jan 2016 14:11:27 +0000
Message-Id: <E1aHuEp-00076J-1E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/vPMU: document as unsupported
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 499886c800ef88263f17a6b861e7cef2c707a221
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 15 15:22:58 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:22:58 2015 +0100

    x86/vPMU: document as unsupported
    
    This is XSA-163.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: c03480cf5c4e96fb4afb2237ad0a3cac7162564a
    master date: 2015-11-24 18:32:20 +0100
---
 docs/misc/xen-command-line.markdown |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 26ee8e0..7c936c1 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1474,8 +1474,8 @@ feature is switched on on Intel processors supporting this feature.
 Note that if **watchdog** option is also specified vpmu will be turned off.
 
 *Warning:*
-As the BTS virtualisation is not 100% safe and because of the nehalem quirk
-don't use the vpmu flag on production systems with Intel cpus!
+As the virtualisation is not 100% safe, don't use the vpmu flag on
+production systems (see http://xenbits.xen.org/xsa/advisory-163.html)!
 
 ### watchdog
 > `= force | <boolean>`
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:11:51 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:11: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 1aHuF9-0003U9-VF; Sat, 09 Jan 2016 14:11: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 1aHuF2-0003Tp-Er
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:40 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	F4/20-09708-B1511965; Sat, 09 Jan 2016 14:11:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1452348698!4800216!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33100 invoked from network); 9 Jan 2016 14:11:39 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:11:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuF9-0001UZ-AI
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEz-00076i-Dn
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:37 +0000
Date: Sat, 09 Jan 2016 14:11:37 +0000
Message-Id: <E1aHuEz-00076i-Dn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/VPMU: Initialize VPMU's lvtpc
	vector
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7dcd82d1aa68e793be05dd11cc587c909463a5c1
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Dec 15 15:23:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:23:20 2015 +0100

    x86/VPMU: Initialize VPMU's lvtpc vector
    
    If a guest sets up performance counters so that they can generate
    a PMC interrupt but does not initilaize APIC LVTPC register the
    resulting interrupt will cause an APIC error.
    
    Note that a guest deciding to clear LVTPC in order to unduce the error
    will not be successful in achieving its goal: emulation code only
    looks at the mask bit and always sets the vector to PMU_APIC_VECTOR.
    Only the initial value of LVTPC (which is zero) that gets loaded into
    APIC as result of PMC initialization is the problem.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 0c3f24645b07b875bc1294fb4627f01e030690fe
    master date: 2015-11-24 18:33:08 +0100
---
 xen/arch/x86/cpu/vpmu.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 2f5156a..d870dcc 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -480,6 +480,8 @@ void vpmu_initialise(struct vcpu *v)
         return; /* Don't bother restoring vpmu_count, VPMU is off forever */
     }
 
+    vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
+
     if ( ret )
         printk(XENLOG_G_WARNING "VPMU: Initialization failed for %pv\n", v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:11:51 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:11: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 1aHuF9-0003U9-VF; Sat, 09 Jan 2016 14:11: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 1aHuF2-0003Tp-Er
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:40 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	F4/20-09708-B1511965; Sat, 09 Jan 2016 14:11:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1452348698!4800216!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33100 invoked from network); 9 Jan 2016 14:11:39 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:11:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuF9-0001UZ-AI
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuEz-00076i-Dn
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:37 +0000
Date: Sat, 09 Jan 2016 14:11:37 +0000
Message-Id: <E1aHuEz-00076i-Dn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/VPMU: Initialize VPMU's lvtpc
	vector
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7dcd82d1aa68e793be05dd11cc587c909463a5c1
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Dec 15 15:23:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:23:20 2015 +0100

    x86/VPMU: Initialize VPMU's lvtpc vector
    
    If a guest sets up performance counters so that they can generate
    a PMC interrupt but does not initilaize APIC LVTPC register the
    resulting interrupt will cause an APIC error.
    
    Note that a guest deciding to clear LVTPC in order to unduce the error
    will not be successful in achieving its goal: emulation code only
    looks at the mask bit and always sets the vector to PMU_APIC_VECTOR.
    Only the initial value of LVTPC (which is zero) that gets loaded into
    APIC as result of PMC initialization is the problem.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 0c3f24645b07b875bc1294fb4627f01e030690fe
    master date: 2015-11-24 18:33:08 +0100
---
 xen/arch/x86/cpu/vpmu.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 2f5156a..d870dcc 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -480,6 +480,8 @@ void vpmu_initialise(struct vcpu *v)
         return; /* Don't bother restoring vpmu_count, VPMU is off forever */
     }
 
+    vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
+
     if ( ret )
         printk(XENLOG_G_WARNING "VPMU: Initialization failed for %pv\n", v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:12:00 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14: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 1aHuFK-0003VV-WD; Sat, 09 Jan 2016 14:11: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 1aHuFF-0003V2-QM
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:54 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	E8/C3-13475-92511965; Sat, 09 Jan 2016 14:11:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1452348711!15724224!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28319 invoked from network); 9 Jan 2016 14:11:52 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:11:52 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFK-0001Uh-Av
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFA-00077S-Fd
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:48 +0000
Date: Sat, 09 Jan 2016 14:11:48 +0000
Message-Id: <E1aHuFA-00077S-Fd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/VPMU: return correct fixed PMC
	count
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 57817d09bf6a55604a317b746c0177183ce50c66
Author:     Brendan Gregg <bgregg@netflix.com>
AuthorDate: Tue Dec 15 15:23:54 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:23:54 2015 +0100

    x86/VPMU: return correct fixed PMC count
    
    Fixes a register typo.
    
    Signed-off-by: Brendan Gregg <bgregg@netflix.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7d596f5ad70969d8171e1eb5b7a39d0dc6c11dc2
    master date: 2015-11-25 11:12:55 +0100
---
 xen/arch/x86/cpu/vpmu_intel.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 12f80ae..d5ea7fe 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -166,10 +166,9 @@ static int core2_get_arch_pmc_count(void)
  */
 static int core2_get_fixed_pmc_count(void)
 {
-    u32 eax;
+    u32 edx = cpuid_edx(0xa);
 
-    eax = cpuid_eax(0xa);
-    return MASK_EXTR(eax, PMU_FIXED_NR_MASK);
+    return MASK_EXTR(edx, PMU_FIXED_NR_MASK);
 }
 
 /* edx bits 5-12: Bit width of fixed-function performance counters  */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:12:00 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14: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 1aHuFK-0003VV-WD; Sat, 09 Jan 2016 14:11: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 1aHuFF-0003V2-QM
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:54 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	E8/C3-13475-92511965; Sat, 09 Jan 2016 14:11:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1452348711!15724224!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28319 invoked from network); 9 Jan 2016 14:11:52 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:11:52 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFK-0001Uh-Av
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFA-00077S-Fd
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:11:48 +0000
Date: Sat, 09 Jan 2016 14:11:48 +0000
Message-Id: <E1aHuFA-00077S-Fd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/VPMU: return correct fixed PMC
	count
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 57817d09bf6a55604a317b746c0177183ce50c66
Author:     Brendan Gregg <bgregg@netflix.com>
AuthorDate: Tue Dec 15 15:23:54 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:23:54 2015 +0100

    x86/VPMU: return correct fixed PMC count
    
    Fixes a register typo.
    
    Signed-off-by: Brendan Gregg <bgregg@netflix.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7d596f5ad70969d8171e1eb5b7a39d0dc6c11dc2
    master date: 2015-11-25 11:12:55 +0100
---
 xen/arch/x86/cpu/vpmu_intel.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 12f80ae..d5ea7fe 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -166,10 +166,9 @@ static int core2_get_arch_pmc_count(void)
  */
 static int core2_get_fixed_pmc_count(void)
 {
-    u32 eax;
+    u32 edx = cpuid_edx(0xa);
 
-    eax = cpuid_eax(0xa);
-    return MASK_EXTR(eax, PMU_FIXED_NR_MASK);
+    return MASK_EXTR(edx, PMU_FIXED_NR_MASK);
 }
 
 /* edx bits 5-12: Bit width of fixed-function performance counters  */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:12:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:12: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 1aHuFV-0003Wn-Pn; Sat, 09 Jan 2016 14:12:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFR-0003W0-ES
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:06 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	D8/A3-31122-43511965; Sat, 09 Jan 2016 14:12:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1452348723!9212087!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8549 invoked from network); 9 Jan 2016 14:12:04 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:12:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFX-0001VI-Kn
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFN-000794-HL
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:01 +0000
Date: Sat, 09 Jan 2016 14:12:01 +0000
Message-Id: <E1aHuFN-000794-HL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/boot: check for not allowed
	sections before linking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d60b3a5d6ce50c7a3371a49cbc8c6cb0e2ce6cac
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue Dec 15 15:24:29 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:24:29 2015 +0100

    x86/boot: check for not allowed sections before linking
    
    Currently check for not allowed sections is performed just after
    compilation. However, if compilation succeeds and check fails then
    second build will create xen.gz/xen.efi without any visible error.
    This happens because %.o: %.c recipe created object file during first
    run and make do not execute this recipe during second run. So, look
    for not allowed sections before linking. This way check will be
    executed every time.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: d380b3559734739ae009cd3c0e9aabb5602863e2
    master date: 2015-11-25 17:24:36 +0100
---
 xen/arch/x86/boot/build32.mk |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk
index c208249..4a1421f 100644
--- a/xen/arch/x86/boot/build32.mk
+++ b/xen/arch/x86/boot/build32.mk
@@ -16,11 +16,7 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
 	$(OBJCOPY) -O binary $< $@
 
 %.lnk: %.o
-	$(LD) $(LDFLAGS_DIRECT) -N -Ttext 0 -o $@ $<
-
-%.o: %.c
-	$(CC) $(CFLAGS) -c -fpic $< -o $@
-	$(OBJDUMP) -h $@ | sed -n '/[0-9]/{s,00*,0,g;p;}' |\
+	$(OBJDUMP) -h $< | sed -n '/[0-9]/{s,00*,0,g;p;}' |\
 		while read idx name sz rest; do \
 			case "$$name" in \
 			.data|.data.*|.rodata|.rodata.*|.bss|.bss.*) \
@@ -29,6 +25,10 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
 				exit $$(expr $$idx + 1);; \
 			esac; \
 		done
+	$(LD) $(LDFLAGS_DIRECT) -N -Ttext 0 -o $@ $<
+
+%.o: %.c
+	$(CC) $(CFLAGS) -c -fpic $< -o $@
 
 reloc.o: reloc.c $(RELOC_DEPS)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:12:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:12: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 1aHuFV-0003Wn-Pn; Sat, 09 Jan 2016 14:12:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFR-0003W0-ES
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:06 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	D8/A3-31122-43511965; Sat, 09 Jan 2016 14:12:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1452348723!9212087!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8549 invoked from network); 9 Jan 2016 14:12:04 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:12:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFX-0001VI-Kn
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFN-000794-HL
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:01 +0000
Date: Sat, 09 Jan 2016 14:12:01 +0000
Message-Id: <E1aHuFN-000794-HL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/boot: check for not allowed
	sections before linking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d60b3a5d6ce50c7a3371a49cbc8c6cb0e2ce6cac
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Tue Dec 15 15:24:29 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:24:29 2015 +0100

    x86/boot: check for not allowed sections before linking
    
    Currently check for not allowed sections is performed just after
    compilation. However, if compilation succeeds and check fails then
    second build will create xen.gz/xen.efi without any visible error.
    This happens because %.o: %.c recipe created object file during first
    run and make do not execute this recipe during second run. So, look
    for not allowed sections before linking. This way check will be
    executed every time.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: d380b3559734739ae009cd3c0e9aabb5602863e2
    master date: 2015-11-25 17:24:36 +0100
---
 xen/arch/x86/boot/build32.mk |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk
index c208249..4a1421f 100644
--- a/xen/arch/x86/boot/build32.mk
+++ b/xen/arch/x86/boot/build32.mk
@@ -16,11 +16,7 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
 	$(OBJCOPY) -O binary $< $@
 
 %.lnk: %.o
-	$(LD) $(LDFLAGS_DIRECT) -N -Ttext 0 -o $@ $<
-
-%.o: %.c
-	$(CC) $(CFLAGS) -c -fpic $< -o $@
-	$(OBJDUMP) -h $@ | sed -n '/[0-9]/{s,00*,0,g;p;}' |\
+	$(OBJDUMP) -h $< | sed -n '/[0-9]/{s,00*,0,g;p;}' |\
 		while read idx name sz rest; do \
 			case "$$name" in \
 			.data|.data.*|.rodata|.rodata.*|.bss|.bss.*) \
@@ -29,6 +25,10 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
 				exit $$(expr $$idx + 1);; \
 			esac; \
 		done
+	$(LD) $(LDFLAGS_DIRECT) -N -Ttext 0 -o $@ $<
+
+%.o: %.c
+	$(CC) $(CFLAGS) -c -fpic $< -o $@
 
 reloc.o: reloc.c $(RELOC_DEPS)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:12:29 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:12: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 1aHuFm-0003a3-JF; Sat, 09 Jan 2016 14:12: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 1aHuFd-0003YT-NB
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:18 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	E4/F0-32641-04511965; Sat, 09 Jan 2016 14:12:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1452348735!14868339!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60471 invoked from network); 9 Jan 2016 14:12:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:12:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFj-0001W9-Ea
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFZ-00079l-Er
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:13 +0000
Date: Sat, 09 Jan 2016 14:12:13 +0000
Message-Id: <E1aHuFZ-00079l-Er@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/ept: remove unnecessary sync
	after resolving misconfigured entries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6e59151b50b8981a37b015ad1b10e4876eb20926
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Tue Dec 15 15:25:00 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:25:00 2015 +0100

    x86/ept: remove unnecessary sync after resolving misconfigured entries
    
    When using EPT, type changes are done with the following steps:
    
    1. Set entry as invalid (misconfigured) by settings a reserved memory
    type.
    
    2. Flush all EPT and combined translations (ept_sync_domain()).
    
    3. Fixup misconfigured entries as required (on EPT_MISCONFIG vmexits or
    when explicitly setting an entry.
    
    Since resolve_misconfig() only updates entries that were misconfigured,
    there is no need to invalidate any translations since the hardware
    does not cache misconfigured translations (vol 3, section 28.3.2).
    
    Remove the unnecessary (and very expensive) ept_sync_domain() calls).
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: cea357ba4b3335ca5279ee9c00838f85575d5842
    master date: 2015-12-02 15:19:53 +0100
---
 xen/arch/x86/mm/p2m-ept.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 9860c6c..8418aad 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -642,7 +642,6 @@ bool_t ept_handle_misconfig(uint64_t gpa)
     spurious = curr->arch.hvm_vmx.ept_spurious_misconfig;
     rc = resolve_misconfig(p2m, PFN_DOWN(gpa));
     curr->arch.hvm_vmx.ept_spurious_misconfig = 0;
-    ept_sync_domain(p2m);
 
     p2m_unlock(p2m);
 
@@ -669,7 +668,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     int need_modify_vtd_table = 1;
     int vtd_pte_present = 0;
     unsigned int iommu_flags = p2m_get_iommu_flags(p2mt);
-    enum { sync_off, sync_on, sync_check } needs_sync = sync_check;
+    bool_t needs_sync = 1;
     ept_entry_t old_entry = { .epte = 0 };
     ept_entry_t new_entry = { .epte = 0 };
     struct ept_data *ept = &p2m->ept;
@@ -690,12 +689,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     /* Carry out any eventually pending earlier changes first. */
     ret = resolve_misconfig(p2m, gfn);
     if ( ret < 0 )
-    {
-        ept_sync_domain(p2m);
         return ret;
-    }
-    if ( ret > 0 )
-        needs_sync = sync_on;
 
     ASSERT((target == 2 && hvm_hap_has_1gb()) ||
            (target == 1 && hvm_hap_has_2mb()) ||
@@ -738,8 +732,8 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         /* We reached the target level. */
 
         /* No need to flush if the old entry wasn't valid */
-        if ( needs_sync == sync_check && !is_epte_present(ept_entry) )
-            needs_sync = sync_off;
+        if ( !is_epte_present(ept_entry) )
+            needs_sync = 0;
 
         /* If we're replacing a non-leaf entry with a leaf entry (1GiB or 2MiB),
          * the intermediate tables will be freed below after the ept flush
@@ -821,7 +815,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         p2m->max_mapped_pfn = gfn + (1UL << order) - 1;
 
 out:
-    if ( needs_sync != sync_off )
+    if ( needs_sync )
         ept_sync_domain(p2m);
 
     /* For host p2m, may need to change VT-d page table.*/
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:12:29 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:12: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 1aHuFm-0003a3-JF; Sat, 09 Jan 2016 14:12: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 1aHuFd-0003YT-NB
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:18 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	E4/F0-32641-04511965; Sat, 09 Jan 2016 14:12:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1452348735!14868339!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60471 invoked from network); 9 Jan 2016 14:12:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:12:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFj-0001W9-Ea
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFZ-00079l-Er
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:13 +0000
Date: Sat, 09 Jan 2016 14:12:13 +0000
Message-Id: <E1aHuFZ-00079l-Er@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/ept: remove unnecessary sync
	after resolving misconfigured entries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6e59151b50b8981a37b015ad1b10e4876eb20926
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Tue Dec 15 15:25:00 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:25:00 2015 +0100

    x86/ept: remove unnecessary sync after resolving misconfigured entries
    
    When using EPT, type changes are done with the following steps:
    
    1. Set entry as invalid (misconfigured) by settings a reserved memory
    type.
    
    2. Flush all EPT and combined translations (ept_sync_domain()).
    
    3. Fixup misconfigured entries as required (on EPT_MISCONFIG vmexits or
    when explicitly setting an entry.
    
    Since resolve_misconfig() only updates entries that were misconfigured,
    there is no need to invalidate any translations since the hardware
    does not cache misconfigured translations (vol 3, section 28.3.2).
    
    Remove the unnecessary (and very expensive) ept_sync_domain() calls).
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: cea357ba4b3335ca5279ee9c00838f85575d5842
    master date: 2015-12-02 15:19:53 +0100
---
 xen/arch/x86/mm/p2m-ept.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 9860c6c..8418aad 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -642,7 +642,6 @@ bool_t ept_handle_misconfig(uint64_t gpa)
     spurious = curr->arch.hvm_vmx.ept_spurious_misconfig;
     rc = resolve_misconfig(p2m, PFN_DOWN(gpa));
     curr->arch.hvm_vmx.ept_spurious_misconfig = 0;
-    ept_sync_domain(p2m);
 
     p2m_unlock(p2m);
 
@@ -669,7 +668,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     int need_modify_vtd_table = 1;
     int vtd_pte_present = 0;
     unsigned int iommu_flags = p2m_get_iommu_flags(p2mt);
-    enum { sync_off, sync_on, sync_check } needs_sync = sync_check;
+    bool_t needs_sync = 1;
     ept_entry_t old_entry = { .epte = 0 };
     ept_entry_t new_entry = { .epte = 0 };
     struct ept_data *ept = &p2m->ept;
@@ -690,12 +689,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     /* Carry out any eventually pending earlier changes first. */
     ret = resolve_misconfig(p2m, gfn);
     if ( ret < 0 )
-    {
-        ept_sync_domain(p2m);
         return ret;
-    }
-    if ( ret > 0 )
-        needs_sync = sync_on;
 
     ASSERT((target == 2 && hvm_hap_has_1gb()) ||
            (target == 1 && hvm_hap_has_2mb()) ||
@@ -738,8 +732,8 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         /* We reached the target level. */
 
         /* No need to flush if the old entry wasn't valid */
-        if ( needs_sync == sync_check && !is_epte_present(ept_entry) )
-            needs_sync = sync_off;
+        if ( !is_epte_present(ept_entry) )
+            needs_sync = 0;
 
         /* If we're replacing a non-leaf entry with a leaf entry (1GiB or 2MiB),
          * the intermediate tables will be freed below after the ept flush
@@ -821,7 +815,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         p2m->max_mapped_pfn = gfn + (1UL << order) - 1;
 
 out:
-    if ( needs_sync != sync_off )
+    if ( needs_sync )
         ept_sync_domain(p2m);
 
     /* For host p2m, may need to change VT-d page table.*/
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:12:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:12: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 1aHuFy-0003bV-QY; Sat, 09 Jan 2016 14:12: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 1aHuFp-0003aR-6s
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:29 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	6E/A6-05427-C4511965; Sat, 09 Jan 2016 14:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1452348746!15721946!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40241 invoked from network); 9 Jan 2016 14:12:27 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:12:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFv-0001WH-AO
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFl-0007AO-AL
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:25 +0000
Date: Sat, 09 Jan 2016 14:12:25 +0000
Message-Id: <E1aHuFl-0007AO-AL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] evtchn: don't reuse ports that are
	still "busy"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e07a0dc588e5e0cc1fd56c0e76c3b29f6c82927
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Tue Dec 15 15:25:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:25:39 2015 +0100

    evtchn: don't reuse ports that are still "busy"
    
    When using the FIFO ABI a guest may close an event channel that is
    still LINKED.  If this port is reused, subsequent events may be lost
    because they may become pending on the wrong queue.
    
    This could be fixed by requiring guests to only close event channels
    that are not linked.  This is difficult since: a) irq cleanup in the
    guest may be done in a context that cannot wait for the event to be
    unlinked; b) the guest may attempt to rebind a PIRQ whose previous
    close is still pending; and c) existing guests already have the
    problematic behaviour.
    
    Instead, simply check a port is not "busy" (i.e., it's not linked)
    before reusing it.
    
    Guests should still drain any queues for VCPUs that are being
    offlined, or the port will become unusable until the VCPU is onlined
    and starts processing events again.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 78e24c269b0a4a8b864ece725e6d4209ed95dfa7
    master date: 2015-12-02 15:21:46 +0100
---
 xen/common/event_channel.c |    3 ++-
 xen/common/event_fifo.c    |   12 ++++++++++++
 xen/include/xen/event.h    |   12 ++++++++++++
 3 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 46737cf..584a5ff 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -170,7 +170,8 @@ static int get_free_port(struct domain *d)
     {
         if ( port > d->max_evtchn_port )
             return -ENOSPC;
-        if ( evtchn_from_port(d, port)->state == ECS_FREE )
+        if ( evtchn_from_port(d, port)->state == ECS_FREE
+             && !evtchn_port_is_busy(d, port) )
             return port;
     }
 
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index c9b7884..79c36ff 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -312,6 +312,17 @@ static bool_t evtchn_fifo_is_masked(struct domain *d,
     return test_bit(EVTCHN_FIFO_MASKED, word);
 }
 
+static bool_t evtchn_fifo_is_busy(struct domain *d, evtchn_port_t port)
+{
+    event_word_t *word;
+
+    word = evtchn_fifo_word_from_port(d, port);
+    if ( unlikely(!word) )
+        return 0;
+
+    return test_bit(EVTCHN_FIFO_LINKED, word);
+}
+
 static int evtchn_fifo_set_priority(struct domain *d, struct evtchn *evtchn,
                                     unsigned int priority)
 {
@@ -351,6 +362,7 @@ static const struct evtchn_port_ops evtchn_port_ops_fifo =
     .unmask        = evtchn_fifo_unmask,
     .is_pending    = evtchn_fifo_is_pending,
     .is_masked     = evtchn_fifo_is_masked,
+    .is_busy       = evtchn_fifo_is_busy,
     .set_priority  = evtchn_fifo_set_priority,
     .print_state   = evtchn_fifo_print_state,
 };
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index af923d1..ef22f44 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -136,6 +136,11 @@ struct evtchn_port_ops {
     void (*unmask)(struct domain *d, struct evtchn *evtchn);
     bool_t (*is_pending)(struct domain *d, const struct evtchn *evtchn);
     bool_t (*is_masked)(struct domain *d, const struct evtchn *evtchn);
+    /*
+     * Is the port unavailable because it's still being cleaned up
+     * after being closed?
+     */
+    bool_t (*is_busy)(struct domain *d, evtchn_port_t port);
     int (*set_priority)(struct domain *d, struct evtchn *evtchn,
                         unsigned int priority);
     void (*print_state)(struct domain *d, const struct evtchn *evtchn);
@@ -178,6 +183,13 @@ static inline bool_t evtchn_port_is_masked(struct domain *d,
     return d->evtchn_port_ops->is_masked(d, evtchn);
 }
 
+static inline bool_t evtchn_port_is_busy(struct domain *d, evtchn_port_t port)
+{
+    if ( d->evtchn_port_ops->is_busy )
+        return d->evtchn_port_ops->is_busy(d, port);
+    return 0;
+}
+
 static inline int evtchn_port_set_priority(struct domain *d,
                                            struct evtchn *evtchn,
                                            unsigned int priority)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:12:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:12: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 1aHuFy-0003bV-QY; Sat, 09 Jan 2016 14:12: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 1aHuFp-0003aR-6s
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:29 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	6E/A6-05427-C4511965; Sat, 09 Jan 2016 14:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1452348746!15721946!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40241 invoked from network); 9 Jan 2016 14:12:27 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:12:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFv-0001WH-AO
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFl-0007AO-AL
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:25 +0000
Date: Sat, 09 Jan 2016 14:12:25 +0000
Message-Id: <E1aHuFl-0007AO-AL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] evtchn: don't reuse ports that are
	still "busy"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e07a0dc588e5e0cc1fd56c0e76c3b29f6c82927
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Tue Dec 15 15:25:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:25:39 2015 +0100

    evtchn: don't reuse ports that are still "busy"
    
    When using the FIFO ABI a guest may close an event channel that is
    still LINKED.  If this port is reused, subsequent events may be lost
    because they may become pending on the wrong queue.
    
    This could be fixed by requiring guests to only close event channels
    that are not linked.  This is difficult since: a) irq cleanup in the
    guest may be done in a context that cannot wait for the event to be
    unlinked; b) the guest may attempt to rebind a PIRQ whose previous
    close is still pending; and c) existing guests already have the
    problematic behaviour.
    
    Instead, simply check a port is not "busy" (i.e., it's not linked)
    before reusing it.
    
    Guests should still drain any queues for VCPUs that are being
    offlined, or the port will become unusable until the VCPU is onlined
    and starts processing events again.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 78e24c269b0a4a8b864ece725e6d4209ed95dfa7
    master date: 2015-12-02 15:21:46 +0100
---
 xen/common/event_channel.c |    3 ++-
 xen/common/event_fifo.c    |   12 ++++++++++++
 xen/include/xen/event.h    |   12 ++++++++++++
 3 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 46737cf..584a5ff 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -170,7 +170,8 @@ static int get_free_port(struct domain *d)
     {
         if ( port > d->max_evtchn_port )
             return -ENOSPC;
-        if ( evtchn_from_port(d, port)->state == ECS_FREE )
+        if ( evtchn_from_port(d, port)->state == ECS_FREE
+             && !evtchn_port_is_busy(d, port) )
             return port;
     }
 
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index c9b7884..79c36ff 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -312,6 +312,17 @@ static bool_t evtchn_fifo_is_masked(struct domain *d,
     return test_bit(EVTCHN_FIFO_MASKED, word);
 }
 
+static bool_t evtchn_fifo_is_busy(struct domain *d, evtchn_port_t port)
+{
+    event_word_t *word;
+
+    word = evtchn_fifo_word_from_port(d, port);
+    if ( unlikely(!word) )
+        return 0;
+
+    return test_bit(EVTCHN_FIFO_LINKED, word);
+}
+
 static int evtchn_fifo_set_priority(struct domain *d, struct evtchn *evtchn,
                                     unsigned int priority)
 {
@@ -351,6 +362,7 @@ static const struct evtchn_port_ops evtchn_port_ops_fifo =
     .unmask        = evtchn_fifo_unmask,
     .is_pending    = evtchn_fifo_is_pending,
     .is_masked     = evtchn_fifo_is_masked,
+    .is_busy       = evtchn_fifo_is_busy,
     .set_priority  = evtchn_fifo_set_priority,
     .print_state   = evtchn_fifo_print_state,
 };
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index af923d1..ef22f44 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -136,6 +136,11 @@ struct evtchn_port_ops {
     void (*unmask)(struct domain *d, struct evtchn *evtchn);
     bool_t (*is_pending)(struct domain *d, const struct evtchn *evtchn);
     bool_t (*is_masked)(struct domain *d, const struct evtchn *evtchn);
+    /*
+     * Is the port unavailable because it's still being cleaned up
+     * after being closed?
+     */
+    bool_t (*is_busy)(struct domain *d, evtchn_port_t port);
     int (*set_priority)(struct domain *d, struct evtchn *evtchn,
                         unsigned int priority);
     void (*print_state)(struct domain *d, const struct evtchn *evtchn);
@@ -178,6 +183,13 @@ static inline bool_t evtchn_port_is_masked(struct domain *d,
     return d->evtchn_port_ops->is_masked(d, evtchn);
 }
 
+static inline bool_t evtchn_port_is_busy(struct domain *d, evtchn_port_t port)
+{
+    if ( d->evtchn_port_ops->is_busy )
+        return d->evtchn_port_ops->is_busy(d, port);
+    return 0;
+}
+
 static inline int evtchn_port_set_priority(struct domain *d,
                                            struct evtchn *evtchn,
                                            unsigned int priority)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:12:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:12:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aHuG8-0003co-2g; Sat, 09 Jan 2016 14:12: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 1aHuG0-0003bm-QX
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:43 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	FB/50-09708-85511965; Sat, 09 Jan 2016 14:12:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1452348758!9182691!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4564 invoked from network); 9 Jan 2016 14:12:39 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:12:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuG6-0001WP-KS
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFw-0007B9-Od
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:36 +0000
Date: Sat, 09 Jan 2016 14:12:36 +0000
Message-Id: <E1aHuFw-0007B9-Od@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] VT-d: drop unneeded Ivybridge
	quirk 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 1a448f836e1b9d26a91e7ea7e94a95a2dee58c9e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 15 15:26:07 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:26:07 2015 +0100

    VT-d: drop unneeded Ivybridge quirk workaround
    
    We've been told by Intel that server chipsets don't need the workaround
    anymore starting with Ivybridge (Xeon E5/E7 v2); the second half of the
    workaround was missing anyway.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: a10307b3912e65bbdd9184ba5fe849d252b75f92
    master date: 2015-12-03 15:33:10 +0100
---
 xen/drivers/passthrough/vtd/quirks.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 1888843..49df41d 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -432,7 +432,6 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
      *   - 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 */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:12:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:12:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aHuG8-0003co-2g; Sat, 09 Jan 2016 14:12: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 1aHuG0-0003bm-QX
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:43 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	FB/50-09708-85511965; Sat, 09 Jan 2016 14:12:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1452348758!9182691!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4564 invoked from network); 9 Jan 2016 14:12:39 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:12:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuG6-0001WP-KS
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuFw-0007B9-Od
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:36 +0000
Date: Sat, 09 Jan 2016 14:12:36 +0000
Message-Id: <E1aHuFw-0007B9-Od@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] VT-d: drop unneeded Ivybridge
	quirk 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 1a448f836e1b9d26a91e7ea7e94a95a2dee58c9e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 15 15:26:07 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:26:07 2015 +0100

    VT-d: drop unneeded Ivybridge quirk workaround
    
    We've been told by Intel that server chipsets don't need the workaround
    anymore starting with Ivybridge (Xeon E5/E7 v2); the second half of the
    workaround was missing anyway.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: a10307b3912e65bbdd9184ba5fe849d252b75f92
    master date: 2015-12-03 15:33:10 +0100
---
 xen/drivers/passthrough/vtd/quirks.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 1888843..49df41d 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -432,7 +432,6 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
      *   - 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 */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:12:58 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:12: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 1aHuGF-0003eC-W6; Sat, 09 Jan 2016 14:12: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 1aHuGC-0003db-96
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:52 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	C9/28-08977-36511965; Sat, 09 Jan 2016 14:12:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1452348770!9182114!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18525 invoked from network); 9 Jan 2016 14:12:50 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:12:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGI-0001WX-M3
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuG8-0007Bc-Px
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:48 +0000
Date: Sat, 09 Jan 2016 14:12:48 +0000
Message-Id: <E1aHuG8-0007Bc-Px@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86: refine nr_sockets calculation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3d2d3d86a8e130ca1b708244bc2e16ef1975ca99
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 15 15:26:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:26:56 2015 +0100

    x86: refine nr_sockets calculation
    
    The previous variant didn't work for non-contiguous socket numbers.
    
    Reported-by: Ed Swierk <eswierk@skyportsystems.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Ed Swierk <eswierk@skyportsystems.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 4217080693f9a4831e290c7a31bc6b886be5ca12
    master date: 2015-12-08 09:45:29 +0100
---
 xen/arch/x86/mpparse.c       |   21 ++++++++-------------
 xen/include/asm-x86/mpspec.h |   13 +++++++++++++
 2 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index 8609f4a..837ede9 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -89,19 +89,14 @@ void __init set_nr_cpu_ids(unsigned int max_cpus)
 
 void __init set_nr_sockets(void)
 {
-    /*
-     * Count the actual cpus in the socket 0 and use it to calculate nr_sockets
-     * so that the latter will be always >= the actual socket number in the
-     * system even when APIC IDs from MP table are too sparse.
-     */
-    unsigned int cpus = bitmap_weight(phys_cpu_present_map.mask,
-                                      boot_cpu_data.x86_max_cores *
-                                      boot_cpu_data.x86_num_siblings);
-
-    if ( cpus == 0 )
-        cpus = 1;
-
-    nr_sockets = DIV_ROUND_UP(num_processors + disabled_cpus, cpus);
+	nr_sockets = last_physid(phys_cpu_present_map)
+		     / boot_cpu_data.x86_max_cores
+		     / boot_cpu_data.x86_num_siblings + 1;
+	if (disabled_cpus)
+		nr_sockets += (disabled_cpus - 1)
+			      / boot_cpu_data.x86_max_cores
+			      / boot_cpu_data.x86_num_siblings + 1;
+	printk(XENLOG_DEBUG "nr_sockets: %u\n", nr_sockets);
 }
 
 /*
diff --git a/xen/include/asm-x86/mpspec.h b/xen/include/asm-x86/mpspec.h
index 8ae3cd5..e3e6f50 100644
--- a/xen/include/asm-x86/mpspec.h
+++ b/xen/include/asm-x86/mpspec.h
@@ -43,6 +43,19 @@ typedef struct physid_mask physid_mask_t;
 #define physid_isset(physid, map)		test_bit(physid, (map).mask)
 #define physid_test_and_set(physid, map)	test_and_set_bit(physid, (map).mask)
 
+#define first_physid(map)			find_first_bit((map).mask, \
+							       MAX_APICS)
+#define next_physid(id, map)			find_next_bit((map).mask, \
+							      MAX_APICS, (id) + 1)
+#define last_physid(map) ({ \
+	const unsigned long *mask = (map).mask; \
+	unsigned int id, last = MAX_APICS; \
+	for (id = find_first_bit(mask, MAX_APICS); id < MAX_APICS; \
+	     id = find_next_bit(mask, MAX_APICS, (id) + 1)) \
+		last = id; \
+	last; \
+})
+
 #define physids_and(dst, src1, src2)		bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
 #define physids_or(dst, src1, src2)		bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
 #define physids_clear(map)			bitmap_zero((map).mask, MAX_APICS)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:12:58 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:12: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 1aHuGF-0003eC-W6; Sat, 09 Jan 2016 14:12: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 1aHuGC-0003db-96
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:52 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	C9/28-08977-36511965; Sat, 09 Jan 2016 14:12:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1452348770!9182114!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18525 invoked from network); 9 Jan 2016 14:12:50 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:12:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGI-0001WX-M3
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuG8-0007Bc-Px
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:12:48 +0000
Date: Sat, 09 Jan 2016 14:12:48 +0000
Message-Id: <E1aHuG8-0007Bc-Px@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86: refine nr_sockets calculation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3d2d3d86a8e130ca1b708244bc2e16ef1975ca99
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 15 15:26:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:26:56 2015 +0100

    x86: refine nr_sockets calculation
    
    The previous variant didn't work for non-contiguous socket numbers.
    
    Reported-by: Ed Swierk <eswierk@skyportsystems.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Ed Swierk <eswierk@skyportsystems.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 4217080693f9a4831e290c7a31bc6b886be5ca12
    master date: 2015-12-08 09:45:29 +0100
---
 xen/arch/x86/mpparse.c       |   21 ++++++++-------------
 xen/include/asm-x86/mpspec.h |   13 +++++++++++++
 2 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index 8609f4a..837ede9 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -89,19 +89,14 @@ void __init set_nr_cpu_ids(unsigned int max_cpus)
 
 void __init set_nr_sockets(void)
 {
-    /*
-     * Count the actual cpus in the socket 0 and use it to calculate nr_sockets
-     * so that the latter will be always >= the actual socket number in the
-     * system even when APIC IDs from MP table are too sparse.
-     */
-    unsigned int cpus = bitmap_weight(phys_cpu_present_map.mask,
-                                      boot_cpu_data.x86_max_cores *
-                                      boot_cpu_data.x86_num_siblings);
-
-    if ( cpus == 0 )
-        cpus = 1;
-
-    nr_sockets = DIV_ROUND_UP(num_processors + disabled_cpus, cpus);
+	nr_sockets = last_physid(phys_cpu_present_map)
+		     / boot_cpu_data.x86_max_cores
+		     / boot_cpu_data.x86_num_siblings + 1;
+	if (disabled_cpus)
+		nr_sockets += (disabled_cpus - 1)
+			      / boot_cpu_data.x86_max_cores
+			      / boot_cpu_data.x86_num_siblings + 1;
+	printk(XENLOG_DEBUG "nr_sockets: %u\n", nr_sockets);
 }
 
 /*
diff --git a/xen/include/asm-x86/mpspec.h b/xen/include/asm-x86/mpspec.h
index 8ae3cd5..e3e6f50 100644
--- a/xen/include/asm-x86/mpspec.h
+++ b/xen/include/asm-x86/mpspec.h
@@ -43,6 +43,19 @@ typedef struct physid_mask physid_mask_t;
 #define physid_isset(physid, map)		test_bit(physid, (map).mask)
 #define physid_test_and_set(physid, map)	test_and_set_bit(physid, (map).mask)
 
+#define first_physid(map)			find_first_bit((map).mask, \
+							       MAX_APICS)
+#define next_physid(id, map)			find_next_bit((map).mask, \
+							      MAX_APICS, (id) + 1)
+#define last_physid(map) ({ \
+	const unsigned long *mask = (map).mask; \
+	unsigned int id, last = MAX_APICS; \
+	for (id = find_first_bit(mask, MAX_APICS); id < MAX_APICS; \
+	     id = find_next_bit(mask, MAX_APICS, (id) + 1)) \
+		last = id; \
+	last; \
+})
+
 #define physids_and(dst, src1, src2)		bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
 #define physids_or(dst, src1, src2)		bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
 #define physids_clear(map)			bitmap_zero((map).mask, MAX_APICS)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:13:08 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:13: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 1aHuGS-0003fx-Ja; Sat, 09 Jan 2016 14:13: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 1aHuGN-0003fN-HA
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:04 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	BB/D3-31122-E6511965; Sat, 09 Jan 2016 14:13:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1452348781!9309497!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37914 invoked from network); 9 Jan 2016 14:13:02 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:13:02 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGU-0001X9-3P
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGK-0007Ct-7g
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:00 +0000
Date: Sat, 09 Jan 2016 14:13:00 +0000
Message-Id: <E1aHuGK-0007Ct-7g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/time: fix domain type check in
	tsc_set_info()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fea8dbb3c31c89cf65320f8ce66f47f85f3c293c
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Tue Dec 15 15:27:32 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:27:32 2015 +0100

    x86/time: fix domain type check in tsc_set_info()
    
    Replace is_hvm_domain() in tsc_set_info() by has_hvm_container_domain()
    to keep consistent with other domain type checks in tsc_set_info().
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 3c80d6f3c61eb0f8072f70b0a9a8c8c7adf17572
    master date: 2015-12-08 09:46:30 +0100
---
 xen/arch/x86/time.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index bbb7e6c..7a01c90 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1979,7 +1979,7 @@ void tsc_set_info(struct domain *d,
         break;
     }
     d->arch.incarnation = incarnation + 1;
-    if ( is_hvm_domain(d) )
+    if ( has_hvm_container_domain(d) )
     {
         hvm_set_rdtsc_exiting(d, d->arch.vtsc);
         if ( d->vcpu && d->vcpu[0] && incarnation == 0 )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:13:08 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:13: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 1aHuGS-0003fx-Ja; Sat, 09 Jan 2016 14:13: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 1aHuGN-0003fN-HA
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:04 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	BB/D3-31122-E6511965; Sat, 09 Jan 2016 14:13:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1452348781!9309497!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37914 invoked from network); 9 Jan 2016 14:13:02 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:13:02 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGU-0001X9-3P
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGK-0007Ct-7g
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:00 +0000
Date: Sat, 09 Jan 2016 14:13:00 +0000
Message-Id: <E1aHuGK-0007Ct-7g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/time: fix domain type check in
	tsc_set_info()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fea8dbb3c31c89cf65320f8ce66f47f85f3c293c
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Tue Dec 15 15:27:32 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 15 15:27:32 2015 +0100

    x86/time: fix domain type check in tsc_set_info()
    
    Replace is_hvm_domain() in tsc_set_info() by has_hvm_container_domain()
    to keep consistent with other domain type checks in tsc_set_info().
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 3c80d6f3c61eb0f8072f70b0a9a8c8c7adf17572
    master date: 2015-12-08 09:46:30 +0100
---
 xen/arch/x86/time.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index bbb7e6c..7a01c90 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1979,7 +1979,7 @@ void tsc_set_info(struct domain *d,
         break;
     }
     d->arch.incarnation = incarnation + 1;
-    if ( is_hvm_domain(d) )
+    if ( has_hvm_container_domain(d) )
     {
         hvm_set_rdtsc_exiting(d, d->arch.vtsc);
         if ( d->vcpu && d->vcpu[0] && incarnation == 0 )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:13:23 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:13: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 1aHuGh-0003i3-1v; Sat, 09 Jan 2016 14:13: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 1aHuGZ-0003h8-04
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:15 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	8A/38-08977-97511965; Sat, 09 Jan 2016 14:13:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1452348792!8757998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25039 invoked from network); 9 Jan 2016 14:13:13 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:13:13 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGf-0001Xq-JJ
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGV-0007Do-MA
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:11 +0000
Date: Sat, 09 Jan 2016 14:13:11 +0000
Message-Id: <E1aHuGV-0007Do-MA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86: don't leak ST(n)/XMMn values
	to domains first using 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 82c5c64eaa813b8ec19b1d0016b062413dc12692
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:25:50 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:25:50 2015 +0100

    x86: don't leak ST(n)/XMMn values to domains first using them
    
    FNINIT doesn't alter these registers, and hence using it is
    insufficient to initialize a guest's initial state.
    
    This is CVE-2015-8555 / XSA-165.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 81818b3f277544535974204f8d840da86fa8a44f
    master date: 2015-12-17 14:22:13 +0100
---
 xen/arch/x86/domain.c |   11 +++++++++++
 xen/arch/x86/i387.c   |   31 +++++++++----------------------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index a877bab..54f5875 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -851,6 +851,17 @@ int arch_set_info_guest(
         if ( v->arch.xsave_area )
              v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
     }
+    else if ( v->arch.xsave_area )
+        memset(&v->arch.xsave_area->xsave_hdr, 0,
+               sizeof(v->arch.xsave_area->xsave_hdr));
+    else
+    {
+        typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+        memset(fpu_sse, 0, sizeof(*fpu_sse));
+        fpu_sse->fcw = FCW_DEFAULT;
+        fpu_sse->mxcsr = MXCSR_DEFAULT;
+    }
 
     if ( !compat )
     {
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 14f2a79..57eae28 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -17,19 +17,6 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-static void fpu_init(void)
-{
-    unsigned long val;
-    
-    asm volatile ( "fninit" );
-    if ( cpu_has_xmm )
-    {
-        /* load default value into MXCSR control/status register */
-        val = MXCSR_DEFAULT;
-        asm volatile ( "ldmxcsr %0" : : "m" (val) );
-    }
-}
-
 /*******************************/
 /*     FPU Restore Functions   */
 /*******************************/
@@ -248,15 +235,8 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
 
     if ( cpu_has_xsave )
         fpu_xrstor(v, XSTATE_LAZY);
-    else if ( v->fpu_initialised )
-    {
-        if ( cpu_has_fxsr )
-            fpu_fxrstor(v);
-        else
-            fpu_frstor(v);
-    }
     else
-        fpu_init();
+        fpu_fxrstor(v);
 
     v->fpu_initialised = 1;
     v->fpu_dirtied = 1;
@@ -313,7 +293,14 @@ int vcpu_init_fpu(struct vcpu *v)
     else
     {
         v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse), 16);
-        if ( !v->arch.fpu_ctxt )
+        if ( v->arch.fpu_ctxt )
+        {
+            typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+            fpu_sse->fcw = FCW_DEFAULT;
+            fpu_sse->mxcsr = MXCSR_DEFAULT;
+        }
+        else
             rc = -ENOMEM;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:13:23 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:13: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 1aHuGh-0003i3-1v; Sat, 09 Jan 2016 14:13: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 1aHuGZ-0003h8-04
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:15 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	8A/38-08977-97511965; Sat, 09 Jan 2016 14:13:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1452348792!8757998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25039 invoked from network); 9 Jan 2016 14:13:13 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:13:13 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGf-0001Xq-JJ
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGV-0007Do-MA
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:11 +0000
Date: Sat, 09 Jan 2016 14:13:11 +0000
Message-Id: <E1aHuGV-0007Do-MA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86: don't leak ST(n)/XMMn values
	to domains first using 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 82c5c64eaa813b8ec19b1d0016b062413dc12692
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:25:50 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:25:50 2015 +0100

    x86: don't leak ST(n)/XMMn values to domains first using them
    
    FNINIT doesn't alter these registers, and hence using it is
    insufficient to initialize a guest's initial state.
    
    This is CVE-2015-8555 / XSA-165.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 81818b3f277544535974204f8d840da86fa8a44f
    master date: 2015-12-17 14:22:13 +0100
---
 xen/arch/x86/domain.c |   11 +++++++++++
 xen/arch/x86/i387.c   |   31 +++++++++----------------------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index a877bab..54f5875 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -851,6 +851,17 @@ int arch_set_info_guest(
         if ( v->arch.xsave_area )
              v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
     }
+    else if ( v->arch.xsave_area )
+        memset(&v->arch.xsave_area->xsave_hdr, 0,
+               sizeof(v->arch.xsave_area->xsave_hdr));
+    else
+    {
+        typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+        memset(fpu_sse, 0, sizeof(*fpu_sse));
+        fpu_sse->fcw = FCW_DEFAULT;
+        fpu_sse->mxcsr = MXCSR_DEFAULT;
+    }
 
     if ( !compat )
     {
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 14f2a79..57eae28 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -17,19 +17,6 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-static void fpu_init(void)
-{
-    unsigned long val;
-    
-    asm volatile ( "fninit" );
-    if ( cpu_has_xmm )
-    {
-        /* load default value into MXCSR control/status register */
-        val = MXCSR_DEFAULT;
-        asm volatile ( "ldmxcsr %0" : : "m" (val) );
-    }
-}
-
 /*******************************/
 /*     FPU Restore Functions   */
 /*******************************/
@@ -248,15 +235,8 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
 
     if ( cpu_has_xsave )
         fpu_xrstor(v, XSTATE_LAZY);
-    else if ( v->fpu_initialised )
-    {
-        if ( cpu_has_fxsr )
-            fpu_fxrstor(v);
-        else
-            fpu_frstor(v);
-    }
     else
-        fpu_init();
+        fpu_fxrstor(v);
 
     v->fpu_initialised = 1;
     v->fpu_dirtied = 1;
@@ -313,7 +293,14 @@ int vcpu_init_fpu(struct vcpu *v)
     else
     {
         v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse), 16);
-        if ( !v->arch.fpu_ctxt )
+        if ( v->arch.fpu_ctxt )
+        {
+            typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+            fpu_sse->fcw = FCW_DEFAULT;
+            fpu_sse->mxcsr = MXCSR_DEFAULT;
+        }
+        else
             rc = -ENOMEM;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:13:34 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:13: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 1aHuGr-0003je-7e; Sat, 09 Jan 2016 14:13: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 1aHuGk-0003j2-5Q
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:27 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	D4/58-02499-58511965; Sat, 09 Jan 2016 14:13:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1452348803!14798641!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39926 invoked from network); 9 Jan 2016 14:13:24 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:13:24 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGq-0001Xx-9c
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGg-0007Eo-DI
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:22 +0000
Date: Sat, 09 Jan 2016 14:13:22 +0000
Message-Id: <E1aHuGg-0007Eo-DI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/HVM: avoid reading ioreq state
	more than once
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33708eee8f6a1ac4f4f92317e5d0c412761d2fbb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:27:25 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:27:25 2015 +0100

    x86/HVM: avoid reading ioreq state more than once
    
    Otherwise, especially when the compiler chooses to translate the
    switch() to a jump table, unpredictable behavior (and in the jump table
    case arbitrary code execution) can result.
    
    This is XSA-166.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: b452430a4cdfc801fa4bc391aed7522365e1deb6
    master date: 2015-12-17 14:22:46 +0100
---
 xen/arch/x86/hvm/hvm.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 615fa89..186e01e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -448,7 +448,10 @@ static bool_t hvm_wait_for_io(struct hvm_ioreq_vcpu *sv, ioreq_t *p)
 {
     while ( sv->pending )
     {
-        switch ( p->state )
+        unsigned int state = p->state;
+
+        rmb();
+        switch ( state )
         {
         case STATE_IOREQ_NONE:
             /*
@@ -459,18 +462,15 @@ static bool_t hvm_wait_for_io(struct hvm_ioreq_vcpu *sv, ioreq_t *p)
             hvm_io_assist(sv, ~0ul);
             break;
         case STATE_IORESP_READY: /* IORESP_READY -> NONE */
-            rmb(); /* see IORESP_READY /then/ read contents of ioreq */
             p->state = STATE_IOREQ_NONE;
             hvm_io_assist(sv, p->data);
             break;
         case STATE_IOREQ_READY:  /* IOREQ_{READY,INPROCESS} -> IORESP_READY */
         case STATE_IOREQ_INPROCESS:
-            wait_on_xen_event_channel(sv->ioreq_evtchn,
-                                      (p->state != STATE_IOREQ_READY) &&
-                                      (p->state != STATE_IOREQ_INPROCESS));
+            wait_on_xen_event_channel(sv->ioreq_evtchn, p->state != state);
             break;
         default:
-            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %d.\n", p->state);
+            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %u\n", state);
             sv->pending = 0;
             domain_crash(sv->vcpu->domain);
             return 0; /* bail */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:13:34 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:13: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 1aHuGr-0003je-7e; Sat, 09 Jan 2016 14:13: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 1aHuGk-0003j2-5Q
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:27 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	D4/58-02499-58511965; Sat, 09 Jan 2016 14:13:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1452348803!14798641!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39926 invoked from network); 9 Jan 2016 14:13:24 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:13:24 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGq-0001Xx-9c
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGg-0007Eo-DI
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:22 +0000
Date: Sat, 09 Jan 2016 14:13:22 +0000
Message-Id: <E1aHuGg-0007Eo-DI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/HVM: avoid reading ioreq state
	more than once
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33708eee8f6a1ac4f4f92317e5d0c412761d2fbb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:27:25 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:27:25 2015 +0100

    x86/HVM: avoid reading ioreq state more than once
    
    Otherwise, especially when the compiler chooses to translate the
    switch() to a jump table, unpredictable behavior (and in the jump table
    case arbitrary code execution) can result.
    
    This is XSA-166.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: b452430a4cdfc801fa4bc391aed7522365e1deb6
    master date: 2015-12-17 14:22:46 +0100
---
 xen/arch/x86/hvm/hvm.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 615fa89..186e01e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -448,7 +448,10 @@ static bool_t hvm_wait_for_io(struct hvm_ioreq_vcpu *sv, ioreq_t *p)
 {
     while ( sv->pending )
     {
-        switch ( p->state )
+        unsigned int state = p->state;
+
+        rmb();
+        switch ( state )
         {
         case STATE_IOREQ_NONE:
             /*
@@ -459,18 +462,15 @@ static bool_t hvm_wait_for_io(struct hvm_ioreq_vcpu *sv, ioreq_t *p)
             hvm_io_assist(sv, ~0ul);
             break;
         case STATE_IORESP_READY: /* IORESP_READY -> NONE */
-            rmb(); /* see IORESP_READY /then/ read contents of ioreq */
             p->state = STATE_IOREQ_NONE;
             hvm_io_assist(sv, p->data);
             break;
         case STATE_IOREQ_READY:  /* IOREQ_{READY,INPROCESS} -> IORESP_READY */
         case STATE_IOREQ_INPROCESS:
-            wait_on_xen_event_channel(sv->ioreq_evtchn,
-                                      (p->state != STATE_IOREQ_READY) &&
-                                      (p->state != STATE_IOREQ_INPROCESS));
+            wait_on_xen_event_channel(sv->ioreq_evtchn, p->state != state);
             break;
         default:
-            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %d.\n", p->state);
+            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %u\n", state);
             sv->pending = 0;
             domain_crash(sv->vcpu->domain);
             return 0; /* bail */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:13:44 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:13: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 1aHuH0-0003lE-B2; Sat, 09 Jan 2016 14:13:43 +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 1aHuGv-0003kV-LS
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:38 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	C1/9D-02745-09511965; Sat, 09 Jan 2016 14:13:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1452348815!14257871!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31863 invoked from network); 9 Jan 2016 14:13:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:13:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuH1-0001Y2-Qh
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGr-0007FM-Ug
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:33 +0000
Date: Sat, 09 Jan 2016 14:13:33 +0000
Message-Id: <E1aHuGr-0007FM-Ug@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cdd96b9be5a57ae7795750c3ae83ea6783030688
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Dec 18 14:57:01 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 18 14:57:01 2015 +0000

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

diff --git a/Config.mk b/Config.mk
index 49d55b1..5f11b48 100644
--- a/Config.mk
+++ b/Config.mk
@@ -266,9 +266,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= aaaf657c8f6106da6d7e97ad0d08ed291cc895c7
-# Wed Dec 9 11:47:35 2015 +0000
-# net: pcnet: add check to validate receive data size(CVE-2015-7504)
+QEMU_TRADITIONAL_REVISION ?= 6ff95ee25149052f6eccfd5d3b3ec814f4f8a6d7
+# Fri Nov 20 10:56:00 2015 -0500
+# blkif: Avoid double access to src->nr_segments
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:13:44 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:13: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 1aHuH0-0003lE-B2; Sat, 09 Jan 2016 14:13:43 +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 1aHuGv-0003kV-LS
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:38 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	C1/9D-02745-09511965; Sat, 09 Jan 2016 14:13:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1452348815!14257871!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31863 invoked from network); 9 Jan 2016 14:13:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:13:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuH1-0001Y2-Qh
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuGr-0007FM-Ug
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:33 +0000
Date: Sat, 09 Jan 2016 14:13:33 +0000
Message-Id: <E1aHuGr-0007FM-Ug@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cdd96b9be5a57ae7795750c3ae83ea6783030688
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Dec 18 14:57:01 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 18 14:57:01 2015 +0000

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

diff --git a/Config.mk b/Config.mk
index 49d55b1..5f11b48 100644
--- a/Config.mk
+++ b/Config.mk
@@ -266,9 +266,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= aaaf657c8f6106da6d7e97ad0d08ed291cc895c7
-# Wed Dec 9 11:47:35 2015 +0000
-# net: pcnet: add check to validate receive data size(CVE-2015-7504)
+QEMU_TRADITIONAL_REVISION ?= 6ff95ee25149052f6eccfd5d3b3ec814f4f8a6d7
+# Fri Nov 20 10:56:00 2015 -0500
+# blkif: Avoid double access to src->nr_segments
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:13:58 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:13: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 1aHuHE-0003nQ-Sr; Sat, 09 Jan 2016 14:13: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 1aHuH6-0003mU-2l
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:48 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	21/4E-13487-B9511965; Sat, 09 Jan 2016 14:13:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1452348826!14577814!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22243 invoked from network); 9 Jan 2016 14:13:46 -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;
	9 Jan 2016 14:13:46 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHD-0001YD-Ac
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuH3-0007Fv-Ey
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:45 +0000
Date: Sat, 09 Jan 2016 14:13:45 +0000
Message-Id: <E1aHuH3-0007Fv-Ey@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86: make debug output consistent
	in hvm_set_callback_via
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eb32a519f5945dc7465f1f4f555e2dd9654250b7
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Mon Dec 21 14:07:36 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 21 14:07:36 2015 +0100

    x86: make debug output consistent in hvm_set_callback_via
    
    The unconditional printks in the switch statement of the
    hvm_set_callback_via function results in Xen log spam in non debug
    versions of Xen. The printks are for debug output only so conditionally
    compile the entire switch statement on debug versions of Xen only.
    
    This is XSA-169.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 5c1048565ba5b240f47203bdb67572bee73d639e
    master date: 2015-12-21 13:40:48 +0100
---
 xen/arch/x86/hvm/irq.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 50fcf73..ed05970 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -382,7 +382,8 @@ void hvm_set_callback_via(struct domain *d, uint64_t via)
 
     spin_unlock(&d->arch.hvm_domain.irq_lock);
 
-    dprintk(XENLOG_G_INFO, "Dom%u callback via changed to ", d->domain_id);
+#ifndef NDEBUG
+    printk(XENLOG_G_INFO "Dom%u callback via changed to ", d->domain_id);
     switch ( via_type )
     {
     case HVMIRQ_callback_gsi:
@@ -398,6 +399,7 @@ void hvm_set_callback_via(struct domain *d, uint64_t via)
         printk("None\n");
         break;
     }
+#endif
 }
 
 struct hvm_intack hvm_vcpu_has_pending_irq(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:13:58 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:13: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 1aHuHE-0003nQ-Sr; Sat, 09 Jan 2016 14:13: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 1aHuH6-0003mU-2l
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:48 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	21/4E-13487-B9511965; Sat, 09 Jan 2016 14:13:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1452348826!14577814!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22243 invoked from network); 9 Jan 2016 14:13:46 -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;
	9 Jan 2016 14:13:46 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHD-0001YD-Ac
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuH3-0007Fv-Ey
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:45 +0000
Date: Sat, 09 Jan 2016 14:13:45 +0000
Message-Id: <E1aHuH3-0007Fv-Ey@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86: make debug output consistent
	in hvm_set_callback_via
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eb32a519f5945dc7465f1f4f555e2dd9654250b7
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Mon Dec 21 14:07:36 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 21 14:07:36 2015 +0100

    x86: make debug output consistent in hvm_set_callback_via
    
    The unconditional printks in the switch statement of the
    hvm_set_callback_via function results in Xen log spam in non debug
    versions of Xen. The printks are for debug output only so conditionally
    compile the entire switch statement on debug versions of Xen only.
    
    This is XSA-169.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 5c1048565ba5b240f47203bdb67572bee73d639e
    master date: 2015-12-21 13:40:48 +0100
---
 xen/arch/x86/hvm/irq.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 50fcf73..ed05970 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -382,7 +382,8 @@ void hvm_set_callback_via(struct domain *d, uint64_t via)
 
     spin_unlock(&d->arch.hvm_domain.irq_lock);
 
-    dprintk(XENLOG_G_INFO, "Dom%u callback via changed to ", d->domain_id);
+#ifndef NDEBUG
+    printk(XENLOG_G_INFO "Dom%u callback via changed to ", d->domain_id);
     switch ( via_type )
     {
     case HVMIRQ_callback_gsi:
@@ -398,6 +399,7 @@ void hvm_set_callback_via(struct domain *d, uint64_t via)
         printk("None\n");
         break;
     }
+#endif
 }
 
 struct hvm_intack hvm_vcpu_has_pending_irq(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:14:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:14: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 1aHuHO-0003oc-Ku; Sat, 09 Jan 2016 14:14: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 1aHuHH-0003o1-LB
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:00 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	09/21-07451-6A511965; Sat, 09 Jan 2016 14:13:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1452348837!14824248!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45166 invoked from network); 9 Jan 2016 14:13:58 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:13:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHO-0001Yo-01
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHE-0007HB-2f
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:56 +0000
Date: Sat, 09 Jan 2016 14:13:56 +0000
Message-Id: <E1aHuHE-0007HB-2f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 828ac175e5f8f616b14e49f5353bca4dc2d0efd1
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 15:35:54 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:35:54 2016 +0000

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

diff --git a/Config.mk b/Config.mk
index 5f11b48..5ba36aa 100644
--- a/Config.mk
+++ b/Config.mk
@@ -266,9 +266,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= 6ff95ee25149052f6eccfd5d3b3ec814f4f8a6d7
-# Fri Nov 20 10:56:00 2015 -0500
-# blkif: Avoid double access to src->nr_segments
+QEMU_TRADITIONAL_REVISION ?= 7457f4beae2583a106a4176949514e81248fc22d
+# Mon Jan 4 15:34:29 2016 +0000
+# MSI-X: avoid array overrun upon MSI-X table writes
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:14:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:14: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 1aHuHO-0003oc-Ku; Sat, 09 Jan 2016 14:14: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 1aHuHH-0003o1-LB
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:00 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	09/21-07451-6A511965; Sat, 09 Jan 2016 14:13:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1452348837!14824248!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45166 invoked from network); 9 Jan 2016 14:13:58 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:13:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHO-0001Yo-01
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHE-0007HB-2f
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:13:56 +0000
Date: Sat, 09 Jan 2016 14:13:56 +0000
Message-Id: <E1aHuHE-0007HB-2f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 828ac175e5f8f616b14e49f5353bca4dc2d0efd1
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 15:35:54 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:35:54 2016 +0000

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

diff --git a/Config.mk b/Config.mk
index 5f11b48..5ba36aa 100644
--- a/Config.mk
+++ b/Config.mk
@@ -266,9 +266,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= 6ff95ee25149052f6eccfd5d3b3ec814f4f8a6d7
-# Fri Nov 20 10:56:00 2015 -0500
-# blkif: Avoid double access to src->nr_segments
+QEMU_TRADITIONAL_REVISION ?= 7457f4beae2583a106a4176949514e81248fc22d
+# Mon Jan 4 15:34:29 2016 +0000
+# MSI-X: avoid array overrun upon MSI-X table writes
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:14:16 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:14: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 1aHuHX-0003px-VH; Sat, 09 Jan 2016 14:14:16 +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 1aHuHS-0003pM-Sy
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:11 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	AC/31-07451-2B511965; Sat, 09 Jan 2016 14:14:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1452348848!14749174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 65214 invoked from network); 9 Jan 2016 14:14:09 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:14:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHZ-0001Zf-J4
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHP-0007IV-Dt
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:07 +0000
Date: Sat, 09 Jan 2016 14:14:07 +0000
Message-Id: <E1aHuHP-0007IV-Dt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] Config.mk: update OVMF changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c3c6ff9ecaa5ee0be8b535d36fdcd12380564a1
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 14 12:41:13 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jan 7 15:30:44 2016 +0000

    Config.mk: update OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    
    (cherry picked from commit 04c5efb0a141fa53e805e396970419436e74ce67)
    
    Apropos of discussion in
     "OVMF related osstest failures on multiple branches"
     http://lists.xenproject.org/archives/html/xen-devel/2016-01/msg00442.html
    
    We believe the older ovmf.git does not work when built with the gcc in
    Debian jessie.  We do not know where this bug lies but we are fixing
    it by updating ovmf.
    
    We have decided that we are not in a position to review the changes to
    OVMF upstream, and ourselves decide what to cherry pick.  Instead we
    will update the revision wholesale and use the xen.git stable
    branches' push gate.
    
    Conflicts:
    	Config.mk
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 5ba36aa..e829f7e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -253,7 +253,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
-OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
+OVMF_UPSTREAM_REVISION ?= af9785a9ed61daea52b47f0bf448f1f228beee1e
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.6.0
 MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.6.0
 # Fri Jun 26 11:58:40 2015 +0100
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:14:16 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14:14: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 1aHuHX-0003px-VH; Sat, 09 Jan 2016 14:14:16 +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 1aHuHS-0003pM-Sy
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:11 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	AC/31-07451-2B511965; Sat, 09 Jan 2016 14:14:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1452348848!14749174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 65214 invoked from network); 9 Jan 2016 14:14:09 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:14:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHZ-0001Zf-J4
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHP-0007IV-Dt
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:07 +0000
Date: Sat, 09 Jan 2016 14:14:07 +0000
Message-Id: <E1aHuHP-0007IV-Dt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] Config.mk: update OVMF changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c3c6ff9ecaa5ee0be8b535d36fdcd12380564a1
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 14 12:41:13 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jan 7 15:30:44 2016 +0000

    Config.mk: update OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    
    (cherry picked from commit 04c5efb0a141fa53e805e396970419436e74ce67)
    
    Apropos of discussion in
     "OVMF related osstest failures on multiple branches"
     http://lists.xenproject.org/archives/html/xen-devel/2016-01/msg00442.html
    
    We believe the older ovmf.git does not work when built with the gcc in
    Debian jessie.  We do not know where this bug lies but we are fixing
    it by updating ovmf.
    
    We have decided that we are not in a position to review the changes to
    OVMF upstream, and ourselves decide what to cherry pick.  Instead we
    will update the revision wholesale and use the xen.git stable
    branches' push gate.
    
    Conflicts:
    	Config.mk
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 5ba36aa..e829f7e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -253,7 +253,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
-OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
+OVMF_UPSTREAM_REVISION ?= af9785a9ed61daea52b47f0bf448f1f228beee1e
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.6.0
 MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.6.0
 # Fri Jun 26 11:58:40 2015 +0100
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:14:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14: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 1aHuHg-0003sI-5f; Sat, 09 Jan 2016 14:14:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHd-0003r5-TC
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:22 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	F8/81-32641-DB511965; Sat, 09 Jan 2016 14:14:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1452348859!2206340!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17767 invoked from network); 9 Jan 2016 14:14:20 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:14:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHk-0001Zn-M5
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHa-0007JS-QN
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:18 +0000
Date: Sat, 09 Jan 2016 14:14:18 +0000
Message-Id: <E1aHuHa-0007JS-QN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] Config.mk: update OVMF changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1d3cc6e62c4d2fc3dd9251d4921881425c9d27bd
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Nov 12 10:06:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jan 7 15:46:03 2016 +0000

    Config.mk: update OVMF changeset
    
    The new osstest tested head contains a fix for gcc-4.4 toolchain.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit f046e501bbca1c8a46853b2e1f1b587e228c73de)
    
    This should have been folded into the previous commit.
    
    Conflicts:
    	Config.mk
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index e829f7e..1eb53d7 100644
--- a/Config.mk
+++ b/Config.mk
@@ -253,7 +253,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
-OVMF_UPSTREAM_REVISION ?= af9785a9ed61daea52b47f0bf448f1f228beee1e
+OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.6.0
 MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.6.0
 # Fri Jun 26 11:58:40 2015 +0100
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sat Jan 09 14:14:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 09 Jan 2016 14: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 1aHuHg-0003sI-5f; Sat, 09 Jan 2016 14:14:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHd-0003r5-TC
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:22 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	F8/81-32641-DB511965; Sat, 09 Jan 2016 14:14:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1452348859!2206340!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17767 invoked from network); 9 Jan 2016 14:14:20 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Jan 2016 14:14:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHk-0001Zn-M5
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aHuHa-0007JS-QN
	for xen-changelog@lists.xensource.com; Sat, 09 Jan 2016 14:14:18 +0000
Date: Sat, 09 Jan 2016 14:14:18 +0000
Message-Id: <E1aHuHa-0007JS-QN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] Config.mk: update OVMF changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1d3cc6e62c4d2fc3dd9251d4921881425c9d27bd
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Nov 12 10:06:58 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jan 7 15:46:03 2016 +0000

    Config.mk: update OVMF changeset
    
    The new osstest tested head contains a fix for gcc-4.4 toolchain.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit f046e501bbca1c8a46853b2e1f1b587e228c73de)
    
    This should have been folded into the previous commit.
    
    Conflicts:
    	Config.mk
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index e829f7e..1eb53d7 100644
--- a/Config.mk
+++ b/Config.mk
@@ -253,7 +253,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
-OVMF_UPSTREAM_REVISION ?= af9785a9ed61daea52b47f0bf448f1f228beee1e
+OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.6.0
 MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.6.0
 # Fri Jun 26 11:58:40 2015 +0100
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Sun Jan 10 23:33:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 10 Jan 2016 23: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 1aIPU1-0006XP-4v; Sun, 10 Jan 2016 23:33:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPTx-0006XK-5L
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:10 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	0E/77-13487-43AE2965; Sun, 10 Jan 2016 23:33:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1452468786!14967894!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47775 invoked from network); 10 Jan 2016 23:33:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2016 23:33:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPU5-0007rM-Mz
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPTr-0003Xo-Po
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:04 +0000
Date: Sun, 10 Jan 2016 23:33:03 +0000
Message-Id: <E1aIPTr-0003Xo-Po@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: don't leak ST(n)/XMMn values
	to domains first using 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 b45e5349ee747371d07d833afc9a6d5c9b68a0c6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:28:58 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:28:58 2015 +0100

    x86: don't leak ST(n)/XMMn values to domains first using them
    
    FNINIT doesn't alter these registers, and hence using it is
    insufficient to initialize a guest's initial state.
    
    This is CVE-2015-8555 / XSA-165.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 81818b3f277544535974204f8d840da86fa8a44f
    master date: 2015-12-17 14:22:13 +0100
---
 xen/arch/x86/domain.c |   11 +++++++++++
 xen/arch/x86/i387.c   |   31 +++++++++----------------------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 61deaff..6e01733 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -798,6 +798,17 @@ int arch_set_info_guest(
         if ( v->arch.xsave_area )
              v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
     }
+    else if ( v->arch.xsave_area )
+        memset(&v->arch.xsave_area->xsave_hdr, 0,
+               sizeof(v->arch.xsave_area->xsave_hdr));
+    else
+    {
+        typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+        memset(fpu_sse, 0, sizeof(*fpu_sse));
+        fpu_sse->fcw = FCW_DEFAULT;
+        fpu_sse->mxcsr = MXCSR_DEFAULT;
+    }
 
     if ( !compat )
     {
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index a372e0b..58fb7b7 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -17,19 +17,6 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-static void fpu_init(void)
-{
-    unsigned long val;
-    
-    asm volatile ( "fninit" );
-    if ( cpu_has_xmm )
-    {
-        /* load default value into MXCSR control/status register */
-        val = MXCSR_DEFAULT;
-        asm volatile ( "ldmxcsr %0" : : "m" (val) );
-    }
-}
-
 /*******************************/
 /*     FPU Restore Functions   */
 /*******************************/
@@ -248,15 +235,8 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
 
     if ( cpu_has_xsave )
         fpu_xrstor(v, XSTATE_LAZY);
-    else if ( v->fpu_initialised )
-    {
-        if ( cpu_has_fxsr )
-            fpu_fxrstor(v);
-        else
-            fpu_frstor(v);
-    }
     else
-        fpu_init();
+        fpu_fxrstor(v);
 
     v->fpu_initialised = 1;
     v->fpu_dirtied = 1;
@@ -317,7 +297,14 @@ int vcpu_init_fpu(struct vcpu *v)
     else
     {
         v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse), 16);
-        if ( !v->arch.fpu_ctxt )
+        if ( v->arch.fpu_ctxt )
+        {
+            typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+            fpu_sse->fcw = FCW_DEFAULT;
+            fpu_sse->mxcsr = MXCSR_DEFAULT;
+        }
+        else
         {
             rc = -ENOMEM;
             goto done;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sun Jan 10 23:33:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 10 Jan 2016 23: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 1aIPU1-0006XP-4v; Sun, 10 Jan 2016 23:33:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPTx-0006XK-5L
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:10 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	0E/77-13487-43AE2965; Sun, 10 Jan 2016 23:33:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1452468786!14967894!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47775 invoked from network); 10 Jan 2016 23:33:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2016 23:33:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPU5-0007rM-Mz
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPTr-0003Xo-Po
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:04 +0000
Date: Sun, 10 Jan 2016 23:33:03 +0000
Message-Id: <E1aIPTr-0003Xo-Po@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86: don't leak ST(n)/XMMn values
	to domains first using 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 b45e5349ee747371d07d833afc9a6d5c9b68a0c6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:28:58 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:28:58 2015 +0100

    x86: don't leak ST(n)/XMMn values to domains first using them
    
    FNINIT doesn't alter these registers, and hence using it is
    insufficient to initialize a guest's initial state.
    
    This is CVE-2015-8555 / XSA-165.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 81818b3f277544535974204f8d840da86fa8a44f
    master date: 2015-12-17 14:22:13 +0100
---
 xen/arch/x86/domain.c |   11 +++++++++++
 xen/arch/x86/i387.c   |   31 +++++++++----------------------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 61deaff..6e01733 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -798,6 +798,17 @@ int arch_set_info_guest(
         if ( v->arch.xsave_area )
              v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
     }
+    else if ( v->arch.xsave_area )
+        memset(&v->arch.xsave_area->xsave_hdr, 0,
+               sizeof(v->arch.xsave_area->xsave_hdr));
+    else
+    {
+        typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+        memset(fpu_sse, 0, sizeof(*fpu_sse));
+        fpu_sse->fcw = FCW_DEFAULT;
+        fpu_sse->mxcsr = MXCSR_DEFAULT;
+    }
 
     if ( !compat )
     {
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index a372e0b..58fb7b7 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -17,19 +17,6 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-static void fpu_init(void)
-{
-    unsigned long val;
-    
-    asm volatile ( "fninit" );
-    if ( cpu_has_xmm )
-    {
-        /* load default value into MXCSR control/status register */
-        val = MXCSR_DEFAULT;
-        asm volatile ( "ldmxcsr %0" : : "m" (val) );
-    }
-}
-
 /*******************************/
 /*     FPU Restore Functions   */
 /*******************************/
@@ -248,15 +235,8 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
 
     if ( cpu_has_xsave )
         fpu_xrstor(v, XSTATE_LAZY);
-    else if ( v->fpu_initialised )
-    {
-        if ( cpu_has_fxsr )
-            fpu_fxrstor(v);
-        else
-            fpu_frstor(v);
-    }
     else
-        fpu_init();
+        fpu_fxrstor(v);
 
     v->fpu_initialised = 1;
     v->fpu_dirtied = 1;
@@ -317,7 +297,14 @@ int vcpu_init_fpu(struct vcpu *v)
     else
     {
         v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse), 16);
-        if ( !v->arch.fpu_ctxt )
+        if ( v->arch.fpu_ctxt )
+        {
+            typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+            fpu_sse->fcw = FCW_DEFAULT;
+            fpu_sse->mxcsr = MXCSR_DEFAULT;
+        }
+        else
         {
             rc = -ENOMEM;
             goto done;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sun Jan 10 23:33:27 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 10 Jan 2016 23:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aIPUF-0006Y2-JI; Sun, 10 Jan 2016 23:33:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUC-0006Xq-5j
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:24 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	36/E0-13475-34AE2965; Sun, 10 Jan 2016 23:33:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1452468801!15806199!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47936 invoked from network); 10 Jan 2016 23:33:22 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2016 23:33:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUI-0007rw-2r
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPU4-0003Yi-NK
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:16 +0000
Date: Sun, 10 Jan 2016 23:33:16 +0000
Message-Id: <E1aIPU4-0003Yi-NK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/HVM: avoid reading ioreq state
	more than once
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 880c29f5838f75764a7767ffbd51942439addbc9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:29:28 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:29:28 2015 +0100

    x86/HVM: avoid reading ioreq state more than once
    
    Otherwise, especially when the compiler chooses to translate the
    switch() to a jump table, unpredictable behavior (and in the jump table
    case arbitrary code execution) can result.
    
    This is XSA-166.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: b452430a4cdfc801fa4bc391aed7522365e1deb6
    master date: 2015-12-17 14:22:46 +0100
---
 xen/arch/x86/hvm/hvm.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index dc904f64..41fb10a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -400,23 +400,23 @@ bool_t hvm_io_pending(struct vcpu *v)
 
 static bool_t hvm_wait_for_io(struct hvm_ioreq_vcpu *sv, ioreq_t *p)
 {
+    unsigned int state;
+
     /* NB. Optimised for common case (p->state == STATE_IOREQ_NONE). */
-    while ( p->state != STATE_IOREQ_NONE )
+    while ( (state = p->state) != STATE_IOREQ_NONE )
     {
-        switch ( p->state )
+        rmb();
+        switch ( state )
         {
         case STATE_IORESP_READY: /* IORESP_READY -> NONE */
-            rmb(); /* see IORESP_READY /then/ read contents of ioreq */
             hvm_io_assist(p);
             break;
         case STATE_IOREQ_READY:  /* IOREQ_{READY,INPROCESS} -> IORESP_READY */
         case STATE_IOREQ_INPROCESS:
-            wait_on_xen_event_channel(sv->ioreq_evtchn,
-                                      (p->state != STATE_IOREQ_READY) &&
-                                      (p->state != STATE_IOREQ_INPROCESS));
+            wait_on_xen_event_channel(sv->ioreq_evtchn, p->state != state);
             break;
         default:
-            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %d.\n", p->state);
+            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %u\n", state);
             domain_crash(sv->vcpu->domain);
             return 0; /* bail */
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sun Jan 10 23:33:27 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 10 Jan 2016 23:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aIPUF-0006Y2-JI; Sun, 10 Jan 2016 23:33:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUC-0006Xq-5j
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:24 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	36/E0-13475-34AE2965; Sun, 10 Jan 2016 23:33:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1452468801!15806199!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47936 invoked from network); 10 Jan 2016 23:33:22 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2016 23:33:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUI-0007rw-2r
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPU4-0003Yi-NK
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:16 +0000
Date: Sun, 10 Jan 2016 23:33:16 +0000
Message-Id: <E1aIPU4-0003Yi-NK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/HVM: avoid reading ioreq state
	more than once
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 880c29f5838f75764a7767ffbd51942439addbc9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:29:28 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:29:28 2015 +0100

    x86/HVM: avoid reading ioreq state more than once
    
    Otherwise, especially when the compiler chooses to translate the
    switch() to a jump table, unpredictable behavior (and in the jump table
    case arbitrary code execution) can result.
    
    This is XSA-166.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: b452430a4cdfc801fa4bc391aed7522365e1deb6
    master date: 2015-12-17 14:22:46 +0100
---
 xen/arch/x86/hvm/hvm.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index dc904f64..41fb10a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -400,23 +400,23 @@ bool_t hvm_io_pending(struct vcpu *v)
 
 static bool_t hvm_wait_for_io(struct hvm_ioreq_vcpu *sv, ioreq_t *p)
 {
+    unsigned int state;
+
     /* NB. Optimised for common case (p->state == STATE_IOREQ_NONE). */
-    while ( p->state != STATE_IOREQ_NONE )
+    while ( (state = p->state) != STATE_IOREQ_NONE )
     {
-        switch ( p->state )
+        rmb();
+        switch ( state )
         {
         case STATE_IORESP_READY: /* IORESP_READY -> NONE */
-            rmb(); /* see IORESP_READY /then/ read contents of ioreq */
             hvm_io_assist(p);
             break;
         case STATE_IOREQ_READY:  /* IOREQ_{READY,INPROCESS} -> IORESP_READY */
         case STATE_IOREQ_INPROCESS:
-            wait_on_xen_event_channel(sv->ioreq_evtchn,
-                                      (p->state != STATE_IOREQ_READY) &&
-                                      (p->state != STATE_IOREQ_INPROCESS));
+            wait_on_xen_event_channel(sv->ioreq_evtchn, p->state != state);
             break;
         default:
-            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %d.\n", p->state);
+            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %u\n", state);
             domain_crash(sv->vcpu->domain);
             return 0; /* bail */
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sun Jan 10 23:33:37 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 10 Jan 2016 23:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aIPUP-0006ZE-HO; Sun, 10 Jan 2016 23:33:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUN-0006Yw-3H
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:36 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	CC/80-31122-E4AE2965; Sun, 10 Jan 2016 23:33:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1452468813!9313801!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33571 invoked from network); 10 Jan 2016 23:33:33 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2016 23:33:33 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUW-0007s5-V5
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUJ-0003Zb-K4
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:31 +0000
Date: Sun, 10 Jan 2016 23:33:31 +0000
Message-Id: <E1aIPUJ-0003Zb-K4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 172797ecdfd4e2cfece6a401b7b000799534c84e
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Dec 18 14:58:10 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 18 14:58:10 2015 +0000

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

diff --git a/Config.mk b/Config.mk
index d11c211..032abc5 100644
--- a/Config.mk
+++ b/Config.mk
@@ -260,9 +260,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= 3159615c393e0b981e00ecd0e06fcfd44235f2d4
-# Wed Dec 9 11:47:35 2015 +0000
-# net: pcnet: add check to validate receive data size(CVE-2015-7504)
+QEMU_TRADITIONAL_REVISION ?= f9eb9952892716caae2f0960acc1f06132625426
+# Fri Nov 20 10:56:00 2015 -0500
+# blkif: Avoid double access to src->nr_segments
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sun Jan 10 23:33:37 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 10 Jan 2016 23:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aIPUP-0006ZE-HO; Sun, 10 Jan 2016 23:33:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUN-0006Yw-3H
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:36 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	CC/80-31122-E4AE2965; Sun, 10 Jan 2016 23:33:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1452468813!9313801!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33571 invoked from network); 10 Jan 2016 23:33:33 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2016 23:33:33 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUW-0007s5-V5
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUJ-0003Zb-K4
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:31 +0000
Date: Sun, 10 Jan 2016 23:33:31 +0000
Message-Id: <E1aIPUJ-0003Zb-K4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 172797ecdfd4e2cfece6a401b7b000799534c84e
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Dec 18 14:58:10 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 18 14:58:10 2015 +0000

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

diff --git a/Config.mk b/Config.mk
index d11c211..032abc5 100644
--- a/Config.mk
+++ b/Config.mk
@@ -260,9 +260,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= 3159615c393e0b981e00ecd0e06fcfd44235f2d4
-# Wed Dec 9 11:47:35 2015 +0000
-# net: pcnet: add check to validate receive data size(CVE-2015-7504)
+QEMU_TRADITIONAL_REVISION ?= f9eb9952892716caae2f0960acc1f06132625426
+# Fri Nov 20 10:56:00 2015 -0500
+# blkif: Avoid double access to src->nr_segments
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sun Jan 10 23:33:47 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 10 Jan 2016 23:33:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aIPUZ-0006au-Oq; Sun, 10 Jan 2016 23:33: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 1aIPUX-0006ac-PA
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:46 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	7F/66-22089-95AE2965; Sun, 10 Jan 2016 23:33:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1452468823!14657171!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25228 invoked from network); 10 Jan 2016 23:33:44 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2016 23:33:44 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUi-0007sG-8m
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUU-0003aw-Ut
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:42 +0000
Date: Sun, 10 Jan 2016 23:33:42 +0000
Message-Id: <E1aIPUU-0003aw-Ut@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7b2ce457b8bbcf928f347fac3d2b111611e61e0a
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 15:36:12 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:36:12 2016 +0000

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

diff --git a/Config.mk b/Config.mk
index 032abc5..3051e40 100644
--- a/Config.mk
+++ b/Config.mk
@@ -260,9 +260,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= f9eb9952892716caae2f0960acc1f06132625426
-# Fri Nov 20 10:56:00 2015 -0500
-# blkif: Avoid double access to src->nr_segments
+QEMU_TRADITIONAL_REVISION ?= f5bf3ed6eaa752d91e4d1fb1675b4c3e9f984c71
+# Mon Jan 4 15:34:29 2016 +0000
+# MSI-X: avoid array overrun upon MSI-X table writes
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sun Jan 10 23:33:47 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 10 Jan 2016 23:33:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aIPUZ-0006au-Oq; Sun, 10 Jan 2016 23:33: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 1aIPUX-0006ac-PA
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:46 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	7F/66-22089-95AE2965; Sun, 10 Jan 2016 23:33:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1452468823!14657171!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25228 invoked from network); 10 Jan 2016 23:33:44 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2016 23:33:44 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUi-0007sG-8m
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUU-0003aw-Ut
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:42 +0000
Date: Sun, 10 Jan 2016 23:33:42 +0000
Message-Id: <E1aIPUU-0003aw-Ut@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7b2ce457b8bbcf928f347fac3d2b111611e61e0a
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 15:36:12 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:36:12 2016 +0000

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

diff --git a/Config.mk b/Config.mk
index 032abc5..3051e40 100644
--- a/Config.mk
+++ b/Config.mk
@@ -260,9 +260,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= f9eb9952892716caae2f0960acc1f06132625426
-# Fri Nov 20 10:56:00 2015 -0500
-# blkif: Avoid double access to src->nr_segments
+QEMU_TRADITIONAL_REVISION ?= f5bf3ed6eaa752d91e4d1fb1675b4c3e9f984c71
+# Mon Jan 4 15:34:29 2016 +0000
+# MSI-X: avoid array overrun upon MSI-X table writes
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sun Jan 10 23:33:58 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 10 Jan 2016 23: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 1aIPUk-0006cM-Gh; Sun, 10 Jan 2016 23: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 1aIPUh-0006c0-Lz
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:55 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	D8/90-31122-36AE2965; Sun, 10 Jan 2016 23:33:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1452468833!9443817!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18942 invoked from network); 10 Jan 2016 23:33:54 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2016 23:33:54 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUs-0007sr-KG
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:34:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUf-0003bx-Al
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:53 +0000
Date: Sun, 10 Jan 2016 23:33:53 +0000
Message-Id: <E1aIPUf-0003bx-Al@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] blktap: 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 845e8c1653242bbd9b9de5a081182db0f3f39054
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: Wed Jan 6 11:32:18 2016 +0000

    blktap: Fix two 'maybe uninitialized' variables
    
    [ Cross-ported to blktap1 from 345e44a85d71a
      "blktap2: Fix two 'maybe uninitialized' variables" -iwj;
      Remainder of commit message is from blktap2's version. ]
    
    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>
    
    Backport-requested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/blktap/drivers/block-qcow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/blktap/drivers/block-qcow.c b/tools/blktap/drivers/block-qcow.c
index 0e4e9cf..8fb6023 100644
--- a/tools/blktap/drivers/block-qcow.c
+++ b/tools/blktap/drivers/block-qcow.c
@@ -440,6 +440,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);
 
@@ -613,6 +614,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#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sun Jan 10 23:33:58 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 10 Jan 2016 23: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 1aIPUk-0006cM-Gh; Sun, 10 Jan 2016 23: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 1aIPUh-0006c0-Lz
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:55 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	D8/90-31122-36AE2965; Sun, 10 Jan 2016 23:33:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1452468833!9443817!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18942 invoked from network); 10 Jan 2016 23:33:54 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2016 23:33:54 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUs-0007sr-KG
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:34:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUf-0003bx-Al
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:33:53 +0000
Date: Sun, 10 Jan 2016 23:33:53 +0000
Message-Id: <E1aIPUf-0003bx-Al@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] blktap: 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 845e8c1653242bbd9b9de5a081182db0f3f39054
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: Wed Jan 6 11:32:18 2016 +0000

    blktap: Fix two 'maybe uninitialized' variables
    
    [ Cross-ported to blktap1 from 345e44a85d71a
      "blktap2: Fix two 'maybe uninitialized' variables" -iwj;
      Remainder of commit message is from blktap2's version. ]
    
    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>
    
    Backport-requested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/blktap/drivers/block-qcow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/blktap/drivers/block-qcow.c b/tools/blktap/drivers/block-qcow.c
index 0e4e9cf..8fb6023 100644
--- a/tools/blktap/drivers/block-qcow.c
+++ b/tools/blktap/drivers/block-qcow.c
@@ -440,6 +440,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);
 
@@ -613,6 +614,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#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sun Jan 10 23:34:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 10 Jan 2016 23:34:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aIPUv-0006eG-Lu; Sun, 10 Jan 2016 23:34: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 1aIPUu-0006du-3C
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:34:08 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	A8/1B-07165-F6AE2965; Sun, 10 Jan 2016 23:34:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1452468845!15806247!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49730 invoked from network); 10 Jan 2016 23:34:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2016 23:34:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPV3-0007sz-4I
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:34:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUp-0003d6-M4
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:34:03 +0000
Date: Sun, 10 Jan 2016 23:34:03 +0000
Message-Id: <E1aIPUp-0003d6-M4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] Config.mk: update OVMF changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ee576d71103e6795dc0add91db1b0d281eab1caf
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 14 12:41:13 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jan 7 15:47:57 2016 +0000

    Config.mk: update OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    
    (cherry picked from commits 04c5efb0a141fa53e805e396970419436e74ce67
     and f046e501bbca1c8a46853b2e1f1b587e228c73de)
    
    Apropos of discussion in
     "OVMF related osstest failures on multiple branches"
     http://lists.xenproject.org/archives/html/xen-devel/2016-01/msg00442.html
    
    We believe the older ovmf.git does not work when built with the gcc in
    Debian jessie.  We do not know where this bug lies but we are fixing
    it by updating ovmf.
    
    We have decided that we are not in a position to review the changes to
    OVMF upstream, and ourselves decide what to cherry pick.  Instead we
    will update the revision wholesale and use the xen.git stable
    branches' push gate.
    
    Conflicts:
    	Config.mk
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    (cherry picked from commits 6c3c6ff9ecaa5ee0be8b535d36fdcd12380564a1
     and 1d3cc6e62c4d2fc3dd9251d4921881425c9d27bd)
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 3051e40..149a73f 100644
--- a/Config.mk
+++ b/Config.mk
@@ -251,7 +251,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
 QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
-OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
+OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.5.2
 SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 # Thu May 22 16:59:16 2014 -0400
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Sun Jan 10 23:34:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 10 Jan 2016 23:34:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aIPUv-0006eG-Lu; Sun, 10 Jan 2016 23:34: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 1aIPUu-0006du-3C
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:34:08 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	A8/1B-07165-F6AE2965; Sun, 10 Jan 2016 23:34:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1452468845!15806247!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49730 invoked from network); 10 Jan 2016 23:34:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Jan 2016 23:34:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPV3-0007sz-4I
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:34:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIPUp-0003d6-M4
	for xen-changelog@lists.xensource.com; Sun, 10 Jan 2016 23:34:03 +0000
Date: Sun, 10 Jan 2016 23:34:03 +0000
Message-Id: <E1aIPUp-0003d6-M4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] Config.mk: update OVMF changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ee576d71103e6795dc0add91db1b0d281eab1caf
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 14 12:41:13 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jan 7 15:47:57 2016 +0000

    Config.mk: update OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    
    (cherry picked from commits 04c5efb0a141fa53e805e396970419436e74ce67
     and f046e501bbca1c8a46853b2e1f1b587e228c73de)
    
    Apropos of discussion in
     "OVMF related osstest failures on multiple branches"
     http://lists.xenproject.org/archives/html/xen-devel/2016-01/msg00442.html
    
    We believe the older ovmf.git does not work when built with the gcc in
    Debian jessie.  We do not know where this bug lies but we are fixing
    it by updating ovmf.
    
    We have decided that we are not in a position to review the changes to
    OVMF upstream, and ourselves decide what to cherry pick.  Instead we
    will update the revision wholesale and use the xen.git stable
    branches' push gate.
    
    Conflicts:
    	Config.mk
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    (cherry picked from commits 6c3c6ff9ecaa5ee0be8b535d36fdcd12380564a1
     and 1d3cc6e62c4d2fc3dd9251d4921881425c9d27bd)
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 3051e40..149a73f 100644
--- a/Config.mk
+++ b/Config.mk
@@ -251,7 +251,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
 QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
-OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
+OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.5.2
 SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 # Thu May 22 16:59:16 2014 -0400
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 02:55:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:55:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aISdQ-0006NH-BZ; Mon, 11 Jan 2016 02:55: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 1aISdP-0006NC-Ci
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:07 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	D9/59-31069-A8913965; Mon, 11 Jan 2016 02:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1452480905!15087284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18437 invoked from network); 11 Jan 2016 02:55:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:55:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISda-0002Ct-Cu
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISdM-0001W1-9X
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:04 +0000
Date: Mon, 11 Jan 2016 02:55:04 +0000
Message-Id: <E1aISdM-0001W1-9X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: don't leak ST(n)/XMMn values
	to domains first using 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 52a5c0bf5350f045810d159af0c06305dd9d517f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:30:57 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:30:57 2015 +0100

    x86: don't leak ST(n)/XMMn values to domains first using them
    
    FNINIT doesn't alter these registers, and hence using it is
    insufficient to initialize a guest's initial state.
    
    This is CVE-2015-8555 / XSA-165.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 81818b3f277544535974204f8d840da86fa8a44f
    master date: 2015-12-17 14:22:13 +0100
---
 xen/arch/x86/domain.c |   11 +++++++++++
 xen/arch/x86/i387.c   |   31 +++++++++----------------------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 062cff0..4efef9a 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -751,6 +751,17 @@ int arch_set_info_guest(
         if ( v->arch.xsave_area )
              v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
     }
+    else if ( v->arch.xsave_area )
+        memset(&v->arch.xsave_area->xsave_hdr, 0,
+               sizeof(v->arch.xsave_area->xsave_hdr));
+    else
+    {
+        typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+        memset(fpu_sse, 0, sizeof(*fpu_sse));
+        fpu_sse->fcw = FCW_DEFAULT;
+        fpu_sse->mxcsr = MXCSR_DEFAULT;
+    }
 
     if ( !compat )
     {
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index a372e0b..58fb7b7 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -17,19 +17,6 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-static void fpu_init(void)
-{
-    unsigned long val;
-    
-    asm volatile ( "fninit" );
-    if ( cpu_has_xmm )
-    {
-        /* load default value into MXCSR control/status register */
-        val = MXCSR_DEFAULT;
-        asm volatile ( "ldmxcsr %0" : : "m" (val) );
-    }
-}
-
 /*******************************/
 /*     FPU Restore Functions   */
 /*******************************/
@@ -248,15 +235,8 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
 
     if ( cpu_has_xsave )
         fpu_xrstor(v, XSTATE_LAZY);
-    else if ( v->fpu_initialised )
-    {
-        if ( cpu_has_fxsr )
-            fpu_fxrstor(v);
-        else
-            fpu_frstor(v);
-    }
     else
-        fpu_init();
+        fpu_fxrstor(v);
 
     v->fpu_initialised = 1;
     v->fpu_dirtied = 1;
@@ -317,7 +297,14 @@ int vcpu_init_fpu(struct vcpu *v)
     else
     {
         v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse), 16);
-        if ( !v->arch.fpu_ctxt )
+        if ( v->arch.fpu_ctxt )
+        {
+            typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+            fpu_sse->fcw = FCW_DEFAULT;
+            fpu_sse->mxcsr = MXCSR_DEFAULT;
+        }
+        else
         {
             rc = -ENOMEM;
             goto done;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 02:55:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:55:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aISdQ-0006NH-BZ; Mon, 11 Jan 2016 02:55: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 1aISdP-0006NC-Ci
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:07 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	D9/59-31069-A8913965; Mon, 11 Jan 2016 02:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1452480905!15087284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18437 invoked from network); 11 Jan 2016 02:55:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:55:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISda-0002Ct-Cu
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISdM-0001W1-9X
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:04 +0000
Date: Mon, 11 Jan 2016 02:55:04 +0000
Message-Id: <E1aISdM-0001W1-9X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: don't leak ST(n)/XMMn values
	to domains first using 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 52a5c0bf5350f045810d159af0c06305dd9d517f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:30:57 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:30:57 2015 +0100

    x86: don't leak ST(n)/XMMn values to domains first using them
    
    FNINIT doesn't alter these registers, and hence using it is
    insufficient to initialize a guest's initial state.
    
    This is CVE-2015-8555 / XSA-165.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 81818b3f277544535974204f8d840da86fa8a44f
    master date: 2015-12-17 14:22:13 +0100
---
 xen/arch/x86/domain.c |   11 +++++++++++
 xen/arch/x86/i387.c   |   31 +++++++++----------------------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 062cff0..4efef9a 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -751,6 +751,17 @@ int arch_set_info_guest(
         if ( v->arch.xsave_area )
              v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
     }
+    else if ( v->arch.xsave_area )
+        memset(&v->arch.xsave_area->xsave_hdr, 0,
+               sizeof(v->arch.xsave_area->xsave_hdr));
+    else
+    {
+        typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+        memset(fpu_sse, 0, sizeof(*fpu_sse));
+        fpu_sse->fcw = FCW_DEFAULT;
+        fpu_sse->mxcsr = MXCSR_DEFAULT;
+    }
 
     if ( !compat )
     {
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index a372e0b..58fb7b7 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -17,19 +17,6 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-static void fpu_init(void)
-{
-    unsigned long val;
-    
-    asm volatile ( "fninit" );
-    if ( cpu_has_xmm )
-    {
-        /* load default value into MXCSR control/status register */
-        val = MXCSR_DEFAULT;
-        asm volatile ( "ldmxcsr %0" : : "m" (val) );
-    }
-}
-
 /*******************************/
 /*     FPU Restore Functions   */
 /*******************************/
@@ -248,15 +235,8 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
 
     if ( cpu_has_xsave )
         fpu_xrstor(v, XSTATE_LAZY);
-    else if ( v->fpu_initialised )
-    {
-        if ( cpu_has_fxsr )
-            fpu_fxrstor(v);
-        else
-            fpu_frstor(v);
-    }
     else
-        fpu_init();
+        fpu_fxrstor(v);
 
     v->fpu_initialised = 1;
     v->fpu_dirtied = 1;
@@ -317,7 +297,14 @@ int vcpu_init_fpu(struct vcpu *v)
     else
     {
         v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse), 16);
-        if ( !v->arch.fpu_ctxt )
+        if ( v->arch.fpu_ctxt )
+        {
+            typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+            fpu_sse->fcw = FCW_DEFAULT;
+            fpu_sse->mxcsr = MXCSR_DEFAULT;
+        }
+        else
         {
             rc = -ENOMEM;
             goto done;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 02:55:19 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aISdb-0006OT-Hj; Mon, 11 Jan 2016 02:55: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 1aISdZ-0006OK-R8
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:17 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	01/E3-08347-59913965; Mon, 11 Jan 2016 02:55:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1452480915!15789602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8059 invoked from network); 11 Jan 2016 02:55:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:55:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISdk-0002D6-T5
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISdW-0001XN-VS
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:15 +0000
Date: Mon, 11 Jan 2016 02:55:14 +0000
Message-Id: <E1aISdW-0001XN-VS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/HVM: avoid reading ioreq state
	more than once
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4dacb5d7429913430895fe38cb58308ea4fa4a05
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:31:28 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:31:28 2015 +0100

    x86/HVM: avoid reading ioreq state more than once
    
    Otherwise, especially when the compiler chooses to translate the
    switch() to a jump table, unpredictable behavior (and in the jump table
    case arbitrary code execution) can result.
    
    This is XSA-166.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: b452430a4cdfc801fa4bc391aed7522365e1deb6
    master date: 2015-12-17 14:22:46 +0100
---
 xen/arch/x86/hvm/hvm.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 321f8bf..f3f6c61 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -348,6 +348,7 @@ void hvm_migrate_pirqs(struct vcpu *v)
 void hvm_do_resume(struct vcpu *v)
 {
     ioreq_t *p;
+    unsigned int state;
 
     check_wakeup_from_wait();
 
@@ -358,9 +359,10 @@ void hvm_do_resume(struct vcpu *v)
     if ( !(p = get_ioreq(v)) )
         goto check_inject_trap;
 
-    while ( p->state != STATE_IOREQ_NONE )
+    while ( (state = p->state) != STATE_IOREQ_NONE )
     {
-        switch ( p->state )
+        rmb();
+        switch ( state )
         {
         case STATE_IORESP_READY: /* IORESP_READY -> NONE */
             hvm_io_assist(p);
@@ -368,11 +370,10 @@ void hvm_do_resume(struct vcpu *v)
         case STATE_IOREQ_READY:  /* IOREQ_{READY,INPROCESS} -> IORESP_READY */
         case STATE_IOREQ_INPROCESS:
             wait_on_xen_event_channel(v->arch.hvm_vcpu.xen_port,
-                                      (p->state != STATE_IOREQ_READY) &&
-                                      (p->state != STATE_IOREQ_INPROCESS));
+                                      p->state != state);
             break;
         default:
-            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %d.\n", p->state);
+            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %u\n", state);
             domain_crash(v->domain);
             return; /* bail */
         }
--
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 Mon Jan 11 02:55:19 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aISdb-0006OT-Hj; Mon, 11 Jan 2016 02:55: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 1aISdZ-0006OK-R8
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:17 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	01/E3-08347-59913965; Mon, 11 Jan 2016 02:55:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1452480915!15789602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8059 invoked from network); 11 Jan 2016 02:55:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:55:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISdk-0002D6-T5
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISdW-0001XN-VS
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:15 +0000
Date: Mon, 11 Jan 2016 02:55:14 +0000
Message-Id: <E1aISdW-0001XN-VS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/HVM: avoid reading ioreq state
	more than once
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4dacb5d7429913430895fe38cb58308ea4fa4a05
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:31:28 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:31:28 2015 +0100

    x86/HVM: avoid reading ioreq state more than once
    
    Otherwise, especially when the compiler chooses to translate the
    switch() to a jump table, unpredictable behavior (and in the jump table
    case arbitrary code execution) can result.
    
    This is XSA-166.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: b452430a4cdfc801fa4bc391aed7522365e1deb6
    master date: 2015-12-17 14:22:46 +0100
---
 xen/arch/x86/hvm/hvm.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 321f8bf..f3f6c61 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -348,6 +348,7 @@ void hvm_migrate_pirqs(struct vcpu *v)
 void hvm_do_resume(struct vcpu *v)
 {
     ioreq_t *p;
+    unsigned int state;
 
     check_wakeup_from_wait();
 
@@ -358,9 +359,10 @@ void hvm_do_resume(struct vcpu *v)
     if ( !(p = get_ioreq(v)) )
         goto check_inject_trap;
 
-    while ( p->state != STATE_IOREQ_NONE )
+    while ( (state = p->state) != STATE_IOREQ_NONE )
     {
-        switch ( p->state )
+        rmb();
+        switch ( state )
         {
         case STATE_IORESP_READY: /* IORESP_READY -> NONE */
             hvm_io_assist(p);
@@ -368,11 +370,10 @@ void hvm_do_resume(struct vcpu *v)
         case STATE_IOREQ_READY:  /* IOREQ_{READY,INPROCESS} -> IORESP_READY */
         case STATE_IOREQ_INPROCESS:
             wait_on_xen_event_channel(v->arch.hvm_vcpu.xen_port,
-                                      (p->state != STATE_IOREQ_READY) &&
-                                      (p->state != STATE_IOREQ_INPROCESS));
+                                      p->state != state);
             break;
         default:
-            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %d.\n", p->state);
+            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %u\n", state);
             domain_crash(v->domain);
             return; /* bail */
         }
--
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 Mon Jan 11 02:55:29 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aISdl-0006Pg-Mu; Mon, 11 Jan 2016 02:55: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 1aISdj-0006PT-Mz
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:27 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	EB/28-08977-F9913965; Mon, 11 Jan 2016 02:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1452480925!9330554!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29897 invoked from network); 11 Jan 2016 02:55:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:55:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISdv-0002DE-6o
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISdh-0001Xs-Gk
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:25 +0000
Date: Mon, 11 Jan 2016 02:55:25 +0000
Message-Id: <E1aISdh-0001Xs-Gk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd4db045339863c901e887fe35fe958ce766351e
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Dec 18 14:58:40 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 18 14:58:40 2015 +0000

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

diff --git a/Config.mk b/Config.mk
index c2aff43..2376348 100644
--- a/Config.mk
+++ b/Config.mk
@@ -246,9 +246,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 6425f5d8c25a4d6486435278bcccefd8810becf0
-# Wed Dec 9 11:47:35 2015 +0000
-# net: pcnet: add check to validate receive data size(CVE-2015-7504)
+QEMU_TAG ?= c51f20baba0bc01e7e3a3a16e72be9a0ed6cb734
+# Fri Nov 20 10:56:00 2015 -0500
+# blkif: Avoid double access to src->nr_segments
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 02:55:29 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aISdl-0006Pg-Mu; Mon, 11 Jan 2016 02:55: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 1aISdj-0006PT-Mz
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:27 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	EB/28-08977-F9913965; Mon, 11 Jan 2016 02:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1452480925!9330554!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29897 invoked from network); 11 Jan 2016 02:55:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:55:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISdv-0002DE-6o
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISdh-0001Xs-Gk
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:25 +0000
Date: Mon, 11 Jan 2016 02:55:25 +0000
Message-Id: <E1aISdh-0001Xs-Gk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd4db045339863c901e887fe35fe958ce766351e
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Dec 18 14:58:40 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 18 14:58:40 2015 +0000

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

diff --git a/Config.mk b/Config.mk
index c2aff43..2376348 100644
--- a/Config.mk
+++ b/Config.mk
@@ -246,9 +246,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 6425f5d8c25a4d6486435278bcccefd8810becf0
-# Wed Dec 9 11:47:35 2015 +0000
-# net: pcnet: add check to validate receive data size(CVE-2015-7504)
+QEMU_TAG ?= c51f20baba0bc01e7e3a3a16e72be9a0ed6cb734
+# Fri Nov 20 10:56:00 2015 -0500
+# blkif: Avoid double access to src->nr_segments
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 02:55:40 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:55:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aISdw-0006R4-R2; Mon, 11 Jan 2016 02:55: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 1aISdv-0006Qr-9M
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:39 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	98/E6-10115-AA913965; Mon, 11 Jan 2016 02:55:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1452480936!15852325!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47359 invoked from network); 11 Jan 2016 02:55:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:55:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISe5-0002DK-HQ
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISdr-0001YS-RD
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:35 +0000
Date: Mon, 11 Jan 2016 02:55:35 +0000
Message-Id: <E1aISdr-0001YS-RD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] libxl: Rerun bison and flex
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4df657ba8e4472421639ac5bf7cc0d16856fe1e0
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 14:45:12 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 14:45:12 2016 +0000

    libxl: Rerun bison and flex
    
    We are going to want to cherry pick a change to the bison input, which
    will involve rerunning bison.
    
    So firstly, update the bison and flex output to that from current
    Debian wheezy (i386; 1:2.5.dfsg-2.1 and 2.5.35-10.1 respectively).
    
    There should be no functional change since there is no change to the
    source file, but we will inherit bugfixes and behavioural changes from
    the new version of bison.  So this is more a matter of hope than
    knowledge.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxlu_cfg_y.c |  538 ++++++++++++++++++++++++--------------------
 tools/libxl/libxlu_cfg_y.h |   14 +-
 2 files changed, 304 insertions(+), 248 deletions(-)

diff --git a/tools/libxl/libxlu_cfg_y.c b/tools/libxl/libxlu_cfg_y.c
index 218933e..4437e05 100644
--- a/tools/libxl/libxlu_cfg_y.c
+++ b/tools/libxl/libxlu_cfg_y.c
@@ -1,10 +1,8 @@
+/* A Bison parser, made by GNU Bison 2.5.  */
 
-/* A Bison parser, made by GNU Bison 2.4.1.  */
-
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* Bison implementation for Yacc-like parsers in C
    
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
+      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -46,7 +44,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "2.5"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -75,7 +73,7 @@
 
 /* Copy the first part of user declarations.  */
 
-/* Line 189 of yacc.c  */
+/* Line 268 of yacc.c  */
 #line 19 "libxlu_cfg_y.y"
 
 #define YYLEX_PARAM ctx->scanner
@@ -83,8 +81,8 @@
 #include "libxlu_cfg_l.h"
 
 
-/* Line 189 of yacc.c  */
-#line 88 "libxlu_cfg_y.c"
+/* Line 268 of yacc.c  */
+#line 86 "libxlu_cfg_y.c"
 
 /* Enabling traces.  */
 #ifndef YYDEBUG
@@ -124,7 +122,7 @@
 typedef union YYSTYPE
 {
 
-/* Line 214 of yacc.c  */
+/* Line 293 of yacc.c  */
 #line 25 "libxlu_cfg_y.y"
 
   char *string;
@@ -132,8 +130,8 @@ typedef union YYSTYPE
 
 
 
-/* Line 214 of yacc.c  */
-#line 137 "libxlu_cfg_y.c"
+/* Line 293 of yacc.c  */
+#line 135 "libxlu_cfg_y.c"
 } YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -157,8 +155,8 @@ typedef struct YYLTYPE
 /* Copy the second part of user declarations.  */
 
 
-/* Line 264 of yacc.c  */
-#line 162 "libxlu_cfg_y.c"
+/* Line 343 of yacc.c  */
+#line 160 "libxlu_cfg_y.c"
 
 #ifdef short
 # undef short
@@ -208,7 +206,7 @@ typedef short int yytype_int16;
 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
 #ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -261,11 +259,11 @@ YYID (yyi)
 #    define alloca _alloca
 #   else
 #    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     ifndef _STDLIB_H
-#      define _STDLIB_H 1
+#     ifndef EXIT_SUCCESS
+#      define EXIT_SUCCESS 0
 #     endif
 #    endif
 #   endif
@@ -288,24 +286,24 @@ YYID (yyi)
 #  ifndef YYSTACK_ALLOC_MAXIMUM
 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 #  endif
-#  if (defined __cplusplus && ! defined _STDLIB_H \
+#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
        && ! ((defined YYMALLOC || defined malloc) \
 	     && (defined YYFREE || defined free)))
 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef _STDLIB_H
-#    define _STDLIB_H 1
+#   ifndef EXIT_SUCCESS
+#    define EXIT_SUCCESS 0
 #   endif
 #  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 #  ifndef YYFREE
 #   define YYFREE free
-#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
@@ -336,23 +334,7 @@ union yyalloc
      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
       + 2 * YYSTACK_GAP_MAXIMUM)
 
-/* Copy COUNT objects from FROM to TO.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-#  else
-#   define YYCOPY(To, From, Count)		\
-      do					\
-	{					\
-	  YYSIZE_T yyi;				\
-	  for (yyi = 0; yyi < (Count); yyi++)	\
-	    (To)[yyi] = (From)[yyi];		\
-	}					\
-      while (YYID (0))
-#  endif
-# endif
+# define YYCOPY_NEEDED 1
 
 /* Relocate STACK from its old location to the new one.  The
    local variables YYSIZE and YYSTACKSIZE give the old and new number of
@@ -372,6 +354,26 @@ union yyalloc
 
 #endif
 
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if defined __GNUC__ && 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  YYSIZE_T yyi;				\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (YYID (0))
+#  endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  3
 /* YYLAST -- Last index in YYTABLE.  */
@@ -492,8 +494,8 @@ static const yytype_uint8 yyr2[] =
        5,     0,     2
 };
 
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
-   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+   Performed when YYTABLE doesn't specify something else to do.  Zero
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
@@ -528,8 +530,7 @@ static const yytype_int8 yypgoto[] =
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If zero, do what YYDEFACT says.
-   If YYTABLE_NINF, syntax error.  */
+   number is the opposite.  If YYTABLE_NINF, syntax error.  */
 #define YYTABLE_NINF -3
 static const yytype_int8 yytable[] =
 {
@@ -538,6 +539,12 @@ static const yytype_int8 yytable[] =
       16,    26,    25,    20,    13
 };
 
+#define yypact_value_is_default(yystate) \
+  ((yystate) == (-18))
+
+#define yytable_value_is_error(yytable_value) \
+  YYID (0)
+
 static const yytype_uint8 yycheck[] =
 {
        0,     1,    19,     3,     0,     6,     6,    21,     8,     6,
@@ -566,9 +573,18 @@ static const yytype_uint8 yystos[] =
 
 /* Like YYERROR except do call yyerror.  This remains here temporarily
    to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
+   Once GCC version 2 has supplanted version 1, this can go.  However,
+   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
+   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+   discussed.  */
 
 #define YYFAIL		goto yyerrlab
+#if defined YYFAIL
+  /* This is here to suppress warnings from the GCC cpp's
+     -Wunused-macros.  Normally we don't worry about that warning, but
+     some users do, and we want to make it easy for users to remove
+     YYFAIL uses, which will produce warnings from Bison 2.5.  */
+#endif
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
@@ -578,7 +594,6 @@ do								\
     {								\
       yychar = (Token);						\
       yylval = (Value);						\
-      yytoken = YYTRANSLATE (yychar);				\
       YYPOPSTACK (1);						\
       goto yybackup;						\
     }								\
@@ -625,7 +640,7 @@ while (YYID (0))
    we won't break user code: when these are the locations we know.  */
 
 #ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
 #  define YY_LOCATION_PRINT(File, Loc)			\
      fprintf (File, "%d.%d-%d.%d",			\
 	      (Loc).first_line, (Loc).first_column,	\
@@ -834,7 +849,6 @@ int yydebug;
 # define YYMAXDEPTH 10000
 #endif
 
-
 
 #if YYERROR_VERBOSE
 
@@ -937,115 +951,142 @@ yytnamerr (char *yyres, const char *yystr)
 }
 # endif
 
-/* Copy into YYRESULT an error message about the unexpected token
-   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
-   including the terminating null byte.  If YYRESULT is null, do not
-   copy anything; just return the number of bytes that would be
-   copied.  As a special case, return 0 if an ordinary "syntax error"
-   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
-   size calculation.  */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
-  int yyn = yypact[yystate];
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+   about the unexpected token YYTOKEN for the state stack whose top is
+   YYSSP.
 
-  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
-    return 0;
-  else
+   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
+   not large enough to hold the message.  In that case, also set
+   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
+   required number of bytes is too large to store.  */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+                yytype_int16 *yyssp, int yytoken)
+{
+  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
+  YYSIZE_T yysize = yysize0;
+  YYSIZE_T yysize1;
+  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+  /* Internationalized format string. */
+  const char *yyformat = 0;
+  /* Arguments of yyformat. */
+  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+  /* Number of reported tokens (one for the "unexpected", one per
+     "expected"). */
+  int yycount = 0;
+
+  /* There are many possibilities here to consider:
+     - Assume YYFAIL is not used.  It's too flawed to consider.  See
+       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
+       for details.  YYERROR is fine as it does not invoke this
+       function.
+     - If this state is a consistent state with a default action, then
+       the only way this function was invoked is if the default action
+       is an error action.  In that case, don't check for expected
+       tokens because there are none.
+     - The only way there can be no lookahead present (in yychar) is if
+       this state is a consistent state with a default action.  Thus,
+       detecting the absence of a lookahead is sufficient to determine
+       that there is no unexpected or expected token to report.  In that
+       case, just report a simple "syntax error".
+     - Don't assume there isn't a lookahead just because this state is a
+       consistent state with a default action.  There might have been a
+       previous inconsistent state, consistent state with a non-default
+       action, or user semantic action that manipulated yychar.
+     - Of course, the expected token list depends on states to have
+       correct lookahead information, and it depends on the parser not
+       to perform extra reductions after fetching a lookahead from the
+       scanner and before detecting a syntax error.  Thus, state merging
+       (from LALR or IELR) and default reductions corrupt the expected
+       token list.  However, the list is correct for canonical LR with
+       one exception: it will still contain any token that will not be
+       accepted due to an error action in a later state.
+  */
+  if (yytoken != YYEMPTY)
     {
-      int yytype = YYTRANSLATE (yychar);
-      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
-      YYSIZE_T yysize = yysize0;
-      YYSIZE_T yysize1;
-      int yysize_overflow = 0;
-      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-      int yyx;
-
-# if 0
-      /* This is so xgettext sees the translatable formats that are
-	 constructed on the fly.  */
-      YY_("syntax error, unexpected %s");
-      YY_("syntax error, unexpected %s, expecting %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
-      char *yyfmt;
-      char const *yyf;
-      static char const yyunexpected[] = "syntax error, unexpected %s";
-      static char const yyexpecting[] = ", expecting %s";
-      static char const yyor[] = " or %s";
-      char yyformat[sizeof yyunexpected
-		    + sizeof yyexpecting - 1
-		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
-		       * (sizeof yyor - 1))];
-      char const *yyprefix = yyexpecting;
-
-      /* Start YYX at -YYN if negative to avoid negative indexes in
-	 YYCHECK.  */
-      int yyxbegin = yyn < 0 ? -yyn : 0;
-
-      /* Stay within bounds of both yycheck and yytname.  */
-      int yychecklim = YYLAST - yyn + 1;
-      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-      int yycount = 1;
-
-      yyarg[0] = yytname[yytype];
-      yyfmt = yystpcpy (yyformat, yyunexpected);
-
-      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-	  {
-	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-	      {
-		yycount = 1;
-		yysize = yysize0;
-		yyformat[sizeof yyunexpected - 1] = '\0';
-		break;
-	      }
-	    yyarg[yycount++] = yytname[yyx];
-	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-	    yysize_overflow |= (yysize1 < yysize);
-	    yysize = yysize1;
-	    yyfmt = yystpcpy (yyfmt, yyprefix);
-	    yyprefix = yyor;
-	  }
+      int yyn = yypact[*yyssp];
+      yyarg[yycount++] = yytname[yytoken];
+      if (!yypact_value_is_default (yyn))
+        {
+          /* Start YYX at -YYN if negative to avoid negative indexes in
+             YYCHECK.  In other words, skip the first -YYN actions for
+             this state because they are default actions.  */
+          int yyxbegin = yyn < 0 ? -yyn : 0;
+          /* Stay within bounds of both yycheck and yytname.  */
+          int yychecklim = YYLAST - yyn + 1;
+          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+          int yyx;
+
+          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+                && !yytable_value_is_error (yytable[yyx + yyn]))
+              {
+                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+                  {
+                    yycount = 1;
+                    yysize = yysize0;
+                    break;
+                  }
+                yyarg[yycount++] = yytname[yyx];
+                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+                if (! (yysize <= yysize1
+                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                  return 2;
+                yysize = yysize1;
+              }
+        }
+    }
 
-      yyf = YY_(yyformat);
-      yysize1 = yysize + yystrlen (yyf);
-      yysize_overflow |= (yysize1 < yysize);
-      yysize = yysize1;
+  switch (yycount)
+    {
+# define YYCASE_(N, S)                      \
+      case N:                               \
+        yyformat = S;                       \
+      break
+      YYCASE_(0, YY_("syntax error"));
+      YYCASE_(1, YY_("syntax error, unexpected %s"));
+      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+    }
 
-      if (yysize_overflow)
-	return YYSIZE_MAXIMUM;
+  yysize1 = yysize + yystrlen (yyformat);
+  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+    return 2;
+  yysize = yysize1;
 
-      if (yyresult)
-	{
-	  /* Avoid sprintf, as that infringes on the user's name space.
-	     Don't have undefined behavior even if the translation
-	     produced a string with the wrong number of "%s"s.  */
-	  char *yyp = yyresult;
-	  int yyi = 0;
-	  while ((*yyp = *yyf) != '\0')
-	    {
-	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
-		{
-		  yyp += yytnamerr (yyp, yyarg[yyi++]);
-		  yyf += 2;
-		}
-	      else
-		{
-		  yyp++;
-		  yyf++;
-		}
-	    }
-	}
-      return yysize;
+  if (*yymsg_alloc < yysize)
+    {
+      *yymsg_alloc = 2 * yysize;
+      if (! (yysize <= *yymsg_alloc
+             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+      return 1;
     }
+
+  /* Avoid sprintf, as that infringes on the user's name space.
+     Don't have undefined behavior even if the translation
+     produced a string with the wrong number of "%s"s.  */
+  {
+    char *yyp = *yymsg;
+    int yyi = 0;
+    while ((*yyp = *yyformat) != '\0')
+      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+        {
+          yyp += yytnamerr (yyp, yyarg[yyi++]);
+          yyformat += 2;
+        }
+      else
+        {
+          yyp++;
+          yyformat++;
+        }
+  }
+  return 0;
 }
 #endif /* YYERROR_VERBOSE */
-
 
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
@@ -1078,66 +1119,66 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, ctx)
     {
       case 3: /* "IDENT" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 40 "libxlu_cfg_y.y"
 	{ free((yyvaluep->string)); };
 
-/* Line 1000 of yacc.c  */
-#line 1087 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1128 "libxlu_cfg_y.c"
 	break;
       case 4: /* "STRING" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 40 "libxlu_cfg_y.y"
 	{ free((yyvaluep->string)); };
 
-/* Line 1000 of yacc.c  */
-#line 1096 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1137 "libxlu_cfg_y.c"
 	break;
       case 5: /* "NUMBER" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 40 "libxlu_cfg_y.y"
 	{ free((yyvaluep->string)); };
 
-/* Line 1000 of yacc.c  */
-#line 1105 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1146 "libxlu_cfg_y.c"
 	break;
       case 18: /* "value" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
-/* Line 1000 of yacc.c  */
-#line 1114 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1155 "libxlu_cfg_y.c"
 	break;
       case 19: /* "atom" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 40 "libxlu_cfg_y.y"
 	{ free((yyvaluep->string)); };
 
-/* Line 1000 of yacc.c  */
-#line 1123 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1164 "libxlu_cfg_y.c"
 	break;
       case 20: /* "valuelist" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
-/* Line 1000 of yacc.c  */
-#line 1132 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1173 "libxlu_cfg_y.c"
 	break;
       case 21: /* "values" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
-/* Line 1000 of yacc.c  */
-#line 1141 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1182 "libxlu_cfg_y.c"
 	break;
 
       default:
@@ -1145,6 +1186,7 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, ctx)
     }
 }
 
+
 /* Prevent warnings from -Wmissing-prototypes.  */
 #ifdef YYPARSE_PARAM
 #if defined __STDC__ || defined __cplusplus
@@ -1161,12 +1203,9 @@ int yyparse ();
 #endif /* ! YYPARSE_PARAM */
 
 
-
-
-
-/*-------------------------.
-| yyparse or yypush_parse.  |
-`-------------------------*/
+/*----------.
+| yyparse.  |
+`----------*/
 
 #ifdef YYPARSE_PARAM
 #if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1230,7 +1269,7 @@ YYLTYPE yylloc;
     YYLTYPE *yylsp;
 
     /* The locations where the error started and ended.  */
-    YYLTYPE yyerror_range[2];
+    YYLTYPE yyerror_range[3];
 
     YYSIZE_T yystacksize;
 
@@ -1277,7 +1316,7 @@ YYLTYPE yylloc;
   yyvsp = yyvs;
   yylsp = yyls;
 
-#if YYLTYPE_IS_TRIVIAL
+#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
   /* Initialize the default location before parsing starts.  */
   yylloc.first_line   = yylloc.last_line   = 1;
   yylloc.first_column = yylloc.last_column = 1;
@@ -1379,7 +1418,7 @@ yybackup:
 
   /* First try to decide what to do without reference to lookahead token.  */
   yyn = yypact[yystate];
-  if (yyn == YYPACT_NINF)
+  if (yypact_value_is_default (yyn))
     goto yydefault;
 
   /* Not known => get a lookahead token if don't already have one.  */
@@ -1410,8 +1449,8 @@ yybackup:
   yyn = yytable[yyn];
   if (yyn <= 0)
     {
-      if (yyn == 0 || yyn == YYTABLE_NINF)
-	goto yyerrlab;
+      if (yytable_value_is_error (yyn))
+        goto yyerrlab;
       yyn = -yyn;
       goto yyreduce;
     }
@@ -1467,80 +1506,91 @@ yyreduce:
     {
         case 9:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 57 "libxlu_cfg_y.y"
-    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].setting),(yylsp[(3) - (3)]).first_line); ;}
+    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].setting),(yylsp[(3) - (3)]).first_line); }
     break;
 
   case 12:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 62 "libxlu_cfg_y.y"
-    { (yyval.setting)= xlu__cfg_set_mk(ctx,1,(yyvsp[(1) - (1)].string)); ;}
+    { (yyval.setting)= xlu__cfg_set_mk(ctx,1,(yyvsp[(1) - (1)].string)); }
     break;
 
   case 13:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 63 "libxlu_cfg_y.y"
-    { (yyval.setting)= (yyvsp[(3) - (4)].setting); ;}
+    { (yyval.setting)= (yyvsp[(3) - (4)].setting); }
     break;
 
   case 14:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 65 "libxlu_cfg_y.y"
-    { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
+    { (yyval.string)= (yyvsp[(1) - (1)].string); }
     break;
 
   case 15:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 66 "libxlu_cfg_y.y"
-    { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
+    { (yyval.string)= (yyvsp[(1) - (1)].string); }
     break;
 
   case 16:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 68 "libxlu_cfg_y.y"
-    { (yyval.setting)= xlu__cfg_set_mk(ctx,0,0); ;}
+    { (yyval.setting)= xlu__cfg_set_mk(ctx,0,0); }
     break;
 
   case 17:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 69 "libxlu_cfg_y.y"
-    { (yyval.setting)= (yyvsp[(1) - (1)].setting); ;}
+    { (yyval.setting)= (yyvsp[(1) - (1)].setting); }
     break;
 
   case 18:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 70 "libxlu_cfg_y.y"
-    { (yyval.setting)= (yyvsp[(1) - (3)].setting); ;}
+    { (yyval.setting)= (yyvsp[(1) - (3)].setting); }
     break;
 
   case 19:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 72 "libxlu_cfg_y.y"
-    { (yyval.setting)= xlu__cfg_set_mk(ctx,2,(yyvsp[(1) - (2)].string)); ;}
+    { (yyval.setting)= xlu__cfg_set_mk(ctx,2,(yyvsp[(1) - (2)].string)); }
     break;
 
   case 20:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 73 "libxlu_cfg_y.y"
-    { xlu__cfg_set_add(ctx,(yyvsp[(1) - (5)].setting),(yyvsp[(4) - (5)].string)); (yyval.setting)= (yyvsp[(1) - (5)].setting); ;}
+    { xlu__cfg_set_add(ctx,(yyvsp[(1) - (5)].setting),(yyvsp[(4) - (5)].string)); (yyval.setting)= (yyvsp[(1) - (5)].setting); }
     break;
 
 
 
-/* Line 1455 of yacc.c  */
-#line 1542 "libxlu_cfg_y.c"
+/* Line 1806 of yacc.c  */
+#line 1581 "libxlu_cfg_y.c"
       default: break;
     }
+  /* User semantic actions sometimes alter yychar, and that requires
+     that yytoken be updated with the new translation.  We take the
+     approach of translating immediately before every use of yytoken.
+     One alternative is translating here after every semantic action,
+     but that translation would be missed if the semantic action invokes
+     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
+     incorrect destructor might then be invoked immediately.  In the
+     case of YYERROR or YYBACKUP, subsequent parser actions might lead
+     to an incorrect destructor call or verbose syntax error message
+     before the lookahead is translated.  */
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
   YYPOPSTACK (yylen);
@@ -1569,6 +1619,10 @@ yyreduce:
 | yyerrlab -- here on detecting error |
 `------------------------------------*/
 yyerrlab:
+  /* Make sure we have latest lookahead translation.  See comments at
+     user semantic actions for why this is necessary.  */
+  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
   /* If not already recovering from an error, report this error.  */
   if (!yyerrstatus)
     {
@@ -1576,41 +1630,40 @@ yyerrlab:
 #if ! YYERROR_VERBOSE
       yyerror (&yylloc, ctx, YY_("syntax error"));
 #else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+                                        yyssp, yytoken)
       {
-	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
-	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
-	  {
-	    YYSIZE_T yyalloc = 2 * yysize;
-	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
-	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
-	    if (yymsg != yymsgbuf)
-	      YYSTACK_FREE (yymsg);
-	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
-	    if (yymsg)
-	      yymsg_alloc = yyalloc;
-	    else
-	      {
-		yymsg = yymsgbuf;
-		yymsg_alloc = sizeof yymsgbuf;
-	      }
-	  }
-
-	if (0 < yysize && yysize <= yymsg_alloc)
-	  {
-	    (void) yysyntax_error (yymsg, yystate, yychar);
-	    yyerror (&yylloc, ctx, yymsg);
-	  }
-	else
-	  {
-	    yyerror (&yylloc, ctx, YY_("syntax error"));
-	    if (yysize != 0)
-	      goto yyexhaustedlab;
-	  }
+        char const *yymsgp = YY_("syntax error");
+        int yysyntax_error_status;
+        yysyntax_error_status = YYSYNTAX_ERROR;
+        if (yysyntax_error_status == 0)
+          yymsgp = yymsg;
+        else if (yysyntax_error_status == 1)
+          {
+            if (yymsg != yymsgbuf)
+              YYSTACK_FREE (yymsg);
+            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+            if (!yymsg)
+              {
+                yymsg = yymsgbuf;
+                yymsg_alloc = sizeof yymsgbuf;
+                yysyntax_error_status = 2;
+              }
+            else
+              {
+                yysyntax_error_status = YYSYNTAX_ERROR;
+                yymsgp = yymsg;
+              }
+          }
+        yyerror (&yylloc, ctx, yymsgp);
+        if (yysyntax_error_status == 2)
+          goto yyexhaustedlab;
       }
+# undef YYSYNTAX_ERROR
 #endif
     }
 
-  yyerror_range[0] = yylloc;
+  yyerror_range[1] = yylloc;
 
   if (yyerrstatus == 3)
     {
@@ -1647,7 +1700,7 @@ yyerrorlab:
   if (/*CONSTCOND*/ 0)
      goto yyerrorlab;
 
-  yyerror_range[0] = yylsp[1-yylen];
+  yyerror_range[1] = yylsp[1-yylen];
   /* Do not reclaim the symbols of the rule which action triggered
      this YYERROR.  */
   YYPOPSTACK (yylen);
@@ -1666,7 +1719,7 @@ yyerrlab1:
   for (;;)
     {
       yyn = yypact[yystate];
-      if (yyn != YYPACT_NINF)
+      if (!yypact_value_is_default (yyn))
 	{
 	  yyn += YYTERROR;
 	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -1681,7 +1734,7 @@ yyerrlab1:
       if (yyssp == yyss)
 	YYABORT;
 
-      yyerror_range[0] = *yylsp;
+      yyerror_range[1] = *yylsp;
       yydestruct ("Error: popping",
 		  yystos[yystate], yyvsp, yylsp, ctx);
       YYPOPSTACK (1);
@@ -1691,10 +1744,10 @@ yyerrlab1:
 
   *++yyvsp = yylval;
 
-  yyerror_range[1] = yylloc;
+  yyerror_range[2] = yylloc;
   /* Using YYLLOC is tempting, but would change the location of
      the lookahead.  YYLOC is available though.  */
-  YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
+  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
   *++yylsp = yyloc;
 
   /* Shift the error token.  */
@@ -1730,8 +1783,13 @@ yyexhaustedlab:
 
 yyreturn:
   if (yychar != YYEMPTY)
-     yydestruct ("Cleanup: discarding lookahead",
-		 yytoken, &yylval, &yylloc, ctx);
+    {
+      /* Make sure we have latest lookahead translation.  See comments at
+         user semantic actions for why this is necessary.  */
+      yytoken = YYTRANSLATE (yychar);
+      yydestruct ("Cleanup: discarding lookahead",
+                  yytoken, &yylval, &yylloc, ctx);
+    }
   /* Do not reclaim the symbols of the rule which action triggered
      this YYABORT or YYACCEPT.  */
   YYPOPSTACK (yylen);
diff --git a/tools/libxl/libxlu_cfg_y.h b/tools/libxl/libxlu_cfg_y.h
index e7b3d12..d7dfaf2 100644
--- a/tools/libxl/libxlu_cfg_y.h
+++ b/tools/libxl/libxlu_cfg_y.h
@@ -1,10 +1,8 @@
+/* A Bison parser, made by GNU Bison 2.5.  */
 
-/* A Bison parser, made by GNU Bison 2.4.1.  */
-
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* Bison interface for Yacc-like parsers in C
    
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
+      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -52,7 +50,7 @@
 typedef union YYSTYPE
 {
 
-/* Line 1676 of yacc.c  */
+/* Line 2068 of yacc.c  */
 #line 25 "libxlu_cfg_y.y"
 
   char *string;
@@ -60,8 +58,8 @@ typedef union YYSTYPE
 
 
 
-/* Line 1676 of yacc.c  */
-#line 65 "libxlu_cfg_y.h"
+/* Line 2068 of yacc.c  */
+#line 63 "libxlu_cfg_y.h"
 } YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
--
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 Mon Jan 11 02:55:40 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:55:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aISdw-0006R4-R2; Mon, 11 Jan 2016 02:55: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 1aISdv-0006Qr-9M
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:39 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	98/E6-10115-AA913965; Mon, 11 Jan 2016 02:55:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1452480936!15852325!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47359 invoked from network); 11 Jan 2016 02:55:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:55:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISe5-0002DK-HQ
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISdr-0001YS-RD
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:35 +0000
Date: Mon, 11 Jan 2016 02:55:35 +0000
Message-Id: <E1aISdr-0001YS-RD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] libxl: Rerun bison and flex
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4df657ba8e4472421639ac5bf7cc0d16856fe1e0
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 14:45:12 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 14:45:12 2016 +0000

    libxl: Rerun bison and flex
    
    We are going to want to cherry pick a change to the bison input, which
    will involve rerunning bison.
    
    So firstly, update the bison and flex output to that from current
    Debian wheezy (i386; 1:2.5.dfsg-2.1 and 2.5.35-10.1 respectively).
    
    There should be no functional change since there is no change to the
    source file, but we will inherit bugfixes and behavioural changes from
    the new version of bison.  So this is more a matter of hope than
    knowledge.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxlu_cfg_y.c |  538 ++++++++++++++++++++++++--------------------
 tools/libxl/libxlu_cfg_y.h |   14 +-
 2 files changed, 304 insertions(+), 248 deletions(-)

diff --git a/tools/libxl/libxlu_cfg_y.c b/tools/libxl/libxlu_cfg_y.c
index 218933e..4437e05 100644
--- a/tools/libxl/libxlu_cfg_y.c
+++ b/tools/libxl/libxlu_cfg_y.c
@@ -1,10 +1,8 @@
+/* A Bison parser, made by GNU Bison 2.5.  */
 
-/* A Bison parser, made by GNU Bison 2.4.1.  */
-
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* Bison implementation for Yacc-like parsers in C
    
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
+      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -46,7 +44,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "2.5"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -75,7 +73,7 @@
 
 /* Copy the first part of user declarations.  */
 
-/* Line 189 of yacc.c  */
+/* Line 268 of yacc.c  */
 #line 19 "libxlu_cfg_y.y"
 
 #define YYLEX_PARAM ctx->scanner
@@ -83,8 +81,8 @@
 #include "libxlu_cfg_l.h"
 
 
-/* Line 189 of yacc.c  */
-#line 88 "libxlu_cfg_y.c"
+/* Line 268 of yacc.c  */
+#line 86 "libxlu_cfg_y.c"
 
 /* Enabling traces.  */
 #ifndef YYDEBUG
@@ -124,7 +122,7 @@
 typedef union YYSTYPE
 {
 
-/* Line 214 of yacc.c  */
+/* Line 293 of yacc.c  */
 #line 25 "libxlu_cfg_y.y"
 
   char *string;
@@ -132,8 +130,8 @@ typedef union YYSTYPE
 
 
 
-/* Line 214 of yacc.c  */
-#line 137 "libxlu_cfg_y.c"
+/* Line 293 of yacc.c  */
+#line 135 "libxlu_cfg_y.c"
 } YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -157,8 +155,8 @@ typedef struct YYLTYPE
 /* Copy the second part of user declarations.  */
 
 
-/* Line 264 of yacc.c  */
-#line 162 "libxlu_cfg_y.c"
+/* Line 343 of yacc.c  */
+#line 160 "libxlu_cfg_y.c"
 
 #ifdef short
 # undef short
@@ -208,7 +206,7 @@ typedef short int yytype_int16;
 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
 #ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -261,11 +259,11 @@ YYID (yyi)
 #    define alloca _alloca
 #   else
 #    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     ifndef _STDLIB_H
-#      define _STDLIB_H 1
+#     ifndef EXIT_SUCCESS
+#      define EXIT_SUCCESS 0
 #     endif
 #    endif
 #   endif
@@ -288,24 +286,24 @@ YYID (yyi)
 #  ifndef YYSTACK_ALLOC_MAXIMUM
 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 #  endif
-#  if (defined __cplusplus && ! defined _STDLIB_H \
+#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
        && ! ((defined YYMALLOC || defined malloc) \
 	     && (defined YYFREE || defined free)))
 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef _STDLIB_H
-#    define _STDLIB_H 1
+#   ifndef EXIT_SUCCESS
+#    define EXIT_SUCCESS 0
 #   endif
 #  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 #  ifndef YYFREE
 #   define YYFREE free
-#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
@@ -336,23 +334,7 @@ union yyalloc
      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
       + 2 * YYSTACK_GAP_MAXIMUM)
 
-/* Copy COUNT objects from FROM to TO.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-#  else
-#   define YYCOPY(To, From, Count)		\
-      do					\
-	{					\
-	  YYSIZE_T yyi;				\
-	  for (yyi = 0; yyi < (Count); yyi++)	\
-	    (To)[yyi] = (From)[yyi];		\
-	}					\
-      while (YYID (0))
-#  endif
-# endif
+# define YYCOPY_NEEDED 1
 
 /* Relocate STACK from its old location to the new one.  The
    local variables YYSIZE and YYSTACKSIZE give the old and new number of
@@ -372,6 +354,26 @@ union yyalloc
 
 #endif
 
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if defined __GNUC__ && 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  YYSIZE_T yyi;				\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (YYID (0))
+#  endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  3
 /* YYLAST -- Last index in YYTABLE.  */
@@ -492,8 +494,8 @@ static const yytype_uint8 yyr2[] =
        5,     0,     2
 };
 
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
-   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+   Performed when YYTABLE doesn't specify something else to do.  Zero
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
@@ -528,8 +530,7 @@ static const yytype_int8 yypgoto[] =
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If zero, do what YYDEFACT says.
-   If YYTABLE_NINF, syntax error.  */
+   number is the opposite.  If YYTABLE_NINF, syntax error.  */
 #define YYTABLE_NINF -3
 static const yytype_int8 yytable[] =
 {
@@ -538,6 +539,12 @@ static const yytype_int8 yytable[] =
       16,    26,    25,    20,    13
 };
 
+#define yypact_value_is_default(yystate) \
+  ((yystate) == (-18))
+
+#define yytable_value_is_error(yytable_value) \
+  YYID (0)
+
 static const yytype_uint8 yycheck[] =
 {
        0,     1,    19,     3,     0,     6,     6,    21,     8,     6,
@@ -566,9 +573,18 @@ static const yytype_uint8 yystos[] =
 
 /* Like YYERROR except do call yyerror.  This remains here temporarily
    to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
+   Once GCC version 2 has supplanted version 1, this can go.  However,
+   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
+   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+   discussed.  */
 
 #define YYFAIL		goto yyerrlab
+#if defined YYFAIL
+  /* This is here to suppress warnings from the GCC cpp's
+     -Wunused-macros.  Normally we don't worry about that warning, but
+     some users do, and we want to make it easy for users to remove
+     YYFAIL uses, which will produce warnings from Bison 2.5.  */
+#endif
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
@@ -578,7 +594,6 @@ do								\
     {								\
       yychar = (Token);						\
       yylval = (Value);						\
-      yytoken = YYTRANSLATE (yychar);				\
       YYPOPSTACK (1);						\
       goto yybackup;						\
     }								\
@@ -625,7 +640,7 @@ while (YYID (0))
    we won't break user code: when these are the locations we know.  */
 
 #ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
 #  define YY_LOCATION_PRINT(File, Loc)			\
      fprintf (File, "%d.%d-%d.%d",			\
 	      (Loc).first_line, (Loc).first_column,	\
@@ -834,7 +849,6 @@ int yydebug;
 # define YYMAXDEPTH 10000
 #endif
 
-
 
 #if YYERROR_VERBOSE
 
@@ -937,115 +951,142 @@ yytnamerr (char *yyres, const char *yystr)
 }
 # endif
 
-/* Copy into YYRESULT an error message about the unexpected token
-   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
-   including the terminating null byte.  If YYRESULT is null, do not
-   copy anything; just return the number of bytes that would be
-   copied.  As a special case, return 0 if an ordinary "syntax error"
-   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
-   size calculation.  */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
-  int yyn = yypact[yystate];
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+   about the unexpected token YYTOKEN for the state stack whose top is
+   YYSSP.
 
-  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
-    return 0;
-  else
+   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
+   not large enough to hold the message.  In that case, also set
+   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
+   required number of bytes is too large to store.  */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+                yytype_int16 *yyssp, int yytoken)
+{
+  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
+  YYSIZE_T yysize = yysize0;
+  YYSIZE_T yysize1;
+  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+  /* Internationalized format string. */
+  const char *yyformat = 0;
+  /* Arguments of yyformat. */
+  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+  /* Number of reported tokens (one for the "unexpected", one per
+     "expected"). */
+  int yycount = 0;
+
+  /* There are many possibilities here to consider:
+     - Assume YYFAIL is not used.  It's too flawed to consider.  See
+       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
+       for details.  YYERROR is fine as it does not invoke this
+       function.
+     - If this state is a consistent state with a default action, then
+       the only way this function was invoked is if the default action
+       is an error action.  In that case, don't check for expected
+       tokens because there are none.
+     - The only way there can be no lookahead present (in yychar) is if
+       this state is a consistent state with a default action.  Thus,
+       detecting the absence of a lookahead is sufficient to determine
+       that there is no unexpected or expected token to report.  In that
+       case, just report a simple "syntax error".
+     - Don't assume there isn't a lookahead just because this state is a
+       consistent state with a default action.  There might have been a
+       previous inconsistent state, consistent state with a non-default
+       action, or user semantic action that manipulated yychar.
+     - Of course, the expected token list depends on states to have
+       correct lookahead information, and it depends on the parser not
+       to perform extra reductions after fetching a lookahead from the
+       scanner and before detecting a syntax error.  Thus, state merging
+       (from LALR or IELR) and default reductions corrupt the expected
+       token list.  However, the list is correct for canonical LR with
+       one exception: it will still contain any token that will not be
+       accepted due to an error action in a later state.
+  */
+  if (yytoken != YYEMPTY)
     {
-      int yytype = YYTRANSLATE (yychar);
-      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
-      YYSIZE_T yysize = yysize0;
-      YYSIZE_T yysize1;
-      int yysize_overflow = 0;
-      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-      int yyx;
-
-# if 0
-      /* This is so xgettext sees the translatable formats that are
-	 constructed on the fly.  */
-      YY_("syntax error, unexpected %s");
-      YY_("syntax error, unexpected %s, expecting %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
-      char *yyfmt;
-      char const *yyf;
-      static char const yyunexpected[] = "syntax error, unexpected %s";
-      static char const yyexpecting[] = ", expecting %s";
-      static char const yyor[] = " or %s";
-      char yyformat[sizeof yyunexpected
-		    + sizeof yyexpecting - 1
-		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
-		       * (sizeof yyor - 1))];
-      char const *yyprefix = yyexpecting;
-
-      /* Start YYX at -YYN if negative to avoid negative indexes in
-	 YYCHECK.  */
-      int yyxbegin = yyn < 0 ? -yyn : 0;
-
-      /* Stay within bounds of both yycheck and yytname.  */
-      int yychecklim = YYLAST - yyn + 1;
-      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-      int yycount = 1;
-
-      yyarg[0] = yytname[yytype];
-      yyfmt = yystpcpy (yyformat, yyunexpected);
-
-      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-	  {
-	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-	      {
-		yycount = 1;
-		yysize = yysize0;
-		yyformat[sizeof yyunexpected - 1] = '\0';
-		break;
-	      }
-	    yyarg[yycount++] = yytname[yyx];
-	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-	    yysize_overflow |= (yysize1 < yysize);
-	    yysize = yysize1;
-	    yyfmt = yystpcpy (yyfmt, yyprefix);
-	    yyprefix = yyor;
-	  }
+      int yyn = yypact[*yyssp];
+      yyarg[yycount++] = yytname[yytoken];
+      if (!yypact_value_is_default (yyn))
+        {
+          /* Start YYX at -YYN if negative to avoid negative indexes in
+             YYCHECK.  In other words, skip the first -YYN actions for
+             this state because they are default actions.  */
+          int yyxbegin = yyn < 0 ? -yyn : 0;
+          /* Stay within bounds of both yycheck and yytname.  */
+          int yychecklim = YYLAST - yyn + 1;
+          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+          int yyx;
+
+          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+                && !yytable_value_is_error (yytable[yyx + yyn]))
+              {
+                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+                  {
+                    yycount = 1;
+                    yysize = yysize0;
+                    break;
+                  }
+                yyarg[yycount++] = yytname[yyx];
+                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+                if (! (yysize <= yysize1
+                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                  return 2;
+                yysize = yysize1;
+              }
+        }
+    }
 
-      yyf = YY_(yyformat);
-      yysize1 = yysize + yystrlen (yyf);
-      yysize_overflow |= (yysize1 < yysize);
-      yysize = yysize1;
+  switch (yycount)
+    {
+# define YYCASE_(N, S)                      \
+      case N:                               \
+        yyformat = S;                       \
+      break
+      YYCASE_(0, YY_("syntax error"));
+      YYCASE_(1, YY_("syntax error, unexpected %s"));
+      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+    }
 
-      if (yysize_overflow)
-	return YYSIZE_MAXIMUM;
+  yysize1 = yysize + yystrlen (yyformat);
+  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+    return 2;
+  yysize = yysize1;
 
-      if (yyresult)
-	{
-	  /* Avoid sprintf, as that infringes on the user's name space.
-	     Don't have undefined behavior even if the translation
-	     produced a string with the wrong number of "%s"s.  */
-	  char *yyp = yyresult;
-	  int yyi = 0;
-	  while ((*yyp = *yyf) != '\0')
-	    {
-	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
-		{
-		  yyp += yytnamerr (yyp, yyarg[yyi++]);
-		  yyf += 2;
-		}
-	      else
-		{
-		  yyp++;
-		  yyf++;
-		}
-	    }
-	}
-      return yysize;
+  if (*yymsg_alloc < yysize)
+    {
+      *yymsg_alloc = 2 * yysize;
+      if (! (yysize <= *yymsg_alloc
+             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+      return 1;
     }
+
+  /* Avoid sprintf, as that infringes on the user's name space.
+     Don't have undefined behavior even if the translation
+     produced a string with the wrong number of "%s"s.  */
+  {
+    char *yyp = *yymsg;
+    int yyi = 0;
+    while ((*yyp = *yyformat) != '\0')
+      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+        {
+          yyp += yytnamerr (yyp, yyarg[yyi++]);
+          yyformat += 2;
+        }
+      else
+        {
+          yyp++;
+          yyformat++;
+        }
+  }
+  return 0;
 }
 #endif /* YYERROR_VERBOSE */
-
 
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
@@ -1078,66 +1119,66 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, ctx)
     {
       case 3: /* "IDENT" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 40 "libxlu_cfg_y.y"
 	{ free((yyvaluep->string)); };
 
-/* Line 1000 of yacc.c  */
-#line 1087 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1128 "libxlu_cfg_y.c"
 	break;
       case 4: /* "STRING" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 40 "libxlu_cfg_y.y"
 	{ free((yyvaluep->string)); };
 
-/* Line 1000 of yacc.c  */
-#line 1096 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1137 "libxlu_cfg_y.c"
 	break;
       case 5: /* "NUMBER" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 40 "libxlu_cfg_y.y"
 	{ free((yyvaluep->string)); };
 
-/* Line 1000 of yacc.c  */
-#line 1105 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1146 "libxlu_cfg_y.c"
 	break;
       case 18: /* "value" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
-/* Line 1000 of yacc.c  */
-#line 1114 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1155 "libxlu_cfg_y.c"
 	break;
       case 19: /* "atom" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 40 "libxlu_cfg_y.y"
 	{ free((yyvaluep->string)); };
 
-/* Line 1000 of yacc.c  */
-#line 1123 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1164 "libxlu_cfg_y.c"
 	break;
       case 20: /* "valuelist" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
-/* Line 1000 of yacc.c  */
-#line 1132 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1173 "libxlu_cfg_y.c"
 	break;
       case 21: /* "values" */
 
-/* Line 1000 of yacc.c  */
+/* Line 1391 of yacc.c  */
 #line 43 "libxlu_cfg_y.y"
 	{ xlu__cfg_set_free((yyvaluep->setting)); };
 
-/* Line 1000 of yacc.c  */
-#line 1141 "libxlu_cfg_y.c"
+/* Line 1391 of yacc.c  */
+#line 1182 "libxlu_cfg_y.c"
 	break;
 
       default:
@@ -1145,6 +1186,7 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, ctx)
     }
 }
 
+
 /* Prevent warnings from -Wmissing-prototypes.  */
 #ifdef YYPARSE_PARAM
 #if defined __STDC__ || defined __cplusplus
@@ -1161,12 +1203,9 @@ int yyparse ();
 #endif /* ! YYPARSE_PARAM */
 
 
-
-
-
-/*-------------------------.
-| yyparse or yypush_parse.  |
-`-------------------------*/
+/*----------.
+| yyparse.  |
+`----------*/
 
 #ifdef YYPARSE_PARAM
 #if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1230,7 +1269,7 @@ YYLTYPE yylloc;
     YYLTYPE *yylsp;
 
     /* The locations where the error started and ended.  */
-    YYLTYPE yyerror_range[2];
+    YYLTYPE yyerror_range[3];
 
     YYSIZE_T yystacksize;
 
@@ -1277,7 +1316,7 @@ YYLTYPE yylloc;
   yyvsp = yyvs;
   yylsp = yyls;
 
-#if YYLTYPE_IS_TRIVIAL
+#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
   /* Initialize the default location before parsing starts.  */
   yylloc.first_line   = yylloc.last_line   = 1;
   yylloc.first_column = yylloc.last_column = 1;
@@ -1379,7 +1418,7 @@ yybackup:
 
   /* First try to decide what to do without reference to lookahead token.  */
   yyn = yypact[yystate];
-  if (yyn == YYPACT_NINF)
+  if (yypact_value_is_default (yyn))
     goto yydefault;
 
   /* Not known => get a lookahead token if don't already have one.  */
@@ -1410,8 +1449,8 @@ yybackup:
   yyn = yytable[yyn];
   if (yyn <= 0)
     {
-      if (yyn == 0 || yyn == YYTABLE_NINF)
-	goto yyerrlab;
+      if (yytable_value_is_error (yyn))
+        goto yyerrlab;
       yyn = -yyn;
       goto yyreduce;
     }
@@ -1467,80 +1506,91 @@ yyreduce:
     {
         case 9:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 57 "libxlu_cfg_y.y"
-    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].setting),(yylsp[(3) - (3)]).first_line); ;}
+    { xlu__cfg_set_store(ctx,(yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].setting),(yylsp[(3) - (3)]).first_line); }
     break;
 
   case 12:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 62 "libxlu_cfg_y.y"
-    { (yyval.setting)= xlu__cfg_set_mk(ctx,1,(yyvsp[(1) - (1)].string)); ;}
+    { (yyval.setting)= xlu__cfg_set_mk(ctx,1,(yyvsp[(1) - (1)].string)); }
     break;
 
   case 13:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 63 "libxlu_cfg_y.y"
-    { (yyval.setting)= (yyvsp[(3) - (4)].setting); ;}
+    { (yyval.setting)= (yyvsp[(3) - (4)].setting); }
     break;
 
   case 14:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 65 "libxlu_cfg_y.y"
-    { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
+    { (yyval.string)= (yyvsp[(1) - (1)].string); }
     break;
 
   case 15:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 66 "libxlu_cfg_y.y"
-    { (yyval.string)= (yyvsp[(1) - (1)].string); ;}
+    { (yyval.string)= (yyvsp[(1) - (1)].string); }
     break;
 
   case 16:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 68 "libxlu_cfg_y.y"
-    { (yyval.setting)= xlu__cfg_set_mk(ctx,0,0); ;}
+    { (yyval.setting)= xlu__cfg_set_mk(ctx,0,0); }
     break;
 
   case 17:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 69 "libxlu_cfg_y.y"
-    { (yyval.setting)= (yyvsp[(1) - (1)].setting); ;}
+    { (yyval.setting)= (yyvsp[(1) - (1)].setting); }
     break;
 
   case 18:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 70 "libxlu_cfg_y.y"
-    { (yyval.setting)= (yyvsp[(1) - (3)].setting); ;}
+    { (yyval.setting)= (yyvsp[(1) - (3)].setting); }
     break;
 
   case 19:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 72 "libxlu_cfg_y.y"
-    { (yyval.setting)= xlu__cfg_set_mk(ctx,2,(yyvsp[(1) - (2)].string)); ;}
+    { (yyval.setting)= xlu__cfg_set_mk(ctx,2,(yyvsp[(1) - (2)].string)); }
     break;
 
   case 20:
 
-/* Line 1455 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 73 "libxlu_cfg_y.y"
-    { xlu__cfg_set_add(ctx,(yyvsp[(1) - (5)].setting),(yyvsp[(4) - (5)].string)); (yyval.setting)= (yyvsp[(1) - (5)].setting); ;}
+    { xlu__cfg_set_add(ctx,(yyvsp[(1) - (5)].setting),(yyvsp[(4) - (5)].string)); (yyval.setting)= (yyvsp[(1) - (5)].setting); }
     break;
 
 
 
-/* Line 1455 of yacc.c  */
-#line 1542 "libxlu_cfg_y.c"
+/* Line 1806 of yacc.c  */
+#line 1581 "libxlu_cfg_y.c"
       default: break;
     }
+  /* User semantic actions sometimes alter yychar, and that requires
+     that yytoken be updated with the new translation.  We take the
+     approach of translating immediately before every use of yytoken.
+     One alternative is translating here after every semantic action,
+     but that translation would be missed if the semantic action invokes
+     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
+     incorrect destructor might then be invoked immediately.  In the
+     case of YYERROR or YYBACKUP, subsequent parser actions might lead
+     to an incorrect destructor call or verbose syntax error message
+     before the lookahead is translated.  */
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
   YYPOPSTACK (yylen);
@@ -1569,6 +1619,10 @@ yyreduce:
 | yyerrlab -- here on detecting error |
 `------------------------------------*/
 yyerrlab:
+  /* Make sure we have latest lookahead translation.  See comments at
+     user semantic actions for why this is necessary.  */
+  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
   /* If not already recovering from an error, report this error.  */
   if (!yyerrstatus)
     {
@@ -1576,41 +1630,40 @@ yyerrlab:
 #if ! YYERROR_VERBOSE
       yyerror (&yylloc, ctx, YY_("syntax error"));
 #else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+                                        yyssp, yytoken)
       {
-	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
-	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
-	  {
-	    YYSIZE_T yyalloc = 2 * yysize;
-	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
-	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
-	    if (yymsg != yymsgbuf)
-	      YYSTACK_FREE (yymsg);
-	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
-	    if (yymsg)
-	      yymsg_alloc = yyalloc;
-	    else
-	      {
-		yymsg = yymsgbuf;
-		yymsg_alloc = sizeof yymsgbuf;
-	      }
-	  }
-
-	if (0 < yysize && yysize <= yymsg_alloc)
-	  {
-	    (void) yysyntax_error (yymsg, yystate, yychar);
-	    yyerror (&yylloc, ctx, yymsg);
-	  }
-	else
-	  {
-	    yyerror (&yylloc, ctx, YY_("syntax error"));
-	    if (yysize != 0)
-	      goto yyexhaustedlab;
-	  }
+        char const *yymsgp = YY_("syntax error");
+        int yysyntax_error_status;
+        yysyntax_error_status = YYSYNTAX_ERROR;
+        if (yysyntax_error_status == 0)
+          yymsgp = yymsg;
+        else if (yysyntax_error_status == 1)
+          {
+            if (yymsg != yymsgbuf)
+              YYSTACK_FREE (yymsg);
+            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+            if (!yymsg)
+              {
+                yymsg = yymsgbuf;
+                yymsg_alloc = sizeof yymsgbuf;
+                yysyntax_error_status = 2;
+              }
+            else
+              {
+                yysyntax_error_status = YYSYNTAX_ERROR;
+                yymsgp = yymsg;
+              }
+          }
+        yyerror (&yylloc, ctx, yymsgp);
+        if (yysyntax_error_status == 2)
+          goto yyexhaustedlab;
       }
+# undef YYSYNTAX_ERROR
 #endif
     }
 
-  yyerror_range[0] = yylloc;
+  yyerror_range[1] = yylloc;
 
   if (yyerrstatus == 3)
     {
@@ -1647,7 +1700,7 @@ yyerrorlab:
   if (/*CONSTCOND*/ 0)
      goto yyerrorlab;
 
-  yyerror_range[0] = yylsp[1-yylen];
+  yyerror_range[1] = yylsp[1-yylen];
   /* Do not reclaim the symbols of the rule which action triggered
      this YYERROR.  */
   YYPOPSTACK (yylen);
@@ -1666,7 +1719,7 @@ yyerrlab1:
   for (;;)
     {
       yyn = yypact[yystate];
-      if (yyn != YYPACT_NINF)
+      if (!yypact_value_is_default (yyn))
 	{
 	  yyn += YYTERROR;
 	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -1681,7 +1734,7 @@ yyerrlab1:
       if (yyssp == yyss)
 	YYABORT;
 
-      yyerror_range[0] = *yylsp;
+      yyerror_range[1] = *yylsp;
       yydestruct ("Error: popping",
 		  yystos[yystate], yyvsp, yylsp, ctx);
       YYPOPSTACK (1);
@@ -1691,10 +1744,10 @@ yyerrlab1:
 
   *++yyvsp = yylval;
 
-  yyerror_range[1] = yylloc;
+  yyerror_range[2] = yylloc;
   /* Using YYLLOC is tempting, but would change the location of
      the lookahead.  YYLOC is available though.  */
-  YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
+  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
   *++yylsp = yyloc;
 
   /* Shift the error token.  */
@@ -1730,8 +1783,13 @@ yyexhaustedlab:
 
 yyreturn:
   if (yychar != YYEMPTY)
-     yydestruct ("Cleanup: discarding lookahead",
-		 yytoken, &yylval, &yylloc, ctx);
+    {
+      /* Make sure we have latest lookahead translation.  See comments at
+         user semantic actions for why this is necessary.  */
+      yytoken = YYTRANSLATE (yychar);
+      yydestruct ("Cleanup: discarding lookahead",
+                  yytoken, &yylval, &yylloc, ctx);
+    }
   /* Do not reclaim the symbols of the rule which action triggered
      this YYABORT or YYACCEPT.  */
   YYPOPSTACK (yylen);
diff --git a/tools/libxl/libxlu_cfg_y.h b/tools/libxl/libxlu_cfg_y.h
index e7b3d12..d7dfaf2 100644
--- a/tools/libxl/libxlu_cfg_y.h
+++ b/tools/libxl/libxlu_cfg_y.h
@@ -1,10 +1,8 @@
+/* A Bison parser, made by GNU Bison 2.5.  */
 
-/* A Bison parser, made by GNU Bison 2.4.1.  */
-
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* Bison interface for Yacc-like parsers in C
    
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
+      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -52,7 +50,7 @@
 typedef union YYSTYPE
 {
 
-/* Line 1676 of yacc.c  */
+/* Line 2068 of yacc.c  */
 #line 25 "libxlu_cfg_y.y"
 
   char *string;
@@ -60,8 +58,8 @@ typedef union YYSTYPE
 
 
 
-/* Line 1676 of yacc.c  */
-#line 65 "libxlu_cfg_y.h"
+/* Line 2068 of yacc.c  */
+#line 63 "libxlu_cfg_y.h"
 } YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
--
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 Mon Jan 11 02:55:50 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:55:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aISe6-0006Sf-2b; Mon, 11 Jan 2016 02:55: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 1aISe4-0006SP-M3
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:48 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	20/8B-18633-3B913965; Mon, 11 Jan 2016 02:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1452480946!14669391!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18992 invoked from network); 11 Jan 2016 02:55:47 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:55:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISeF-0002E0-Rc
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISe2-0001Z2-3o
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:46 +0000
Date: Mon, 11 Jan 2016 02:55:46 +0000
Message-Id: <E1aISe2-0001Z2-3o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] libxl: Fix building libxlu_cfg_y.y
	with bison 3.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 a43691789e8f3597709a731a535c8e07fe1837ed
Author:     Ed Swierk <eswierk@skyportsystems.com>
AuthorDate: Tue Jan 6 15:21:07 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 14:48:09 2016 +0000

    libxl: Fix building libxlu_cfg_y.y with bison 3.0
    
    - Use %lex-param instead of obsolete YYLEX_PARAM to override lex scanner
      parameter
    - Change deprecated %name-prefix= to %name-prefix
    
    Tested against bison 2.4.1 and 3.0.2.
    
    This is expected to sometimes (depending on timestamps and whether the
    bison input files are edited) break building on systems with ancient
    versions of bison.  Bison 2.4.1 is known to work and was released in
    December 2008.
    
    Also, consquentially, regenerate bison output files with bison
    1:2.5.dfsg-2.1 from Debian wheezy.
    
    Signed-off-by: Ed Swierk <eswierk@skyportsystems.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Tested-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    
    (cherry picked from commit 7ba4cdfadd4f3c45d65ffe50e621759f458fedc0)
    
    [ I have checked that rebuilding the bison and flex input produces no
      further changes. -iwj ]
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxlu_cfg_y.c |    4 ++--
 tools/libxl/libxlu_cfg_y.y |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxlu_cfg_y.c b/tools/libxl/libxlu_cfg_y.c
index 4437e05..07b5a1d 100644
--- a/tools/libxl/libxlu_cfg_y.c
+++ b/tools/libxl/libxlu_cfg_y.c
@@ -76,7 +76,7 @@
 /* Line 268 of yacc.c  */
 #line 19 "libxlu_cfg_y.y"
 
-#define YYLEX_PARAM ctx->scanner
+#define ctx_scanner ctx->scanner
 #include "libxlu_cfg_i.h"
 #include "libxlu_cfg_l.h"
 
@@ -656,7 +656,7 @@ while (YYID (0))
 #ifdef YYLEX_PARAM
 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
 #else
-# define YYLEX yylex (&yylval, &yylloc, scanner)
+# define YYLEX yylex (&yylval, &yylloc, ctx_scanner)
 #endif
 
 /* Enable debugging if requested.  */
diff --git a/tools/libxl/libxlu_cfg_y.y b/tools/libxl/libxlu_cfg_y.y
index aa9f787..5acd438 100644
--- a/tools/libxl/libxlu_cfg_y.y
+++ b/tools/libxl/libxlu_cfg_y.y
@@ -17,7 +17,7 @@
  */
 
 %{
-#define YYLEX_PARAM ctx->scanner
+#define ctx_scanner ctx->scanner
 #include "libxlu_cfg_i.h"
 #include "libxlu_cfg_l.h"
 %}
@@ -31,9 +31,9 @@
 %pure-parser
 %defines
 %error-verbose
-%name-prefix="xlu__cfg_yy"
+%name-prefix "xlu__cfg_yy"
 %parse-param { CfgParseContext *ctx }
-%lex-param { void *scanner }
+%lex-param { ctx_scanner }
 
 %token <string>                IDENT STRING NUMBER NEWLINE
 %type <string>            atom
--
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 Mon Jan 11 02:55:50 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:55:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aISe6-0006Sf-2b; Mon, 11 Jan 2016 02:55: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 1aISe4-0006SP-M3
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:48 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	20/8B-18633-3B913965; Mon, 11 Jan 2016 02:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1452480946!14669391!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18992 invoked from network); 11 Jan 2016 02:55:47 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:55:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISeF-0002E0-Rc
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISe2-0001Z2-3o
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:46 +0000
Date: Mon, 11 Jan 2016 02:55:46 +0000
Message-Id: <E1aISe2-0001Z2-3o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] libxl: Fix building libxlu_cfg_y.y
	with bison 3.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 a43691789e8f3597709a731a535c8e07fe1837ed
Author:     Ed Swierk <eswierk@skyportsystems.com>
AuthorDate: Tue Jan 6 15:21:07 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 14:48:09 2016 +0000

    libxl: Fix building libxlu_cfg_y.y with bison 3.0
    
    - Use %lex-param instead of obsolete YYLEX_PARAM to override lex scanner
      parameter
    - Change deprecated %name-prefix= to %name-prefix
    
    Tested against bison 2.4.1 and 3.0.2.
    
    This is expected to sometimes (depending on timestamps and whether the
    bison input files are edited) break building on systems with ancient
    versions of bison.  Bison 2.4.1 is known to work and was released in
    December 2008.
    
    Also, consquentially, regenerate bison output files with bison
    1:2.5.dfsg-2.1 from Debian wheezy.
    
    Signed-off-by: Ed Swierk <eswierk@skyportsystems.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Tested-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    
    (cherry picked from commit 7ba4cdfadd4f3c45d65ffe50e621759f458fedc0)
    
    [ I have checked that rebuilding the bison and flex input produces no
      further changes. -iwj ]
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxlu_cfg_y.c |    4 ++--
 tools/libxl/libxlu_cfg_y.y |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxlu_cfg_y.c b/tools/libxl/libxlu_cfg_y.c
index 4437e05..07b5a1d 100644
--- a/tools/libxl/libxlu_cfg_y.c
+++ b/tools/libxl/libxlu_cfg_y.c
@@ -76,7 +76,7 @@
 /* Line 268 of yacc.c  */
 #line 19 "libxlu_cfg_y.y"
 
-#define YYLEX_PARAM ctx->scanner
+#define ctx_scanner ctx->scanner
 #include "libxlu_cfg_i.h"
 #include "libxlu_cfg_l.h"
 
@@ -656,7 +656,7 @@ while (YYID (0))
 #ifdef YYLEX_PARAM
 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
 #else
-# define YYLEX yylex (&yylval, &yylloc, scanner)
+# define YYLEX yylex (&yylval, &yylloc, ctx_scanner)
 #endif
 
 /* Enable debugging if requested.  */
diff --git a/tools/libxl/libxlu_cfg_y.y b/tools/libxl/libxlu_cfg_y.y
index aa9f787..5acd438 100644
--- a/tools/libxl/libxlu_cfg_y.y
+++ b/tools/libxl/libxlu_cfg_y.y
@@ -17,7 +17,7 @@
  */
 
 %{
-#define YYLEX_PARAM ctx->scanner
+#define ctx_scanner ctx->scanner
 #include "libxlu_cfg_i.h"
 #include "libxlu_cfg_l.h"
 %}
@@ -31,9 +31,9 @@
 %pure-parser
 %defines
 %error-verbose
-%name-prefix="xlu__cfg_yy"
+%name-prefix "xlu__cfg_yy"
 %parse-param { CfgParseContext *ctx }
-%lex-param { void *scanner }
+%lex-param { ctx_scanner }
 
 %token <string>                IDENT STRING NUMBER NEWLINE
 %type <string>            atom
--
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 Mon Jan 11 02:56:00 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:56: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 1aISeG-0006UN-6n; Mon, 11 Jan 2016 02:56: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 1aISeF-0006U9-6x
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:59 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	E3/9E-28228-EB913965; Mon, 11 Jan 2016 02:55:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1452480956!12111508!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62159 invoked from network); 11 Jan 2016 02:55:57 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:55:57 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISeQ-0002Eb-4w
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISeC-0001Zk-DB
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:56 +0000
Date: Mon, 11 Jan 2016 02:55:56 +0000
Message-Id: <E1aISeC-0001Zk-DB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dfc955ee221faf8df0a9596d79a60ce02339d1e6
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 15:36:32 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:36:32 2016 +0000

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

diff --git a/Config.mk b/Config.mk
index 2376348..b4716d6 100644
--- a/Config.mk
+++ b/Config.mk
@@ -246,9 +246,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= c51f20baba0bc01e7e3a3a16e72be9a0ed6cb734
-# Fri Nov 20 10:56:00 2015 -0500
-# blkif: Avoid double access to src->nr_segments
+QEMU_TAG ?= 2bbe49494f5e910c6fb49f6800d143cae9eb5758
+# Mon Jan 4 15:34:29 2016 +0000
+# MSI-X: avoid array overrun upon MSI-X table writes
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 02:56:00 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:56: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 1aISeG-0006UN-6n; Mon, 11 Jan 2016 02:56: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 1aISeF-0006U9-6x
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:59 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	E3/9E-28228-EB913965; Mon, 11 Jan 2016 02:55:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1452480956!12111508!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62159 invoked from network); 11 Jan 2016 02:55:57 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:55:57 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISeQ-0002Eb-4w
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISeC-0001Zk-DB
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:55:56 +0000
Date: Mon, 11 Jan 2016 02:55:56 +0000
Message-Id: <E1aISeC-0001Zk-DB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dfc955ee221faf8df0a9596d79a60ce02339d1e6
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 15:36:32 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:36:32 2016 +0000

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

diff --git a/Config.mk b/Config.mk
index 2376348..b4716d6 100644
--- a/Config.mk
+++ b/Config.mk
@@ -246,9 +246,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= c51f20baba0bc01e7e3a3a16e72be9a0ed6cb734
-# Fri Nov 20 10:56:00 2015 -0500
-# blkif: Avoid double access to src->nr_segments
+QEMU_TAG ?= 2bbe49494f5e910c6fb49f6800d143cae9eb5758
+# Mon Jan 4 15:34:29 2016 +0000
+# MSI-X: avoid array overrun upon MSI-X table writes
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 02:56:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:56: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 1aISeQ-0006Wm-As; Mon, 11 Jan 2016 02:56:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISeO-0006WR-TY
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:09 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	EC/48-08977-8C913965; Mon, 11 Jan 2016 02:56:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1452480967!9325441!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39226 invoked from network); 11 Jan 2016 02:56:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:56:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISea-0002Ej-EN
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISeM-0001as-N0
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:06 +0000
Date: Mon, 11 Jan 2016 02:56:06 +0000
Message-Id: <E1aISeM-0001as-N0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] blktap: 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 e003d429d8c63523df40663b4586c572ce796659
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: Wed Jan 6 11:34:17 2016 +0000

    blktap: Fix two 'maybe uninitialized' variables
    
    [ Cross-ported to blktap1 from 345e44a85d71a
      "blktap2: Fix two 'maybe uninitialized' variables" -iwj;
      Remainder of commit message is from blktap2's version. ]
    
    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>
    
    Backport-requested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 845e8c1653242bbd9b9de5a081182db0f3f39054)
---
 tools/blktap/drivers/block-qcow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/blktap/drivers/block-qcow.c b/tools/blktap/drivers/block-qcow.c
index 0e4e9cf..8fb6023 100644
--- a/tools/blktap/drivers/block-qcow.c
+++ b/tools/blktap/drivers/block-qcow.c
@@ -440,6 +440,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);
 
@@ -613,6 +614,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#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 Mon Jan 11 02:56:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:56: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 1aISeQ-0006Wm-As; Mon, 11 Jan 2016 02:56:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISeO-0006WR-TY
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:09 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	EC/48-08977-8C913965; Mon, 11 Jan 2016 02:56:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1452480967!9325441!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39226 invoked from network); 11 Jan 2016 02:56:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:56:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISea-0002Ej-EN
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISeM-0001as-N0
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:06 +0000
Date: Mon, 11 Jan 2016 02:56:06 +0000
Message-Id: <E1aISeM-0001as-N0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] blktap: 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 e003d429d8c63523df40663b4586c572ce796659
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: Wed Jan 6 11:34:17 2016 +0000

    blktap: Fix two 'maybe uninitialized' variables
    
    [ Cross-ported to blktap1 from 345e44a85d71a
      "blktap2: Fix two 'maybe uninitialized' variables" -iwj;
      Remainder of commit message is from blktap2's version. ]
    
    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>
    
    Backport-requested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 845e8c1653242bbd9b9de5a081182db0f3f39054)
---
 tools/blktap/drivers/block-qcow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/blktap/drivers/block-qcow.c b/tools/blktap/drivers/block-qcow.c
index 0e4e9cf..8fb6023 100644
--- a/tools/blktap/drivers/block-qcow.c
+++ b/tools/blktap/drivers/block-qcow.c
@@ -440,6 +440,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);
 
@@ -613,6 +614,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#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 Mon Jan 11 02:56:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:56: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 1aISea-0006YM-FT; Mon, 11 Jan 2016 02:56: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 1aISeZ-0006Y9-A4
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:19 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	04/CD-12831-2D913965; Mon, 11 Jan 2016 02:56:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1452480977!14944805!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57874 invoked from network); 11 Jan 2016 02:56:18 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:56:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISek-0002Er-KD
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISeW-0001be-Ur
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:16 +0000
Date: Mon, 11 Jan 2016 02:56:16 +0000
Message-Id: <E1aISeW-0001be-Ur@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] Config.mk: update OVMF changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6d2c41d676339ecc6255b92876b6153d4f85f579
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 14 12:41:13 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jan 7 15:50:45 2016 +0000

    Config.mk: update OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    
    (cherry picked from commits 04c5efb0a141fa53e805e396970419436e74ce67
     and f046e501bbca1c8a46853b2e1f1b587e228c73de)
    
    Apropos of discussion in
     "OVMF related osstest failures on multiple branches"
     http://lists.xenproject.org/archives/html/xen-devel/2016-01/msg00442.html
    
    We believe the older ovmf.git does not work when built with the gcc in
    Debian jessie.  We do not know where this bug lies but we are fixing
    it by updating ovmf.
    
    We have decided that we are not in a position to review the changes to
    OVMF upstream, and ourselves decide what to cherry pick.  Instead we
    will update the revision wholesale and use the xen.git stable
    branches' push gate.
    
    Conflicts:
    	Config.mk
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    (cherry picked from commits 6c3c6ff9ecaa5ee0be8b535d36fdcd12380564a1
     and 1d3cc6e62c4d2fc3dd9251d4921881425c9d27bd)
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit ee576d71103e6795dc0add91db1b0d281eab1caf)
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index b4716d6..554bcd6 100644
--- a/Config.mk
+++ b/Config.mk
@@ -233,7 +233,7 @@ OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
-OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
+OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.3
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
--
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 Mon Jan 11 02:56:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 02:56: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 1aISea-0006YM-FT; Mon, 11 Jan 2016 02:56: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 1aISeZ-0006Y9-A4
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:19 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	04/CD-12831-2D913965; Mon, 11 Jan 2016 02:56:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1452480977!14944805!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57874 invoked from network); 11 Jan 2016 02:56:18 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 02:56:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISek-0002Er-KD
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aISeW-0001be-Ur
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 02:56:16 +0000
Date: Mon, 11 Jan 2016 02:56:16 +0000
Message-Id: <E1aISeW-0001be-Ur@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] Config.mk: update OVMF changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6d2c41d676339ecc6255b92876b6153d4f85f579
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 14 12:41:13 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jan 7 15:50:45 2016 +0000

    Config.mk: update OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    
    (cherry picked from commits 04c5efb0a141fa53e805e396970419436e74ce67
     and f046e501bbca1c8a46853b2e1f1b587e228c73de)
    
    Apropos of discussion in
     "OVMF related osstest failures on multiple branches"
     http://lists.xenproject.org/archives/html/xen-devel/2016-01/msg00442.html
    
    We believe the older ovmf.git does not work when built with the gcc in
    Debian jessie.  We do not know where this bug lies but we are fixing
    it by updating ovmf.
    
    We have decided that we are not in a position to review the changes to
    OVMF upstream, and ourselves decide what to cherry pick.  Instead we
    will update the revision wholesale and use the xen.git stable
    branches' push gate.
    
    Conflicts:
    	Config.mk
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    (cherry picked from commits 6c3c6ff9ecaa5ee0be8b535d36fdcd12380564a1
     and 1d3cc6e62c4d2fc3dd9251d4921881425c9d27bd)
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit ee576d71103e6795dc0add91db1b0d281eab1caf)
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index b4716d6..554bcd6 100644
--- a/Config.mk
+++ b/Config.mk
@@ -233,7 +233,7 @@ OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
-OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
+OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.3
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
--
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 Mon Jan 11 05:33:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 05:33:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aIV6J-0001DE-Hu; Mon, 11 Jan 2016 05:33:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6I-0001Cz-Kj
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:06 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	54/23-22089-19E33965; Mon, 11 Jan 2016 05:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1452490384!14731392!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33081 invoked from network); 11 Jan 2016 05:33:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 05:33:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6U-0005zn-0u
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6F-0004t2-GX
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:03 +0000
Date: Mon, 11 Jan 2016 05:33:03 +0000
Message-Id: <E1aIV6F-0004t2-GX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: don't leak ST(n)/XMMn values
	to domains first using 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 f5119912e9a5f888273306ff6b462d6fd1f7a6bd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:32:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:32:56 2015 +0100

    x86: don't leak ST(n)/XMMn values to domains first using them
    
    FNINIT doesn't alter these registers, and hence using it is
    insufficient to initialize a guest's initial state.
    
    This is CVE-2015-8555 / XSA-165.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 81818b3f277544535974204f8d840da86fa8a44f
    master date: 2015-12-17 14:22:13 +0100
---
 xen/arch/x86/domain.c |   11 +++++++++++
 xen/arch/x86/i387.c   |   31 +++++++++----------------------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 74e1146..d6451fb 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -730,6 +730,17 @@ int arch_set_info_guest(
 
     if ( flags & VGCF_I387_VALID )
         memcpy(v->arch.fpu_ctxt, &c.nat->fpu_ctxt, sizeof(c.nat->fpu_ctxt));
+    else if ( v->arch.xsave_area )
+        memset(&v->arch.xsave_area->xsave_hdr, 0,
+               sizeof(v->arch.xsave_area->xsave_hdr));
+    else
+    {
+        typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+        memset(fpu_sse, 0, sizeof(*fpu_sse));
+        fpu_sse->fcw = FCW_DEFAULT;
+        fpu_sse->mxcsr = MXCSR_DEFAULT;
+    }
 
     if ( !compat )
     {
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index e977453..efc627a 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -17,19 +17,6 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-static void fpu_init(void)
-{
-    unsigned long val;
-    
-    asm volatile ( "fninit" );
-    if ( cpu_has_xmm )
-    {
-        /* load default value into MXCSR control/status register */
-        val = MXCSR_DEFAULT;
-        asm volatile ( "ldmxcsr %0" : : "m" (val) );
-    }
-}
-
 /*******************************/
 /*     FPU Restore Functions   */
 /*******************************/
@@ -254,15 +241,8 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
 
     if ( cpu_has_xsave )
         fpu_xrstor(v, XSTATE_LAZY);
-    else if ( v->fpu_initialised )
-    {
-        if ( cpu_has_fxsr )
-            fpu_fxrstor(v);
-        else
-            fpu_frstor(v);
-    }
     else
-        fpu_init();
+        fpu_fxrstor(v);
 
     v->fpu_initialised = 1;
     v->fpu_dirtied = 1;
@@ -323,7 +303,14 @@ int vcpu_init_fpu(struct vcpu *v)
     else
     {
         v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse), 16);
-        if ( !v->arch.fpu_ctxt )
+        if ( v->arch.fpu_ctxt )
+        {
+            typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+            fpu_sse->fcw = FCW_DEFAULT;
+            fpu_sse->mxcsr = MXCSR_DEFAULT;
+        }
+        else
         {
             rc = -ENOMEM;
             goto done;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 05:33:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 05:33:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aIV6J-0001DE-Hu; Mon, 11 Jan 2016 05:33:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6I-0001Cz-Kj
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:06 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	54/23-22089-19E33965; Mon, 11 Jan 2016 05:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1452490384!14731392!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33081 invoked from network); 11 Jan 2016 05:33:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 05:33:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6U-0005zn-0u
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6F-0004t2-GX
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:03 +0000
Date: Mon, 11 Jan 2016 05:33:03 +0000
Message-Id: <E1aIV6F-0004t2-GX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: don't leak ST(n)/XMMn values
	to domains first using 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 f5119912e9a5f888273306ff6b462d6fd1f7a6bd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:32:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:32:56 2015 +0100

    x86: don't leak ST(n)/XMMn values to domains first using them
    
    FNINIT doesn't alter these registers, and hence using it is
    insufficient to initialize a guest's initial state.
    
    This is CVE-2015-8555 / XSA-165.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 81818b3f277544535974204f8d840da86fa8a44f
    master date: 2015-12-17 14:22:13 +0100
---
 xen/arch/x86/domain.c |   11 +++++++++++
 xen/arch/x86/i387.c   |   31 +++++++++----------------------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 74e1146..d6451fb 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -730,6 +730,17 @@ int arch_set_info_guest(
 
     if ( flags & VGCF_I387_VALID )
         memcpy(v->arch.fpu_ctxt, &c.nat->fpu_ctxt, sizeof(c.nat->fpu_ctxt));
+    else if ( v->arch.xsave_area )
+        memset(&v->arch.xsave_area->xsave_hdr, 0,
+               sizeof(v->arch.xsave_area->xsave_hdr));
+    else
+    {
+        typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+        memset(fpu_sse, 0, sizeof(*fpu_sse));
+        fpu_sse->fcw = FCW_DEFAULT;
+        fpu_sse->mxcsr = MXCSR_DEFAULT;
+    }
 
     if ( !compat )
     {
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index e977453..efc627a 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -17,19 +17,6 @@
 #include <asm/xstate.h>
 #include <asm/asm_defns.h>
 
-static void fpu_init(void)
-{
-    unsigned long val;
-    
-    asm volatile ( "fninit" );
-    if ( cpu_has_xmm )
-    {
-        /* load default value into MXCSR control/status register */
-        val = MXCSR_DEFAULT;
-        asm volatile ( "ldmxcsr %0" : : "m" (val) );
-    }
-}
-
 /*******************************/
 /*     FPU Restore Functions   */
 /*******************************/
@@ -254,15 +241,8 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
 
     if ( cpu_has_xsave )
         fpu_xrstor(v, XSTATE_LAZY);
-    else if ( v->fpu_initialised )
-    {
-        if ( cpu_has_fxsr )
-            fpu_fxrstor(v);
-        else
-            fpu_frstor(v);
-    }
     else
-        fpu_init();
+        fpu_fxrstor(v);
 
     v->fpu_initialised = 1;
     v->fpu_dirtied = 1;
@@ -323,7 +303,14 @@ int vcpu_init_fpu(struct vcpu *v)
     else
     {
         v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse), 16);
-        if ( !v->arch.fpu_ctxt )
+        if ( v->arch.fpu_ctxt )
+        {
+            typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
+
+            fpu_sse->fcw = FCW_DEFAULT;
+            fpu_sse->mxcsr = MXCSR_DEFAULT;
+        }
+        else
         {
             rc = -ENOMEM;
             goto done;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 05:33:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 05: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 1aIV6U-0001F1-NR; Mon, 11 Jan 2016 05:33: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 1aIV6T-0001EW-5p
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:17 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	6C/B9-14900-C9E33965; Mon, 11 Jan 2016 05:33:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1452490394!15017766!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14045 invoked from network); 11 Jan 2016 05:33:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 05:33:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6e-0005zv-Gh
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6Q-0004tV-D1
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:14 +0000
Date: Mon, 11 Jan 2016 05:33:14 +0000
Message-Id: <E1aIV6Q-0004tV-D1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/HVM: avoid reading ioreq state
	more than once
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83349eede062fc636f89657628a772438012673a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:33:22 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:33:22 2015 +0100

    x86/HVM: avoid reading ioreq state more than once
    
    Otherwise, especially when the compiler chooses to translate the
    switch() to a jump table, unpredictable behavior (and in the jump table
    case arbitrary code execution) can result.
    
    This is XSA-166.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: b452430a4cdfc801fa4bc391aed7522365e1deb6
    master date: 2015-12-17 14:22:46 +0100
---
 xen/arch/x86/hvm/hvm.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c731cc4..9dafcca 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -342,6 +342,7 @@ void hvm_migrate_pirqs(struct vcpu *v)
 void hvm_do_resume(struct vcpu *v)
 {
     ioreq_t *p;
+    unsigned int state;
 
     pt_restore_timer(v);
 
@@ -349,9 +350,10 @@ void hvm_do_resume(struct vcpu *v)
 
     /* NB. Optimised for common case (p->state == STATE_IOREQ_NONE). */
     p = get_ioreq(v);
-    while ( p->state != STATE_IOREQ_NONE )
+    while ( (state = p->state) != STATE_IOREQ_NONE )
     {
-        switch ( p->state )
+        rmb();
+        switch ( state )
         {
         case STATE_IORESP_READY: /* IORESP_READY -> NONE */
             hvm_io_assist();
@@ -359,11 +361,10 @@ void hvm_do_resume(struct vcpu *v)
         case STATE_IOREQ_READY:  /* IOREQ_{READY,INPROCESS} -> IORESP_READY */
         case STATE_IOREQ_INPROCESS:
             wait_on_xen_event_channel(v->arch.hvm_vcpu.xen_port,
-                                      (p->state != STATE_IOREQ_READY) &&
-                                      (p->state != STATE_IOREQ_INPROCESS));
+                                      p->state != state);
             break;
         default:
-            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %d.\n", p->state);
+            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %u\n", state);
             domain_crash(v->domain);
             return; /* bail */
         }
--
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 Mon Jan 11 05:33:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 05: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 1aIV6U-0001F1-NR; Mon, 11 Jan 2016 05:33: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 1aIV6T-0001EW-5p
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:17 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	6C/B9-14900-C9E33965; Mon, 11 Jan 2016 05:33:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1452490394!15017766!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14045 invoked from network); 11 Jan 2016 05:33:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 05:33:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6e-0005zv-Gh
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6Q-0004tV-D1
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:14 +0000
Date: Mon, 11 Jan 2016 05:33:14 +0000
Message-Id: <E1aIV6Q-0004tV-D1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/HVM: avoid reading ioreq state
	more than once
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83349eede062fc636f89657628a772438012673a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Dec 17 14:33:22 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Dec 17 14:33:22 2015 +0100

    x86/HVM: avoid reading ioreq state more than once
    
    Otherwise, especially when the compiler chooses to translate the
    switch() to a jump table, unpredictable behavior (and in the jump table
    case arbitrary code execution) can result.
    
    This is XSA-166.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: b452430a4cdfc801fa4bc391aed7522365e1deb6
    master date: 2015-12-17 14:22:46 +0100
---
 xen/arch/x86/hvm/hvm.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c731cc4..9dafcca 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -342,6 +342,7 @@ void hvm_migrate_pirqs(struct vcpu *v)
 void hvm_do_resume(struct vcpu *v)
 {
     ioreq_t *p;
+    unsigned int state;
 
     pt_restore_timer(v);
 
@@ -349,9 +350,10 @@ void hvm_do_resume(struct vcpu *v)
 
     /* NB. Optimised for common case (p->state == STATE_IOREQ_NONE). */
     p = get_ioreq(v);
-    while ( p->state != STATE_IOREQ_NONE )
+    while ( (state = p->state) != STATE_IOREQ_NONE )
     {
-        switch ( p->state )
+        rmb();
+        switch ( state )
         {
         case STATE_IORESP_READY: /* IORESP_READY -> NONE */
             hvm_io_assist();
@@ -359,11 +361,10 @@ void hvm_do_resume(struct vcpu *v)
         case STATE_IOREQ_READY:  /* IOREQ_{READY,INPROCESS} -> IORESP_READY */
         case STATE_IOREQ_INPROCESS:
             wait_on_xen_event_channel(v->arch.hvm_vcpu.xen_port,
-                                      (p->state != STATE_IOREQ_READY) &&
-                                      (p->state != STATE_IOREQ_INPROCESS));
+                                      p->state != state);
             break;
         default:
-            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %d.\n", p->state);
+            gdprintk(XENLOG_ERR, "Weird HVM iorequest state %u\n", state);
             domain_crash(v->domain);
             return; /* bail */
         }
--
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 Mon Jan 11 05:33:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 05: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 1aIV6e-0001HT-R4; Mon, 11 Jan 2016 05: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 1aIV6d-0001HD-LD
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:27 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	2B/E7-28228-6AE33965; Mon, 11 Jan 2016 05:33:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1452490405!15835130!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47179 invoked from network); 11 Jan 2016 05:33:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 05:33:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6o-000603-Ta
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6a-0004ue-SM
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:24 +0000
Date: Mon, 11 Jan 2016 05:33:24 +0000
Message-Id: <E1aIV6a-0004ue-SM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0574a773238f0ecce3873dc525082f6e16ac655b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Dec 18 14:59:01 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 18 14:59:01 2015 +0000

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

diff --git a/Config.mk b/Config.mk
index 9f0acf0..f0af134 100644
--- a/Config.mk
+++ b/Config.mk
@@ -224,9 +224,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= d886904dd6875648b33d58bb7d2fe75b45e4ea12
-# Wed Dec 9 11:47:35 2015 +0000
-# net: pcnet: add check to validate receive data size(CVE-2015-7504)
+QEMU_TAG ?= 95872ff9713292f1c859c093feae0a2eaff8f810
+# Fri Nov 20 10:56:00 2015 -0500
+# blkif: Avoid double access to src->nr_segments
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 05:33:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 05: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 1aIV6e-0001HT-R4; Mon, 11 Jan 2016 05: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 1aIV6d-0001HD-LD
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:27 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	2B/E7-28228-6AE33965; Mon, 11 Jan 2016 05:33:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1452490405!15835130!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47179 invoked from network); 11 Jan 2016 05:33:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 05:33:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6o-000603-Ta
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6a-0004ue-SM
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:24 +0000
Date: Mon, 11 Jan 2016 05:33:24 +0000
Message-Id: <E1aIV6a-0004ue-SM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0574a773238f0ecce3873dc525082f6e16ac655b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Dec 18 14:59:01 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 18 14:59:01 2015 +0000

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

diff --git a/Config.mk b/Config.mk
index 9f0acf0..f0af134 100644
--- a/Config.mk
+++ b/Config.mk
@@ -224,9 +224,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= d886904dd6875648b33d58bb7d2fe75b45e4ea12
-# Wed Dec 9 11:47:35 2015 +0000
-# net: pcnet: add check to validate receive data size(CVE-2015-7504)
+QEMU_TAG ?= 95872ff9713292f1c859c093feae0a2eaff8f810
+# Fri Nov 20 10:56:00 2015 -0500
+# blkif: Avoid double access to src->nr_segments
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 05:33:39 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 05:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aIV6p-0001K8-0q; Mon, 11 Jan 2016 05:33: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 1aIV6n-0001Jf-IO
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:37 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	D7/7D-08977-0BE33965; Mon, 11 Jan 2016 05:33:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1452490415!9339279!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54281 invoked from network); 11 Jan 2016 05:33:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 05:33:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6z-00060B-5i
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6l-0004vA-7m
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:35 +0000
Date: Mon, 11 Jan 2016 05:33:35 +0000
Message-Id: <E1aIV6l-0004vA-7m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0fe03d7ed26d41e9434fb007d6fe4d05077efa7d
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 15:36:53 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:36:53 2016 +0000

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

diff --git a/Config.mk b/Config.mk
index f0af134..8a8c7a6 100644
--- a/Config.mk
+++ b/Config.mk
@@ -224,9 +224,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 95872ff9713292f1c859c093feae0a2eaff8f810
-# Fri Nov 20 10:56:00 2015 -0500
-# blkif: Avoid double access to src->nr_segments
+QEMU_TAG ?= b96625e17169a7958575c2fb41499bb9ea2c212e
+# Mon Jan 4 15:34:29 2016 +0000
+# MSI-X: avoid array overrun upon MSI-X table writes
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 05:33:39 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 05:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aIV6p-0001K8-0q; Mon, 11 Jan 2016 05:33: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 1aIV6n-0001Jf-IO
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:37 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	D7/7D-08977-0BE33965; Mon, 11 Jan 2016 05:33:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1452490415!9339279!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54281 invoked from network); 11 Jan 2016 05:33:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 05:33:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6z-00060B-5i
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6l-0004vA-7m
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:35 +0000
Date: Mon, 11 Jan 2016 05:33:35 +0000
Message-Id: <E1aIV6l-0004vA-7m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0fe03d7ed26d41e9434fb007d6fe4d05077efa7d
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 15:36:53 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:36:53 2016 +0000

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

diff --git a/Config.mk b/Config.mk
index f0af134..8a8c7a6 100644
--- a/Config.mk
+++ b/Config.mk
@@ -224,9 +224,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 95872ff9713292f1c859c093feae0a2eaff8f810
-# Fri Nov 20 10:56:00 2015 -0500
-# blkif: Avoid double access to src->nr_segments
+QEMU_TAG ?= b96625e17169a7958575c2fb41499bb9ea2c212e
+# Mon Jan 4 15:34:29 2016 +0000
+# MSI-X: avoid array overrun upon MSI-X table writes
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 05:33:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 05: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 1aIV6z-0001MH-4S; Mon, 11 Jan 2016 05:33: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 1aIV6y-0001Ly-0j
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:48 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	62/2A-14900-BBE33965; Mon, 11 Jan 2016 05:33:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1452490425!14428410!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 36068 invoked from network); 11 Jan 2016 05:33:46 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 05:33:46 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV79-00060N-GR
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6v-0004vX-Gq
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:45 +0000
Date: Mon, 11 Jan 2016 05:33:45 +0000
Message-Id: <E1aIV6v-0004vX-Gq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] blktap: 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 a64bfae49ae845ba4cb8cb6923fa08c41439872a
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: Wed Jan 6 11:34:24 2016 +0000

    blktap: Fix two 'maybe uninitialized' variables
    
    [ Cross-ported to blktap1 from 345e44a85d71a
      "blktap2: Fix two 'maybe uninitialized' variables" -iwj;
      Remainder of commit message is from blktap2's version. ]
    
    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>
    
    Backport-requested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 845e8c1653242bbd9b9de5a081182db0f3f39054)
    (cherry picked from commit e003d429d8c63523df40663b4586c572ce796659)
---
 tools/blktap/drivers/block-qcow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/blktap/drivers/block-qcow.c b/tools/blktap/drivers/block-qcow.c
index 0e4e9cf..8fb6023 100644
--- a/tools/blktap/drivers/block-qcow.c
+++ b/tools/blktap/drivers/block-qcow.c
@@ -440,6 +440,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);
 
@@ -613,6 +614,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#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 Mon Jan 11 05:33:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 05: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 1aIV6z-0001MH-4S; Mon, 11 Jan 2016 05:33: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 1aIV6y-0001Ly-0j
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:48 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	62/2A-14900-BBE33965; Mon, 11 Jan 2016 05:33:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1452490425!14428410!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 36068 invoked from network); 11 Jan 2016 05:33:46 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 05:33:46 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV79-00060N-GR
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV6v-0004vX-Gq
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:45 +0000
Date: Mon, 11 Jan 2016 05:33:45 +0000
Message-Id: <E1aIV6v-0004vX-Gq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] blktap: 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 a64bfae49ae845ba4cb8cb6923fa08c41439872a
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: Wed Jan 6 11:34:24 2016 +0000

    blktap: Fix two 'maybe uninitialized' variables
    
    [ Cross-ported to blktap1 from 345e44a85d71a
      "blktap2: Fix two 'maybe uninitialized' variables" -iwj;
      Remainder of commit message is from blktap2's version. ]
    
    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>
    
    Backport-requested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 845e8c1653242bbd9b9de5a081182db0f3f39054)
    (cherry picked from commit e003d429d8c63523df40663b4586c572ce796659)
---
 tools/blktap/drivers/block-qcow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/blktap/drivers/block-qcow.c b/tools/blktap/drivers/block-qcow.c
index 0e4e9cf..8fb6023 100644
--- a/tools/blktap/drivers/block-qcow.c
+++ b/tools/blktap/drivers/block-qcow.c
@@ -440,6 +440,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);
 
@@ -613,6 +614,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#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 Mon Jan 11 05:34:00 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 05: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 1aIV7A-0001ON-7o; Mon, 11 Jan 2016 05: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 1aIV78-0001Nv-8m
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:58 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	8C/82-12889-5CE33965; Mon, 11 Jan 2016 05:33:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1452490436!15907406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45216 invoked from network); 11 Jan 2016 05:33:56 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 05:33:56 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV7J-00060y-O5
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:34:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV75-0004vx-QI
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:55 +0000
Date: Mon, 11 Jan 2016 05:33:55 +0000
Message-Id: <E1aIV75-0004vx-QI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Config.mk: update OVMF changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae05efd98917223a0e669026baceb7f489755a42
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 14 12:41:13 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jan 7 15:51:39 2016 +0000

    Config.mk: update OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    
    (cherry picked from commits 04c5efb0a141fa53e805e396970419436e74ce67
     and f046e501bbca1c8a46853b2e1f1b587e228c73de)
    
    Apropos of discussion in
     "OVMF related osstest failures on multiple branches"
     http://lists.xenproject.org/archives/html/xen-devel/2016-01/msg00442.html
    
    We believe the older ovmf.git does not work when built with the gcc in
    Debian jessie.  We do not know where this bug lies but we are fixing
    it by updating ovmf.
    
    We have decided that we are not in a position to review the changes to
    OVMF upstream, and ourselves decide what to cherry pick.  Instead we
    will update the revision wholesale and use the xen.git stable
    branches' push gate.
    
    Conflicts:
    	Config.mk
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    (cherry picked from commits 6c3c6ff9ecaa5ee0be8b535d36fdcd12380564a1
     and 1d3cc6e62c4d2fc3dd9251d4921881425c9d27bd)
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit ee576d71103e6795dc0add91db1b0d281eab1caf)
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 6d2c41d676339ecc6255b92876b6153d4f85f579)
    
    In 4.3, old OVMF_UPSTREAM_REVISION was b0855f92 rather than cb9a7eba.
    I have pulled in the additional changes, willy-nilly.
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 8a8c7a6..cbe4878 100644
--- a/Config.mk
+++ b/Config.mk
@@ -211,7 +211,7 @@ OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
-OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
+OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.4
 SEABIOS_UPSTREAM_TAG ?= 3a28511b46f0c2af5fae1b6ed2b0c19d7913cee3
 # Wed Jun 26 16:30:45 2013 +0100
--
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 Mon Jan 11 05:34:00 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 05: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 1aIV7A-0001ON-7o; Mon, 11 Jan 2016 05: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 1aIV78-0001Nv-8m
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:58 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	8C/82-12889-5CE33965; Mon, 11 Jan 2016 05:33:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1452490436!15907406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45216 invoked from network); 11 Jan 2016 05:33:56 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 05:33:56 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV7J-00060y-O5
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:34:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIV75-0004vx-QI
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 05:33:55 +0000
Date: Mon, 11 Jan 2016 05:33:55 +0000
Message-Id: <E1aIV75-0004vx-QI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Config.mk: update OVMF changeset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae05efd98917223a0e669026baceb7f489755a42
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 14 12:41:13 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Jan 7 15:51:39 2016 +0000

    Config.mk: update OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    
    (cherry picked from commits 04c5efb0a141fa53e805e396970419436e74ce67
     and f046e501bbca1c8a46853b2e1f1b587e228c73de)
    
    Apropos of discussion in
     "OVMF related osstest failures on multiple branches"
     http://lists.xenproject.org/archives/html/xen-devel/2016-01/msg00442.html
    
    We believe the older ovmf.git does not work when built with the gcc in
    Debian jessie.  We do not know where this bug lies but we are fixing
    it by updating ovmf.
    
    We have decided that we are not in a position to review the changes to
    OVMF upstream, and ourselves decide what to cherry pick.  Instead we
    will update the revision wholesale and use the xen.git stable
    branches' push gate.
    
    Conflicts:
    	Config.mk
    
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    (cherry picked from commits 6c3c6ff9ecaa5ee0be8b535d36fdcd12380564a1
     and 1d3cc6e62c4d2fc3dd9251d4921881425c9d27bd)
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit ee576d71103e6795dc0add91db1b0d281eab1caf)
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 6d2c41d676339ecc6255b92876b6153d4f85f579)
    
    In 4.3, old OVMF_UPSTREAM_REVISION was b0855f92 rather than cb9a7eba.
    I have pulled in the additional changes, willy-nilly.
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 8a8c7a6..cbe4878 100644
--- a/Config.mk
+++ b/Config.mk
@@ -211,7 +211,7 @@ OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
-OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
+OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.4
 SEABIOS_UPSTREAM_TAG ?= 3a28511b46f0c2af5fae1b6ed2b0c19d7913cee3
 # Wed Jun 26 16:30:45 2013 +0100
--
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 Mon Jan 11 14:22:08 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 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 1aIdMG-0006V1-0I; Mon, 11 Jan 2016 14:22: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 1aIdME-0006Uv-Fk
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 14:22:06 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	21/D9-28221-D8AB3965; Mon, 11 Jan 2016 14:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1452522124!15997600!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57966 invoked from network); 11 Jan 2016 14:22:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 14:22:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIdMQ-00007x-LM
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 14:22:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIdMB-0006FR-HB
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 14:22:03 +0000
Date: Mon, 11 Jan 2016 14:22:03 +0000
Message-Id: <E1aIdMB-0006FR-HB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.6] xen/blkif: Avoid double
	access to src->nr_segments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fdd64c7720b98af20c9e63ae04b868d06341bfdc
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:09:58 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:28:42 2015 +0000

    xen/blkif: Avoid double access to src->nr_segments
    
    src is stored in shared memory and src->nr_segments is dereferenced
    twice at the end of the function.  If a compiler decides to compile this
    into two separate memory accesses then the size limitation could be
    bypassed.
    
    Fix it by removing the double access to src->nr_segments.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/block/xen_blkif.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/block/xen_blkif.h b/hw/block/xen_blkif.h
index 711b692..c68487cb 100644
--- a/hw/block/xen_blkif.h
+++ b/hw/block/xen_blkif.h
@@ -85,8 +85,10 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
 		d->nr_sectors = s->nr_sectors;
 		return;
 	}
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
@@ -106,8 +108,10 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
 		d->nr_sectors = s->nr_sectors;
 		return;
 	}
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 14:22:08 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 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 1aIdMG-0006V1-0I; Mon, 11 Jan 2016 14:22: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 1aIdME-0006Uv-Fk
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 14:22:06 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	21/D9-28221-D8AB3965; Mon, 11 Jan 2016 14:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1452522124!15997600!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57966 invoked from network); 11 Jan 2016 14:22:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 14:22:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIdMQ-00007x-LM
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 14:22:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIdMB-0006FR-HB
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 14:22:03 +0000
Date: Mon, 11 Jan 2016 14:22:03 +0000
Message-Id: <E1aIdMB-0006FR-HB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.6] xen/blkif: Avoid double
	access to src->nr_segments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fdd64c7720b98af20c9e63ae04b868d06341bfdc
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:09:58 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:28:42 2015 +0000

    xen/blkif: Avoid double access to src->nr_segments
    
    src is stored in shared memory and src->nr_segments is dereferenced
    twice at the end of the function.  If a compiler decides to compile this
    into two separate memory accesses then the size limitation could be
    bypassed.
    
    Fix it by removing the double access to src->nr_segments.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/block/xen_blkif.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/block/xen_blkif.h b/hw/block/xen_blkif.h
index 711b692..c68487cb 100644
--- a/hw/block/xen_blkif.h
+++ b/hw/block/xen_blkif.h
@@ -85,8 +85,10 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
 		d->nr_sectors = s->nr_sectors;
 		return;
 	}
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
@@ -106,8 +108,10 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
 		d->nr_sectors = s->nr_sectors;
 		return;
 	}
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 14:22:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 14: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 1aIdMQ-0006WN-3k; Mon, 11 Jan 2016 14: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 1aIdMP-0006W9-37
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 14:22:17 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	77/9B-03066-89AB3965; Mon, 11 Jan 2016 14:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1452522134!14802784!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29311 invoked from network); 11 Jan 2016 14:22:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 14:22:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIdMa-000085-W5
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 14:22:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIdMM-0006Fz-1p
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 14:22:14 +0000
Date: Mon, 11 Jan 2016 14:22:14 +0000
Message-Id: <E1aIdMM-0006Fz-1p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.6] xenfb: avoid reading twice
	the same fields from the shared page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9e304f572ac98265f5e7433b6490077962acda97
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:10:09 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:28:46 2015 +0000

    xenfb: avoid reading twice the same fields from the shared page
    
    Reading twice the same field could give the guest an attack of
    opportunity. In the case of event->type, gcc could compile the switch
    statement into a jump table, effectively ending up reading the type
    field multiple times.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/display/xenfb.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 8a61e95..7baacbe 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -779,18 +779,20 @@ static void xenfb_invalidate(void *opaque)
 
 static void xenfb_handle_events(struct XenFB *xenfb)
 {
-    uint32_t prod, cons;
+    uint32_t prod, cons, out_cons;
     struct xenfb_page *page = xenfb->c.page;
 
     prod = page->out_prod;
-    if (prod == page->out_cons)
+    out_cons = page->out_cons;
+    if (prod == out_cons)
 	return;
     xen_rmb();		/* ensure we see ring contents up to prod */
-    for (cons = page->out_cons; cons != prod; cons++) {
+    for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
+        uint8_t type = event->type;
 	int x, y, w, h;
 
-	switch (event->type) {
+	switch (type) {
 	case XENFB_TYPE_UPDATE:
 	    if (xenfb->up_count == UP_QUEUE)
 		xenfb->up_fullscreen = 1;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Mon Jan 11 14:22:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 Jan 2016 14: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 1aIdMQ-0006WN-3k; Mon, 11 Jan 2016 14: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 1aIdMP-0006W9-37
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 14:22:17 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	77/9B-03066-89AB3965; Mon, 11 Jan 2016 14:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1452522134!14802784!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29311 invoked from network); 11 Jan 2016 14:22:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Jan 2016 14:22:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIdMa-000085-W5
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 14:22:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aIdMM-0006Fz-1p
	for xen-changelog@lists.xensource.com; Mon, 11 Jan 2016 14:22:14 +0000
Date: Mon, 11 Jan 2016 14:22:14 +0000
Message-Id: <E1aIdMM-0006Fz-1p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.6] xenfb: avoid reading twice
	the same fields from the shared page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9e304f572ac98265f5e7433b6490077962acda97
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:10:09 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:28:46 2015 +0000

    xenfb: avoid reading twice the same fields from the shared page
    
    Reading twice the same field could give the guest an attack of
    opportunity. In the case of event->type, gcc could compile the switch
    statement into a jump table, effectively ending up reading the type
    field multiple times.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/display/xenfb.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 8a61e95..7baacbe 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -779,18 +779,20 @@ static void xenfb_invalidate(void *opaque)
 
 static void xenfb_handle_events(struct XenFB *xenfb)
 {
-    uint32_t prod, cons;
+    uint32_t prod, cons, out_cons;
     struct xenfb_page *page = xenfb->c.page;
 
     prod = page->out_prod;
-    if (prod == page->out_cons)
+    out_cons = page->out_cons;
+    if (prod == out_cons)
 	return;
     xen_rmb();		/* ensure we see ring contents up to prod */
-    for (cons = page->out_cons; cons != prod; cons++) {
+    for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
+        uint8_t type = event->type;
 	int x, y, w, h;
 
-	switch (event->type) {
+	switch (type) {
 	case XENFB_TYPE_UPDATE:
 	    if (xenfb->up_count == UP_QUEUE)
 		xenfb->up_fullscreen = 1;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:00:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:00:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ1Md-0003j4-La; Tue, 12 Jan 2016 16:00: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 1aJ1Mc-0003iz-B4
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:00:06 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	EF/39-24450-50325965; Tue, 12 Jan 2016 16:00:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1452614404!15408674!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46915 invoked from network); 12 Jan 2016 16:00:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:00:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ1Mr-00061m-7L
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ1MZ-0002xI-In
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:00:03 +0000
Date: Tue, 12 Jan 2016 16:00:03 +0000
Message-Id: <E1aJ1MZ-0002xI-In@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.4] xen/blkif: Avoid double
	access to src->nr_segments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 75421c82154542e6855bbb98e6cccaacb4b8904c
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:44:58 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:44:58 2015 +0000

    xen/blkif: Avoid double access to src->nr_segments
    
    src is stored in shared memory and src->nr_segments is dereferenced
    twice at the end of the function.  If a compiler decides to compile this
    into two separate memory accesses then the size limitation could be
    bypassed.
    
    Fix it by removing the double access to src->nr_segments.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/block/xen_blkif.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/block/xen_blkif.h b/hw/block/xen_blkif.h
index c0f4136..24188f4 100644
--- a/hw/block/xen_blkif.h
+++ b/hw/block/xen_blkif.h
@@ -79,8 +79,10 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
 	dst->handle = src->handle;
 	dst->id = src->id;
 	dst->sector_number = src->sector_number;
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
@@ -94,8 +96,10 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
 	dst->handle = src->handle;
 	dst->id = src->id;
 	dst->sector_number = src->sector_number;
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:00:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:00:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ1Md-0003j4-La; Tue, 12 Jan 2016 16:00: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 1aJ1Mc-0003iz-B4
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:00:06 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	EF/39-24450-50325965; Tue, 12 Jan 2016 16:00:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1452614404!15408674!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46915 invoked from network); 12 Jan 2016 16:00:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:00:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ1Mr-00061m-7L
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ1MZ-0002xI-In
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:00:03 +0000
Date: Tue, 12 Jan 2016 16:00:03 +0000
Message-Id: <E1aJ1MZ-0002xI-In@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.4] xen/blkif: Avoid double
	access to src->nr_segments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 75421c82154542e6855bbb98e6cccaacb4b8904c
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:44:58 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:44:58 2015 +0000

    xen/blkif: Avoid double access to src->nr_segments
    
    src is stored in shared memory and src->nr_segments is dereferenced
    twice at the end of the function.  If a compiler decides to compile this
    into two separate memory accesses then the size limitation could be
    bypassed.
    
    Fix it by removing the double access to src->nr_segments.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/block/xen_blkif.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/block/xen_blkif.h b/hw/block/xen_blkif.h
index c0f4136..24188f4 100644
--- a/hw/block/xen_blkif.h
+++ b/hw/block/xen_blkif.h
@@ -79,8 +79,10 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
 	dst->handle = src->handle;
 	dst->id = src->id;
 	dst->sector_number = src->sector_number;
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
@@ -94,8 +96,10 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
 	dst->handle = src->handle;
 	dst->id = src->id;
 	dst->sector_number = src->sector_number;
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:00:17 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:00: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 1aJ1Mn-0003rO-Oy; Tue, 12 Jan 2016 16:00: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 1aJ1Mm-0003rG-NN
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:00:16 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	8B/68-25435-F0325965; Tue, 12 Jan 2016 16:00:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1452614414!12572850!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1758 invoked from network); 12 Jan 2016 16:00:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:00:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ1N1-00061q-HX
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:00:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ1Mk-0002y2-0o
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:00:14 +0000
Date: Tue, 12 Jan 2016 16:00:14 +0000
Message-Id: <E1aJ1Mk-0002y2-0o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.4] xenfb: avoid reading twice
	the same fields from the shared page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2264b0c66075cc34c252a1386f019f8be6240890
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:45:14 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:45:14 2015 +0000

    xenfb: avoid reading twice the same fields from the shared page
    
    Reading twice the same field could give the guest an attack of
    opportunity. In the case of event->type, gcc could compile the switch
    statement into a jump table, effectively ending up reading the type
    field multiple times.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/display/xenfb.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index f0333a0..8ccdf44 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -775,18 +775,20 @@ static void xenfb_invalidate(void *opaque)
 
 static void xenfb_handle_events(struct XenFB *xenfb)
 {
-    uint32_t prod, cons;
+    uint32_t prod, cons, out_cons;
     struct xenfb_page *page = xenfb->c.page;
 
     prod = page->out_prod;
-    if (prod == page->out_cons)
+    out_cons = page->out_cons;
+    if (prod == out_cons)
 	return;
     xen_rmb();		/* ensure we see ring contents up to prod */
-    for (cons = page->out_cons; cons != prod; cons++) {
+    for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
+        uint8_t type = event->type;
 	int x, y, w, h;
 
-	switch (event->type) {
+	switch (type) {
 	case XENFB_TYPE_UPDATE:
 	    if (xenfb->up_count == UP_QUEUE)
 		xenfb->up_fullscreen = 1;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:00:17 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:00: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 1aJ1Mn-0003rO-Oy; Tue, 12 Jan 2016 16:00: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 1aJ1Mm-0003rG-NN
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:00:16 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	8B/68-25435-F0325965; Tue, 12 Jan 2016 16:00:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1452614414!12572850!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1758 invoked from network); 12 Jan 2016 16:00:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:00:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ1N1-00061q-HX
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:00:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ1Mk-0002y2-0o
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:00:14 +0000
Date: Tue, 12 Jan 2016 16:00:14 +0000
Message-Id: <E1aJ1Mk-0002y2-0o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.4] xenfb: avoid reading twice
	the same fields from the shared page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2264b0c66075cc34c252a1386f019f8be6240890
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:45:14 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:45:14 2015 +0000

    xenfb: avoid reading twice the same fields from the shared page
    
    Reading twice the same field could give the guest an attack of
    opportunity. In the case of event->type, gcc could compile the switch
    statement into a jump table, effectively ending up reading the type
    field multiple times.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/display/xenfb.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index f0333a0..8ccdf44 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -775,18 +775,20 @@ static void xenfb_invalidate(void *opaque)
 
 static void xenfb_handle_events(struct XenFB *xenfb)
 {
-    uint32_t prod, cons;
+    uint32_t prod, cons, out_cons;
     struct xenfb_page *page = xenfb->c.page;
 
     prod = page->out_prod;
-    if (prod == page->out_cons)
+    out_cons = page->out_cons;
+    if (prod == out_cons)
 	return;
     xen_rmb();		/* ensure we see ring contents up to prod */
-    for (cons = page->out_cons; cons != prod; cons++) {
+    for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
+        uint8_t type = event->type;
 	int x, y, w, h;
 
-	switch (event->type) {
+	switch (type) {
 	case XENFB_TYPE_UPDATE:
 	    if (xenfb->up_count == UP_QUEUE)
 		xenfb->up_fullscreen = 1;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:55:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:55: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 1aJ2Dt-0007Ip-KX; Tue, 12 Jan 2016 16:55: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 1aJ2Ds-0007Ii-F2
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:08 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	3D/D5-09834-BEF25965; Tue, 12 Jan 2016 16:55:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1452617706!16035174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 36085 invoked from network); 12 Jan 2016 16:55:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:55:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2E7-00077u-C6
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Dp-0005M1-CQ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:05 +0000
Date: Tue, 12 Jan 2016 16:55:05 +0000
Message-Id: <E1aJ2Dp-0005M1-CQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mmuext: unify okay/rc error
	handling in do_mmuext_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0d82868e1f45a4219954433a24f86004308f5c57
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 22 10:10:44 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 22 10:10:44 2015 +0100

    x86/mmuext: unify okay/rc error handling in do_mmuext_op()
    
    c/s 506db90 "x86/HVM: merge HVM and PVH hypercall tables" introduced a path
    whereby 'okay' was used uninitialised, with broke compilation on CentOS 7.
    
    Splitting the error handling like this is fragile and unnecessary.  Drop the
    okay variable entirely and just use rc directly, substituting rc = -EINVAL/0
    for okay = 0/1.
    
    In addition, two error messages are updated to print rc, and some stray
    whitespace is dropped.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    
    Make setting of rc happen consistently after MEM_LOG(), if that is being
    used.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c |   65 ++++++++++++++++++++++++----------------------------
 1 files changed, 30 insertions(+), 35 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 717546a..3056869 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2974,7 +2974,7 @@ long do_mmuext_op(
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
     struct domain *pg_owner;
-    int okay, rc = put_old_guest_table(curr);
+    int rc = put_old_guest_table(curr);
 
     if ( unlikely(rc) )
     {
@@ -3053,7 +3053,7 @@ long do_mmuext_op(
             }
         }
 
-        okay = 1;
+        rc = 0;
 
         switch ( op.cmd )
         {
@@ -3087,33 +3087,32 @@ long do_mmuext_op(
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
             if ( unlikely(!page) )
             {
-                okay = 0;
+                rc = -EINVAL;
                 break;
             }
 
             rc = get_page_type_preemptible(page, type);
-            okay = !rc;
-            if ( unlikely(!okay) )
+            if ( unlikely(rc) )
             {
                 if ( rc == -EINTR )
                     rc = -ERESTART;
                 else if ( rc != -ERESTART )
-                    MEM_LOG("Error while pinning mfn %lx", page_to_mfn(page));
+                    MEM_LOG("Error %d while pinning mfn %lx",
+                            rc, page_to_mfn(page));
                 if ( page != curr->arch.old_guest_table )
                     put_page(page);
                 break;
             }
 
-            if ( (rc = xsm_memory_pin_page(XSM_HOOK, d, pg_owner, page)) != 0 )
-                okay = 0;
-            else if ( unlikely(test_and_set_bit(_PGT_pinned,
-                                                &page->u.inuse.type_info)) )
+            rc = xsm_memory_pin_page(XSM_HOOK, d, pg_owner, page);
+            if ( !rc && unlikely(test_and_set_bit(_PGT_pinned,
+                                                  &page->u.inuse.type_info)) )
             {
                 MEM_LOG("Mfn %lx already pinned", page_to_mfn(page));
-                okay = 0;
+                rc = -EINVAL;
             }
 
-            if ( unlikely(!okay) )
+            if ( unlikely(rc) )
                 goto pin_drop;
 
             /* A page is dirtied when its pin status is set. */
@@ -3150,16 +3149,16 @@ long do_mmuext_op(
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
             if ( unlikely(!page) )
             {
-                okay = 0;
                 MEM_LOG("Mfn %lx bad domain", op.arg1.mfn);
+                rc = -EINVAL;
                 break;
             }
 
             if ( !test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
             {
-                okay = 0;
                 put_page(page);
                 MEM_LOG("Mfn %lx not pinned", op.arg1.mfn);
+                rc = -EINVAL;
                 break;
             }
 
@@ -3212,20 +3211,18 @@ long do_mmuext_op(
             if ( op.arg1.mfn != 0 )
             {
                 if ( paging_mode_refcounts(d) )
-                    okay = get_page_from_pagenr(op.arg1.mfn, d);
+                    rc = get_page_from_pagenr(op.arg1.mfn, d) ? 0 : -EINVAL;
                 else
-                {
                     rc = get_page_and_type_from_pagenr(
                         op.arg1.mfn, PGT_root_page_table, d, 0, 1);
-                    okay = !rc;
-                }
-                if ( unlikely(!okay) )
+
+                if ( unlikely(rc) )
                 {
                     if ( rc == -EINTR )
                         rc = -ERESTART;
                     else if ( rc != -ERESTART )
-                        MEM_LOG("Error while installing new mfn %lx",
-                                op.arg1.mfn);
+                        MEM_LOG("Error %d while installing new mfn %lx",
+                                rc, op.arg1.mfn);
                     break;
                 }
                 if ( VM_ASSIST(d, m2p_strict) && !paging_mode_refcounts(d) )
@@ -3248,7 +3245,6 @@ long do_mmuext_op(
                         /* fallthrough */
                     case -ERESTART:
                         curr->arch.old_guest_table = page;
-                        okay = 0;
                         break;
                     default:
                         BUG_ON(rc);
@@ -3258,14 +3254,14 @@ long do_mmuext_op(
 
             break;
         }
-        
+
         case MMUEXT_TLB_FLUSH_LOCAL:
             if ( likely(d == pg_owner) )
                 flush_tlb_local();
             else
                 rc = -EPERM;
             break;
-    
+
         case MMUEXT_INVLPG_LOCAL:
             if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
@@ -3342,7 +3338,7 @@ long do_mmuext_op(
             else
             {
                 MEM_LOG("Non-physdev domain tried to FLUSH_CACHE_GLOBAL");
-                okay = 0;
+                rc = -EINVAL;
             }
             break;
 
@@ -3356,13 +3352,13 @@ long do_mmuext_op(
             else if ( paging_mode_external(d) )
             {
                 MEM_LOG("ignoring SET_LDT hypercall from external domain");
-                okay = 0;
+                rc = -EINVAL;
             }
             else if ( ((ptr & (PAGE_SIZE - 1)) != 0) || !__addr_ok(ptr) ||
                       (ents > 8192) )
             {
-                okay = 0;
                 MEM_LOG("Bad args to SET_LDT: ptr=%lx, ents=%lx", ptr, ents);
+                rc = -EINVAL;
             }
             else if ( (curr->arch.pv_vcpu.ldt_ents != ents) ||
                       (curr->arch.pv_vcpu.ldt_base != ptr) )
@@ -3385,7 +3381,7 @@ long do_mmuext_op(
                 if ( page )
                     put_page(page);
                 MEM_LOG("Error while clearing mfn %lx", op.arg1.mfn);
-                okay = 0;
+                rc = -EINVAL;
                 break;
             }
 
@@ -3406,15 +3402,16 @@ long do_mmuext_op(
                                          P2M_ALLOC);
             if ( unlikely(!src_page) )
             {
-                okay = 0;
                 MEM_LOG("Error while copying from mfn %lx", op.arg2.src_mfn);
+                rc = -EINVAL;
                 break;
             }
 
             dst_page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL,
                                          P2M_ALLOC);
-            okay = (dst_page && get_page_type(dst_page, PGT_writable_page));
-            if ( unlikely(!okay) )
+            rc = (dst_page &&
+                  get_page_type(dst_page, PGT_writable_page)) ? 0 : -EINVAL;
+            if ( unlikely(rc) )
             {
                 put_page(src_page);
                 if ( dst_page )
@@ -3443,7 +3440,7 @@ long do_mmuext_op(
             else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
             {
                 MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
+                rc = -EINVAL;
             }
             else if ( !opt_allow_superpage )
             {
@@ -3464,7 +3461,7 @@ long do_mmuext_op(
             else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
             {
                 MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
+                rc = -EINVAL;
             }
             else if ( !opt_allow_superpage )
             {
@@ -3483,8 +3480,6 @@ long do_mmuext_op(
         }
 
  done:
-        if ( unlikely(!okay) && !rc )
-            rc = -EINVAL;
         if ( unlikely(rc) )
             break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:55:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:55: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 1aJ2Dt-0007Ip-KX; Tue, 12 Jan 2016 16:55: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 1aJ2Ds-0007Ii-F2
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:08 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	3D/D5-09834-BEF25965; Tue, 12 Jan 2016 16:55:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1452617706!16035174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 36085 invoked from network); 12 Jan 2016 16:55:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:55:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2E7-00077u-C6
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Dp-0005M1-CQ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:05 +0000
Date: Tue, 12 Jan 2016 16:55:05 +0000
Message-Id: <E1aJ2Dp-0005M1-CQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mmuext: unify okay/rc error
	handling in do_mmuext_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0d82868e1f45a4219954433a24f86004308f5c57
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 22 10:10:44 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 22 10:10:44 2015 +0100

    x86/mmuext: unify okay/rc error handling in do_mmuext_op()
    
    c/s 506db90 "x86/HVM: merge HVM and PVH hypercall tables" introduced a path
    whereby 'okay' was used uninitialised, with broke compilation on CentOS 7.
    
    Splitting the error handling like this is fragile and unnecessary.  Drop the
    okay variable entirely and just use rc directly, substituting rc = -EINVAL/0
    for okay = 0/1.
    
    In addition, two error messages are updated to print rc, and some stray
    whitespace is dropped.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    
    Make setting of rc happen consistently after MEM_LOG(), if that is being
    used.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c |   65 ++++++++++++++++++++++++----------------------------
 1 files changed, 30 insertions(+), 35 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 717546a..3056869 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2974,7 +2974,7 @@ long do_mmuext_op(
     struct vcpu *curr = current;
     struct domain *d = curr->domain;
     struct domain *pg_owner;
-    int okay, rc = put_old_guest_table(curr);
+    int rc = put_old_guest_table(curr);
 
     if ( unlikely(rc) )
     {
@@ -3053,7 +3053,7 @@ long do_mmuext_op(
             }
         }
 
-        okay = 1;
+        rc = 0;
 
         switch ( op.cmd )
         {
@@ -3087,33 +3087,32 @@ long do_mmuext_op(
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
             if ( unlikely(!page) )
             {
-                okay = 0;
+                rc = -EINVAL;
                 break;
             }
 
             rc = get_page_type_preemptible(page, type);
-            okay = !rc;
-            if ( unlikely(!okay) )
+            if ( unlikely(rc) )
             {
                 if ( rc == -EINTR )
                     rc = -ERESTART;
                 else if ( rc != -ERESTART )
-                    MEM_LOG("Error while pinning mfn %lx", page_to_mfn(page));
+                    MEM_LOG("Error %d while pinning mfn %lx",
+                            rc, page_to_mfn(page));
                 if ( page != curr->arch.old_guest_table )
                     put_page(page);
                 break;
             }
 
-            if ( (rc = xsm_memory_pin_page(XSM_HOOK, d, pg_owner, page)) != 0 )
-                okay = 0;
-            else if ( unlikely(test_and_set_bit(_PGT_pinned,
-                                                &page->u.inuse.type_info)) )
+            rc = xsm_memory_pin_page(XSM_HOOK, d, pg_owner, page);
+            if ( !rc && unlikely(test_and_set_bit(_PGT_pinned,
+                                                  &page->u.inuse.type_info)) )
             {
                 MEM_LOG("Mfn %lx already pinned", page_to_mfn(page));
-                okay = 0;
+                rc = -EINVAL;
             }
 
-            if ( unlikely(!okay) )
+            if ( unlikely(rc) )
                 goto pin_drop;
 
             /* A page is dirtied when its pin status is set. */
@@ -3150,16 +3149,16 @@ long do_mmuext_op(
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
             if ( unlikely(!page) )
             {
-                okay = 0;
                 MEM_LOG("Mfn %lx bad domain", op.arg1.mfn);
+                rc = -EINVAL;
                 break;
             }
 
             if ( !test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
             {
-                okay = 0;
                 put_page(page);
                 MEM_LOG("Mfn %lx not pinned", op.arg1.mfn);
+                rc = -EINVAL;
                 break;
             }
 
@@ -3212,20 +3211,18 @@ long do_mmuext_op(
             if ( op.arg1.mfn != 0 )
             {
                 if ( paging_mode_refcounts(d) )
-                    okay = get_page_from_pagenr(op.arg1.mfn, d);
+                    rc = get_page_from_pagenr(op.arg1.mfn, d) ? 0 : -EINVAL;
                 else
-                {
                     rc = get_page_and_type_from_pagenr(
                         op.arg1.mfn, PGT_root_page_table, d, 0, 1);
-                    okay = !rc;
-                }
-                if ( unlikely(!okay) )
+
+                if ( unlikely(rc) )
                 {
                     if ( rc == -EINTR )
                         rc = -ERESTART;
                     else if ( rc != -ERESTART )
-                        MEM_LOG("Error while installing new mfn %lx",
-                                op.arg1.mfn);
+                        MEM_LOG("Error %d while installing new mfn %lx",
+                                rc, op.arg1.mfn);
                     break;
                 }
                 if ( VM_ASSIST(d, m2p_strict) && !paging_mode_refcounts(d) )
@@ -3248,7 +3245,6 @@ long do_mmuext_op(
                         /* fallthrough */
                     case -ERESTART:
                         curr->arch.old_guest_table = page;
-                        okay = 0;
                         break;
                     default:
                         BUG_ON(rc);
@@ -3258,14 +3254,14 @@ long do_mmuext_op(
 
             break;
         }
-        
+
         case MMUEXT_TLB_FLUSH_LOCAL:
             if ( likely(d == pg_owner) )
                 flush_tlb_local();
             else
                 rc = -EPERM;
             break;
-    
+
         case MMUEXT_INVLPG_LOCAL:
             if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
@@ -3342,7 +3338,7 @@ long do_mmuext_op(
             else
             {
                 MEM_LOG("Non-physdev domain tried to FLUSH_CACHE_GLOBAL");
-                okay = 0;
+                rc = -EINVAL;
             }
             break;
 
@@ -3356,13 +3352,13 @@ long do_mmuext_op(
             else if ( paging_mode_external(d) )
             {
                 MEM_LOG("ignoring SET_LDT hypercall from external domain");
-                okay = 0;
+                rc = -EINVAL;
             }
             else if ( ((ptr & (PAGE_SIZE - 1)) != 0) || !__addr_ok(ptr) ||
                       (ents > 8192) )
             {
-                okay = 0;
                 MEM_LOG("Bad args to SET_LDT: ptr=%lx, ents=%lx", ptr, ents);
+                rc = -EINVAL;
             }
             else if ( (curr->arch.pv_vcpu.ldt_ents != ents) ||
                       (curr->arch.pv_vcpu.ldt_base != ptr) )
@@ -3385,7 +3381,7 @@ long do_mmuext_op(
                 if ( page )
                     put_page(page);
                 MEM_LOG("Error while clearing mfn %lx", op.arg1.mfn);
-                okay = 0;
+                rc = -EINVAL;
                 break;
             }
 
@@ -3406,15 +3402,16 @@ long do_mmuext_op(
                                          P2M_ALLOC);
             if ( unlikely(!src_page) )
             {
-                okay = 0;
                 MEM_LOG("Error while copying from mfn %lx", op.arg2.src_mfn);
+                rc = -EINVAL;
                 break;
             }
 
             dst_page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL,
                                          P2M_ALLOC);
-            okay = (dst_page && get_page_type(dst_page, PGT_writable_page));
-            if ( unlikely(!okay) )
+            rc = (dst_page &&
+                  get_page_type(dst_page, PGT_writable_page)) ? 0 : -EINVAL;
+            if ( unlikely(rc) )
             {
                 put_page(src_page);
                 if ( dst_page )
@@ -3443,7 +3440,7 @@ long do_mmuext_op(
             else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
             {
                 MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
+                rc = -EINVAL;
             }
             else if ( !opt_allow_superpage )
             {
@@ -3464,7 +3461,7 @@ long do_mmuext_op(
             else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
             {
                 MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
+                rc = -EINVAL;
             }
             else if ( !opt_allow_superpage )
             {
@@ -3483,8 +3480,6 @@ long do_mmuext_op(
         }
 
  done:
-        if ( unlikely(!okay) && !rc )
-            rc = -EINVAL;
         if ( unlikely(rc) )
             break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:55:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:55:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2E4-0007Jt-OQ; Tue, 12 Jan 2016 16:55: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 1aJ2E3-0007Jk-Bd
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:19 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	E7/92-08977-6FF25965; Tue, 12 Jan 2016 16:55:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1452617716!9819305!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58948 invoked from network); 12 Jan 2016 16:55:17 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:55:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2EH-00078l-Uc
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2E0-0005Mn-1T
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:16 +0000
Date: Tue, 12 Jan 2016 16:55:16 +0000
Message-Id: <E1aJ2E0-0005Mn-1T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: unhide messages needed for
	diagnosing firmware issues
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 009298d7baf6b8a9baed48121ff181e24abf6224
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 22 10:11:44 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 22 10:11:44 2015 +0100

    VT-d: unhide messages needed for diagnosing firmware issues
    
    Undue use of dprintk() lead to many messages useful in diagnosing
    issues in the field now being hidden in non-debug (i.e. production)
    builds. Re-surface them, namely when init-time only and/or already
    guarded by iommu_{verbose,debug} conditionals. Switch from using
    iommu_verbose to iommu_debug in a couple of runtime cases.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Feng Wu <feng.wu@intel.com>
---
 xen/drivers/passthrough/vtd/dmar.c  |  121 ++++++++++++++++-------------------
 xen/drivers/passthrough/vtd/iommu.c |   74 ++++++++++-----------
 2 files changed, 90 insertions(+), 105 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 7cad593..08c1d2d 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -298,7 +298,7 @@ static int __init scope_device_count(const void *start, const void *end)
         scope = start;
         if ( scope->length < MIN_SCOPE_LEN )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX, "Invalid device scope.\n");
+            printk(XENLOG_WARNING VTDPREFIX "Invalid device scope\n");
             return -EINVAL;
         }
 
@@ -360,18 +360,18 @@ static int __init acpi_parse_dev_scope(
             sub_bus = pci_conf_read8(seg, bus, path->dev, path->fn,
                                      PCI_SUBORDINATE_BUS);
             if ( iommu_verbose )
-                dprintk(VTDPREFIX,
-                        " bridge: %04x:%02x:%02x.%u start=%x sec=%x sub=%x\n",
-                        seg, bus, path->dev, path->fn,
-                        acpi_scope->bus, sec_bus, sub_bus);
+                printk(VTDPREFIX
+                       " bridge: %04x:%02x:%02x.%u start=%x sec=%x sub=%x\n",
+                       seg, bus, path->dev, path->fn,
+                       acpi_scope->bus, sec_bus, sub_bus);
 
             dmar_scope_add_buses(scope, sec_bus, sub_bus);
             break;
 
         case ACPI_DMAR_SCOPE_TYPE_HPET:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
-                        seg, bus, path->dev, path->fn);
+                printk(VTDPREFIX " MSI HPET: %04x:%02x:%02x.%u\n",
+                       seg, bus, path->dev, path->fn);
 
             if ( drhd )
             {
@@ -392,8 +392,8 @@ static int __init acpi_parse_dev_scope(
 
         case ACPI_DMAR_SCOPE_TYPE_ENDPOINT:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",
-                        seg, bus, path->dev, path->fn);
+                printk(VTDPREFIX " endpoint: %04x:%02x:%02x.%u\n",
+                       seg, bus, path->dev, path->fn);
 
             if ( drhd )
             {
@@ -406,8 +406,8 @@ static int __init acpi_parse_dev_scope(
 
         case ACPI_DMAR_SCOPE_TYPE_IOAPIC:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%u\n",
-                        seg, bus, path->dev, path->fn);
+                printk(VTDPREFIX " IOAPIC: %04x:%02x:%02x.%u\n",
+                       seg, bus, path->dev, path->fn);
 
             if ( drhd )
             {
@@ -449,9 +449,8 @@ static int __init acpi_dmar_check_length(
 {
     if ( h->length >= min_len )
         return 0;
-    dprintk(XENLOG_ERR VTDPREFIX,
-            "Invalid ACPI DMAR entry length: %#x\n",
-            h->length);
+    printk(XENLOG_ERR VTDPREFIX "Invalid ACPI DMAR entry length: %#x\n",
+           h->length);
     return -EINVAL;
 }
 
@@ -481,8 +480,7 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
     INIT_LIST_HEAD(&dmaru->ioapic_list);
     INIT_LIST_HEAD(&dmaru->hpet_list);
     if ( iommu_verbose )
-        dprintk(VTDPREFIX, "  dmaru->address = %"PRIx64"\n",
-                dmaru->address);
+        printk(VTDPREFIX "  dmaru->address = %"PRIx64"\n", dmaru->address);
 
     ret = iommu_alloc(dmaru);
     if ( ret )
@@ -496,12 +494,12 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
     if ( dmaru->include_all )
     {
         if ( iommu_verbose )
-            dprintk(VTDPREFIX, "  flags: INCLUDE_ALL\n");
+            printk(VTDPREFIX "  flags: INCLUDE_ALL\n");
         /* Only allow one INCLUDE_ALL */
         if ( drhd->segment == 0 && include_all )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                    "Only one INCLUDE_ALL device scope is allowed\n");
+            printk(XENLOG_WARNING VTDPREFIX
+                   "Only one INCLUDE_ALL device scope is allowed\n");
             ret = -EINVAL;
         }
         if ( drhd->segment == 0 )
@@ -538,9 +536,9 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
 
             if ( !pci_device_detect(drhd->segment, b, d, f) )
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                        " Non-existent device (%04x:%02x:%02x.%u) is reported"
-                        " in this DRHD's scope!\n", drhd->segment, b, d, f);
+                printk(XENLOG_WARNING VTDPREFIX
+                       " Non-existent device (%04x:%02x:%02x.%u) in this DRHD's scope!\n",
+                       drhd->segment, b, d, f);
                 invalid_cnt++;
             }
         }
@@ -550,9 +548,8 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
             if ( iommu_workaround_bios_bug &&
                  invalid_cnt == dmaru->scope.devices_cnt )
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                    "  Workaround BIOS bug: ignore the DRHD due to all "
-                    "devices under its scope are not PCI discoverable!\n");
+                printk(XENLOG_WARNING VTDPREFIX
+                       "  Workaround BIOS bug: ignoring DRHD (no devices in its scope are PCI discoverable)\n");
 
                 scope_devices_free(&dmaru->scope);
                 iommu_free(dmaru);
@@ -560,11 +557,10 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
             }
             else
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                    "  The DRHD is invalid due to there are devices under "
-                    "its scope are not PCI discoverable! Pls try option "
-                    "iommu=force or iommu=workaround_bios_bug if you "
-                    "really want VT-d\n");
+                printk(XENLOG_WARNING VTDPREFIX
+                       "  DRHD is invalid (some devices in its scope are not PCI discoverable)\n");
+                printk(XENLOG_WARNING VTDPREFIX
+                       "  Try \"iommu=force\" or \"iommu=workaround_bios_bug\" if you really want VT-d\n");
                 ret = -EINVAL;
             }
         }
@@ -613,10 +609,9 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
     if ( (!page_is_ram_type(paddr_to_pfn(base_addr), RAM_TYPE_RESERVED)) ||
          (!page_is_ram_type(paddr_to_pfn(end_addr), RAM_TYPE_RESERVED)) )
     {
-        dprintk(XENLOG_WARNING VTDPREFIX,
-                "  RMRR address range not in reserved memory "
-                "base = %"PRIx64" end = %"PRIx64"; "
-                "iommu_inclusive_mapping=1 parameter may be needed.\n",
+        printk(XENLOG_WARNING VTDPREFIX
+               "  RMRR address range %"PRIx64"..%"PRIx64" not in reserved memory;"
+               " need \"iommu_inclusive_mapping=1\"?\n",
                 base_addr, end_addr);
     }
 
@@ -653,11 +648,10 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
 
             if ( !pci_device_detect(rmrr->segment, b, d, f) )
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                        " Non-existent device (%04x:%02x:%02x.%u) is reported"
-                        " in RMRR (%"PRIx64", %"PRIx64")'s scope!\n",
-                        rmrr->segment, b, d, f,
-                        rmrru->base_address, rmrru->end_address);
+                printk(XENLOG_WARNING VTDPREFIX
+                       " Non-existent device (%04x:%02x:%02x.%u) reported in RMRR (%"PRIx64", %"PRIx64")'s scope!\n",
+                       rmrr->segment, b, d, f,
+                       rmrru->base_address, rmrru->end_address);
                 ignore = 1;
             }
             else
@@ -669,18 +663,17 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
 
         if ( ignore )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                "  Ignore the RMRR (%"PRIx64", %"PRIx64") due to "
-                "devices under its scope are not PCI discoverable!\n",
-                rmrru->base_address, rmrru->end_address);
+            printk(XENLOG_WARNING VTDPREFIX
+                   "  Ignore RMRR (%"PRIx64", %"PRIx64") (some devices in its scope are not PCI discoverable)\n",
+                   rmrru->base_address, rmrru->end_address);
             scope_devices_free(&rmrru->scope);
             xfree(rmrru);
         }
         else if ( base_addr > end_addr )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                "  The RMRR (%"PRIx64", %"PRIx64") is incorrect!\n",
-                rmrru->base_address, rmrru->end_address);
+            printk(XENLOG_WARNING VTDPREFIX
+                   "  RMRR (%"PRIx64", %"PRIx64") is incorrect\n",
+                   rmrru->base_address, rmrru->end_address);
             scope_devices_free(&rmrru->scope);
             xfree(rmrru);
             ret = -EFAULT;
@@ -688,10 +681,9 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
         else
         {
             if ( iommu_verbose )
-                dprintk(VTDPREFIX,
-                        "  RMRR region: base_addr %"PRIx64
-                        " end_address %"PRIx64"\n",
-                        rmrru->base_address, rmrru->end_address);
+                printk(VTDPREFIX
+                       "  RMRR region: base_addr %"PRIx64" end_address %"PRIx64"\n",
+                       rmrru->base_address, rmrru->end_address);
             acpi_register_rmrr_unit(rmrru);
         }
     }
@@ -719,8 +711,7 @@ acpi_parse_one_atsr(struct acpi_dmar_header *header)
     atsru->segment = atsr->segment;
     atsru->all_ports = atsr->flags & ACPI_DMAR_ALL_PORTS;
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
-                "  atsru->all_ports: %x\n", atsru->all_ports);
+        printk(VTDPREFIX "  atsru->all_ports: %x\n", atsru->all_ports);
     if ( !atsru->all_ports )
     {
         dev_scope_start = (void *)(atsr + 1);
@@ -731,12 +722,12 @@ acpi_parse_one_atsr(struct acpi_dmar_header *header)
     else
     {
         if ( iommu_verbose )
-            dprintk(VTDPREFIX, "  flags: ALL_PORTS\n");
+            printk(VTDPREFIX "  flags: ALL_PORTS\n");
         /* Only allow one ALL_PORTS */
         if ( atsr->segment == 0 && all_ports )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                    "Only one ALL_PORTS device scope is allowed\n");
+            printk(XENLOG_WARNING VTDPREFIX
+                   "Only one ALL_PORTS device scope is allowed\n");
             ret = -EINVAL;
         }
         if ( atsr->segment == 0 )
@@ -772,10 +763,9 @@ acpi_parse_one_rhsa(struct acpi_dmar_header *header)
     rhsau->proximity_domain = rhsa->proximity_domain;
     list_add_tail(&rhsau->list, &acpi_rhsa_units);
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
-                "  rhsau->address: %"PRIx64
-                " rhsau->proximity_domain: %"PRIx32"\n",
-                rhsau->address, rhsau->proximity_domain);
+        printk(VTDPREFIX
+               "  rhsau->address: %"PRIx64" rhsau->proximity_domain: %"PRIx32"\n",
+               rhsau->address, rhsau->proximity_domain);
 
     return ret;
 }
@@ -798,15 +788,14 @@ static int __init acpi_parse_dmar(struct acpi_table_header *table)
 
     if ( !dmar->width )
     {
-        dprintk(XENLOG_WARNING VTDPREFIX, "Zero: Invalid DMAR width\n");
+        printk(XENLOG_WARNING VTDPREFIX "Zero: Invalid DMAR width\n");
         ret = -EINVAL;
         goto out;
     }
 
     dmar_host_address_width = dmar->width + 1;
     if ( iommu_verbose )
-        dprintk(VTDPREFIX, "Host address width %d\n",
-                dmar_host_address_width);
+        printk(VTDPREFIX "Host address width %d\n", dmar_host_address_width);
 
     entry_header = (void *)(dmar + 1);
     while ( ((unsigned long)entry_header) <
@@ -820,22 +809,22 @@ static int __init acpi_parse_dmar(struct acpi_table_header *table)
         {
         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_DRHD:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_DRHD:\n");
             ret = acpi_parse_one_drhd(entry_header);
             break;
         case ACPI_DMAR_TYPE_RESERVED_MEMORY:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_RMRR:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_RMRR:\n");
             ret = acpi_parse_one_rmrr(entry_header);
             break;
         case ACPI_DMAR_TYPE_ATSR:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_ATSR:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_ATSR:\n");
             ret = acpi_parse_one_atsr(entry_header);
             break;
         case ACPI_DMAR_HARDWARE_AFFINITY:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_RHSA:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_RHSA:\n");
             ret = acpi_parse_one_rhsa(entry_header);
             break;
         default:
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 065f239..ec31c6b 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -713,20 +713,18 @@ static void iommu_enable_translation(struct acpi_drhd_unit *drhd)
     {
         if ( force_iommu )
             panic("BIOS did not enable IGD for VT properly, crash Xen for security purpose");
-        else
-        {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                    "BIOS did not enable IGD for VT properly.  Disabling IGD VT-d engine.\n");
-            return;
-        }
+
+        printk(XENLOG_WARNING VTDPREFIX
+               "BIOS did not enable IGD for VT properly.  Disabling IGD VT-d engine.\n");
+        return;
     }
 
     /* apply platform specific errata workarounds */
     vtd_ops_preamble_quirk(iommu);
 
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
-                "iommu_enable_translation: iommu->reg = %p\n", iommu->reg);
+        printk(VTDPREFIX "iommu_enable_translation: iommu->reg = %p\n",
+               iommu->reg);
     spin_lock_irqsave(&iommu->register_lock, flags);
     sts = dmar_readl(iommu->reg, DMAR_GSTS_REG);
     dmar_writel(iommu->reg, DMAR_GCMD_REG, sts | DMA_GCMD_TE);
@@ -1150,11 +1148,10 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
 
     if ( iommu_verbose )
     {
-        dprintk(VTDPREFIX,
-                "drhd->address = %"PRIx64" iommu->reg = %p\n",
-                drhd->address, iommu->reg);
-        dprintk(VTDPREFIX,
-                "cap = %"PRIx64" ecap = %"PRIx64"\n", iommu->cap, iommu->ecap);
+        printk(VTDPREFIX "drhd->address = %"PRIx64" iommu->reg = %p\n",
+               drhd->address, iommu->reg);
+        printk(VTDPREFIX "cap = %"PRIx64" ecap = %"PRIx64"\n",
+               iommu->cap, iommu->ecap);
     }
     if ( !(iommu->cap + 1) || !(iommu->ecap + 1) )
         return -ENODEV;
@@ -1163,7 +1160,7 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
          cap_num_fault_regs(iommu->cap) * PRIMARY_FAULT_REG_LEN >= PAGE_SIZE ||
          ecap_iotlb_offset(iommu->ecap) >= PAGE_SIZE )
     {
-        dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: unsupported\n");
+        printk(XENLOG_ERR VTDPREFIX "IOMMU: unsupported\n");
         print_iommu_regs(drhd);
         return -ENODEV;
     }
@@ -1175,8 +1172,7 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
             break;
     if ( agaw < 0 )
     {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                 "IOMMU: unsupported sagaw %lx\n", sagaw);
+        printk(XENLOG_ERR VTDPREFIX "IOMMU: unsupported sagaw %lx\n", sagaw);
         print_iommu_regs(drhd);
         return -ENODEV;
     }
@@ -1433,10 +1429,10 @@ static int domain_context_mapping(
     switch ( pdev->type )
     {
     case DEV_TYPE_PCI_HOST_BRIDGE:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:Hostbridge: skip %04x:%02x:%02x.%u map\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:Hostbridge: skip %04x:%02x:%02x.%u map\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         if ( !is_hardware_domain(domain) )
             return -EPERM;
         break;
@@ -1447,10 +1443,10 @@ static int domain_context_mapping(
         break;
 
     case DEV_TYPE_PCIe_ENDPOINT:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCIe: map %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCIe: map %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
@@ -1459,10 +1455,10 @@ static int domain_context_mapping(
         break;
 
     case DEV_TYPE_PCI:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCI: map %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCI: map %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
 
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
@@ -1572,10 +1568,10 @@ static int domain_context_unmap(
     switch ( pdev->type )
     {
     case DEV_TYPE_PCI_HOST_BRIDGE:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:Hostbridge: skip %04x:%02x:%02x.%u unmap\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:Hostbridge: skip %04x:%02x:%02x.%u unmap\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         if ( !is_hardware_domain(domain) )
             return -EPERM;
         goto out;
@@ -1586,10 +1582,10 @@ static int domain_context_unmap(
         goto out;
 
     case DEV_TYPE_PCIe_ENDPOINT:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCIe: unmap %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCIe: unmap %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_unmap_one(domain, iommu, bus, devfn);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
             disable_ats_device(seg, bus, devfn);
@@ -1597,9 +1593,9 @@ static int domain_context_unmap(
         break;
 
     case DEV_TYPE_PCI:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCI: unmap %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCI: unmap %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_unmap_one(domain, iommu, bus, devfn);
         if ( ret )
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:55:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:55:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2E4-0007Jt-OQ; Tue, 12 Jan 2016 16:55: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 1aJ2E3-0007Jk-Bd
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:19 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	E7/92-08977-6FF25965; Tue, 12 Jan 2016 16:55:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1452617716!9819305!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58948 invoked from network); 12 Jan 2016 16:55:17 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:55:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2EH-00078l-Uc
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2E0-0005Mn-1T
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:16 +0000
Date: Tue, 12 Jan 2016 16:55:16 +0000
Message-Id: <E1aJ2E0-0005Mn-1T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: unhide messages needed for
	diagnosing firmware issues
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 009298d7baf6b8a9baed48121ff181e24abf6224
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 22 10:11:44 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 22 10:11:44 2015 +0100

    VT-d: unhide messages needed for diagnosing firmware issues
    
    Undue use of dprintk() lead to many messages useful in diagnosing
    issues in the field now being hidden in non-debug (i.e. production)
    builds. Re-surface them, namely when init-time only and/or already
    guarded by iommu_{verbose,debug} conditionals. Switch from using
    iommu_verbose to iommu_debug in a couple of runtime cases.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Feng Wu <feng.wu@intel.com>
---
 xen/drivers/passthrough/vtd/dmar.c  |  121 ++++++++++++++++-------------------
 xen/drivers/passthrough/vtd/iommu.c |   74 ++++++++++-----------
 2 files changed, 90 insertions(+), 105 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 7cad593..08c1d2d 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -298,7 +298,7 @@ static int __init scope_device_count(const void *start, const void *end)
         scope = start;
         if ( scope->length < MIN_SCOPE_LEN )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX, "Invalid device scope.\n");
+            printk(XENLOG_WARNING VTDPREFIX "Invalid device scope\n");
             return -EINVAL;
         }
 
@@ -360,18 +360,18 @@ static int __init acpi_parse_dev_scope(
             sub_bus = pci_conf_read8(seg, bus, path->dev, path->fn,
                                      PCI_SUBORDINATE_BUS);
             if ( iommu_verbose )
-                dprintk(VTDPREFIX,
-                        " bridge: %04x:%02x:%02x.%u start=%x sec=%x sub=%x\n",
-                        seg, bus, path->dev, path->fn,
-                        acpi_scope->bus, sec_bus, sub_bus);
+                printk(VTDPREFIX
+                       " bridge: %04x:%02x:%02x.%u start=%x sec=%x sub=%x\n",
+                       seg, bus, path->dev, path->fn,
+                       acpi_scope->bus, sec_bus, sub_bus);
 
             dmar_scope_add_buses(scope, sec_bus, sub_bus);
             break;
 
         case ACPI_DMAR_SCOPE_TYPE_HPET:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
-                        seg, bus, path->dev, path->fn);
+                printk(VTDPREFIX " MSI HPET: %04x:%02x:%02x.%u\n",
+                       seg, bus, path->dev, path->fn);
 
             if ( drhd )
             {
@@ -392,8 +392,8 @@ static int __init acpi_parse_dev_scope(
 
         case ACPI_DMAR_SCOPE_TYPE_ENDPOINT:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",
-                        seg, bus, path->dev, path->fn);
+                printk(VTDPREFIX " endpoint: %04x:%02x:%02x.%u\n",
+                       seg, bus, path->dev, path->fn);
 
             if ( drhd )
             {
@@ -406,8 +406,8 @@ static int __init acpi_parse_dev_scope(
 
         case ACPI_DMAR_SCOPE_TYPE_IOAPIC:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%u\n",
-                        seg, bus, path->dev, path->fn);
+                printk(VTDPREFIX " IOAPIC: %04x:%02x:%02x.%u\n",
+                       seg, bus, path->dev, path->fn);
 
             if ( drhd )
             {
@@ -449,9 +449,8 @@ static int __init acpi_dmar_check_length(
 {
     if ( h->length >= min_len )
         return 0;
-    dprintk(XENLOG_ERR VTDPREFIX,
-            "Invalid ACPI DMAR entry length: %#x\n",
-            h->length);
+    printk(XENLOG_ERR VTDPREFIX "Invalid ACPI DMAR entry length: %#x\n",
+           h->length);
     return -EINVAL;
 }
 
@@ -481,8 +480,7 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
     INIT_LIST_HEAD(&dmaru->ioapic_list);
     INIT_LIST_HEAD(&dmaru->hpet_list);
     if ( iommu_verbose )
-        dprintk(VTDPREFIX, "  dmaru->address = %"PRIx64"\n",
-                dmaru->address);
+        printk(VTDPREFIX "  dmaru->address = %"PRIx64"\n", dmaru->address);
 
     ret = iommu_alloc(dmaru);
     if ( ret )
@@ -496,12 +494,12 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
     if ( dmaru->include_all )
     {
         if ( iommu_verbose )
-            dprintk(VTDPREFIX, "  flags: INCLUDE_ALL\n");
+            printk(VTDPREFIX "  flags: INCLUDE_ALL\n");
         /* Only allow one INCLUDE_ALL */
         if ( drhd->segment == 0 && include_all )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                    "Only one INCLUDE_ALL device scope is allowed\n");
+            printk(XENLOG_WARNING VTDPREFIX
+                   "Only one INCLUDE_ALL device scope is allowed\n");
             ret = -EINVAL;
         }
         if ( drhd->segment == 0 )
@@ -538,9 +536,9 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
 
             if ( !pci_device_detect(drhd->segment, b, d, f) )
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                        " Non-existent device (%04x:%02x:%02x.%u) is reported"
-                        " in this DRHD's scope!\n", drhd->segment, b, d, f);
+                printk(XENLOG_WARNING VTDPREFIX
+                       " Non-existent device (%04x:%02x:%02x.%u) in this DRHD's scope!\n",
+                       drhd->segment, b, d, f);
                 invalid_cnt++;
             }
         }
@@ -550,9 +548,8 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
             if ( iommu_workaround_bios_bug &&
                  invalid_cnt == dmaru->scope.devices_cnt )
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                    "  Workaround BIOS bug: ignore the DRHD due to all "
-                    "devices under its scope are not PCI discoverable!\n");
+                printk(XENLOG_WARNING VTDPREFIX
+                       "  Workaround BIOS bug: ignoring DRHD (no devices in its scope are PCI discoverable)\n");
 
                 scope_devices_free(&dmaru->scope);
                 iommu_free(dmaru);
@@ -560,11 +557,10 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
             }
             else
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                    "  The DRHD is invalid due to there are devices under "
-                    "its scope are not PCI discoverable! Pls try option "
-                    "iommu=force or iommu=workaround_bios_bug if you "
-                    "really want VT-d\n");
+                printk(XENLOG_WARNING VTDPREFIX
+                       "  DRHD is invalid (some devices in its scope are not PCI discoverable)\n");
+                printk(XENLOG_WARNING VTDPREFIX
+                       "  Try \"iommu=force\" or \"iommu=workaround_bios_bug\" if you really want VT-d\n");
                 ret = -EINVAL;
             }
         }
@@ -613,10 +609,9 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
     if ( (!page_is_ram_type(paddr_to_pfn(base_addr), RAM_TYPE_RESERVED)) ||
          (!page_is_ram_type(paddr_to_pfn(end_addr), RAM_TYPE_RESERVED)) )
     {
-        dprintk(XENLOG_WARNING VTDPREFIX,
-                "  RMRR address range not in reserved memory "
-                "base = %"PRIx64" end = %"PRIx64"; "
-                "iommu_inclusive_mapping=1 parameter may be needed.\n",
+        printk(XENLOG_WARNING VTDPREFIX
+               "  RMRR address range %"PRIx64"..%"PRIx64" not in reserved memory;"
+               " need \"iommu_inclusive_mapping=1\"?\n",
                 base_addr, end_addr);
     }
 
@@ -653,11 +648,10 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
 
             if ( !pci_device_detect(rmrr->segment, b, d, f) )
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                        " Non-existent device (%04x:%02x:%02x.%u) is reported"
-                        " in RMRR (%"PRIx64", %"PRIx64")'s scope!\n",
-                        rmrr->segment, b, d, f,
-                        rmrru->base_address, rmrru->end_address);
+                printk(XENLOG_WARNING VTDPREFIX
+                       " Non-existent device (%04x:%02x:%02x.%u) reported in RMRR (%"PRIx64", %"PRIx64")'s scope!\n",
+                       rmrr->segment, b, d, f,
+                       rmrru->base_address, rmrru->end_address);
                 ignore = 1;
             }
             else
@@ -669,18 +663,17 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
 
         if ( ignore )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                "  Ignore the RMRR (%"PRIx64", %"PRIx64") due to "
-                "devices under its scope are not PCI discoverable!\n",
-                rmrru->base_address, rmrru->end_address);
+            printk(XENLOG_WARNING VTDPREFIX
+                   "  Ignore RMRR (%"PRIx64", %"PRIx64") (some devices in its scope are not PCI discoverable)\n",
+                   rmrru->base_address, rmrru->end_address);
             scope_devices_free(&rmrru->scope);
             xfree(rmrru);
         }
         else if ( base_addr > end_addr )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                "  The RMRR (%"PRIx64", %"PRIx64") is incorrect!\n",
-                rmrru->base_address, rmrru->end_address);
+            printk(XENLOG_WARNING VTDPREFIX
+                   "  RMRR (%"PRIx64", %"PRIx64") is incorrect\n",
+                   rmrru->base_address, rmrru->end_address);
             scope_devices_free(&rmrru->scope);
             xfree(rmrru);
             ret = -EFAULT;
@@ -688,10 +681,9 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
         else
         {
             if ( iommu_verbose )
-                dprintk(VTDPREFIX,
-                        "  RMRR region: base_addr %"PRIx64
-                        " end_address %"PRIx64"\n",
-                        rmrru->base_address, rmrru->end_address);
+                printk(VTDPREFIX
+                       "  RMRR region: base_addr %"PRIx64" end_address %"PRIx64"\n",
+                       rmrru->base_address, rmrru->end_address);
             acpi_register_rmrr_unit(rmrru);
         }
     }
@@ -719,8 +711,7 @@ acpi_parse_one_atsr(struct acpi_dmar_header *header)
     atsru->segment = atsr->segment;
     atsru->all_ports = atsr->flags & ACPI_DMAR_ALL_PORTS;
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
-                "  atsru->all_ports: %x\n", atsru->all_ports);
+        printk(VTDPREFIX "  atsru->all_ports: %x\n", atsru->all_ports);
     if ( !atsru->all_ports )
     {
         dev_scope_start = (void *)(atsr + 1);
@@ -731,12 +722,12 @@ acpi_parse_one_atsr(struct acpi_dmar_header *header)
     else
     {
         if ( iommu_verbose )
-            dprintk(VTDPREFIX, "  flags: ALL_PORTS\n");
+            printk(VTDPREFIX "  flags: ALL_PORTS\n");
         /* Only allow one ALL_PORTS */
         if ( atsr->segment == 0 && all_ports )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                    "Only one ALL_PORTS device scope is allowed\n");
+            printk(XENLOG_WARNING VTDPREFIX
+                   "Only one ALL_PORTS device scope is allowed\n");
             ret = -EINVAL;
         }
         if ( atsr->segment == 0 )
@@ -772,10 +763,9 @@ acpi_parse_one_rhsa(struct acpi_dmar_header *header)
     rhsau->proximity_domain = rhsa->proximity_domain;
     list_add_tail(&rhsau->list, &acpi_rhsa_units);
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
-                "  rhsau->address: %"PRIx64
-                " rhsau->proximity_domain: %"PRIx32"\n",
-                rhsau->address, rhsau->proximity_domain);
+        printk(VTDPREFIX
+               "  rhsau->address: %"PRIx64" rhsau->proximity_domain: %"PRIx32"\n",
+               rhsau->address, rhsau->proximity_domain);
 
     return ret;
 }
@@ -798,15 +788,14 @@ static int __init acpi_parse_dmar(struct acpi_table_header *table)
 
     if ( !dmar->width )
     {
-        dprintk(XENLOG_WARNING VTDPREFIX, "Zero: Invalid DMAR width\n");
+        printk(XENLOG_WARNING VTDPREFIX "Zero: Invalid DMAR width\n");
         ret = -EINVAL;
         goto out;
     }
 
     dmar_host_address_width = dmar->width + 1;
     if ( iommu_verbose )
-        dprintk(VTDPREFIX, "Host address width %d\n",
-                dmar_host_address_width);
+        printk(VTDPREFIX "Host address width %d\n", dmar_host_address_width);
 
     entry_header = (void *)(dmar + 1);
     while ( ((unsigned long)entry_header) <
@@ -820,22 +809,22 @@ static int __init acpi_parse_dmar(struct acpi_table_header *table)
         {
         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_DRHD:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_DRHD:\n");
             ret = acpi_parse_one_drhd(entry_header);
             break;
         case ACPI_DMAR_TYPE_RESERVED_MEMORY:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_RMRR:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_RMRR:\n");
             ret = acpi_parse_one_rmrr(entry_header);
             break;
         case ACPI_DMAR_TYPE_ATSR:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_ATSR:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_ATSR:\n");
             ret = acpi_parse_one_atsr(entry_header);
             break;
         case ACPI_DMAR_HARDWARE_AFFINITY:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_RHSA:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_RHSA:\n");
             ret = acpi_parse_one_rhsa(entry_header);
             break;
         default:
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 065f239..ec31c6b 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -713,20 +713,18 @@ static void iommu_enable_translation(struct acpi_drhd_unit *drhd)
     {
         if ( force_iommu )
             panic("BIOS did not enable IGD for VT properly, crash Xen for security purpose");
-        else
-        {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                    "BIOS did not enable IGD for VT properly.  Disabling IGD VT-d engine.\n");
-            return;
-        }
+
+        printk(XENLOG_WARNING VTDPREFIX
+               "BIOS did not enable IGD for VT properly.  Disabling IGD VT-d engine.\n");
+        return;
     }
 
     /* apply platform specific errata workarounds */
     vtd_ops_preamble_quirk(iommu);
 
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
-                "iommu_enable_translation: iommu->reg = %p\n", iommu->reg);
+        printk(VTDPREFIX "iommu_enable_translation: iommu->reg = %p\n",
+               iommu->reg);
     spin_lock_irqsave(&iommu->register_lock, flags);
     sts = dmar_readl(iommu->reg, DMAR_GSTS_REG);
     dmar_writel(iommu->reg, DMAR_GCMD_REG, sts | DMA_GCMD_TE);
@@ -1150,11 +1148,10 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
 
     if ( iommu_verbose )
     {
-        dprintk(VTDPREFIX,
-                "drhd->address = %"PRIx64" iommu->reg = %p\n",
-                drhd->address, iommu->reg);
-        dprintk(VTDPREFIX,
-                "cap = %"PRIx64" ecap = %"PRIx64"\n", iommu->cap, iommu->ecap);
+        printk(VTDPREFIX "drhd->address = %"PRIx64" iommu->reg = %p\n",
+               drhd->address, iommu->reg);
+        printk(VTDPREFIX "cap = %"PRIx64" ecap = %"PRIx64"\n",
+               iommu->cap, iommu->ecap);
     }
     if ( !(iommu->cap + 1) || !(iommu->ecap + 1) )
         return -ENODEV;
@@ -1163,7 +1160,7 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
          cap_num_fault_regs(iommu->cap) * PRIMARY_FAULT_REG_LEN >= PAGE_SIZE ||
          ecap_iotlb_offset(iommu->ecap) >= PAGE_SIZE )
     {
-        dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: unsupported\n");
+        printk(XENLOG_ERR VTDPREFIX "IOMMU: unsupported\n");
         print_iommu_regs(drhd);
         return -ENODEV;
     }
@@ -1175,8 +1172,7 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
             break;
     if ( agaw < 0 )
     {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                 "IOMMU: unsupported sagaw %lx\n", sagaw);
+        printk(XENLOG_ERR VTDPREFIX "IOMMU: unsupported sagaw %lx\n", sagaw);
         print_iommu_regs(drhd);
         return -ENODEV;
     }
@@ -1433,10 +1429,10 @@ static int domain_context_mapping(
     switch ( pdev->type )
     {
     case DEV_TYPE_PCI_HOST_BRIDGE:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:Hostbridge: skip %04x:%02x:%02x.%u map\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:Hostbridge: skip %04x:%02x:%02x.%u map\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         if ( !is_hardware_domain(domain) )
             return -EPERM;
         break;
@@ -1447,10 +1443,10 @@ static int domain_context_mapping(
         break;
 
     case DEV_TYPE_PCIe_ENDPOINT:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCIe: map %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCIe: map %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
@@ -1459,10 +1455,10 @@ static int domain_context_mapping(
         break;
 
     case DEV_TYPE_PCI:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCI: map %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCI: map %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
 
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
@@ -1572,10 +1568,10 @@ static int domain_context_unmap(
     switch ( pdev->type )
     {
     case DEV_TYPE_PCI_HOST_BRIDGE:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:Hostbridge: skip %04x:%02x:%02x.%u unmap\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:Hostbridge: skip %04x:%02x:%02x.%u unmap\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         if ( !is_hardware_domain(domain) )
             return -EPERM;
         goto out;
@@ -1586,10 +1582,10 @@ static int domain_context_unmap(
         goto out;
 
     case DEV_TYPE_PCIe_ENDPOINT:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCIe: unmap %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCIe: unmap %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_unmap_one(domain, iommu, bus, devfn);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
             disable_ats_device(seg, bus, devfn);
@@ -1597,9 +1593,9 @@ static int domain_context_unmap(
         break;
 
     case DEV_TYPE_PCI:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCI: unmap %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCI: unmap %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_unmap_one(domain, iommu, bus, devfn);
         if ( ret )
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:55:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:55:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2EF-0007LO-28; Tue, 12 Jan 2016 16:55: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 1aJ2ED-0007L9-IE
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:29 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	9F/0B-12946-00035965; Tue, 12 Jan 2016 16:55:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1452617726!15422166!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55586 invoked from network); 12 Jan 2016 16:55:27 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:55:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2ES-000792-6a
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2EA-0005N9-Jy
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:26 +0000
Date: Tue, 12 Jan 2016 16:55:26 +0000
Message-Id: <E1aJ2EA-0005N9-Jy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] IOMMU: unhide messages useful for
	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 8e4d18e113c9d914a591c7bd8159c990122f50dc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 22 10:12:14 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 22 10:12:14 2015 +0100

    IOMMU: unhide messages useful for diagnostics
    
    Undue use of dprintk() lead to many messages useful in diagnosing
    issues in the field now being hidden in non-debug (i.e. production)
    builds. Re-surface them.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/io.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c
index 6b1ee6a..042360e 100644
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -543,10 +543,10 @@ int pt_irq_create_bind(
         spin_unlock(&d->event_lock);
 
         if ( iommu_verbose )
-            dprintk(XENLOG_G_INFO,
-                    "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);
+            printk(XENLOG_G_INFO
+                   "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;
     }
 
@@ -576,11 +576,11 @@ int pt_irq_destroy_bind(
             unsigned int device = pt_irq_bind->u.pci.device;
             unsigned int intx = pt_irq_bind->u.pci.intx;
 
-            dprintk(XENLOG_G_INFO,
-                    "d%d: unbind: m_gsi=%u g_gsi=%u dev=%02x:%02x.%u intx=%u\n",
-                    d->domain_id, machine_gsi, hvm_pci_intx_gsi(device, intx),
-                    pt_irq_bind->u.pci.bus,
-                    PCI_SLOT(device), PCI_FUNC(device), intx);
+            printk(XENLOG_G_INFO
+                   "d%d: unbind: m_gsi=%u g_gsi=%u dev=%02x:%02x.%u intx=%u\n",
+                   d->domain_id, machine_gsi, hvm_pci_intx_gsi(device, intx),
+                   pt_irq_bind->u.pci.bus,
+                   PCI_SLOT(device), PCI_FUNC(device), intx);
         }
         break;
     case PT_IRQ_TYPE_MSI:
@@ -676,10 +676,10 @@ int pt_irq_destroy_bind(
     {
         unsigned int device = pt_irq_bind->u.pci.device;
 
-        dprintk(XENLOG_G_INFO,
-                "d%d %s unmap: m_irq=%u dev=%02x:%02x.%u intx=%u\n",
-                d->domain_id, what, machine_gsi, pt_irq_bind->u.pci.bus,
-                PCI_SLOT(device), PCI_FUNC(device), pt_irq_bind->u.pci.intx);
+        printk(XENLOG_G_INFO
+               "d%d %s unmap: m_irq=%u dev=%02x:%02x.%u intx=%u\n",
+               d->domain_id, what, machine_gsi, pt_irq_bind->u.pci.bus,
+               PCI_SLOT(device), PCI_FUNC(device), pt_irq_bind->u.pci.intx);
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:55:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:55:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2EF-0007LO-28; Tue, 12 Jan 2016 16:55: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 1aJ2ED-0007L9-IE
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:29 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	9F/0B-12946-00035965; Tue, 12 Jan 2016 16:55:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1452617726!15422166!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55586 invoked from network); 12 Jan 2016 16:55:27 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:55:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2ES-000792-6a
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2EA-0005N9-Jy
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:26 +0000
Date: Tue, 12 Jan 2016 16:55:26 +0000
Message-Id: <E1aJ2EA-0005N9-Jy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] IOMMU: unhide messages useful for
	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 8e4d18e113c9d914a591c7bd8159c990122f50dc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 22 10:12:14 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 22 10:12:14 2015 +0100

    IOMMU: unhide messages useful for diagnostics
    
    Undue use of dprintk() lead to many messages useful in diagnosing
    issues in the field now being hidden in non-debug (i.e. production)
    builds. Re-surface them.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/io.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c
index 6b1ee6a..042360e 100644
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -543,10 +543,10 @@ int pt_irq_create_bind(
         spin_unlock(&d->event_lock);
 
         if ( iommu_verbose )
-            dprintk(XENLOG_G_INFO,
-                    "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);
+            printk(XENLOG_G_INFO
+                   "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;
     }
 
@@ -576,11 +576,11 @@ int pt_irq_destroy_bind(
             unsigned int device = pt_irq_bind->u.pci.device;
             unsigned int intx = pt_irq_bind->u.pci.intx;
 
-            dprintk(XENLOG_G_INFO,
-                    "d%d: unbind: m_gsi=%u g_gsi=%u dev=%02x:%02x.%u intx=%u\n",
-                    d->domain_id, machine_gsi, hvm_pci_intx_gsi(device, intx),
-                    pt_irq_bind->u.pci.bus,
-                    PCI_SLOT(device), PCI_FUNC(device), intx);
+            printk(XENLOG_G_INFO
+                   "d%d: unbind: m_gsi=%u g_gsi=%u dev=%02x:%02x.%u intx=%u\n",
+                   d->domain_id, machine_gsi, hvm_pci_intx_gsi(device, intx),
+                   pt_irq_bind->u.pci.bus,
+                   PCI_SLOT(device), PCI_FUNC(device), intx);
         }
         break;
     case PT_IRQ_TYPE_MSI:
@@ -676,10 +676,10 @@ int pt_irq_destroy_bind(
     {
         unsigned int device = pt_irq_bind->u.pci.device;
 
-        dprintk(XENLOG_G_INFO,
-                "d%d %s unmap: m_irq=%u dev=%02x:%02x.%u intx=%u\n",
-                d->domain_id, what, machine_gsi, pt_irq_bind->u.pci.bus,
-                PCI_SLOT(device), PCI_FUNC(device), pt_irq_bind->u.pci.intx);
+        printk(XENLOG_G_INFO
+               "d%d %s unmap: m_irq=%u dev=%02x:%02x.%u intx=%u\n",
+               d->domain_id, what, machine_gsi, pt_irq_bind->u.pci.bus,
+               PCI_SLOT(device), PCI_FUNC(device), pt_irq_bind->u.pci.intx);
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:55:41 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:55:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2EP-0007Mn-DR; Tue, 12 Jan 2016 16:55: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 1aJ2EN-0007MV-HG
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:39 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	18/13-07165-A0035965; Tue, 12 Jan 2016 16:55:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1452617737!16270549!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2944 invoked from network); 12 Jan 2016 16:55:38 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:55:38 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ec-00079D-JI
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2EK-0005O1-T0
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:36 +0000
Date: Tue, 12 Jan 2016 16:55:36 +0000
Message-Id: <E1aJ2EK-0005O1-T0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3110c30a1b4556133947fd8871533411aab7ca8a
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 15:35:25 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:35:25 2016 +0000

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

diff --git a/Config.mk b/Config.mk
index 7b2aa07..075bb01 100644
--- a/Config.mk
+++ b/Config.mk
@@ -266,9 +266,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.9.0
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= a82794b1d5a6da06062a333b1db404e2448345dd
-# Fri Nov 20 10:56:00 2015 -0500
-# blkif: Avoid double access to src->nr_segments
+QEMU_TRADITIONAL_REVISION ?= 569eac99e8ddccd15fe78e8a3af5622afe780e3b
+# Mon Jan 4 15:34:29 2016 +0000
+# MSI-X: avoid array overrun upon MSI-X table writes
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:55:41 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:55:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2EP-0007Mn-DR; Tue, 12 Jan 2016 16:55: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 1aJ2EN-0007MV-HG
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:39 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	18/13-07165-A0035965; Tue, 12 Jan 2016 16:55:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1452617737!16270549!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2944 invoked from network); 12 Jan 2016 16:55:38 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:55:38 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ec-00079D-JI
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2EK-0005O1-T0
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:36 +0000
Date: Tue, 12 Jan 2016 16:55:36 +0000
Message-Id: <E1aJ2EK-0005O1-T0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3110c30a1b4556133947fd8871533411aab7ca8a
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 15:35:25 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 15:35:25 2016 +0000

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

diff --git a/Config.mk b/Config.mk
index 7b2aa07..075bb01 100644
--- a/Config.mk
+++ b/Config.mk
@@ -266,9 +266,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.9.0
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= a82794b1d5a6da06062a333b1db404e2448345dd
-# Fri Nov 20 10:56:00 2015 -0500
-# blkif: Avoid double access to src->nr_segments
+QEMU_TRADITIONAL_REVISION ?= 569eac99e8ddccd15fe78e8a3af5622afe780e3b
+# Mon Jan 4 15:34:29 2016 +0000
+# MSI-X: avoid array overrun upon MSI-X table writes
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:55:53 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2Eb-0007OY-2Z; Tue, 12 Jan 2016 16:55:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2EZ-0007OJ-VH
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:52 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	B0/93-09708-71035965; Tue, 12 Jan 2016 16:55:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1452617747!9721574!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32725 invoked from network); 12 Jan 2016 16:55:48 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:55:48 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2En-00079o-0X
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2EV-0005OR-AF
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:47 +0000
Date: Tue, 12 Jan 2016 16:55:47 +0000
Message-Id: <E1aJ2EV-0005OR-AF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Fix doc comment ref to
	DOMAIN_DEATH
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dcdb6588779ac8a0cab513d9a2d5ee0bb1dda1cd
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 15:13:14 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 17:41:35 2016 +0000

    libxl: Fix doc comment ref to DOMAIN_DEATH
    
    The doc comment for libxl_evdisable_domain_death mistakenly referred
    to DOMAIN_DESTROY but the event type name is actually DOMAIN_DEATH.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_event.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_event.h b/tools/libxl/libxl_event.h
index fad4c14..1ea789e 100644
--- a/tools/libxl/libxl_event.h
+++ b/tools/libxl/libxl_event.h
@@ -179,9 +179,9 @@ typedef struct libxl__evgen_domain_death libxl_evgen_domain_death;
 int libxl_evenable_domain_death(libxl_ctx *ctx, uint32_t domid,
                          libxl_ev_user, libxl_evgen_domain_death **evgen_out);
 void libxl_evdisable_domain_death(libxl_ctx *ctx, libxl_evgen_domain_death*);
-  /* Arranges for the generation of DOMAIN_SHUTDOWN and DOMAIN_DESTROY
+  /* Arranges for the generation of DOMAIN_SHUTDOWN and DOMAIN_DEATH
    * events.  A domain which is destroyed before it shuts down
-   * may generate only a DESTROY event.
+   * may generate only a DEATH event.
    */
 
 typedef struct libxl__evgen_disk_eject libxl_evgen_disk_eject;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:55:53 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2Eb-0007OY-2Z; Tue, 12 Jan 2016 16:55:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2EZ-0007OJ-VH
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:52 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	B0/93-09708-71035965; Tue, 12 Jan 2016 16:55:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1452617747!9721574!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32725 invoked from network); 12 Jan 2016 16:55:48 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:55:48 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2En-00079o-0X
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2EV-0005OR-AF
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:47 +0000
Date: Tue, 12 Jan 2016 16:55:47 +0000
Message-Id: <E1aJ2EV-0005OR-AF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Fix doc comment ref to
	DOMAIN_DEATH
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dcdb6588779ac8a0cab513d9a2d5ee0bb1dda1cd
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Jan 4 15:13:14 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 4 17:41:35 2016 +0000

    libxl: Fix doc comment ref to DOMAIN_DEATH
    
    The doc comment for libxl_evdisable_domain_death mistakenly referred
    to DOMAIN_DESTROY but the event type name is actually DOMAIN_DEATH.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_event.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_event.h b/tools/libxl/libxl_event.h
index fad4c14..1ea789e 100644
--- a/tools/libxl/libxl_event.h
+++ b/tools/libxl/libxl_event.h
@@ -179,9 +179,9 @@ typedef struct libxl__evgen_domain_death libxl_evgen_domain_death;
 int libxl_evenable_domain_death(libxl_ctx *ctx, uint32_t domid,
                          libxl_ev_user, libxl_evgen_domain_death **evgen_out);
 void libxl_evdisable_domain_death(libxl_ctx *ctx, libxl_evgen_domain_death*);
-  /* Arranges for the generation of DOMAIN_SHUTDOWN and DOMAIN_DESTROY
+  /* Arranges for the generation of DOMAIN_SHUTDOWN and DOMAIN_DEATH
    * events.  A domain which is destroyed before it shuts down
-   * may generate only a DESTROY event.
+   * may generate only a DEATH event.
    */
 
 typedef struct libxl__evgen_disk_eject libxl_evgen_disk_eject;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:56:01 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:56: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 1aJ2Ej-0007Qk-6j; Tue, 12 Jan 2016 16:56: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 1aJ2Ei-0007QX-5M
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:00 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	EB/42-18633-F1035965; Tue, 12 Jan 2016 16:55:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1452617758!15111804!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20536 invoked from network); 12 Jan 2016 16:55:58 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:55:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ex-0007A1-Aq
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ef-0005On-Nj
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:57 +0000
Date: Tue, 12 Jan 2016 16:55:57 +0000
Message-Id: <E1aJ2Ef-0005On-Nj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vmx: Fix injection of #DB traps
	following XSA-156
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0747bc8b4d85f3fc0ee1e58418418fa0229e8ff8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 4 09:59:38 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:28:56 2016 +0000

    x86/vmx: Fix injection of #DB traps following XSA-156
    
    Most #DB exceptions are traps rather than faults, meaning that the instruction
    pointer in the exception frame points after the instruction rather than at it.
    
    However, VMX intercepts all have fault semantics, even when intercepting a
    trap.  Re-injecting an intercepted trap as a fault causes an infinite loop in
    the guest, by re-executing the same trapping instruction repeatedly.  This
    breaks debugging inside the guest.
    
    Introduce a helper which copies VM_EXIT_INTR_INTO to VM_ENTRY_INTR_INFO, and
    use it to mirror the intercepted interrupt back to the guest.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index b918b8a..7917fb7 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2877,6 +2877,33 @@ static int vmx_handle_eoi_write(void)
     return 0;
 }
 
+/*
+ * Propagate VM_EXIT_INTR_INFO to VM_ENTRY_INTR_INFO.  Used to mirror an
+ * intercepted exception back to the guest as if Xen hadn't intercepted it.
+ *
+ * It is the callers responsibility to ensure that this function is only used
+ * in the context of an appropriate vmexit.
+ */
+static void vmx_propagate_intr(void)
+{
+    unsigned long intr, tmp;
+
+    __vmread(VM_EXIT_INTR_INFO, &intr);
+
+    ASSERT(intr & INTR_INFO_VALID_MASK);
+
+    __vmwrite(VM_ENTRY_INTR_INFO, intr);
+
+    if ( intr & INTR_INFO_DELIVER_CODE_MASK )
+    {
+        __vmread(VM_EXIT_INTR_ERROR_CODE, &tmp);
+        __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, tmp);
+    }
+
+    __vmread(VM_EXIT_INSTRUCTION_LEN, &tmp);
+    __vmwrite(VM_ENTRY_INSTRUCTION_LEN, tmp);
+}
+
 static void vmx_idtv_reinject(unsigned long idtv_info)
 {
 
@@ -3137,7 +3164,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | DR_STATUS_RESERVED_ONE);
             if ( !v->domain->debugger_attached )
-                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+                vmx_propagate_intr();
             else
                 domain_pause_for_debugger();
             break;
@@ -3206,8 +3233,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             break;
         case TRAP_alignment_check:
             HVMTRACE_1D(TRAP, vector);
-            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
-            hvm_inject_hw_exception(vector, ecode);
+            vmx_propagate_intr();
             break;
         case TRAP_nmi:
             if ( MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_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 Tue Jan 12 16:56:01 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:56: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 1aJ2Ej-0007Qk-6j; Tue, 12 Jan 2016 16:56: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 1aJ2Ei-0007QX-5M
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:00 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	EB/42-18633-F1035965; Tue, 12 Jan 2016 16:55:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1452617758!15111804!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20536 invoked from network); 12 Jan 2016 16:55:58 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:55:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ex-0007A1-Aq
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ef-0005On-Nj
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:55:57 +0000
Date: Tue, 12 Jan 2016 16:55:57 +0000
Message-Id: <E1aJ2Ef-0005On-Nj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vmx: Fix injection of #DB traps
	following XSA-156
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0747bc8b4d85f3fc0ee1e58418418fa0229e8ff8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 4 09:59:38 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:28:56 2016 +0000

    x86/vmx: Fix injection of #DB traps following XSA-156
    
    Most #DB exceptions are traps rather than faults, meaning that the instruction
    pointer in the exception frame points after the instruction rather than at it.
    
    However, VMX intercepts all have fault semantics, even when intercepting a
    trap.  Re-injecting an intercepted trap as a fault causes an infinite loop in
    the guest, by re-executing the same trapping instruction repeatedly.  This
    breaks debugging inside the guest.
    
    Introduce a helper which copies VM_EXIT_INTR_INTO to VM_ENTRY_INTR_INFO, and
    use it to mirror the intercepted interrupt back to the guest.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index b918b8a..7917fb7 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2877,6 +2877,33 @@ static int vmx_handle_eoi_write(void)
     return 0;
 }
 
+/*
+ * Propagate VM_EXIT_INTR_INFO to VM_ENTRY_INTR_INFO.  Used to mirror an
+ * intercepted exception back to the guest as if Xen hadn't intercepted it.
+ *
+ * It is the callers responsibility to ensure that this function is only used
+ * in the context of an appropriate vmexit.
+ */
+static void vmx_propagate_intr(void)
+{
+    unsigned long intr, tmp;
+
+    __vmread(VM_EXIT_INTR_INFO, &intr);
+
+    ASSERT(intr & INTR_INFO_VALID_MASK);
+
+    __vmwrite(VM_ENTRY_INTR_INFO, intr);
+
+    if ( intr & INTR_INFO_DELIVER_CODE_MASK )
+    {
+        __vmread(VM_EXIT_INTR_ERROR_CODE, &tmp);
+        __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, tmp);
+    }
+
+    __vmread(VM_EXIT_INSTRUCTION_LEN, &tmp);
+    __vmwrite(VM_ENTRY_INSTRUCTION_LEN, tmp);
+}
+
 static void vmx_idtv_reinject(unsigned long idtv_info)
 {
 
@@ -3137,7 +3164,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | DR_STATUS_RESERVED_ONE);
             if ( !v->domain->debugger_attached )
-                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+                vmx_propagate_intr();
             else
                 domain_pause_for_debugger();
             break;
@@ -3206,8 +3233,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             break;
         case TRAP_alignment_check:
             HVMTRACE_1D(TRAP, vector);
-            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
-            hvm_inject_hw_exception(vector, ecode);
+            vmx_propagate_intr();
             break;
         case TRAP_nmi:
             if ( MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_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 Tue Jan 12 16:56:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:56: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 1aJ2Eu-0007Sg-9z; Tue, 12 Jan 2016 16:56: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 1aJ2Es-0007SS-N0
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:10 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	FF/74-32615-A2035965; Tue, 12 Jan 2016 16:56:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1452617768!15423055!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35992 invoked from network); 12 Jan 2016 16:56:09 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:56:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2F7-0007A9-N2
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Eq-0005PI-3g
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:08 +0000
Date: Tue, 12 Jan 2016 16:56:08 +0000
Message-Id: <E1aJ2Eq-0005PI-3g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: allow configure time choice of
	libexec subdirectory.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit de858271c16851d662b2613699401df6ecec8ef8
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 16 15:06:35 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:32:21 2016 +0000

    tools: allow configure time choice of libexec subdirectory.
    
    Currently we hardcode various paths such as $libexec/xen/{bin,boot},
    however some downstreams (notably Debian) would like instead to
    install things into $libexec/xen-X.Y/{bin,boot} as part of allowing
    multiple versions of the tools packages to be installed.
    
    Since this currently involves patching configure its a bit fiddly,
    provide a configure option for the leaf dir instead, name it
    --with-libexec-leaf-dir similar to the existing
    --with-sysconfig-leaf-dir.
    
    Rather than have the determination of the full path in both configure
    and config/Paths.mk.in move it into configure only. Also for
    consistency move the other LIBEXEC_* to configure, even though they
    are only substituted into Paths.mk.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: 805508@bugs.debian.org
    [ ijc -- removed stray ` ]
---
 config/Paths.mk.in |    6 +++---
 configure          |   26 +++++++++++++++++++++++---
 m4/paths.m4        |   24 ++++++++++++++++++------
 tools/configure    |   26 +++++++++++++++++++++++---
 4 files changed, 67 insertions(+), 15 deletions(-)

diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index d36504f..1c7afb4 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -29,10 +29,10 @@ includedir               := @includedir@
 localstatedir            := @localstatedir@
 sysconfdir               := @sysconfdir@
 
-LIBEXEC                  := $(libexecdir)/$(PACKAGE_TARNAME)
+LIBEXEC                  := @LIBEXEC@
 LIBEXEC_BIN              := @LIBEXEC_BIN@
-LIBEXEC_LIB              := $(LIBEXEC)/lib
-LIBEXEC_INC              := $(LIBEXEC)/include
+LIBEXEC_LIB              := @LIBEXEC_LIB@
+LIBEXEC_INC              := @LIBEXEC_INC@
 
 SHAREDIR                 := @SHAREDIR@
 MAN1DIR                  := $(mandir)/man1
diff --git a/configure b/configure
index 3c269fa..c200eed 100755
--- a/configure
+++ b/configure
@@ -606,7 +606,10 @@ XEN_LIB_STORED
 XEN_LOG_DIR
 XEN_RUN_DIR
 XENFIRMWAREDIR
+LIBEXEC_INC
+LIBEXEC_LIB
 LIBEXEC_BIN
+LIBEXEC
 CONFIG_LEAF_DIR
 host_os
 host_vendor
@@ -659,6 +662,7 @@ ac_user_opts='
 enable_option_checking
 with_initddir
 with_sysconfig_leaf_dir
+with_libexec_leaf_dir
 with_xen_dumpdir
 enable_xen
 enable_tools
@@ -1299,6 +1303,8 @@ Optional Packages:
                           options for runlevel scripts and daemons such as
                           xenstored. This should be either "sysconfig" or
                           "default". [sysconfig]
+  --with-libexec-leaf-dir=SUBDIR
+                          Name of subdirectory in libexecdir to use.
   --with-xen-dumpdir=DIR  Path to directory for domU crash dumps.
                           [LOCALSTATEDIR/lib/xen/dump]
 
@@ -1924,6 +1930,15 @@ CONFIG_LEAF_DIR=$config_leaf_dir
 
 
 
+# Check whether --with-libexec-leaf-dir was given.
+if test "${with_libexec_leaf_dir+set}" = set; then :
+  withval=$with_libexec_leaf_dir; libexec_subdir=$withval
+else
+  libexec_subdir=$PACKAGE_TARNAME
+fi
+
+
+
 # Check whether --with-xen-dumpdir was given.
 if test "${with_xen_dumpdir+set}" = set; then :
   withval=$with_xen_dumpdir; xen_dumpdir_path=$withval
@@ -1940,11 +1955,16 @@ if test "$libexecdir" = '${exec_prefix}/libexec' ; then
          ;;
     esac
 fi
-libexecdir=`eval echo $libexecdir`
-LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
+LIBEXEC=`eval echo $libexecdir/$libexec_subdir`
+
+
+LIBEXEC_BIN=${LIBEXEC}/bin
+
+LIBEXEC_LIB=${LIBEXEC}/lib
 
+LIBEXEC_INC=${LIBEXEC}/include
 
-XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+XENFIRMWAREDIR=${LIBEXEC}/boot
 
 
 XEN_RUN_DIR=$localstatedir/run/xen
diff --git a/m4/paths.m4 b/m4/paths.m4
index 63e0f6b..fa902bb 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -62,6 +62,14 @@ AC_ARG_WITH([sysconfig-leaf-dir],
 CONFIG_LEAF_DIR=$config_leaf_dir
 AC_SUBST(CONFIG_LEAF_DIR)
 
+dnl autoconf docs suggest to use a "package name" subdir. We make it
+dnl configurable for the benefit of those who want e.g. xen-X.Y instead.
+AC_ARG_WITH([libexec-leaf-dir],
+    AS_HELP_STRING([--with-libexec-leaf-dir=SUBDIR],
+    [Name of subdirectory in libexecdir to use.]),
+    [libexec_subdir=$withval],
+    [libexec_subdir=$PACKAGE_TARNAME])
+
 AC_ARG_WITH([xen-dumpdir],
     AS_HELP_STRING([--with-xen-dumpdir=DIR],
     [Path to directory for domU crash dumps. [LOCALSTATEDIR/lib/xen/dump]]),
@@ -77,13 +85,17 @@ if test "$libexecdir" = '${exec_prefix}/libexec' ; then
     esac
 fi
 dnl expand exec_prefix or it will endup in substituted variables
-libexecdir=`eval echo $libexecdir`
-dnl autoconf doc suggest to use a "package name" subdir
-dnl This variable will be substituted in various .in files
-LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
-AC_SUBST(LIBEXEC_BIN)
+LIBEXEC=`eval echo $libexecdir/$libexec_subdir`
+AC_SUBST(LIBEXEC)
 
-XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+dnl These variables will be substituted in various .in files
+LIBEXEC_BIN=${LIBEXEC}/bin
+AC_SUBST(LIBEXEC_BIN)
+LIBEXEC_LIB=${LIBEXEC}/lib
+AC_SUBST(LIBEXEC_LIB)
+LIBEXEC_INC=${LIBEXEC}/include
+AC_SUBST(LIBEXEC_INC)
+XENFIRMWAREDIR=${LIBEXEC}/boot
 AC_SUBST(XENFIRMWAREDIR)
 
 XEN_RUN_DIR=$localstatedir/run/xen
diff --git a/tools/configure b/tools/configure
index 41bed77..cd41b26 100755
--- a/tools/configure
+++ b/tools/configure
@@ -726,7 +726,10 @@ XEN_LIB_STORED
 XEN_LOG_DIR
 XEN_RUN_DIR
 XENFIRMWAREDIR
+LIBEXEC_INC
+LIBEXEC_LIB
 LIBEXEC_BIN
+LIBEXEC
 CONFIG_LEAF_DIR
 FILE_OFFSET_BITS
 OBJEXT
@@ -789,6 +792,7 @@ enable_option_checking
 enable_largefile
 with_initddir
 with_sysconfig_leaf_dir
+with_libexec_leaf_dir
 with_xen_dumpdir
 enable_rpath
 enable_githttp
@@ -1490,6 +1494,8 @@ Optional Packages:
                           options for runlevel scripts and daemons such as
                           xenstored. This should be either "sysconfig" or
                           "default". [sysconfig]
+  --with-libexec-leaf-dir=SUBDIR
+                          Name of subdirectory in libexecdir to use.
   --with-xen-dumpdir=DIR  Path to directory for domU crash dumps.
                           [LOCALSTATEDIR/lib/xen/dump]
   --with-linux-backend-modules="mod1 mod2"
@@ -3887,6 +3893,15 @@ CONFIG_LEAF_DIR=$config_leaf_dir
 
 
 
+# Check whether --with-libexec-leaf-dir was given.
+if test "${with_libexec_leaf_dir+set}" = set; then :
+  withval=$with_libexec_leaf_dir; libexec_subdir=$withval
+else
+  libexec_subdir=$PACKAGE_TARNAME
+fi
+
+
+
 # Check whether --with-xen-dumpdir was given.
 if test "${with_xen_dumpdir+set}" = set; then :
   withval=$with_xen_dumpdir; xen_dumpdir_path=$withval
@@ -3903,11 +3918,16 @@ if test "$libexecdir" = '${exec_prefix}/libexec' ; then
          ;;
     esac
 fi
-libexecdir=`eval echo $libexecdir`
-LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
+LIBEXEC=`eval echo $libexecdir/$libexec_subdir`
+
+
+LIBEXEC_BIN=${LIBEXEC}/bin
+
+LIBEXEC_LIB=${LIBEXEC}/lib
 
+LIBEXEC_INC=${LIBEXEC}/include
 
-XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+XENFIRMWAREDIR=${LIBEXEC}/boot
 
 
 XEN_RUN_DIR=$localstatedir/run/xen
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:56:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:56: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 1aJ2Eu-0007Sg-9z; Tue, 12 Jan 2016 16:56: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 1aJ2Es-0007SS-N0
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:10 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	FF/74-32615-A2035965; Tue, 12 Jan 2016 16:56:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1452617768!15423055!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35992 invoked from network); 12 Jan 2016 16:56:09 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:56:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2F7-0007A9-N2
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Eq-0005PI-3g
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:08 +0000
Date: Tue, 12 Jan 2016 16:56:08 +0000
Message-Id: <E1aJ2Eq-0005PI-3g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: allow configure time choice of
	libexec subdirectory.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit de858271c16851d662b2613699401df6ecec8ef8
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 16 15:06:35 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:32:21 2016 +0000

    tools: allow configure time choice of libexec subdirectory.
    
    Currently we hardcode various paths such as $libexec/xen/{bin,boot},
    however some downstreams (notably Debian) would like instead to
    install things into $libexec/xen-X.Y/{bin,boot} as part of allowing
    multiple versions of the tools packages to be installed.
    
    Since this currently involves patching configure its a bit fiddly,
    provide a configure option for the leaf dir instead, name it
    --with-libexec-leaf-dir similar to the existing
    --with-sysconfig-leaf-dir.
    
    Rather than have the determination of the full path in both configure
    and config/Paths.mk.in move it into configure only. Also for
    consistency move the other LIBEXEC_* to configure, even though they
    are only substituted into Paths.mk.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: 805508@bugs.debian.org
    [ ijc -- removed stray ` ]
---
 config/Paths.mk.in |    6 +++---
 configure          |   26 +++++++++++++++++++++++---
 m4/paths.m4        |   24 ++++++++++++++++++------
 tools/configure    |   26 +++++++++++++++++++++++---
 4 files changed, 67 insertions(+), 15 deletions(-)

diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index d36504f..1c7afb4 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -29,10 +29,10 @@ includedir               := @includedir@
 localstatedir            := @localstatedir@
 sysconfdir               := @sysconfdir@
 
-LIBEXEC                  := $(libexecdir)/$(PACKAGE_TARNAME)
+LIBEXEC                  := @LIBEXEC@
 LIBEXEC_BIN              := @LIBEXEC_BIN@
-LIBEXEC_LIB              := $(LIBEXEC)/lib
-LIBEXEC_INC              := $(LIBEXEC)/include
+LIBEXEC_LIB              := @LIBEXEC_LIB@
+LIBEXEC_INC              := @LIBEXEC_INC@
 
 SHAREDIR                 := @SHAREDIR@
 MAN1DIR                  := $(mandir)/man1
diff --git a/configure b/configure
index 3c269fa..c200eed 100755
--- a/configure
+++ b/configure
@@ -606,7 +606,10 @@ XEN_LIB_STORED
 XEN_LOG_DIR
 XEN_RUN_DIR
 XENFIRMWAREDIR
+LIBEXEC_INC
+LIBEXEC_LIB
 LIBEXEC_BIN
+LIBEXEC
 CONFIG_LEAF_DIR
 host_os
 host_vendor
@@ -659,6 +662,7 @@ ac_user_opts='
 enable_option_checking
 with_initddir
 with_sysconfig_leaf_dir
+with_libexec_leaf_dir
 with_xen_dumpdir
 enable_xen
 enable_tools
@@ -1299,6 +1303,8 @@ Optional Packages:
                           options for runlevel scripts and daemons such as
                           xenstored. This should be either "sysconfig" or
                           "default". [sysconfig]
+  --with-libexec-leaf-dir=SUBDIR
+                          Name of subdirectory in libexecdir to use.
   --with-xen-dumpdir=DIR  Path to directory for domU crash dumps.
                           [LOCALSTATEDIR/lib/xen/dump]
 
@@ -1924,6 +1930,15 @@ CONFIG_LEAF_DIR=$config_leaf_dir
 
 
 
+# Check whether --with-libexec-leaf-dir was given.
+if test "${with_libexec_leaf_dir+set}" = set; then :
+  withval=$with_libexec_leaf_dir; libexec_subdir=$withval
+else
+  libexec_subdir=$PACKAGE_TARNAME
+fi
+
+
+
 # Check whether --with-xen-dumpdir was given.
 if test "${with_xen_dumpdir+set}" = set; then :
   withval=$with_xen_dumpdir; xen_dumpdir_path=$withval
@@ -1940,11 +1955,16 @@ if test "$libexecdir" = '${exec_prefix}/libexec' ; then
          ;;
     esac
 fi
-libexecdir=`eval echo $libexecdir`
-LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
+LIBEXEC=`eval echo $libexecdir/$libexec_subdir`
+
+
+LIBEXEC_BIN=${LIBEXEC}/bin
+
+LIBEXEC_LIB=${LIBEXEC}/lib
 
+LIBEXEC_INC=${LIBEXEC}/include
 
-XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+XENFIRMWAREDIR=${LIBEXEC}/boot
 
 
 XEN_RUN_DIR=$localstatedir/run/xen
diff --git a/m4/paths.m4 b/m4/paths.m4
index 63e0f6b..fa902bb 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -62,6 +62,14 @@ AC_ARG_WITH([sysconfig-leaf-dir],
 CONFIG_LEAF_DIR=$config_leaf_dir
 AC_SUBST(CONFIG_LEAF_DIR)
 
+dnl autoconf docs suggest to use a "package name" subdir. We make it
+dnl configurable for the benefit of those who want e.g. xen-X.Y instead.
+AC_ARG_WITH([libexec-leaf-dir],
+    AS_HELP_STRING([--with-libexec-leaf-dir=SUBDIR],
+    [Name of subdirectory in libexecdir to use.]),
+    [libexec_subdir=$withval],
+    [libexec_subdir=$PACKAGE_TARNAME])
+
 AC_ARG_WITH([xen-dumpdir],
     AS_HELP_STRING([--with-xen-dumpdir=DIR],
     [Path to directory for domU crash dumps. [LOCALSTATEDIR/lib/xen/dump]]),
@@ -77,13 +85,17 @@ if test "$libexecdir" = '${exec_prefix}/libexec' ; then
     esac
 fi
 dnl expand exec_prefix or it will endup in substituted variables
-libexecdir=`eval echo $libexecdir`
-dnl autoconf doc suggest to use a "package name" subdir
-dnl This variable will be substituted in various .in files
-LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
-AC_SUBST(LIBEXEC_BIN)
+LIBEXEC=`eval echo $libexecdir/$libexec_subdir`
+AC_SUBST(LIBEXEC)
 
-XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+dnl These variables will be substituted in various .in files
+LIBEXEC_BIN=${LIBEXEC}/bin
+AC_SUBST(LIBEXEC_BIN)
+LIBEXEC_LIB=${LIBEXEC}/lib
+AC_SUBST(LIBEXEC_LIB)
+LIBEXEC_INC=${LIBEXEC}/include
+AC_SUBST(LIBEXEC_INC)
+XENFIRMWAREDIR=${LIBEXEC}/boot
 AC_SUBST(XENFIRMWAREDIR)
 
 XEN_RUN_DIR=$localstatedir/run/xen
diff --git a/tools/configure b/tools/configure
index 41bed77..cd41b26 100755
--- a/tools/configure
+++ b/tools/configure
@@ -726,7 +726,10 @@ XEN_LIB_STORED
 XEN_LOG_DIR
 XEN_RUN_DIR
 XENFIRMWAREDIR
+LIBEXEC_INC
+LIBEXEC_LIB
 LIBEXEC_BIN
+LIBEXEC
 CONFIG_LEAF_DIR
 FILE_OFFSET_BITS
 OBJEXT
@@ -789,6 +792,7 @@ enable_option_checking
 enable_largefile
 with_initddir
 with_sysconfig_leaf_dir
+with_libexec_leaf_dir
 with_xen_dumpdir
 enable_rpath
 enable_githttp
@@ -1490,6 +1494,8 @@ Optional Packages:
                           options for runlevel scripts and daemons such as
                           xenstored. This should be either "sysconfig" or
                           "default". [sysconfig]
+  --with-libexec-leaf-dir=SUBDIR
+                          Name of subdirectory in libexecdir to use.
   --with-xen-dumpdir=DIR  Path to directory for domU crash dumps.
                           [LOCALSTATEDIR/lib/xen/dump]
   --with-linux-backend-modules="mod1 mod2"
@@ -3887,6 +3893,15 @@ CONFIG_LEAF_DIR=$config_leaf_dir
 
 
 
+# Check whether --with-libexec-leaf-dir was given.
+if test "${with_libexec_leaf_dir+set}" = set; then :
+  withval=$with_libexec_leaf_dir; libexec_subdir=$withval
+else
+  libexec_subdir=$PACKAGE_TARNAME
+fi
+
+
+
 # Check whether --with-xen-dumpdir was given.
 if test "${with_xen_dumpdir+set}" = set; then :
   withval=$with_xen_dumpdir; xen_dumpdir_path=$withval
@@ -3903,11 +3918,16 @@ if test "$libexecdir" = '${exec_prefix}/libexec' ; then
          ;;
     esac
 fi
-libexecdir=`eval echo $libexecdir`
-LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
+LIBEXEC=`eval echo $libexecdir/$libexec_subdir`
+
+
+LIBEXEC_BIN=${LIBEXEC}/bin
+
+LIBEXEC_LIB=${LIBEXEC}/lib
 
+LIBEXEC_INC=${LIBEXEC}/include
 
-XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+XENFIRMWAREDIR=${LIBEXEC}/boot
 
 
 XEN_RUN_DIR=$localstatedir/run/xen
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:56:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:56: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 1aJ2FD-0007VY-40; Tue, 12 Jan 2016 16:56: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 1aJ2F3-0007U6-DM
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:28 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	20/E9-28221-43035965; Tue, 12 Jan 2016 16:56:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1452617778!16375055!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40521 invoked from network); 12 Jan 2016 16:56:19 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:56:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2FI-0007An-7M
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2F0-0005Pe-D5
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:18 +0000
Date: Tue, 12 Jan 2016 16:56:18 +0000
Message-Id: <E1aJ2F0-0005Pe-D5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: recurse into tools/include in
	mk-headers-$(XEN_TARGET_ARCH) rule
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b48aae50a872b9db3c595f2b0e2277087c7819d9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 16 12:31:08 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:33:32 2016 +0000

    stubdom: recurse into tools/include in mk-headers-$(XEN_TARGET_ARCH) rule
    
    ... rather than in the libxc rule.
    
    This puts all the header dependencies in one place and will allow us
    to avoid races when more libraries which need these headers are
    introduced. I observed issues with the xen-foreign/tmp.size file
    getting deleted in parallel with another process trying to use it.
    
    The mini-os links are already created in the
    mk-headers-$(XEN_TARGET_ARCH) target so the other places which do so
    are redundant, in the case of polarssl and vtpmmgr indirectly through
    their eventual dependency on newlib which in turn depends on
    mk-headers-$(XEN_TARGET_ARCH).
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Cc: samuel.thibault@ens-lyon.org
---
 stubdom/Makefile |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index e1359cf..fd84024 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -304,6 +304,7 @@ ioemu/linkfarm.stamp:
 endif
 
 mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
+	$(MAKE) -C $(XEN_ROOT)/tools/include
 	mkdir -p include/xen && \
           ln -sf $(wildcard $(XEN_ROOT)/xen/include/public/*.h) include/xen && \
           ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 hvm io xsm) include/xen && \
@@ -341,9 +342,7 @@ $(TARGETS_MINIOS): mini-os-%:
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: cross-zlib
-	$(MAKE) -C $(XEN_ROOT)/tools/include
-	$(MAKE) DESTDIR= -C $(MINI_OS) links
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) cross-zlib
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
@@ -386,7 +385,6 @@ c: $(CROSS_ROOT)
 
 .PHONY: vtpm
 vtpm: cross-polarssl cross-tpmemu
-	make -C $(MINI_OS) links
 	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
 
 ######
@@ -395,7 +393,6 @@ vtpm: cross-polarssl cross-tpmemu
 
 .PHONY: vtpmmgr
 vtpmmgr: cross-polarssl
-	make -C $(MINI_OS) links
 	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
 
 ######
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:56:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:56: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 1aJ2FD-0007VY-40; Tue, 12 Jan 2016 16:56: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 1aJ2F3-0007U6-DM
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:28 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	20/E9-28221-43035965; Tue, 12 Jan 2016 16:56:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1452617778!16375055!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40521 invoked from network); 12 Jan 2016 16:56:19 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:56:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2FI-0007An-7M
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2F0-0005Pe-D5
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:18 +0000
Date: Tue, 12 Jan 2016 16:56:18 +0000
Message-Id: <E1aJ2F0-0005Pe-D5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: recurse into tools/include in
	mk-headers-$(XEN_TARGET_ARCH) rule
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b48aae50a872b9db3c595f2b0e2277087c7819d9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 16 12:31:08 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:33:32 2016 +0000

    stubdom: recurse into tools/include in mk-headers-$(XEN_TARGET_ARCH) rule
    
    ... rather than in the libxc rule.
    
    This puts all the header dependencies in one place and will allow us
    to avoid races when more libraries which need these headers are
    introduced. I observed issues with the xen-foreign/tmp.size file
    getting deleted in parallel with another process trying to use it.
    
    The mini-os links are already created in the
    mk-headers-$(XEN_TARGET_ARCH) target so the other places which do so
    are redundant, in the case of polarssl and vtpmmgr indirectly through
    their eventual dependency on newlib which in turn depends on
    mk-headers-$(XEN_TARGET_ARCH).
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Cc: samuel.thibault@ens-lyon.org
---
 stubdom/Makefile |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index e1359cf..fd84024 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -304,6 +304,7 @@ ioemu/linkfarm.stamp:
 endif
 
 mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
+	$(MAKE) -C $(XEN_ROOT)/tools/include
 	mkdir -p include/xen && \
           ln -sf $(wildcard $(XEN_ROOT)/xen/include/public/*.h) include/xen && \
           ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 hvm io xsm) include/xen && \
@@ -341,9 +342,7 @@ $(TARGETS_MINIOS): mini-os-%:
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: cross-zlib
-	$(MAKE) -C $(XEN_ROOT)/tools/include
-	$(MAKE) DESTDIR= -C $(MINI_OS) links
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) cross-zlib
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
@@ -386,7 +385,6 @@ c: $(CROSS_ROOT)
 
 .PHONY: vtpm
 vtpm: cross-polarssl cross-tpmemu
-	make -C $(MINI_OS) links
 	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
 
 ######
@@ -395,7 +393,6 @@ vtpm: cross-polarssl cross-tpmemu
 
 .PHONY: vtpmmgr
 vtpmmgr: cross-polarssl
-	make -C $(MINI_OS) links
 	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
 
 ######
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:56:33 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:56: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 1aJ2FF-0007XT-RA; Tue, 12 Jan 2016 16:56: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 1aJ2FE-0007WS-P5
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:33 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	59/0C-13487-04035965; Tue, 12 Jan 2016 16:56:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1452617789!15386346!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37245 invoked from network); 12 Jan 2016 16:56:30 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:56:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2FS-0007Ar-Kh
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2FA-0005Q0-Vz
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:29 +0000
Date: Tue, 12 Jan 2016 16:56:28 +0000
Message-Id: <E1aJ2FA-0005Q0-Vz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Refactor "xentoollog" into its
	own library
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5d3dc8671521ea4a4f753e77d3e7fb3a3a6f5f80
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 16 12:31:09 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:45:26 2016 +0000

    tools: Refactor "xentoollog" into its own library
    
    In attempting to disaggregate libxenctrl I found that many of the
    pieces were going to want access to this library, so split it out (as
    it probably should always have been).
    
    Various build adjustments are needed. In particular things which use
    xtl_* themselves now need to explicity link against the library.
    
    This has a nice side effect which is that users of libxl no longer
    need to link against libxenctrl just to create a logger, which was
    counter to the principal that applications using libxl shouldn't be
    required to look behind the curtain. This means that xl no longer
    links against libxenctrl.
    
    The new library uses a version script to ensure that only expected
    symbols are exported and to version them such that ABI guarantees can
    be kept in the future.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- dropped QEMU_TRADITIONAL_REVISION update, this had since
             progressed to 569eac99e8dd which is after 9fad9ed28583, the
             commit needed here. ]
---
 .gitignore                               |    1 +
 Config.mk                                |    6 +-
 stubdom/Makefile                         |   22 ++++-
 stubdom/grub/Makefile                    |    1 +
 tools/Makefile                           |    3 +
 tools/Rules.mk                           |   14 ++-
 tools/libs/Makefile                      |    7 +
 tools/libs/toollog/Makefile              |   59 +++++++++
 tools/libs/toollog/include/xentoollog.h  |  136 +++++++++++++++++++++
 tools/libs/toollog/libxentoollog.map     |   12 ++
 tools/libs/toollog/xtl_core.c            |   83 +++++++++++++
 tools/libs/toollog/xtl_logger_stdio.c    |  192 ++++++++++++++++++++++++++++++
 tools/libxc/Makefile                     |    7 +-
 tools/libxc/include/xentoollog.h         |  136 ---------------------
 tools/libxc/xtl_core.c                   |   83 -------------
 tools/libxc/xtl_logger_stdio.c           |  192 ------------------------------
 tools/libxl/Makefile                     |   15 ++-
 tools/ocaml/libs/xentoollog/Makefile     |    6 +-
 tools/ocaml/libs/xentoollog/genlevels.py |    2 +-
 tools/python/setup.py                    |    5 +-
 tools/xenpaging/Makefile                 |    2 +-
 21 files changed, 547 insertions(+), 437 deletions(-)

diff --git a/.gitignore b/.gitignore
index 0a0f3ad..e0df903 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,6 +58,7 @@ stubdom/gcc-*
 stubdom/include
 stubdom/ioemu
 stubdom/xenstore
+stubdom/libxentoollog-*
 stubdom/libxc-*
 stubdom/lwip-*
 stubdom/mini-os-*
diff --git a/Config.mk b/Config.mk
index 075bb01..a3be5ed 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= bccd90071e863ec22216a000f1a07035e2f226ff
-# Mon Nov 23 16:34:31 2015 +0000
-# Add a .gitignore
+MINIOS_UPSTREAM_REVISION ?= d25773c8afa2f4dbbb466116daeb60159ddd22bd
+# Thu Dec 3 11:23:25 2015 +0000
+# mini-os: Include libxentoollog with libxc
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.9.0
 # Tue Nov 17 09:18:44 2015 -0500
diff --git a/stubdom/Makefile b/stubdom/Makefile
index fd84024..9c77205 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -314,6 +314,11 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
 	  ln -sf $(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*) include/xen-foreign/ && \
 	  $(MAKE) DESTDIR= -C include/xen-foreign/ && \
 	  ( [ -h include/xen/foreign ] || ln -sf ../xen-foreign include/xen/foreign )
+	mkdir -p libs-$(XEN_TARGET_ARCH)/toollog
+	[ -h libs-$(XEN_TARGET_ARCH)/toollog/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/toollog && \
+	  ln -sf $(XEN_ROOT)/tools/libs/toollog/include/*.h . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/toollog/*.c . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/toollog/Makefile . )
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
@@ -337,12 +342,21 @@ $(TARGETS_MINIOS): mini-os-%:
 	done
 
 #######
+# libxentoollog
+#######
+
+.PHONY: libxentoollog
+libxentoollog: libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a
+libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/toollog
+
+#######
 # libxc
 #######
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog cross-zlib
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
@@ -512,6 +526,11 @@ clean:
 	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
+	[ ! -e libs-$(XEN_TARGET_ARCH)/toollog/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/toollog clean
+	[ ! -e libs-$(XEN_TARGET_ARCH)/evtchn/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/evtchn clean
+	[ ! -e libs-$(XEN_TARGET_ARCH)/gnttab/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/gnttab clean
+	[ ! -e libs-$(XEN_TARGET_ARCH)/call/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/call clean
+	[ ! -e libs-$(XEN_TARGET_ARCH)/foreignmemory/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/foreignmemory clean
 	[ ! -e libxc-$(XEN_TARGET_ARCH)/Makefile ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
 	-[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
 	-[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
@@ -522,6 +541,7 @@ crossclean: clean
 	rm -fr $(CROSS_ROOT)
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
+	rm -fr libs-$(XEN_TARGET_ARCH)
 	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu xenstore
 	rm -fr gmp-$(XEN_TARGET_ARCH)
 	rm -fr polarssl-$(XEN_TARGET_ARCH)
diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
index 934cc4c..26dff45 100644
--- a/stubdom/grub/Makefile
+++ b/stubdom/grub/Makefile
@@ -5,6 +5,7 @@ vpath %.c ../grub-upstream
 
 BOOT=$(OBJ_DIR)/boot-$(XEN_TARGET_ARCH).o
 
+DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/toollog/include
 DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc/include -I$(XEN_ROOT)/tools/include -I.
 DEF_CPPFLAGS += -I../grub-upstream/stage1
 DEF_CPPFLAGS += -I../grub-upstream/stage2
diff --git a/tools/Makefile b/tools/Makefile
index 820ca40..9f74ac7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 SUBDIRS-y :=
 SUBDIRS-y += include
+SUBDIRS-y += libs
 SUBDIRS-y += libxc
 SUBDIRS-$(FLASK_ENABLE) += flask
 SUBDIRS-y += xenstore
@@ -248,12 +249,14 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--includedir=$(LIBEXEC_INC) \
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
+		-I$(XEN_ROOT)/tools/libs/toollog/include \
 		-I$(XEN_ROOT)/tools/libxc/include \
 		-I$(XEN_ROOT)/tools/xenstore/include \
 		-I$(XEN_ROOT)/tools/xenstore/compat/include \
 		$(EXTRA_CFLAGS_QEMU_XEN)" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore \
+		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog \
 		$(QEMU_UPSTREAM_RPATH)" \
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 37b0aaf..0652e4b 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -10,6 +10,7 @@ export _INSTALL := $(INSTALL)
 INSTALL = $(XEN_ROOT)/tools/cross-install
 
 XEN_INCLUDE        = $(XEN_ROOT)/tools/include
+XEN_LIBXENTOOLLOG  = $(XEN_ROOT)/tools/libs/toollog
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_XENLIGHT       = $(XEN_ROOT)/tools/libxl
 XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
@@ -76,10 +77,15 @@ endif
 # Consumers of libfoo should not directly use $(SHDEPS_libfoo) or
 # $(SHLIB_libfoo)
 
-CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
-SHDEPS_libxenctrl =
-LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension)
-SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
+CFLAGS_libxentoollog = -I$(XEN_LIBXENTOOLLOG)/include $(CFLAGS_xeninclude)
+SHDEPS_libxentoollog =
+LDLIBS_libxentoollog = $(XEN_LIBXENTOOLLOG)/libxentoollog$(libextension)
+SHLIB_libxentoollog  = -Wl,-rpath-link=$(XEN_LIBXENTOOLLOG)
+
+CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_xeninclude)
+SHDEPS_libxenctrl = $(SHLIB_libxentoollog)
+LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libextension)
+SHLIB_libxenctrl  = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_LIBXC)
 
 CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 SHDEPS_libxenguest =
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
new file mode 100644
index 0000000..73be500
--- /dev/null
+++ b/tools/libs/Makefile
@@ -0,0 +1,7 @@
+XEN_ROOT = $(CURDIR)/../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+SUBDIRS-y :=
+SUBDIRS-y += toollog
+
+all clean install distclean: %: subdirs-%
diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile
new file mode 100644
index 0000000..bd12403
--- /dev/null
+++ b/tools/libs/toollog/Makefile
@@ -0,0 +1,59 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR	= 1
+MINOR	= 0
+SHLIB_LDFLAGS += -Wl,--version-script=libxentoollog.map
+
+CFLAGS	+= -Werror -Wmissing-prototypes
+CFLAGS	+= -I./include
+
+SRCS-y	+= xtl_core.c
+SRCS-y	+= xtl_logger_stdio.c
+
+LIB_OBJS := $(patsubst %.c,%.o,$(SRCS-y))
+PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS-y))
+
+LIB := libxentoollog.a
+ifneq ($(nosharedlibs),y)
+LIB += libxentoollog.so
+endif
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build:
+	$(MAKE) libs
+
+.PHONY: libs
+libs: $(LIB)
+
+libxentoollog.a: $(LIB_OBJS)
+	$(AR) rc $@ $^
+
+libxentoollog.so: libxentoollog.so.$(MAJOR)
+	$(SYMLINK_SHLIB) $< $@
+libxentoollog.so.$(MAJOR): libxentoollog.so.$(MAJOR).$(MINOR)
+	$(SYMLINK_SHLIB) $< $@
+
+libxentoollog.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxentoollog.map
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxentoollog.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: build
+	$(INSTALL_DIR) $(DESTDIR)$(libdir)
+	$(INSTALL_DIR) $(DESTDIR)$(includedir)
+	$(INSTALL_SHLIB) libxentoollog.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) libxentoollog.a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) libxentoollog.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxentoollog.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxentoollog.so.$(MAJOR) $(DESTDIR)$(libdir)/libxentoollog.so
+	$(INSTALL_DATA) include/xentoollog.h $(DESTDIR)$(includedir)
+
+.PHONY: TAGS
+TAGS:
+	etags -t *.c *.h
+
+.PHONY: clean
+clean:
+	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
diff --git a/tools/libs/toollog/include/xentoollog.h b/tools/libs/toollog/include/xentoollog.h
new file mode 100644
index 0000000..853e9c7
--- /dev/null
+++ b/tools/libs/toollog/include/xentoollog.h
@@ -0,0 +1,136 @@
+/*
+ * xentoollog.h
+ *
+ * Copyright (c) 2010 Citrix
+ * Part of a generic logging interface used by various dom0 userland libraries.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef XENTOOLLOG_H
+#define XENTOOLLOG_H
+
+#include <stdio.h>
+#include <stdarg.h>
+
+
+/*---------- common declarations and types ----------*/
+
+typedef enum xentoollog_level {
+    XTL_NONE, /* sentinel etc, never used for logging */
+    XTL_DEBUG,
+    XTL_VERBOSE,
+    XTL_DETAIL,
+    XTL_PROGRESS, /* also used for "progress" messages */
+    XTL_INFO,
+    XTL_NOTICE,
+    XTL_WARN,
+    XTL_ERROR,
+    XTL_CRITICAL,
+    XTL_NUM_LEVELS
+} xentoollog_level;
+
+typedef struct xentoollog_logger xentoollog_logger;
+struct xentoollog_logger {
+    void (*vmessage)(struct xentoollog_logger *logger,
+                     xentoollog_level level,
+                     int errnoval /* or -1 */,
+                     const char *context /* eg "xc", "xl", may be 0 */,
+                     const char *format /* without level, context, \n */,
+                     va_list al)
+         __attribute__((format(printf,5,0)));
+    void (*progress)(struct xentoollog_logger *logger,
+                     const char *context /* see above */,
+                     const char *doing_what /* no \r,\n */,
+                     int percent, unsigned long done, unsigned long total)
+         /* null function pointer is ok.
+          * will always be called with done==0 for each new
+          * context/doing_what */;
+    void (*destroy)(struct xentoollog_logger *logger);
+    /* each logger can put its necessary data here */
+};
+
+
+/*---------- facilities for consuming log messages ----------*/
+
+#define XTL_STDIOSTREAM_SHOW_PID            001u
+#define XTL_STDIOSTREAM_SHOW_DATE           002u
+#define XTL_STDIOSTREAM_HIDE_PROGRESS       004u
+#define XTL_STDIOSTREAM_PROGRESS_USE_CR     010u /* default is to */
+#define XTL_STDIOSTREAM_PROGRESS_NO_CR      020u /* use \r to ttys */
+
+typedef struct xentoollog_logger_stdiostream  xentoollog_logger_stdiostream;
+
+xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
+        (FILE *f, xentoollog_level min_level, unsigned flags);
+    /* may return 0 if malloc fails, in which case error was logged */
+    /* destroy on this logger does not close the file */
+
+void xtl_stdiostream_set_minlevel(xentoollog_logger_stdiostream*,
+                                  xentoollog_level min_level);
+void xtl_stdiostream_adjust_flags(xentoollog_logger_stdiostream*,
+                                  unsigned set_flags, unsigned clear_flags);
+  /* if set_flags and clear_flags overlap, set_flags takes precedence */
+
+void xtl_logger_destroy(struct xentoollog_logger *logger /* 0 is ok */);
+
+
+/*---------- facilities for generating log messages ----------*/
+
+void xtl_logv(struct xentoollog_logger *logger,
+              xentoollog_level level,
+              int errnoval /* or -1 */,
+              const char *context /* eg "xc", "xenstore", "xl", may be 0 */,
+              const char *format /* does not contain \n */,
+              va_list) __attribute__((format(printf,5,0)));
+
+void xtl_log(struct xentoollog_logger *logger,
+             xentoollog_level level,
+             int errnoval /* or -1 */,
+             const char *context /* eg "xc", "xenstore", "xl" */,
+             const char *format /* does not contain \n */,
+             ...) __attribute__((format(printf,5,6)));
+
+void xtl_progress(struct xentoollog_logger *logger,
+                  const char *context /* see above, may be 0 */,
+                  const char *doing_what,
+                  unsigned long done, unsigned long total);
+
+
+/*---------- facilities for defining log message consumers ----------*/
+
+const char *xtl_level_to_string(xentoollog_level); /* never fails */
+
+
+#define XTL_NEW_LOGGER(LOGGER,buffer) ({                                \
+    xentoollog_logger_##LOGGER *new_consumer;                           \
+                                                                        \
+    (buffer).vtable.vmessage = LOGGER##_vmessage;                       \
+    (buffer).vtable.progress = LOGGER##_progress;                       \
+    (buffer).vtable.destroy  = LOGGER##_destroy;                        \
+                                                                        \
+    new_consumer = malloc(sizeof(*new_consumer));                       \
+    if (!new_consumer) {                                                \
+        xtl_log((xentoollog_logger*)&buffer,                            \
+                XTL_CRITICAL, errno, "xtl",                             \
+                "failed to allocate memory for new message logger");    \
+    } else {                                                            \
+        *new_consumer = buffer;                                         \
+    }                                                                   \
+                                                                        \
+    new_consumer;                                                       \
+});
+
+
+#endif /* XENTOOLLOG_H */
diff --git a/tools/libs/toollog/libxentoollog.map b/tools/libs/toollog/libxentoollog.map
new file mode 100644
index 0000000..c183cf5
--- /dev/null
+++ b/tools/libs/toollog/libxentoollog.map
@@ -0,0 +1,12 @@
+VERS_1.0 {
+	global:
+		xtl_createlogger_stdiostream;
+		xtl_level_to_string;
+		xtl_log;
+		xtl_logger_destroy;
+		xtl_logv;
+		xtl_progress;
+		xtl_stdiostream_adjust_flags;
+		xtl_stdiostream_set_minlevel;
+	local: *; /* Do not expose anything by default */
+};
diff --git a/tools/libs/toollog/xtl_core.c b/tools/libs/toollog/xtl_core.c
new file mode 100644
index 0000000..c4724a0
--- /dev/null
+++ b/tools/libs/toollog/xtl_core.c
@@ -0,0 +1,83 @@
+/*
+ * xtl_core.c
+ *
+ * core code including functions for generating log messages
+ *
+ * Copyright (c) 2010 Citrix
+ * Part of a generic logging interface used by various dom0 userland libraries.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "xentoollog.h"
+
+#include <assert.h>
+#include <errno.h>
+#include <limits.h>
+
+static const char *level_strings[XTL_NUM_LEVELS]= {
+    "[BUG:XTL_NONE]",
+    "debug", "verbose", "detail",  /* normally off by default */
+    "progress", "info", "notice",  /* not a problem */
+    "warning", "error", "critical" /* problems and errors */
+};
+
+const char *xtl_level_to_string(xentoollog_level level) {
+    assert(level >= 0 && level < XTL_NUM_LEVELS);
+    return level_strings[level];
+}
+
+void xtl_logv(struct xentoollog_logger *logger,
+              xentoollog_level level,
+              int errnoval /* or -1 */,
+              const char *context /* eg "xc", "xenstore", "xl" */,
+              const char *format /* does not contain \n */,
+              va_list al) {
+    int errno_save = errno;
+    assert(level > XTL_NONE && level < XTL_NUM_LEVELS);
+    logger->vmessage(logger,level,errnoval,context,format,al);
+    errno = errno_save;
+}
+
+void xtl_log(struct xentoollog_logger *logger,
+             xentoollog_level level,
+             int errnoval /* or -1 */,
+             const char *context /* eg "xc", "xenstore", "xl" */,
+             const char *format /* does not contain \n */,
+             ...) {
+    va_list al;
+    va_start(al,format);
+    xtl_logv(logger,level,errnoval,context,format,al);
+    va_end(al);
+}
+
+void xtl_progress(struct xentoollog_logger *logger,
+                  const char *context, const char *doing_what,
+                  unsigned long done, unsigned long total) {
+    int percent = 0;
+
+    if (!logger->progress) return;
+
+    if ( total )
+        percent = (total < LONG_MAX/100)
+            ? (done * 100) / total
+            : done / ((total + 99) / 100);
+
+    logger->progress(logger, context, doing_what, percent, done, total);
+}
+
+void xtl_logger_destroy(struct xentoollog_logger *logger) {
+    if (!logger) return;
+    logger->destroy(logger);
+}
diff --git a/tools/libs/toollog/xtl_logger_stdio.c b/tools/libs/toollog/xtl_logger_stdio.c
new file mode 100644
index 0000000..0cd9206
--- /dev/null
+++ b/tools/libs/toollog/xtl_logger_stdio.c
@@ -0,0 +1,192 @@
+/*
+ * xtl_logger_stdio.c
+ *
+ * log message consumer that writes to stdio
+ *
+ * Copyright (c) 2010 Citrix
+ * Part of a generic logging interface used by various dom0 userland libraries.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "xentoollog.h"
+
+#include <time.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <stdbool.h>
+
+struct xentoollog_logger_stdiostream {
+    xentoollog_logger vtable;
+    FILE *f;
+    xentoollog_level min_level;
+    unsigned flags;
+    int progress_erase_len, progress_last_percent;
+    bool progress_use_cr;
+};
+
+static void progress_erase(xentoollog_logger_stdiostream *lg) {
+    if (lg->progress_erase_len)
+        fprintf(lg->f, "\r%*s\r", lg->progress_erase_len, "");
+}
+
+static void stdiostream_vmessage(xentoollog_logger *logger_in,
+                                 xentoollog_level level,
+                                 int errnoval,
+                                 const char *context,
+                                 const char *format,
+                                 va_list al) {
+    xentoollog_logger_stdiostream *lg = (void*)logger_in;
+
+    if (level < lg->min_level)
+        return;
+
+    progress_erase(lg);
+
+    if (lg->flags & XTL_STDIOSTREAM_SHOW_DATE) {
+        struct tm lt_buf;
+        time_t now = time(0);
+        struct tm *lt= localtime_r(&now, &lt_buf);
+        if (lt != NULL)
+            fprintf(lg->f, "%04d-%02d-%02d %02d:%02d:%02d %s ",
+                    lt->tm_year+1900, lt->tm_mon+1, lt->tm_mday,
+                    lt->tm_hour, lt->tm_min, lt->tm_sec,
+                    tzname[!!lt->tm_isdst]);
+        else
+            fprintf(lg->f, "[localtime_r failed: %d] ", errno);
+    }
+    if (lg->flags & XTL_STDIOSTREAM_SHOW_PID)
+        fprintf(lg->f, "[%lu] ", (unsigned long)getpid());
+
+    if (context)
+        fprintf(lg->f, "%s: ", context);
+
+    fprintf(lg->f, "%s: ", xtl_level_to_string(level));
+
+    vfprintf(lg->f, format, al);
+
+    if (errnoval >= 0)
+        fprintf(lg->f, ": %s", strerror(errnoval));
+
+    putc('\n', lg->f);
+    fflush(lg->f);
+}
+
+static void stdiostream_message(struct xentoollog_logger *logger_in,
+                                xentoollog_level level,
+                                const char *context,
+                                const char *format, ...)
+{
+    va_list al;
+    va_start(al,format);
+    stdiostream_vmessage(logger_in, level, -1, context, format, al);
+    va_end(al);
+}
+
+static void stdiostream_progress(struct xentoollog_logger *logger_in,
+                                 const char *context,
+                                 const char *doing_what, int percent,
+                                 unsigned long done, unsigned long total) {
+    xentoollog_logger_stdiostream *lg = (void*)logger_in;
+    int newpel, extra_erase;
+    xentoollog_level this_level;
+
+    if (lg->flags & XTL_STDIOSTREAM_HIDE_PROGRESS)
+        return;
+
+    if (percent < lg->progress_last_percent) {
+        this_level = XTL_PROGRESS;
+    } else if (percent == lg->progress_last_percent) {
+        return;
+    } else if (percent < lg->progress_last_percent + 5) {
+        this_level = XTL_DETAIL;
+    } else {
+        this_level = XTL_PROGRESS;
+    }
+
+    if (this_level < lg->min_level)
+        return;
+
+    lg->progress_last_percent = percent;
+
+    if (!lg->progress_use_cr) {
+        stdiostream_message(logger_in, this_level, context,
+                            "%s: %lu/%lu  %3d%%",
+                            doing_what, done, total, percent);
+        return;
+    }
+
+    if (lg->progress_erase_len)
+        putc('\r', lg->f);
+
+    newpel = fprintf(lg->f, "%s%s" "%s: %lu/%lu  %3d%%%s",
+                     context?context:"", context?": ":"",
+                     doing_what, done, total, percent,
+		     done == total ? "\n" : "");
+
+    extra_erase = lg->progress_erase_len - newpel;
+    if (extra_erase > 0)
+        fprintf(lg->f, "%*s\r", extra_erase, "");
+
+    lg->progress_erase_len = newpel;
+}
+
+static void stdiostream_destroy(struct xentoollog_logger *logger_in) {
+    xentoollog_logger_stdiostream *lg = (void*)logger_in;
+    progress_erase(lg);
+    free(lg);
+}
+
+void xtl_stdiostream_set_minlevel(xentoollog_logger_stdiostream *lg,
+                                  xentoollog_level min_level) {
+    lg->min_level = min_level;
+}
+
+void xtl_stdiostream_adjust_flags(xentoollog_logger_stdiostream *lg,
+                                  unsigned set_flags, unsigned clear_flags) {
+    unsigned new_flags = (lg->flags & ~clear_flags) | set_flags;
+    if (new_flags & XTL_STDIOSTREAM_HIDE_PROGRESS)
+        progress_erase(lg);
+    lg->flags = new_flags;
+}
+
+xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
+        (FILE *f, xentoollog_level min_level, unsigned flags) {
+    xentoollog_logger_stdiostream newlogger;
+
+    newlogger.f = f;
+    newlogger.min_level = min_level;
+    newlogger.flags = flags;
+
+    switch (flags & (XTL_STDIOSTREAM_PROGRESS_USE_CR |
+                     XTL_STDIOSTREAM_PROGRESS_NO_CR)) {
+    case XTL_STDIOSTREAM_PROGRESS_USE_CR: newlogger.progress_use_cr = 1; break;
+    case XTL_STDIOSTREAM_PROGRESS_NO_CR:  newlogger.progress_use_cr = 0; break;
+    case 0:
+        newlogger.progress_use_cr = isatty(fileno(newlogger.f)) > 0;
+        break;
+    default:
+        errno = EINVAL;
+        return 0;
+    }
+
+    if (newlogger.flags & XTL_STDIOSTREAM_SHOW_DATE) tzset();
+
+    newlogger.progress_erase_len = 0;
+    newlogger.progress_last_percent = 0;
+
+    return XTL_NEW_LOGGER(stdiostream, newlogger);
+}
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 818f2e4..940708f 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -39,8 +39,6 @@ CTRL_SRCS-y       += xc_memshr.c
 CTRL_SRCS-y       += xc_hcall_buf.c
 CTRL_SRCS-y       += xc_foreign_memory.c
 CTRL_SRCS-y       += xc_kexec.c
-CTRL_SRCS-y       += xtl_core.c
-CTRL_SRCS-y       += xtl_logger_stdio.c
 CTRL_SRCS-y       += xc_resource.c
 CTRL_SRCS-$(CONFIG_X86) += xc_psr.c
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
@@ -112,6 +110,7 @@ CFLAGS   += -I. -I./include $(CFLAGS_xeninclude)
 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
 
 CFLAGS	+= $(PTHREAD_CFLAGS)
+CFLAGS	+= $(CFLAGS_libxentoollog)
 
 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
@@ -165,7 +164,7 @@ install: build
 	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenctrl.so
-	$(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h include/xentoollog.h $(DESTDIR)$(includedir)
+	$(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h $(DESTDIR)$(includedir)
 	$(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
 	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR)
@@ -208,7 +207,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
diff --git a/tools/libxc/include/xentoollog.h b/tools/libxc/include/xentoollog.h
deleted file mode 100644
index 853e9c7..0000000
--- a/tools/libxc/include/xentoollog.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * xentoollog.h
- *
- * Copyright (c) 2010 Citrix
- * Part of a generic logging interface used by various dom0 userland libraries.
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef XENTOOLLOG_H
-#define XENTOOLLOG_H
-
-#include <stdio.h>
-#include <stdarg.h>
-
-
-/*---------- common declarations and types ----------*/
-
-typedef enum xentoollog_level {
-    XTL_NONE, /* sentinel etc, never used for logging */
-    XTL_DEBUG,
-    XTL_VERBOSE,
-    XTL_DETAIL,
-    XTL_PROGRESS, /* also used for "progress" messages */
-    XTL_INFO,
-    XTL_NOTICE,
-    XTL_WARN,
-    XTL_ERROR,
-    XTL_CRITICAL,
-    XTL_NUM_LEVELS
-} xentoollog_level;
-
-typedef struct xentoollog_logger xentoollog_logger;
-struct xentoollog_logger {
-    void (*vmessage)(struct xentoollog_logger *logger,
-                     xentoollog_level level,
-                     int errnoval /* or -1 */,
-                     const char *context /* eg "xc", "xl", may be 0 */,
-                     const char *format /* without level, context, \n */,
-                     va_list al)
-         __attribute__((format(printf,5,0)));
-    void (*progress)(struct xentoollog_logger *logger,
-                     const char *context /* see above */,
-                     const char *doing_what /* no \r,\n */,
-                     int percent, unsigned long done, unsigned long total)
-         /* null function pointer is ok.
-          * will always be called with done==0 for each new
-          * context/doing_what */;
-    void (*destroy)(struct xentoollog_logger *logger);
-    /* each logger can put its necessary data here */
-};
-
-
-/*---------- facilities for consuming log messages ----------*/
-
-#define XTL_STDIOSTREAM_SHOW_PID            001u
-#define XTL_STDIOSTREAM_SHOW_DATE           002u
-#define XTL_STDIOSTREAM_HIDE_PROGRESS       004u
-#define XTL_STDIOSTREAM_PROGRESS_USE_CR     010u /* default is to */
-#define XTL_STDIOSTREAM_PROGRESS_NO_CR      020u /* use \r to ttys */
-
-typedef struct xentoollog_logger_stdiostream  xentoollog_logger_stdiostream;
-
-xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
-        (FILE *f, xentoollog_level min_level, unsigned flags);
-    /* may return 0 if malloc fails, in which case error was logged */
-    /* destroy on this logger does not close the file */
-
-void xtl_stdiostream_set_minlevel(xentoollog_logger_stdiostream*,
-                                  xentoollog_level min_level);
-void xtl_stdiostream_adjust_flags(xentoollog_logger_stdiostream*,
-                                  unsigned set_flags, unsigned clear_flags);
-  /* if set_flags and clear_flags overlap, set_flags takes precedence */
-
-void xtl_logger_destroy(struct xentoollog_logger *logger /* 0 is ok */);
-
-
-/*---------- facilities for generating log messages ----------*/
-
-void xtl_logv(struct xentoollog_logger *logger,
-              xentoollog_level level,
-              int errnoval /* or -1 */,
-              const char *context /* eg "xc", "xenstore", "xl", may be 0 */,
-              const char *format /* does not contain \n */,
-              va_list) __attribute__((format(printf,5,0)));
-
-void xtl_log(struct xentoollog_logger *logger,
-             xentoollog_level level,
-             int errnoval /* or -1 */,
-             const char *context /* eg "xc", "xenstore", "xl" */,
-             const char *format /* does not contain \n */,
-             ...) __attribute__((format(printf,5,6)));
-
-void xtl_progress(struct xentoollog_logger *logger,
-                  const char *context /* see above, may be 0 */,
-                  const char *doing_what,
-                  unsigned long done, unsigned long total);
-
-
-/*---------- facilities for defining log message consumers ----------*/
-
-const char *xtl_level_to_string(xentoollog_level); /* never fails */
-
-
-#define XTL_NEW_LOGGER(LOGGER,buffer) ({                                \
-    xentoollog_logger_##LOGGER *new_consumer;                           \
-                                                                        \
-    (buffer).vtable.vmessage = LOGGER##_vmessage;                       \
-    (buffer).vtable.progress = LOGGER##_progress;                       \
-    (buffer).vtable.destroy  = LOGGER##_destroy;                        \
-                                                                        \
-    new_consumer = malloc(sizeof(*new_consumer));                       \
-    if (!new_consumer) {                                                \
-        xtl_log((xentoollog_logger*)&buffer,                            \
-                XTL_CRITICAL, errno, "xtl",                             \
-                "failed to allocate memory for new message logger");    \
-    } else {                                                            \
-        *new_consumer = buffer;                                         \
-    }                                                                   \
-                                                                        \
-    new_consumer;                                                       \
-});
-
-
-#endif /* XENTOOLLOG_H */
diff --git a/tools/libxc/xtl_core.c b/tools/libxc/xtl_core.c
deleted file mode 100644
index c4724a0..0000000
--- a/tools/libxc/xtl_core.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * xtl_core.c
- *
- * core code including functions for generating log messages
- *
- * Copyright (c) 2010 Citrix
- * Part of a generic logging interface used by various dom0 userland libraries.
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include "xentoollog.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <limits.h>
-
-static const char *level_strings[XTL_NUM_LEVELS]= {
-    "[BUG:XTL_NONE]",
-    "debug", "verbose", "detail",  /* normally off by default */
-    "progress", "info", "notice",  /* not a problem */
-    "warning", "error", "critical" /* problems and errors */
-};
-
-const char *xtl_level_to_string(xentoollog_level level) {
-    assert(level >= 0 && level < XTL_NUM_LEVELS);
-    return level_strings[level];
-}
-
-void xtl_logv(struct xentoollog_logger *logger,
-              xentoollog_level level,
-              int errnoval /* or -1 */,
-              const char *context /* eg "xc", "xenstore", "xl" */,
-              const char *format /* does not contain \n */,
-              va_list al) {
-    int errno_save = errno;
-    assert(level > XTL_NONE && level < XTL_NUM_LEVELS);
-    logger->vmessage(logger,level,errnoval,context,format,al);
-    errno = errno_save;
-}
-
-void xtl_log(struct xentoollog_logger *logger,
-             xentoollog_level level,
-             int errnoval /* or -1 */,
-             const char *context /* eg "xc", "xenstore", "xl" */,
-             const char *format /* does not contain \n */,
-             ...) {
-    va_list al;
-    va_start(al,format);
-    xtl_logv(logger,level,errnoval,context,format,al);
-    va_end(al);
-}
-
-void xtl_progress(struct xentoollog_logger *logger,
-                  const char *context, const char *doing_what,
-                  unsigned long done, unsigned long total) {
-    int percent = 0;
-
-    if (!logger->progress) return;
-
-    if ( total )
-        percent = (total < LONG_MAX/100)
-            ? (done * 100) / total
-            : done / ((total + 99) / 100);
-
-    logger->progress(logger, context, doing_what, percent, done, total);
-}
-
-void xtl_logger_destroy(struct xentoollog_logger *logger) {
-    if (!logger) return;
-    logger->destroy(logger);
-}
diff --git a/tools/libxc/xtl_logger_stdio.c b/tools/libxc/xtl_logger_stdio.c
deleted file mode 100644
index 0cd9206..0000000
--- a/tools/libxc/xtl_logger_stdio.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * xtl_logger_stdio.c
- *
- * log message consumer that writes to stdio
- *
- * Copyright (c) 2010 Citrix
- * Part of a generic logging interface used by various dom0 userland libraries.
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include "xentoollog.h"
-
-#include <time.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <stdbool.h>
-
-struct xentoollog_logger_stdiostream {
-    xentoollog_logger vtable;
-    FILE *f;
-    xentoollog_level min_level;
-    unsigned flags;
-    int progress_erase_len, progress_last_percent;
-    bool progress_use_cr;
-};
-
-static void progress_erase(xentoollog_logger_stdiostream *lg) {
-    if (lg->progress_erase_len)
-        fprintf(lg->f, "\r%*s\r", lg->progress_erase_len, "");
-}
-
-static void stdiostream_vmessage(xentoollog_logger *logger_in,
-                                 xentoollog_level level,
-                                 int errnoval,
-                                 const char *context,
-                                 const char *format,
-                                 va_list al) {
-    xentoollog_logger_stdiostream *lg = (void*)logger_in;
-
-    if (level < lg->min_level)
-        return;
-
-    progress_erase(lg);
-
-    if (lg->flags & XTL_STDIOSTREAM_SHOW_DATE) {
-        struct tm lt_buf;
-        time_t now = time(0);
-        struct tm *lt= localtime_r(&now, &lt_buf);
-        if (lt != NULL)
-            fprintf(lg->f, "%04d-%02d-%02d %02d:%02d:%02d %s ",
-                    lt->tm_year+1900, lt->tm_mon+1, lt->tm_mday,
-                    lt->tm_hour, lt->tm_min, lt->tm_sec,
-                    tzname[!!lt->tm_isdst]);
-        else
-            fprintf(lg->f, "[localtime_r failed: %d] ", errno);
-    }
-    if (lg->flags & XTL_STDIOSTREAM_SHOW_PID)
-        fprintf(lg->f, "[%lu] ", (unsigned long)getpid());
-
-    if (context)
-        fprintf(lg->f, "%s: ", context);
-
-    fprintf(lg->f, "%s: ", xtl_level_to_string(level));
-
-    vfprintf(lg->f, format, al);
-
-    if (errnoval >= 0)
-        fprintf(lg->f, ": %s", strerror(errnoval));
-
-    putc('\n', lg->f);
-    fflush(lg->f);
-}
-
-static void stdiostream_message(struct xentoollog_logger *logger_in,
-                                xentoollog_level level,
-                                const char *context,
-                                const char *format, ...)
-{
-    va_list al;
-    va_start(al,format);
-    stdiostream_vmessage(logger_in, level, -1, context, format, al);
-    va_end(al);
-}
-
-static void stdiostream_progress(struct xentoollog_logger *logger_in,
-                                 const char *context,
-                                 const char *doing_what, int percent,
-                                 unsigned long done, unsigned long total) {
-    xentoollog_logger_stdiostream *lg = (void*)logger_in;
-    int newpel, extra_erase;
-    xentoollog_level this_level;
-
-    if (lg->flags & XTL_STDIOSTREAM_HIDE_PROGRESS)
-        return;
-
-    if (percent < lg->progress_last_percent) {
-        this_level = XTL_PROGRESS;
-    } else if (percent == lg->progress_last_percent) {
-        return;
-    } else if (percent < lg->progress_last_percent + 5) {
-        this_level = XTL_DETAIL;
-    } else {
-        this_level = XTL_PROGRESS;
-    }
-
-    if (this_level < lg->min_level)
-        return;
-
-    lg->progress_last_percent = percent;
-
-    if (!lg->progress_use_cr) {
-        stdiostream_message(logger_in, this_level, context,
-                            "%s: %lu/%lu  %3d%%",
-                            doing_what, done, total, percent);
-        return;
-    }
-
-    if (lg->progress_erase_len)
-        putc('\r', lg->f);
-
-    newpel = fprintf(lg->f, "%s%s" "%s: %lu/%lu  %3d%%%s",
-                     context?context:"", context?": ":"",
-                     doing_what, done, total, percent,
-		     done == total ? "\n" : "");
-
-    extra_erase = lg->progress_erase_len - newpel;
-    if (extra_erase > 0)
-        fprintf(lg->f, "%*s\r", extra_erase, "");
-
-    lg->progress_erase_len = newpel;
-}
-
-static void stdiostream_destroy(struct xentoollog_logger *logger_in) {
-    xentoollog_logger_stdiostream *lg = (void*)logger_in;
-    progress_erase(lg);
-    free(lg);
-}
-
-void xtl_stdiostream_set_minlevel(xentoollog_logger_stdiostream *lg,
-                                  xentoollog_level min_level) {
-    lg->min_level = min_level;
-}
-
-void xtl_stdiostream_adjust_flags(xentoollog_logger_stdiostream *lg,
-                                  unsigned set_flags, unsigned clear_flags) {
-    unsigned new_flags = (lg->flags & ~clear_flags) | set_flags;
-    if (new_flags & XTL_STDIOSTREAM_HIDE_PROGRESS)
-        progress_erase(lg);
-    lg->flags = new_flags;
-}
-
-xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
-        (FILE *f, xentoollog_level min_level, unsigned flags) {
-    xentoollog_logger_stdiostream newlogger;
-
-    newlogger.f = f;
-    newlogger.min_level = min_level;
-    newlogger.flags = flags;
-
-    switch (flags & (XTL_STDIOSTREAM_PROGRESS_USE_CR |
-                     XTL_STDIOSTREAM_PROGRESS_NO_CR)) {
-    case XTL_STDIOSTREAM_PROGRESS_USE_CR: newlogger.progress_use_cr = 1; break;
-    case XTL_STDIOSTREAM_PROGRESS_NO_CR:  newlogger.progress_use_cr = 0; break;
-    case 0:
-        newlogger.progress_use_cr = isatty(fileno(newlogger.f)) > 0;
-        break;
-    default:
-        errno = EINVAL;
-        return 0;
-    }
-
-    if (newlogger.flags & XTL_STDIOSTREAM_SHOW_DATE) tzset();
-
-    newlogger.progress_erase_len = 0;
-    newlogger.progress_last_percent = 0;
-
-    return XTL_NEW_LOGGER(stdiostream, newlogger);
-}
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 6ff5bee..2abae0c 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -20,11 +20,12 @@ LIBUUID_LIBS += -luuid
 endif
 
 LIBXL_LIBS =
-LIBXL_LIBS = $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS)
+LIBXL_LIBS = $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS)
 ifeq ($(CONFIG_REMUS_NETBUF),y)
 LIBXL_LIBS += $(LIBNL3_LIBS)
 endif
 
+CFLAGS_LIBXL += $(CFLAGS_libxentoollog)
 CFLAGS_LIBXL += $(CFLAGS_libxenctrl)
 CFLAGS_LIBXL += $(CFLAGS_libxenguest)
 CFLAGS_LIBXL += $(CFLAGS_libxenstore)
@@ -149,7 +150,7 @@ CFLAGS_XL += -Wshadow
 
 XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o
 $(XL_OBJS) $(TEST_PROG_OBJS) _libxl.api-for-check: \
-            CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
+            CFLAGS += $(CFLAGS_libxentoollog)
 $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
 $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
 
@@ -253,19 +254,19 @@ libxlutil.a: $(LIBXLU_OBJS)
 	$(AR) rcs libxlutil.a $^
 
 xl: $(XL_OBJS) libxlutil.so libxenlight.so
-	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) -lyajl $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
 
 xen-init-dom0: $(XEN_INIT_DOM0_OBJS) libxenlight.so
-	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
 
 test_%: test_%.o test_common.o libxlutil.so libxenlight_test.so
-	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxenctrl) -lyajl $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
 
 libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
-	$(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
 
 testidl: testidl.o libxlutil.so libxenlight.so
-	$(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
 
 $(PKG_CONFIG): % : %.in Makefile
 	@sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < $< > $@.new
diff --git a/tools/ocaml/libs/xentoollog/Makefile b/tools/ocaml/libs/xentoollog/Makefile
index 666eb66..8ae0a78 100644
--- a/tools/ocaml/libs/xentoollog/Makefile
+++ b/tools/ocaml/libs/xentoollog/Makefile
@@ -5,7 +5,7 @@ include $(TOPLEVEL)/common.make
 # allow mixed declarations and code
 CFLAGS += -Wno-declaration-after-statement
 
-CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+CFLAGS += $(CFLAGS_libxentoollog)
 CFLAGS += $(APPEND_CFLAGS)
 OCAMLINCLUDE +=
 
@@ -13,7 +13,7 @@ OBJS = xentoollog
 INTF = xentoollog.cmi
 LIBS = xentoollog.cma xentoollog.cmxa
 
-LIBS_xentoollog = $(LDLIBS_libxenctrl)
+LIBS_xentoollog = $(LDLIBS_libxentoollog)
 
 xentoollog_OBJS = $(OBJS)
 xentoollog_C_OBJS = xentoollog_stubs
@@ -49,7 +49,7 @@ xentoollog.mli: xentoollog.mli.in _xtl_levels.mli.in
 
 libs: $(LIBS)
 
-_xtl_levels.ml.in _xtl_levels.mli.in _xtl_levels.inc: genlevels.py $(XEN_ROOT)/tools/libxc/include/xentoollog.h
+_xtl_levels.ml.in _xtl_levels.mli.in _xtl_levels.inc: genlevels.py $(XEN_ROOT)/tools/libs/toollog/include/xentoollog.h
 	$(PYTHON) genlevels.py _xtl_levels.mli.in _xtl_levels.ml.in _xtl_levels.inc
 
 .PHONY: install
diff --git a/tools/ocaml/libs/xentoollog/genlevels.py b/tools/ocaml/libs/xentoollog/genlevels.py
index 65d334f..8c233c5 100755
--- a/tools/ocaml/libs/xentoollog/genlevels.py
+++ b/tools/ocaml/libs/xentoollog/genlevels.py
@@ -3,7 +3,7 @@
 import sys
 
 def read_levels():
-	f = open('../../../libxc/include/xentoollog.h', 'r')
+	f = open('../../../libs/toollog/include/xentoollog.h', 'r')
 
 	levels = []
 	record = False
diff --git a/tools/python/setup.py b/tools/python/setup.py
index fdba866..9771cc4 100644
--- a/tools/python/setup.py
+++ b/tools/python/setup.py
@@ -7,16 +7,17 @@ XEN_ROOT = "../.."
 extra_compile_args  = [ "-fno-strict-aliasing", "-Werror" ]
 
 PATH_XEN      = XEN_ROOT + "/tools/include"
+PATH_LIBXENTOOLLOG = XEN_ROOT + "/tools/libs/toollog"
 PATH_LIBXC    = XEN_ROOT + "/tools/libxc"
 PATH_LIBXL    = XEN_ROOT + "/tools/libxl"
 PATH_XENSTORE = XEN_ROOT + "/tools/xenstore"
 
 xc = Extension("xc",
                extra_compile_args = extra_compile_args,
-               include_dirs       = [ PATH_XEN, PATH_LIBXC + "/include", "xen/lowlevel/xc" ],
+               include_dirs       = [ PATH_XEN, PATH_LIBXENTOOLLOG + "/include", PATH_LIBXC + "/include", "xen/lowlevel/xc" ],
                library_dirs       = [ PATH_LIBXC ],
                libraries          = [ "xenctrl", "xenguest" ],
-               depends            = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so" ],
+               depends            = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so",  "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ],
                sources            = [ "xen/lowlevel/xc/xc.c" ])
 
 xs = Extension("xs",
diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile
index 2407a30..e63d894 100644
--- a/tools/xenpaging/Makefile
+++ b/tools/xenpaging/Makefile
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 # xenpaging.c and file_ops.c incorrectly use libxc internals
 CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) -I$(XEN_ROOT)/tools/libxc
-LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS)
+LDLIBS += $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
 
 POLICY    = 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 Tue Jan 12 16:56:33 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:56: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 1aJ2FF-0007XT-RA; Tue, 12 Jan 2016 16:56: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 1aJ2FE-0007WS-P5
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:33 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	59/0C-13487-04035965; Tue, 12 Jan 2016 16:56:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1452617789!15386346!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37245 invoked from network); 12 Jan 2016 16:56:30 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:56:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2FS-0007Ar-Kh
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2FA-0005Q0-Vz
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:29 +0000
Date: Tue, 12 Jan 2016 16:56:28 +0000
Message-Id: <E1aJ2FA-0005Q0-Vz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Refactor "xentoollog" into its
	own library
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5d3dc8671521ea4a4f753e77d3e7fb3a3a6f5f80
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 16 12:31:09 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:45:26 2016 +0000

    tools: Refactor "xentoollog" into its own library
    
    In attempting to disaggregate libxenctrl I found that many of the
    pieces were going to want access to this library, so split it out (as
    it probably should always have been).
    
    Various build adjustments are needed. In particular things which use
    xtl_* themselves now need to explicity link against the library.
    
    This has a nice side effect which is that users of libxl no longer
    need to link against libxenctrl just to create a logger, which was
    counter to the principal that applications using libxl shouldn't be
    required to look behind the curtain. This means that xl no longer
    links against libxenctrl.
    
    The new library uses a version script to ensure that only expected
    symbols are exported and to version them such that ABI guarantees can
    be kept in the future.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- dropped QEMU_TRADITIONAL_REVISION update, this had since
             progressed to 569eac99e8dd which is after 9fad9ed28583, the
             commit needed here. ]
---
 .gitignore                               |    1 +
 Config.mk                                |    6 +-
 stubdom/Makefile                         |   22 ++++-
 stubdom/grub/Makefile                    |    1 +
 tools/Makefile                           |    3 +
 tools/Rules.mk                           |   14 ++-
 tools/libs/Makefile                      |    7 +
 tools/libs/toollog/Makefile              |   59 +++++++++
 tools/libs/toollog/include/xentoollog.h  |  136 +++++++++++++++++++++
 tools/libs/toollog/libxentoollog.map     |   12 ++
 tools/libs/toollog/xtl_core.c            |   83 +++++++++++++
 tools/libs/toollog/xtl_logger_stdio.c    |  192 ++++++++++++++++++++++++++++++
 tools/libxc/Makefile                     |    7 +-
 tools/libxc/include/xentoollog.h         |  136 ---------------------
 tools/libxc/xtl_core.c                   |   83 -------------
 tools/libxc/xtl_logger_stdio.c           |  192 ------------------------------
 tools/libxl/Makefile                     |   15 ++-
 tools/ocaml/libs/xentoollog/Makefile     |    6 +-
 tools/ocaml/libs/xentoollog/genlevels.py |    2 +-
 tools/python/setup.py                    |    5 +-
 tools/xenpaging/Makefile                 |    2 +-
 21 files changed, 547 insertions(+), 437 deletions(-)

diff --git a/.gitignore b/.gitignore
index 0a0f3ad..e0df903 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,6 +58,7 @@ stubdom/gcc-*
 stubdom/include
 stubdom/ioemu
 stubdom/xenstore
+stubdom/libxentoollog-*
 stubdom/libxc-*
 stubdom/lwip-*
 stubdom/mini-os-*
diff --git a/Config.mk b/Config.mk
index 075bb01..a3be5ed 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= bccd90071e863ec22216a000f1a07035e2f226ff
-# Mon Nov 23 16:34:31 2015 +0000
-# Add a .gitignore
+MINIOS_UPSTREAM_REVISION ?= d25773c8afa2f4dbbb466116daeb60159ddd22bd
+# Thu Dec 3 11:23:25 2015 +0000
+# mini-os: Include libxentoollog with libxc
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.9.0
 # Tue Nov 17 09:18:44 2015 -0500
diff --git a/stubdom/Makefile b/stubdom/Makefile
index fd84024..9c77205 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -314,6 +314,11 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
 	  ln -sf $(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*) include/xen-foreign/ && \
 	  $(MAKE) DESTDIR= -C include/xen-foreign/ && \
 	  ( [ -h include/xen/foreign ] || ln -sf ../xen-foreign include/xen/foreign )
+	mkdir -p libs-$(XEN_TARGET_ARCH)/toollog
+	[ -h libs-$(XEN_TARGET_ARCH)/toollog/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/toollog && \
+	  ln -sf $(XEN_ROOT)/tools/libs/toollog/include/*.h . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/toollog/*.c . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/toollog/Makefile . )
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
@@ -337,12 +342,21 @@ $(TARGETS_MINIOS): mini-os-%:
 	done
 
 #######
+# libxentoollog
+#######
+
+.PHONY: libxentoollog
+libxentoollog: libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a
+libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/toollog
+
+#######
 # libxc
 #######
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog cross-zlib
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
@@ -512,6 +526,11 @@ clean:
 	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
+	[ ! -e libs-$(XEN_TARGET_ARCH)/toollog/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/toollog clean
+	[ ! -e libs-$(XEN_TARGET_ARCH)/evtchn/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/evtchn clean
+	[ ! -e libs-$(XEN_TARGET_ARCH)/gnttab/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/gnttab clean
+	[ ! -e libs-$(XEN_TARGET_ARCH)/call/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/call clean
+	[ ! -e libs-$(XEN_TARGET_ARCH)/foreignmemory/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/foreignmemory clean
 	[ ! -e libxc-$(XEN_TARGET_ARCH)/Makefile ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
 	-[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
 	-[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
@@ -522,6 +541,7 @@ crossclean: clean
 	rm -fr $(CROSS_ROOT)
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
+	rm -fr libs-$(XEN_TARGET_ARCH)
 	rm -fr libxc-$(XEN_TARGET_ARCH) ioemu xenstore
 	rm -fr gmp-$(XEN_TARGET_ARCH)
 	rm -fr polarssl-$(XEN_TARGET_ARCH)
diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
index 934cc4c..26dff45 100644
--- a/stubdom/grub/Makefile
+++ b/stubdom/grub/Makefile
@@ -5,6 +5,7 @@ vpath %.c ../grub-upstream
 
 BOOT=$(OBJ_DIR)/boot-$(XEN_TARGET_ARCH).o
 
+DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/toollog/include
 DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc/include -I$(XEN_ROOT)/tools/include -I.
 DEF_CPPFLAGS += -I../grub-upstream/stage1
 DEF_CPPFLAGS += -I../grub-upstream/stage2
diff --git a/tools/Makefile b/tools/Makefile
index 820ca40..9f74ac7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 SUBDIRS-y :=
 SUBDIRS-y += include
+SUBDIRS-y += libs
 SUBDIRS-y += libxc
 SUBDIRS-$(FLASK_ENABLE) += flask
 SUBDIRS-y += xenstore
@@ -248,12 +249,14 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--includedir=$(LIBEXEC_INC) \
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
+		-I$(XEN_ROOT)/tools/libs/toollog/include \
 		-I$(XEN_ROOT)/tools/libxc/include \
 		-I$(XEN_ROOT)/tools/xenstore/include \
 		-I$(XEN_ROOT)/tools/xenstore/compat/include \
 		$(EXTRA_CFLAGS_QEMU_XEN)" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore \
+		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog \
 		$(QEMU_UPSTREAM_RPATH)" \
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 37b0aaf..0652e4b 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -10,6 +10,7 @@ export _INSTALL := $(INSTALL)
 INSTALL = $(XEN_ROOT)/tools/cross-install
 
 XEN_INCLUDE        = $(XEN_ROOT)/tools/include
+XEN_LIBXENTOOLLOG  = $(XEN_ROOT)/tools/libs/toollog
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_XENLIGHT       = $(XEN_ROOT)/tools/libxl
 XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
@@ -76,10 +77,15 @@ endif
 # Consumers of libfoo should not directly use $(SHDEPS_libfoo) or
 # $(SHLIB_libfoo)
 
-CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
-SHDEPS_libxenctrl =
-LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension)
-SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
+CFLAGS_libxentoollog = -I$(XEN_LIBXENTOOLLOG)/include $(CFLAGS_xeninclude)
+SHDEPS_libxentoollog =
+LDLIBS_libxentoollog = $(XEN_LIBXENTOOLLOG)/libxentoollog$(libextension)
+SHLIB_libxentoollog  = -Wl,-rpath-link=$(XEN_LIBXENTOOLLOG)
+
+CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_xeninclude)
+SHDEPS_libxenctrl = $(SHLIB_libxentoollog)
+LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libextension)
+SHLIB_libxenctrl  = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_LIBXC)
 
 CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 SHDEPS_libxenguest =
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
new file mode 100644
index 0000000..73be500
--- /dev/null
+++ b/tools/libs/Makefile
@@ -0,0 +1,7 @@
+XEN_ROOT = $(CURDIR)/../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+SUBDIRS-y :=
+SUBDIRS-y += toollog
+
+all clean install distclean: %: subdirs-%
diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile
new file mode 100644
index 0000000..bd12403
--- /dev/null
+++ b/tools/libs/toollog/Makefile
@@ -0,0 +1,59 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR	= 1
+MINOR	= 0
+SHLIB_LDFLAGS += -Wl,--version-script=libxentoollog.map
+
+CFLAGS	+= -Werror -Wmissing-prototypes
+CFLAGS	+= -I./include
+
+SRCS-y	+= xtl_core.c
+SRCS-y	+= xtl_logger_stdio.c
+
+LIB_OBJS := $(patsubst %.c,%.o,$(SRCS-y))
+PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS-y))
+
+LIB := libxentoollog.a
+ifneq ($(nosharedlibs),y)
+LIB += libxentoollog.so
+endif
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build:
+	$(MAKE) libs
+
+.PHONY: libs
+libs: $(LIB)
+
+libxentoollog.a: $(LIB_OBJS)
+	$(AR) rc $@ $^
+
+libxentoollog.so: libxentoollog.so.$(MAJOR)
+	$(SYMLINK_SHLIB) $< $@
+libxentoollog.so.$(MAJOR): libxentoollog.so.$(MAJOR).$(MINOR)
+	$(SYMLINK_SHLIB) $< $@
+
+libxentoollog.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxentoollog.map
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxentoollog.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: build
+	$(INSTALL_DIR) $(DESTDIR)$(libdir)
+	$(INSTALL_DIR) $(DESTDIR)$(includedir)
+	$(INSTALL_SHLIB) libxentoollog.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) libxentoollog.a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) libxentoollog.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxentoollog.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxentoollog.so.$(MAJOR) $(DESTDIR)$(libdir)/libxentoollog.so
+	$(INSTALL_DATA) include/xentoollog.h $(DESTDIR)$(includedir)
+
+.PHONY: TAGS
+TAGS:
+	etags -t *.c *.h
+
+.PHONY: clean
+clean:
+	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
diff --git a/tools/libs/toollog/include/xentoollog.h b/tools/libs/toollog/include/xentoollog.h
new file mode 100644
index 0000000..853e9c7
--- /dev/null
+++ b/tools/libs/toollog/include/xentoollog.h
@@ -0,0 +1,136 @@
+/*
+ * xentoollog.h
+ *
+ * Copyright (c) 2010 Citrix
+ * Part of a generic logging interface used by various dom0 userland libraries.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef XENTOOLLOG_H
+#define XENTOOLLOG_H
+
+#include <stdio.h>
+#include <stdarg.h>
+
+
+/*---------- common declarations and types ----------*/
+
+typedef enum xentoollog_level {
+    XTL_NONE, /* sentinel etc, never used for logging */
+    XTL_DEBUG,
+    XTL_VERBOSE,
+    XTL_DETAIL,
+    XTL_PROGRESS, /* also used for "progress" messages */
+    XTL_INFO,
+    XTL_NOTICE,
+    XTL_WARN,
+    XTL_ERROR,
+    XTL_CRITICAL,
+    XTL_NUM_LEVELS
+} xentoollog_level;
+
+typedef struct xentoollog_logger xentoollog_logger;
+struct xentoollog_logger {
+    void (*vmessage)(struct xentoollog_logger *logger,
+                     xentoollog_level level,
+                     int errnoval /* or -1 */,
+                     const char *context /* eg "xc", "xl", may be 0 */,
+                     const char *format /* without level, context, \n */,
+                     va_list al)
+         __attribute__((format(printf,5,0)));
+    void (*progress)(struct xentoollog_logger *logger,
+                     const char *context /* see above */,
+                     const char *doing_what /* no \r,\n */,
+                     int percent, unsigned long done, unsigned long total)
+         /* null function pointer is ok.
+          * will always be called with done==0 for each new
+          * context/doing_what */;
+    void (*destroy)(struct xentoollog_logger *logger);
+    /* each logger can put its necessary data here */
+};
+
+
+/*---------- facilities for consuming log messages ----------*/
+
+#define XTL_STDIOSTREAM_SHOW_PID            001u
+#define XTL_STDIOSTREAM_SHOW_DATE           002u
+#define XTL_STDIOSTREAM_HIDE_PROGRESS       004u
+#define XTL_STDIOSTREAM_PROGRESS_USE_CR     010u /* default is to */
+#define XTL_STDIOSTREAM_PROGRESS_NO_CR      020u /* use \r to ttys */
+
+typedef struct xentoollog_logger_stdiostream  xentoollog_logger_stdiostream;
+
+xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
+        (FILE *f, xentoollog_level min_level, unsigned flags);
+    /* may return 0 if malloc fails, in which case error was logged */
+    /* destroy on this logger does not close the file */
+
+void xtl_stdiostream_set_minlevel(xentoollog_logger_stdiostream*,
+                                  xentoollog_level min_level);
+void xtl_stdiostream_adjust_flags(xentoollog_logger_stdiostream*,
+                                  unsigned set_flags, unsigned clear_flags);
+  /* if set_flags and clear_flags overlap, set_flags takes precedence */
+
+void xtl_logger_destroy(struct xentoollog_logger *logger /* 0 is ok */);
+
+
+/*---------- facilities for generating log messages ----------*/
+
+void xtl_logv(struct xentoollog_logger *logger,
+              xentoollog_level level,
+              int errnoval /* or -1 */,
+              const char *context /* eg "xc", "xenstore", "xl", may be 0 */,
+              const char *format /* does not contain \n */,
+              va_list) __attribute__((format(printf,5,0)));
+
+void xtl_log(struct xentoollog_logger *logger,
+             xentoollog_level level,
+             int errnoval /* or -1 */,
+             const char *context /* eg "xc", "xenstore", "xl" */,
+             const char *format /* does not contain \n */,
+             ...) __attribute__((format(printf,5,6)));
+
+void xtl_progress(struct xentoollog_logger *logger,
+                  const char *context /* see above, may be 0 */,
+                  const char *doing_what,
+                  unsigned long done, unsigned long total);
+
+
+/*---------- facilities for defining log message consumers ----------*/
+
+const char *xtl_level_to_string(xentoollog_level); /* never fails */
+
+
+#define XTL_NEW_LOGGER(LOGGER,buffer) ({                                \
+    xentoollog_logger_##LOGGER *new_consumer;                           \
+                                                                        \
+    (buffer).vtable.vmessage = LOGGER##_vmessage;                       \
+    (buffer).vtable.progress = LOGGER##_progress;                       \
+    (buffer).vtable.destroy  = LOGGER##_destroy;                        \
+                                                                        \
+    new_consumer = malloc(sizeof(*new_consumer));                       \
+    if (!new_consumer) {                                                \
+        xtl_log((xentoollog_logger*)&buffer,                            \
+                XTL_CRITICAL, errno, "xtl",                             \
+                "failed to allocate memory for new message logger");    \
+    } else {                                                            \
+        *new_consumer = buffer;                                         \
+    }                                                                   \
+                                                                        \
+    new_consumer;                                                       \
+});
+
+
+#endif /* XENTOOLLOG_H */
diff --git a/tools/libs/toollog/libxentoollog.map b/tools/libs/toollog/libxentoollog.map
new file mode 100644
index 0000000..c183cf5
--- /dev/null
+++ b/tools/libs/toollog/libxentoollog.map
@@ -0,0 +1,12 @@
+VERS_1.0 {
+	global:
+		xtl_createlogger_stdiostream;
+		xtl_level_to_string;
+		xtl_log;
+		xtl_logger_destroy;
+		xtl_logv;
+		xtl_progress;
+		xtl_stdiostream_adjust_flags;
+		xtl_stdiostream_set_minlevel;
+	local: *; /* Do not expose anything by default */
+};
diff --git a/tools/libs/toollog/xtl_core.c b/tools/libs/toollog/xtl_core.c
new file mode 100644
index 0000000..c4724a0
--- /dev/null
+++ b/tools/libs/toollog/xtl_core.c
@@ -0,0 +1,83 @@
+/*
+ * xtl_core.c
+ *
+ * core code including functions for generating log messages
+ *
+ * Copyright (c) 2010 Citrix
+ * Part of a generic logging interface used by various dom0 userland libraries.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "xentoollog.h"
+
+#include <assert.h>
+#include <errno.h>
+#include <limits.h>
+
+static const char *level_strings[XTL_NUM_LEVELS]= {
+    "[BUG:XTL_NONE]",
+    "debug", "verbose", "detail",  /* normally off by default */
+    "progress", "info", "notice",  /* not a problem */
+    "warning", "error", "critical" /* problems and errors */
+};
+
+const char *xtl_level_to_string(xentoollog_level level) {
+    assert(level >= 0 && level < XTL_NUM_LEVELS);
+    return level_strings[level];
+}
+
+void xtl_logv(struct xentoollog_logger *logger,
+              xentoollog_level level,
+              int errnoval /* or -1 */,
+              const char *context /* eg "xc", "xenstore", "xl" */,
+              const char *format /* does not contain \n */,
+              va_list al) {
+    int errno_save = errno;
+    assert(level > XTL_NONE && level < XTL_NUM_LEVELS);
+    logger->vmessage(logger,level,errnoval,context,format,al);
+    errno = errno_save;
+}
+
+void xtl_log(struct xentoollog_logger *logger,
+             xentoollog_level level,
+             int errnoval /* or -1 */,
+             const char *context /* eg "xc", "xenstore", "xl" */,
+             const char *format /* does not contain \n */,
+             ...) {
+    va_list al;
+    va_start(al,format);
+    xtl_logv(logger,level,errnoval,context,format,al);
+    va_end(al);
+}
+
+void xtl_progress(struct xentoollog_logger *logger,
+                  const char *context, const char *doing_what,
+                  unsigned long done, unsigned long total) {
+    int percent = 0;
+
+    if (!logger->progress) return;
+
+    if ( total )
+        percent = (total < LONG_MAX/100)
+            ? (done * 100) / total
+            : done / ((total + 99) / 100);
+
+    logger->progress(logger, context, doing_what, percent, done, total);
+}
+
+void xtl_logger_destroy(struct xentoollog_logger *logger) {
+    if (!logger) return;
+    logger->destroy(logger);
+}
diff --git a/tools/libs/toollog/xtl_logger_stdio.c b/tools/libs/toollog/xtl_logger_stdio.c
new file mode 100644
index 0000000..0cd9206
--- /dev/null
+++ b/tools/libs/toollog/xtl_logger_stdio.c
@@ -0,0 +1,192 @@
+/*
+ * xtl_logger_stdio.c
+ *
+ * log message consumer that writes to stdio
+ *
+ * Copyright (c) 2010 Citrix
+ * Part of a generic logging interface used by various dom0 userland libraries.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "xentoollog.h"
+
+#include <time.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <stdbool.h>
+
+struct xentoollog_logger_stdiostream {
+    xentoollog_logger vtable;
+    FILE *f;
+    xentoollog_level min_level;
+    unsigned flags;
+    int progress_erase_len, progress_last_percent;
+    bool progress_use_cr;
+};
+
+static void progress_erase(xentoollog_logger_stdiostream *lg) {
+    if (lg->progress_erase_len)
+        fprintf(lg->f, "\r%*s\r", lg->progress_erase_len, "");
+}
+
+static void stdiostream_vmessage(xentoollog_logger *logger_in,
+                                 xentoollog_level level,
+                                 int errnoval,
+                                 const char *context,
+                                 const char *format,
+                                 va_list al) {
+    xentoollog_logger_stdiostream *lg = (void*)logger_in;
+
+    if (level < lg->min_level)
+        return;
+
+    progress_erase(lg);
+
+    if (lg->flags & XTL_STDIOSTREAM_SHOW_DATE) {
+        struct tm lt_buf;
+        time_t now = time(0);
+        struct tm *lt= localtime_r(&now, &lt_buf);
+        if (lt != NULL)
+            fprintf(lg->f, "%04d-%02d-%02d %02d:%02d:%02d %s ",
+                    lt->tm_year+1900, lt->tm_mon+1, lt->tm_mday,
+                    lt->tm_hour, lt->tm_min, lt->tm_sec,
+                    tzname[!!lt->tm_isdst]);
+        else
+            fprintf(lg->f, "[localtime_r failed: %d] ", errno);
+    }
+    if (lg->flags & XTL_STDIOSTREAM_SHOW_PID)
+        fprintf(lg->f, "[%lu] ", (unsigned long)getpid());
+
+    if (context)
+        fprintf(lg->f, "%s: ", context);
+
+    fprintf(lg->f, "%s: ", xtl_level_to_string(level));
+
+    vfprintf(lg->f, format, al);
+
+    if (errnoval >= 0)
+        fprintf(lg->f, ": %s", strerror(errnoval));
+
+    putc('\n', lg->f);
+    fflush(lg->f);
+}
+
+static void stdiostream_message(struct xentoollog_logger *logger_in,
+                                xentoollog_level level,
+                                const char *context,
+                                const char *format, ...)
+{
+    va_list al;
+    va_start(al,format);
+    stdiostream_vmessage(logger_in, level, -1, context, format, al);
+    va_end(al);
+}
+
+static void stdiostream_progress(struct xentoollog_logger *logger_in,
+                                 const char *context,
+                                 const char *doing_what, int percent,
+                                 unsigned long done, unsigned long total) {
+    xentoollog_logger_stdiostream *lg = (void*)logger_in;
+    int newpel, extra_erase;
+    xentoollog_level this_level;
+
+    if (lg->flags & XTL_STDIOSTREAM_HIDE_PROGRESS)
+        return;
+
+    if (percent < lg->progress_last_percent) {
+        this_level = XTL_PROGRESS;
+    } else if (percent == lg->progress_last_percent) {
+        return;
+    } else if (percent < lg->progress_last_percent + 5) {
+        this_level = XTL_DETAIL;
+    } else {
+        this_level = XTL_PROGRESS;
+    }
+
+    if (this_level < lg->min_level)
+        return;
+
+    lg->progress_last_percent = percent;
+
+    if (!lg->progress_use_cr) {
+        stdiostream_message(logger_in, this_level, context,
+                            "%s: %lu/%lu  %3d%%",
+                            doing_what, done, total, percent);
+        return;
+    }
+
+    if (lg->progress_erase_len)
+        putc('\r', lg->f);
+
+    newpel = fprintf(lg->f, "%s%s" "%s: %lu/%lu  %3d%%%s",
+                     context?context:"", context?": ":"",
+                     doing_what, done, total, percent,
+		     done == total ? "\n" : "");
+
+    extra_erase = lg->progress_erase_len - newpel;
+    if (extra_erase > 0)
+        fprintf(lg->f, "%*s\r", extra_erase, "");
+
+    lg->progress_erase_len = newpel;
+}
+
+static void stdiostream_destroy(struct xentoollog_logger *logger_in) {
+    xentoollog_logger_stdiostream *lg = (void*)logger_in;
+    progress_erase(lg);
+    free(lg);
+}
+
+void xtl_stdiostream_set_minlevel(xentoollog_logger_stdiostream *lg,
+                                  xentoollog_level min_level) {
+    lg->min_level = min_level;
+}
+
+void xtl_stdiostream_adjust_flags(xentoollog_logger_stdiostream *lg,
+                                  unsigned set_flags, unsigned clear_flags) {
+    unsigned new_flags = (lg->flags & ~clear_flags) | set_flags;
+    if (new_flags & XTL_STDIOSTREAM_HIDE_PROGRESS)
+        progress_erase(lg);
+    lg->flags = new_flags;
+}
+
+xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
+        (FILE *f, xentoollog_level min_level, unsigned flags) {
+    xentoollog_logger_stdiostream newlogger;
+
+    newlogger.f = f;
+    newlogger.min_level = min_level;
+    newlogger.flags = flags;
+
+    switch (flags & (XTL_STDIOSTREAM_PROGRESS_USE_CR |
+                     XTL_STDIOSTREAM_PROGRESS_NO_CR)) {
+    case XTL_STDIOSTREAM_PROGRESS_USE_CR: newlogger.progress_use_cr = 1; break;
+    case XTL_STDIOSTREAM_PROGRESS_NO_CR:  newlogger.progress_use_cr = 0; break;
+    case 0:
+        newlogger.progress_use_cr = isatty(fileno(newlogger.f)) > 0;
+        break;
+    default:
+        errno = EINVAL;
+        return 0;
+    }
+
+    if (newlogger.flags & XTL_STDIOSTREAM_SHOW_DATE) tzset();
+
+    newlogger.progress_erase_len = 0;
+    newlogger.progress_last_percent = 0;
+
+    return XTL_NEW_LOGGER(stdiostream, newlogger);
+}
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 818f2e4..940708f 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -39,8 +39,6 @@ CTRL_SRCS-y       += xc_memshr.c
 CTRL_SRCS-y       += xc_hcall_buf.c
 CTRL_SRCS-y       += xc_foreign_memory.c
 CTRL_SRCS-y       += xc_kexec.c
-CTRL_SRCS-y       += xtl_core.c
-CTRL_SRCS-y       += xtl_logger_stdio.c
 CTRL_SRCS-y       += xc_resource.c
 CTRL_SRCS-$(CONFIG_X86) += xc_psr.c
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
@@ -112,6 +110,7 @@ CFLAGS   += -I. -I./include $(CFLAGS_xeninclude)
 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
 
 CFLAGS	+= $(PTHREAD_CFLAGS)
+CFLAGS	+= $(CFLAGS_libxentoollog)
 
 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
@@ -165,7 +164,7 @@ install: build
 	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenctrl.so
-	$(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h include/xentoollog.h $(DESTDIR)$(includedir)
+	$(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h $(DESTDIR)$(includedir)
 	$(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
 	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR)
@@ -208,7 +207,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
diff --git a/tools/libxc/include/xentoollog.h b/tools/libxc/include/xentoollog.h
deleted file mode 100644
index 853e9c7..0000000
--- a/tools/libxc/include/xentoollog.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * xentoollog.h
- *
- * Copyright (c) 2010 Citrix
- * Part of a generic logging interface used by various dom0 userland libraries.
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef XENTOOLLOG_H
-#define XENTOOLLOG_H
-
-#include <stdio.h>
-#include <stdarg.h>
-
-
-/*---------- common declarations and types ----------*/
-
-typedef enum xentoollog_level {
-    XTL_NONE, /* sentinel etc, never used for logging */
-    XTL_DEBUG,
-    XTL_VERBOSE,
-    XTL_DETAIL,
-    XTL_PROGRESS, /* also used for "progress" messages */
-    XTL_INFO,
-    XTL_NOTICE,
-    XTL_WARN,
-    XTL_ERROR,
-    XTL_CRITICAL,
-    XTL_NUM_LEVELS
-} xentoollog_level;
-
-typedef struct xentoollog_logger xentoollog_logger;
-struct xentoollog_logger {
-    void (*vmessage)(struct xentoollog_logger *logger,
-                     xentoollog_level level,
-                     int errnoval /* or -1 */,
-                     const char *context /* eg "xc", "xl", may be 0 */,
-                     const char *format /* without level, context, \n */,
-                     va_list al)
-         __attribute__((format(printf,5,0)));
-    void (*progress)(struct xentoollog_logger *logger,
-                     const char *context /* see above */,
-                     const char *doing_what /* no \r,\n */,
-                     int percent, unsigned long done, unsigned long total)
-         /* null function pointer is ok.
-          * will always be called with done==0 for each new
-          * context/doing_what */;
-    void (*destroy)(struct xentoollog_logger *logger);
-    /* each logger can put its necessary data here */
-};
-
-
-/*---------- facilities for consuming log messages ----------*/
-
-#define XTL_STDIOSTREAM_SHOW_PID            001u
-#define XTL_STDIOSTREAM_SHOW_DATE           002u
-#define XTL_STDIOSTREAM_HIDE_PROGRESS       004u
-#define XTL_STDIOSTREAM_PROGRESS_USE_CR     010u /* default is to */
-#define XTL_STDIOSTREAM_PROGRESS_NO_CR      020u /* use \r to ttys */
-
-typedef struct xentoollog_logger_stdiostream  xentoollog_logger_stdiostream;
-
-xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
-        (FILE *f, xentoollog_level min_level, unsigned flags);
-    /* may return 0 if malloc fails, in which case error was logged */
-    /* destroy on this logger does not close the file */
-
-void xtl_stdiostream_set_minlevel(xentoollog_logger_stdiostream*,
-                                  xentoollog_level min_level);
-void xtl_stdiostream_adjust_flags(xentoollog_logger_stdiostream*,
-                                  unsigned set_flags, unsigned clear_flags);
-  /* if set_flags and clear_flags overlap, set_flags takes precedence */
-
-void xtl_logger_destroy(struct xentoollog_logger *logger /* 0 is ok */);
-
-
-/*---------- facilities for generating log messages ----------*/
-
-void xtl_logv(struct xentoollog_logger *logger,
-              xentoollog_level level,
-              int errnoval /* or -1 */,
-              const char *context /* eg "xc", "xenstore", "xl", may be 0 */,
-              const char *format /* does not contain \n */,
-              va_list) __attribute__((format(printf,5,0)));
-
-void xtl_log(struct xentoollog_logger *logger,
-             xentoollog_level level,
-             int errnoval /* or -1 */,
-             const char *context /* eg "xc", "xenstore", "xl" */,
-             const char *format /* does not contain \n */,
-             ...) __attribute__((format(printf,5,6)));
-
-void xtl_progress(struct xentoollog_logger *logger,
-                  const char *context /* see above, may be 0 */,
-                  const char *doing_what,
-                  unsigned long done, unsigned long total);
-
-
-/*---------- facilities for defining log message consumers ----------*/
-
-const char *xtl_level_to_string(xentoollog_level); /* never fails */
-
-
-#define XTL_NEW_LOGGER(LOGGER,buffer) ({                                \
-    xentoollog_logger_##LOGGER *new_consumer;                           \
-                                                                        \
-    (buffer).vtable.vmessage = LOGGER##_vmessage;                       \
-    (buffer).vtable.progress = LOGGER##_progress;                       \
-    (buffer).vtable.destroy  = LOGGER##_destroy;                        \
-                                                                        \
-    new_consumer = malloc(sizeof(*new_consumer));                       \
-    if (!new_consumer) {                                                \
-        xtl_log((xentoollog_logger*)&buffer,                            \
-                XTL_CRITICAL, errno, "xtl",                             \
-                "failed to allocate memory for new message logger");    \
-    } else {                                                            \
-        *new_consumer = buffer;                                         \
-    }                                                                   \
-                                                                        \
-    new_consumer;                                                       \
-});
-
-
-#endif /* XENTOOLLOG_H */
diff --git a/tools/libxc/xtl_core.c b/tools/libxc/xtl_core.c
deleted file mode 100644
index c4724a0..0000000
--- a/tools/libxc/xtl_core.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * xtl_core.c
- *
- * core code including functions for generating log messages
- *
- * Copyright (c) 2010 Citrix
- * Part of a generic logging interface used by various dom0 userland libraries.
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include "xentoollog.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <limits.h>
-
-static const char *level_strings[XTL_NUM_LEVELS]= {
-    "[BUG:XTL_NONE]",
-    "debug", "verbose", "detail",  /* normally off by default */
-    "progress", "info", "notice",  /* not a problem */
-    "warning", "error", "critical" /* problems and errors */
-};
-
-const char *xtl_level_to_string(xentoollog_level level) {
-    assert(level >= 0 && level < XTL_NUM_LEVELS);
-    return level_strings[level];
-}
-
-void xtl_logv(struct xentoollog_logger *logger,
-              xentoollog_level level,
-              int errnoval /* or -1 */,
-              const char *context /* eg "xc", "xenstore", "xl" */,
-              const char *format /* does not contain \n */,
-              va_list al) {
-    int errno_save = errno;
-    assert(level > XTL_NONE && level < XTL_NUM_LEVELS);
-    logger->vmessage(logger,level,errnoval,context,format,al);
-    errno = errno_save;
-}
-
-void xtl_log(struct xentoollog_logger *logger,
-             xentoollog_level level,
-             int errnoval /* or -1 */,
-             const char *context /* eg "xc", "xenstore", "xl" */,
-             const char *format /* does not contain \n */,
-             ...) {
-    va_list al;
-    va_start(al,format);
-    xtl_logv(logger,level,errnoval,context,format,al);
-    va_end(al);
-}
-
-void xtl_progress(struct xentoollog_logger *logger,
-                  const char *context, const char *doing_what,
-                  unsigned long done, unsigned long total) {
-    int percent = 0;
-
-    if (!logger->progress) return;
-
-    if ( total )
-        percent = (total < LONG_MAX/100)
-            ? (done * 100) / total
-            : done / ((total + 99) / 100);
-
-    logger->progress(logger, context, doing_what, percent, done, total);
-}
-
-void xtl_logger_destroy(struct xentoollog_logger *logger) {
-    if (!logger) return;
-    logger->destroy(logger);
-}
diff --git a/tools/libxc/xtl_logger_stdio.c b/tools/libxc/xtl_logger_stdio.c
deleted file mode 100644
index 0cd9206..0000000
--- a/tools/libxc/xtl_logger_stdio.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * xtl_logger_stdio.c
- *
- * log message consumer that writes to stdio
- *
- * Copyright (c) 2010 Citrix
- * Part of a generic logging interface used by various dom0 userland libraries.
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include "xentoollog.h"
-
-#include <time.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <stdbool.h>
-
-struct xentoollog_logger_stdiostream {
-    xentoollog_logger vtable;
-    FILE *f;
-    xentoollog_level min_level;
-    unsigned flags;
-    int progress_erase_len, progress_last_percent;
-    bool progress_use_cr;
-};
-
-static void progress_erase(xentoollog_logger_stdiostream *lg) {
-    if (lg->progress_erase_len)
-        fprintf(lg->f, "\r%*s\r", lg->progress_erase_len, "");
-}
-
-static void stdiostream_vmessage(xentoollog_logger *logger_in,
-                                 xentoollog_level level,
-                                 int errnoval,
-                                 const char *context,
-                                 const char *format,
-                                 va_list al) {
-    xentoollog_logger_stdiostream *lg = (void*)logger_in;
-
-    if (level < lg->min_level)
-        return;
-
-    progress_erase(lg);
-
-    if (lg->flags & XTL_STDIOSTREAM_SHOW_DATE) {
-        struct tm lt_buf;
-        time_t now = time(0);
-        struct tm *lt= localtime_r(&now, &lt_buf);
-        if (lt != NULL)
-            fprintf(lg->f, "%04d-%02d-%02d %02d:%02d:%02d %s ",
-                    lt->tm_year+1900, lt->tm_mon+1, lt->tm_mday,
-                    lt->tm_hour, lt->tm_min, lt->tm_sec,
-                    tzname[!!lt->tm_isdst]);
-        else
-            fprintf(lg->f, "[localtime_r failed: %d] ", errno);
-    }
-    if (lg->flags & XTL_STDIOSTREAM_SHOW_PID)
-        fprintf(lg->f, "[%lu] ", (unsigned long)getpid());
-
-    if (context)
-        fprintf(lg->f, "%s: ", context);
-
-    fprintf(lg->f, "%s: ", xtl_level_to_string(level));
-
-    vfprintf(lg->f, format, al);
-
-    if (errnoval >= 0)
-        fprintf(lg->f, ": %s", strerror(errnoval));
-
-    putc('\n', lg->f);
-    fflush(lg->f);
-}
-
-static void stdiostream_message(struct xentoollog_logger *logger_in,
-                                xentoollog_level level,
-                                const char *context,
-                                const char *format, ...)
-{
-    va_list al;
-    va_start(al,format);
-    stdiostream_vmessage(logger_in, level, -1, context, format, al);
-    va_end(al);
-}
-
-static void stdiostream_progress(struct xentoollog_logger *logger_in,
-                                 const char *context,
-                                 const char *doing_what, int percent,
-                                 unsigned long done, unsigned long total) {
-    xentoollog_logger_stdiostream *lg = (void*)logger_in;
-    int newpel, extra_erase;
-    xentoollog_level this_level;
-
-    if (lg->flags & XTL_STDIOSTREAM_HIDE_PROGRESS)
-        return;
-
-    if (percent < lg->progress_last_percent) {
-        this_level = XTL_PROGRESS;
-    } else if (percent == lg->progress_last_percent) {
-        return;
-    } else if (percent < lg->progress_last_percent + 5) {
-        this_level = XTL_DETAIL;
-    } else {
-        this_level = XTL_PROGRESS;
-    }
-
-    if (this_level < lg->min_level)
-        return;
-
-    lg->progress_last_percent = percent;
-
-    if (!lg->progress_use_cr) {
-        stdiostream_message(logger_in, this_level, context,
-                            "%s: %lu/%lu  %3d%%",
-                            doing_what, done, total, percent);
-        return;
-    }
-
-    if (lg->progress_erase_len)
-        putc('\r', lg->f);
-
-    newpel = fprintf(lg->f, "%s%s" "%s: %lu/%lu  %3d%%%s",
-                     context?context:"", context?": ":"",
-                     doing_what, done, total, percent,
-		     done == total ? "\n" : "");
-
-    extra_erase = lg->progress_erase_len - newpel;
-    if (extra_erase > 0)
-        fprintf(lg->f, "%*s\r", extra_erase, "");
-
-    lg->progress_erase_len = newpel;
-}
-
-static void stdiostream_destroy(struct xentoollog_logger *logger_in) {
-    xentoollog_logger_stdiostream *lg = (void*)logger_in;
-    progress_erase(lg);
-    free(lg);
-}
-
-void xtl_stdiostream_set_minlevel(xentoollog_logger_stdiostream *lg,
-                                  xentoollog_level min_level) {
-    lg->min_level = min_level;
-}
-
-void xtl_stdiostream_adjust_flags(xentoollog_logger_stdiostream *lg,
-                                  unsigned set_flags, unsigned clear_flags) {
-    unsigned new_flags = (lg->flags & ~clear_flags) | set_flags;
-    if (new_flags & XTL_STDIOSTREAM_HIDE_PROGRESS)
-        progress_erase(lg);
-    lg->flags = new_flags;
-}
-
-xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
-        (FILE *f, xentoollog_level min_level, unsigned flags) {
-    xentoollog_logger_stdiostream newlogger;
-
-    newlogger.f = f;
-    newlogger.min_level = min_level;
-    newlogger.flags = flags;
-
-    switch (flags & (XTL_STDIOSTREAM_PROGRESS_USE_CR |
-                     XTL_STDIOSTREAM_PROGRESS_NO_CR)) {
-    case XTL_STDIOSTREAM_PROGRESS_USE_CR: newlogger.progress_use_cr = 1; break;
-    case XTL_STDIOSTREAM_PROGRESS_NO_CR:  newlogger.progress_use_cr = 0; break;
-    case 0:
-        newlogger.progress_use_cr = isatty(fileno(newlogger.f)) > 0;
-        break;
-    default:
-        errno = EINVAL;
-        return 0;
-    }
-
-    if (newlogger.flags & XTL_STDIOSTREAM_SHOW_DATE) tzset();
-
-    newlogger.progress_erase_len = 0;
-    newlogger.progress_last_percent = 0;
-
-    return XTL_NEW_LOGGER(stdiostream, newlogger);
-}
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 6ff5bee..2abae0c 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -20,11 +20,12 @@ LIBUUID_LIBS += -luuid
 endif
 
 LIBXL_LIBS =
-LIBXL_LIBS = $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS)
+LIBXL_LIBS = $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS)
 ifeq ($(CONFIG_REMUS_NETBUF),y)
 LIBXL_LIBS += $(LIBNL3_LIBS)
 endif
 
+CFLAGS_LIBXL += $(CFLAGS_libxentoollog)
 CFLAGS_LIBXL += $(CFLAGS_libxenctrl)
 CFLAGS_LIBXL += $(CFLAGS_libxenguest)
 CFLAGS_LIBXL += $(CFLAGS_libxenstore)
@@ -149,7 +150,7 @@ CFLAGS_XL += -Wshadow
 
 XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o
 $(XL_OBJS) $(TEST_PROG_OBJS) _libxl.api-for-check: \
-            CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
+            CFLAGS += $(CFLAGS_libxentoollog)
 $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
 $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
 
@@ -253,19 +254,19 @@ libxlutil.a: $(LIBXLU_OBJS)
 	$(AR) rcs libxlutil.a $^
 
 xl: $(XL_OBJS) libxlutil.so libxenlight.so
-	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) -lyajl $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
 
 xen-init-dom0: $(XEN_INIT_DOM0_OBJS) libxenlight.so
-	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
 
 test_%: test_%.o test_common.o libxlutil.so libxenlight_test.so
-	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxenctrl) -lyajl $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
 
 libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
-	$(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
 
 testidl: testidl.o libxlutil.so libxenlight.so
-	$(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
 
 $(PKG_CONFIG): % : %.in Makefile
 	@sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < $< > $@.new
diff --git a/tools/ocaml/libs/xentoollog/Makefile b/tools/ocaml/libs/xentoollog/Makefile
index 666eb66..8ae0a78 100644
--- a/tools/ocaml/libs/xentoollog/Makefile
+++ b/tools/ocaml/libs/xentoollog/Makefile
@@ -5,7 +5,7 @@ include $(TOPLEVEL)/common.make
 # allow mixed declarations and code
 CFLAGS += -Wno-declaration-after-statement
 
-CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+CFLAGS += $(CFLAGS_libxentoollog)
 CFLAGS += $(APPEND_CFLAGS)
 OCAMLINCLUDE +=
 
@@ -13,7 +13,7 @@ OBJS = xentoollog
 INTF = xentoollog.cmi
 LIBS = xentoollog.cma xentoollog.cmxa
 
-LIBS_xentoollog = $(LDLIBS_libxenctrl)
+LIBS_xentoollog = $(LDLIBS_libxentoollog)
 
 xentoollog_OBJS = $(OBJS)
 xentoollog_C_OBJS = xentoollog_stubs
@@ -49,7 +49,7 @@ xentoollog.mli: xentoollog.mli.in _xtl_levels.mli.in
 
 libs: $(LIBS)
 
-_xtl_levels.ml.in _xtl_levels.mli.in _xtl_levels.inc: genlevels.py $(XEN_ROOT)/tools/libxc/include/xentoollog.h
+_xtl_levels.ml.in _xtl_levels.mli.in _xtl_levels.inc: genlevels.py $(XEN_ROOT)/tools/libs/toollog/include/xentoollog.h
 	$(PYTHON) genlevels.py _xtl_levels.mli.in _xtl_levels.ml.in _xtl_levels.inc
 
 .PHONY: install
diff --git a/tools/ocaml/libs/xentoollog/genlevels.py b/tools/ocaml/libs/xentoollog/genlevels.py
index 65d334f..8c233c5 100755
--- a/tools/ocaml/libs/xentoollog/genlevels.py
+++ b/tools/ocaml/libs/xentoollog/genlevels.py
@@ -3,7 +3,7 @@
 import sys
 
 def read_levels():
-	f = open('../../../libxc/include/xentoollog.h', 'r')
+	f = open('../../../libs/toollog/include/xentoollog.h', 'r')
 
 	levels = []
 	record = False
diff --git a/tools/python/setup.py b/tools/python/setup.py
index fdba866..9771cc4 100644
--- a/tools/python/setup.py
+++ b/tools/python/setup.py
@@ -7,16 +7,17 @@ XEN_ROOT = "../.."
 extra_compile_args  = [ "-fno-strict-aliasing", "-Werror" ]
 
 PATH_XEN      = XEN_ROOT + "/tools/include"
+PATH_LIBXENTOOLLOG = XEN_ROOT + "/tools/libs/toollog"
 PATH_LIBXC    = XEN_ROOT + "/tools/libxc"
 PATH_LIBXL    = XEN_ROOT + "/tools/libxl"
 PATH_XENSTORE = XEN_ROOT + "/tools/xenstore"
 
 xc = Extension("xc",
                extra_compile_args = extra_compile_args,
-               include_dirs       = [ PATH_XEN, PATH_LIBXC + "/include", "xen/lowlevel/xc" ],
+               include_dirs       = [ PATH_XEN, PATH_LIBXENTOOLLOG + "/include", PATH_LIBXC + "/include", "xen/lowlevel/xc" ],
                library_dirs       = [ PATH_LIBXC ],
                libraries          = [ "xenctrl", "xenguest" ],
-               depends            = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so" ],
+               depends            = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so",  "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ],
                sources            = [ "xen/lowlevel/xc/xc.c" ])
 
 xs = Extension("xs",
diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile
index 2407a30..e63d894 100644
--- a/tools/xenpaging/Makefile
+++ b/tools/xenpaging/Makefile
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 # xenpaging.c and file_ops.c incorrectly use libxc internals
 CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) -I$(XEN_ROOT)/tools/libxc
-LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS)
+LDLIBS += $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
 
 POLICY    = 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 Tue Jan 12 16:56:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:56: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 1aJ2FO-0007cX-RG; Tue, 12 Jan 2016 16:56: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 1aJ2FN-0007bn-Ks
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:41 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	79/04-08977-94035965; Tue, 12 Jan 2016 16:56:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1452617799!5311127!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11459 invoked from network); 12 Jan 2016 16:56:40 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:56:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Fc-0007B7-UV
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2FL-0005R5-As
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:39 +0000
Date: Tue, 12 Jan 2016 16:56:39 +0000
Message-Id: <E1aJ2FL-0005R5-As@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Clarify some comments
	after 5d495f4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a6037e6593fe7b44a55304b8c6053088c0cc0441
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Dec 17 17:29:10 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:48:52 2016 +0000

    xen/arm: vgic: Clarify some comments after 5d495f4
    
    Ian pointed out that the definition of "offset" and "appropriate
    boundary" in the comments added by "xen/arm: vgic: Optimize the way to
    store the target vCPU in the rank" were not cleared.
    
    Clarify them by explicitly mentionning the offset is in byte and the
    appropriate boundary is ITARGET<n>/IROUTER<n>
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c |    4 ++--
 xen/arch/arm/vgic-v3.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 2c73133..944b004 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -65,7 +65,7 @@ void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
  * Fetch an ITARGETSR register based on the offset from ITARGETSR0. Only
  * one vCPU will be listed for a given vIRQ.
  *
- * Note the offset will be aligned to the appropriate boundary.
+ * Note the byte offset will be aligned to an ITARGETSR<n> boundary.
  */
 static uint32_t vgic_fetch_itargetsr(struct vgic_irq_rank *rank,
                                      unsigned int offset)
@@ -88,7 +88,7 @@ static uint32_t vgic_fetch_itargetsr(struct vgic_irq_rank *rank,
  * Store an ITARGETSR register in a convenient way and migrate the vIRQ
  * if necessary. This function only deals with ITARGETSR8 and onwards.
  *
- * Note the offset will be aligned to the appropriate boundary.
+ * Note the byte offset will be aligned to an ITARGETSR<n> boundary.
  */
 static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
                                  unsigned int offset, uint32_t itargetsr)
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 985e866..5893b71 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -94,7 +94,7 @@ static struct vcpu *vgic_v3_irouter_to_vcpu(struct domain *d, uint64_t irouter)
  * Fetch an IROUTER register based on the offset from IROUTER0. Only one
  * vCPU will be listed for a given vIRQ.
  *
- * Note the offset will be aligned to the appropriate  boundary.
+ * Note the byte offset will be aligned to an IROUTER<n> boundary.
  */
 static uint64_t vgic_fetch_irouter(struct vgic_irq_rank *rank,
                                    unsigned int offset)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:56:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:56: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 1aJ2FO-0007cX-RG; Tue, 12 Jan 2016 16:56: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 1aJ2FN-0007bn-Ks
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:41 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	79/04-08977-94035965; Tue, 12 Jan 2016 16:56:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1452617799!5311127!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11459 invoked from network); 12 Jan 2016 16:56:40 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:56:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Fc-0007B7-UV
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2FL-0005R5-As
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:39 +0000
Date: Tue, 12 Jan 2016 16:56:39 +0000
Message-Id: <E1aJ2FL-0005R5-As@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Clarify some comments
	after 5d495f4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a6037e6593fe7b44a55304b8c6053088c0cc0441
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Dec 17 17:29:10 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:48:52 2016 +0000

    xen/arm: vgic: Clarify some comments after 5d495f4
    
    Ian pointed out that the definition of "offset" and "appropriate
    boundary" in the comments added by "xen/arm: vgic: Optimize the way to
    store the target vCPU in the rank" were not cleared.
    
    Clarify them by explicitly mentionning the offset is in byte and the
    appropriate boundary is ITARGET<n>/IROUTER<n>
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c |    4 ++--
 xen/arch/arm/vgic-v3.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 2c73133..944b004 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -65,7 +65,7 @@ void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
  * Fetch an ITARGETSR register based on the offset from ITARGETSR0. Only
  * one vCPU will be listed for a given vIRQ.
  *
- * Note the offset will be aligned to the appropriate boundary.
+ * Note the byte offset will be aligned to an ITARGETSR<n> boundary.
  */
 static uint32_t vgic_fetch_itargetsr(struct vgic_irq_rank *rank,
                                      unsigned int offset)
@@ -88,7 +88,7 @@ static uint32_t vgic_fetch_itargetsr(struct vgic_irq_rank *rank,
  * Store an ITARGETSR register in a convenient way and migrate the vIRQ
  * if necessary. This function only deals with ITARGETSR8 and onwards.
  *
- * Note the offset will be aligned to the appropriate boundary.
+ * Note the byte offset will be aligned to an ITARGETSR<n> boundary.
  */
 static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
                                  unsigned int offset, uint32_t itargetsr)
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 985e866..5893b71 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -94,7 +94,7 @@ static struct vcpu *vgic_v3_irouter_to_vcpu(struct domain *d, uint64_t irouter)
  * Fetch an IROUTER register based on the offset from IROUTER0. Only one
  * vCPU will be listed for a given vIRQ.
  *
- * Note the offset will be aligned to the appropriate  boundary.
+ * Note the byte offset will be aligned to an IROUTER<n> boundary.
  */
 static uint64_t vgic_fetch_irouter(struct vgic_irq_rank *rank,
                                    unsigned int offset)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:56:53 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:56: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 1aJ2FZ-0007gS-0B; Tue, 12 Jan 2016 16:56: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 1aJ2FY-0007fw-7T
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:52 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	80/82-25435-35035965; Tue, 12 Jan 2016 16:56:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1452617809!16314916!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10550 invoked from network); 12 Jan 2016 16:56:50 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:56:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Fn-0007Bn-AP
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2FV-0005RY-LZ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:49 +0000
Date: Tue, 12 Jan 2016 16:56:49 +0000
Message-Id: <E1aJ2FV-0005RY-LZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: io: handle_read: Use a local
	variable to store dabt
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit efeedfa0eeec687a5df96c575160c33caeb6b31f
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Fri Dec 11 15:28:20 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:49:39 2016 +0000

    xen/arm: io: handle_read: Use a local variable to store dabt
    
    Rather than getting dabt every time through info->dabt, introduce a
    local variable and use it.
    
    Also fix a coding style error in the if condition.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/io.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
index de5765a..7e29943 100644
--- a/xen/arch/arm/io.c
+++ b/xen/arch/arm/io.c
@@ -26,7 +26,8 @@
 static int handle_read(const struct mmio_handler *handler, struct vcpu *v,
                        mmio_info_t *info, register_t *r)
 {
-    uint8_t size = (1 << info->dabt.size) * 8;
+    const struct hsr_dabt dabt = info->dabt;
+    uint8_t size = (1 << dabt.size) * 8;
 
     if ( !handler->ops->read(v, info, r, handler->priv) )
         return 0;
@@ -36,7 +37,7 @@ static int handle_read(const struct mmio_handler *handler, struct vcpu *v,
      * Note that we expect the read handler to have zeroed the bits
      * outside the requested access size.
      */
-    if ( info->dabt.sign && (*r & (1UL << (size - 1)) ))
+    if ( dabt.sign && (*r & (1UL << (size - 1))) )
     {
         /*
          * We are relying on register_t using the same as
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:56:53 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:56: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 1aJ2FZ-0007gS-0B; Tue, 12 Jan 2016 16:56: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 1aJ2FY-0007fw-7T
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:52 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	80/82-25435-35035965; Tue, 12 Jan 2016 16:56:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1452617809!16314916!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10550 invoked from network); 12 Jan 2016 16:56:50 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:56:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Fn-0007Bn-AP
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2FV-0005RY-LZ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:49 +0000
Date: Tue, 12 Jan 2016 16:56:49 +0000
Message-Id: <E1aJ2FV-0005RY-LZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: io: handle_read: Use a local
	variable to store dabt
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit efeedfa0eeec687a5df96c575160c33caeb6b31f
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Fri Dec 11 15:28:20 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:49:39 2016 +0000

    xen/arm: io: handle_read: Use a local variable to store dabt
    
    Rather than getting dabt every time through info->dabt, introduce a
    local variable and use it.
    
    Also fix a coding style error in the if condition.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/io.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
index de5765a..7e29943 100644
--- a/xen/arch/arm/io.c
+++ b/xen/arch/arm/io.c
@@ -26,7 +26,8 @@
 static int handle_read(const struct mmio_handler *handler, struct vcpu *v,
                        mmio_info_t *info, register_t *r)
 {
-    uint8_t size = (1 << info->dabt.size) * 8;
+    const struct hsr_dabt dabt = info->dabt;
+    uint8_t size = (1 << dabt.size) * 8;
 
     if ( !handler->ops->read(v, info, r, handler->priv) )
         return 0;
@@ -36,7 +37,7 @@ static int handle_read(const struct mmio_handler *handler, struct vcpu *v,
      * Note that we expect the read handler to have zeroed the bits
      * outside the requested access size.
      */
-    if ( info->dabt.sign && (*r & (1UL << (size - 1)) ))
+    if ( dabt.sign && (*r & (1UL << (size - 1))) )
     {
         /*
          * We are relying on register_t using the same as
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:57:08 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:57: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 1aJ2Fo-0007mE-4l; Tue, 12 Jan 2016 16:57: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 1aJ2Fn-0007ly-C2
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:07 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	7B/2B-13905-26035965; Tue, 12 Jan 2016 16:57:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1452617825!15419910!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33142 invoked from network); 12 Jan 2016 16:57:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:57:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Fx-0007Bv-H2
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ff-0005S6-Ua
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:59 +0000
Date: Tue, 12 Jan 2016 16:56:59 +0000
Message-Id: <E1aJ2Ff-0005S6-Ua@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm64: Document the register
	mapping aarch64 <-> aarch32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f38c6603c7160a2ee6b714293bf936f4f371b73
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Fri Dec 11 15:28:21 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:49:39 2016 +0000

    xen/arm64: Document the register mapping aarch64 <-> aarch32
    
    The mapping between aarch64 and aarch32 has not been chosen in random.
    It's based on D1.20.1 in ARM DDI 0487A.d.
    
    The section is not obvious to find in the spec, so make it clear for the
    anyone else.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/arm64/processor.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/arm64/processor.h b/xen/include/asm-arm/arm64/processor.h
index 3a9c0cd..fef35a5 100644
--- a/xen/include/asm-arm/arm64/processor.h
+++ b/xen/include/asm-arm/arm64/processor.h
@@ -15,7 +15,12 @@
 /* On stack VCPU state */
 struct cpu_user_regs
 {
-    /*         Aarch64       Aarch32 */
+    /*
+     * The mapping AArch64 <-> AArch32 is based on D1.20.1 in ARM DDI
+     * 0487A.d.
+     *
+     *         AArch64       AArch32
+     */
     __DECL_REG(x0,           r0/*_usr*/);
     __DECL_REG(x1,           r1/*_usr*/);
     __DECL_REG(x2,           r2/*_usr*/);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:57:08 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:57: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 1aJ2Fo-0007mE-4l; Tue, 12 Jan 2016 16:57: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 1aJ2Fn-0007ly-C2
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:07 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	7B/2B-13905-26035965; Tue, 12 Jan 2016 16:57:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1452617825!15419910!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33142 invoked from network); 12 Jan 2016 16:57:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:57:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Fx-0007Bv-H2
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ff-0005S6-Ua
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:56:59 +0000
Date: Tue, 12 Jan 2016 16:56:59 +0000
Message-Id: <E1aJ2Ff-0005S6-Ua@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm64: Document the register
	mapping aarch64 <-> aarch32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f38c6603c7160a2ee6b714293bf936f4f371b73
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Fri Dec 11 15:28:21 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:49:39 2016 +0000

    xen/arm64: Document the register mapping aarch64 <-> aarch32
    
    The mapping between aarch64 and aarch32 has not been chosen in random.
    It's based on D1.20.1 in ARM DDI 0487A.d.
    
    The section is not obvious to find in the spec, so make it clear for the
    anyone else.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/arm64/processor.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/arm64/processor.h b/xen/include/asm-arm/arm64/processor.h
index 3a9c0cd..fef35a5 100644
--- a/xen/include/asm-arm/arm64/processor.h
+++ b/xen/include/asm-arm/arm64/processor.h
@@ -15,7 +15,12 @@
 /* On stack VCPU state */
 struct cpu_user_regs
 {
-    /*         Aarch64       Aarch32 */
+    /*
+     * The mapping AArch64 <-> AArch32 is based on D1.20.1 in ARM DDI
+     * 0487A.d.
+     *
+     *         AArch64       AArch32
+     */
     __DECL_REG(x0,           r0/*_usr*/);
     __DECL_REG(x1,           r1/*_usr*/);
     __DECL_REG(x2,           r2/*_usr*/);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:57:14 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:57:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2Fu-0007o2-8h; Tue, 12 Jan 2016 16:57: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 1aJ2Fs-0007nY-Kt
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:12 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	E2/96-24856-76035965; Tue, 12 Jan 2016 16:57:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1452617830!15418349!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32951 invoked from network); 12 Jan 2016 16:57:11 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:57:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2G7-0007C2-Sv
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Fq-0005Sk-7R
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:10 +0000
Date: Tue, 12 Jan 2016 16:57:10 +0000
Message-Id: <E1aJ2Fq-0005Sk-7R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vtimer: Introduce
	vtimer_emulate_sysreg{32, 64}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ce0fac22e7f367ba72ebd762331f8c9bdf1e2519
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Fri Dec 11 15:28:22 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:49:40 2016 +0000

    xen/arm: vtimer: Introduce vtimer_emulate_sysreg{32, 64}
    
    Factorize the code to emulate a a 32-bit/64-bit sysreg in specific
    helpers.
    
    While this is currently not necessary, it will be helpful in a following
    patch to handle properly some registers.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vtimer.c |   47 +++++++++++++++++++++++++++++++++--------------
 1 files changed, 33 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 629feb4..b9c0b41 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -302,11 +302,39 @@ static int vtimer_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr)
 }
 
 #ifdef CONFIG_ARM_64
-static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
+typedef int (*vtimer_sysreg32_fn_t)(struct cpu_user_regs *regs, uint32_t *r,
+                                    int read);
+typedef int (*vtimer_sysreg64_fn_t)(struct cpu_user_regs *regs, uint64_t *r,
+                                    int read);
+
+static int vtimer_emulate_sysreg32(struct cpu_user_regs *regs, union hsr hsr,
+                                   vtimer_sysreg32_fn_t fn)
 {
     struct hsr_sysreg sysreg = hsr.sysreg;
     register_t *x = select_user_reg(regs, sysreg.reg);
-    uint32_t r = (uint32_t)*x;
+    uint32_t r = *x;
+    int ret;
+
+    ret = fn(regs, &r, sysreg.read);
+
+    if ( ret && sysreg.read )
+        *x = r;
+
+    return ret;
+}
+
+static int vtimer_emulate_sysreg64(struct cpu_user_regs *regs, union hsr hsr,
+                                   vtimer_sysreg64_fn_t fn)
+{
+    struct hsr_sysreg sysreg = hsr.sysreg;
+    uint64_t *x = select_user_reg(regs, sysreg.reg);
+
+    return fn(regs, x, sysreg.read);
+}
+
+static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
+{
+    struct hsr_sysreg sysreg = hsr.sysreg;
 
     if ( sysreg.read )
         perfc_incr(vtimer_sysreg_reads);
@@ -316,20 +344,11 @@ static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
     switch ( hsr.bits & HSR_SYSREG_REGS_MASK )
     {
     case HSR_SYSREG_CNTP_CTL_EL0:
-        if ( !vtimer_cntp_ctl(regs, &r, sysreg.read) )
-            return 0;
-        if ( sysreg.read )
-            *x = r;
-        return 1;
+        return vtimer_emulate_sysreg32(regs, hsr, vtimer_cntp_ctl);
     case HSR_SYSREG_CNTP_TVAL_EL0:
-        if ( !vtimer_cntp_tval(regs, &r, sysreg.read) )
-            return 0;
-        if ( sysreg.read )
-            *x = r;
-        return 1;
-
+        return vtimer_emulate_sysreg32(regs, hsr, vtimer_cntp_tval);
     case HSR_SYSREG_CNTP_CVAL_EL0:
-        return vtimer_cntp_cval(regs, x, sysreg.read);
+        return vtimer_emulate_sysreg64(regs, hsr, vtimer_cntp_cval);
 
     default:
         return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:57:14 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:57:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2Fu-0007o2-8h; Tue, 12 Jan 2016 16:57: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 1aJ2Fs-0007nY-Kt
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:12 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	E2/96-24856-76035965; Tue, 12 Jan 2016 16:57:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1452617830!15418349!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32951 invoked from network); 12 Jan 2016 16:57:11 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:57:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2G7-0007C2-Sv
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Fq-0005Sk-7R
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:10 +0000
Date: Tue, 12 Jan 2016 16:57:10 +0000
Message-Id: <E1aJ2Fq-0005Sk-7R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vtimer: Introduce
	vtimer_emulate_sysreg{32, 64}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ce0fac22e7f367ba72ebd762331f8c9bdf1e2519
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Fri Dec 11 15:28:22 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 5 11:49:40 2016 +0000

    xen/arm: vtimer: Introduce vtimer_emulate_sysreg{32, 64}
    
    Factorize the code to emulate a a 32-bit/64-bit sysreg in specific
    helpers.
    
    While this is currently not necessary, it will be helpful in a following
    patch to handle properly some registers.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vtimer.c |   47 +++++++++++++++++++++++++++++++++--------------
 1 files changed, 33 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 629feb4..b9c0b41 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -302,11 +302,39 @@ static int vtimer_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr)
 }
 
 #ifdef CONFIG_ARM_64
-static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
+typedef int (*vtimer_sysreg32_fn_t)(struct cpu_user_regs *regs, uint32_t *r,
+                                    int read);
+typedef int (*vtimer_sysreg64_fn_t)(struct cpu_user_regs *regs, uint64_t *r,
+                                    int read);
+
+static int vtimer_emulate_sysreg32(struct cpu_user_regs *regs, union hsr hsr,
+                                   vtimer_sysreg32_fn_t fn)
 {
     struct hsr_sysreg sysreg = hsr.sysreg;
     register_t *x = select_user_reg(regs, sysreg.reg);
-    uint32_t r = (uint32_t)*x;
+    uint32_t r = *x;
+    int ret;
+
+    ret = fn(regs, &r, sysreg.read);
+
+    if ( ret && sysreg.read )
+        *x = r;
+
+    return ret;
+}
+
+static int vtimer_emulate_sysreg64(struct cpu_user_regs *regs, union hsr hsr,
+                                   vtimer_sysreg64_fn_t fn)
+{
+    struct hsr_sysreg sysreg = hsr.sysreg;
+    uint64_t *x = select_user_reg(regs, sysreg.reg);
+
+    return fn(regs, x, sysreg.read);
+}
+
+static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
+{
+    struct hsr_sysreg sysreg = hsr.sysreg;
 
     if ( sysreg.read )
         perfc_incr(vtimer_sysreg_reads);
@@ -316,20 +344,11 @@ static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
     switch ( hsr.bits & HSR_SYSREG_REGS_MASK )
     {
     case HSR_SYSREG_CNTP_CTL_EL0:
-        if ( !vtimer_cntp_ctl(regs, &r, sysreg.read) )
-            return 0;
-        if ( sysreg.read )
-            *x = r;
-        return 1;
+        return vtimer_emulate_sysreg32(regs, hsr, vtimer_cntp_ctl);
     case HSR_SYSREG_CNTP_TVAL_EL0:
-        if ( !vtimer_cntp_tval(regs, &r, sysreg.read) )
-            return 0;
-        if ( sysreg.read )
-            *x = r;
-        return 1;
-
+        return vtimer_emulate_sysreg32(regs, hsr, vtimer_cntp_tval);
     case HSR_SYSREG_CNTP_CVAL_EL0:
-        return vtimer_cntp_cval(regs, x, sysreg.read);
+        return vtimer_emulate_sysreg64(regs, hsr, vtimer_cntp_cval);
 
     default:
         return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:57:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:57: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 1aJ2G4-0007qO-ET; Tue, 12 Jan 2016 16:57:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2G2-0007q1-Uv
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:23 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	1D/B2-12831-27035965; Tue, 12 Jan 2016 16:57:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1452617840!15419967!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34389 invoked from network); 12 Jan 2016 16:57:21 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:57:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2GI-0007Cw-5h
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2G0-0005TC-Ip
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:20 +0000
Date: Tue, 12 Jan 2016 16:57:20 +0000
Message-Id: <E1aJ2G0-0005TC-Ip@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: split mapping p2m leaves into 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 c2474dfe7588b5c8a05d1a3a458306130f4ce76b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Jan 7 13:36:51 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:49:33 2016 +0000

    libxc: split mapping p2m leaves into a separate function
    
    In order to prepare using the virtual mapped linear p2m list for
    migration split mapping of the p2m leaf pages into a separate function.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_sr_save_x86_pv.c |   77 +++++++++++++++++++++++----------------
 1 files changed, 45 insertions(+), 32 deletions(-)

diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c
index c8d6f0b..d7acd37 100644
--- a/tools/libxc/xc_sr_save_x86_pv.c
+++ b/tools/libxc/xc_sr_save_x86_pv.c
@@ -68,6 +68,50 @@ static int copy_mfns_from_guest(const struct xc_sr_context *ctx,
 }
 
 /*
+ * Map the p2m leave pages and build an array of their pfns.
+ */
+static int map_p2m_leaves(struct xc_sr_context *ctx, xen_pfn_t *mfns,
+                          size_t n_mfns)
+{
+    xc_interface *xch = ctx->xch;
+    unsigned x;
+
+    ctx->x86_pv.p2m = xc_map_foreign_pages(xch, ctx->domid, PROT_READ,
+                                           mfns, n_mfns);
+    if ( !ctx->x86_pv.p2m )
+    {
+        PERROR("Failed to map p2m frames");
+        return -1;
+    }
+
+    ctx->save.p2m_size = ctx->x86_pv.max_pfn + 1;
+    ctx->x86_pv.p2m_frames = n_mfns;
+    ctx->x86_pv.p2m_pfns = malloc(n_mfns * sizeof(*mfns));
+    if ( !ctx->x86_pv.p2m_pfns )
+    {
+        ERROR("Cannot allocate %zu bytes for p2m pfns list",
+              n_mfns * sizeof(*mfns));
+        return -1;
+    }
+
+    /* Convert leaf frames from mfns to pfns. */
+    for ( x = 0; x < n_mfns; ++x )
+    {
+        if ( !mfn_in_pseudophysmap(ctx, mfns[x]) )
+        {
+            ERROR("Bad mfn in p2m_frame_list[%u]", x);
+            dump_bad_pseudophysmap_entry(ctx, mfns[x]);
+            errno = ERANGE;
+            return -1;
+        }
+
+        ctx->x86_pv.p2m_pfns[x] = mfn_to_pfn(ctx, mfns[x]);
+    }
+
+    return 0;
+}
+
+/*
  * Walk the guests frame list list and frame list to identify and map the
  * frames making up the guests p2m table.  Construct a list of pfns making up
  * the table.
@@ -173,7 +217,6 @@ static int map_p2m(struct xc_sr_context *ctx)
     ctx->x86_pv.p2m_frames = (ctx->x86_pv.max_pfn + fpp) / fpp;
     DPRINTF("max_pfn %#lx, p2m_frames %d", ctx->x86_pv.max_pfn,
             ctx->x86_pv.p2m_frames);
-    ctx->save.p2m_size = ctx->x86_pv.max_pfn + 1;
     fl_entries  = (ctx->x86_pv.max_pfn / fpp) + 1;
 
     /* Map the guest mid p2m frames. */
@@ -211,38 +254,8 @@ static int map_p2m(struct xc_sr_context *ctx)
     }
 
     /* Map the p2m leaves themselves. */
-    ctx->x86_pv.p2m = xc_map_foreign_pages(xch, ctx->domid, PROT_READ,
-                                           local_fl, fl_entries);
-    if ( !ctx->x86_pv.p2m )
-    {
-        PERROR("Failed to map p2m frames");
-        goto err;
-    }
+    rc = map_p2m_leaves(ctx, local_fl, fl_entries);
 
-    ctx->x86_pv.p2m_frames = fl_entries;
-    ctx->x86_pv.p2m_pfns = malloc(local_fl_size);
-    if ( !ctx->x86_pv.p2m_pfns )
-    {
-        ERROR("Cannot allocate %zu bytes for p2m pfns list",
-              local_fl_size);
-        goto err;
-    }
-
-    /* Convert leaf frames from mfns to pfns. */
-    for ( x = 0; x < fl_entries; ++x )
-    {
-        if ( !mfn_in_pseudophysmap(ctx, local_fl[x]) )
-        {
-            ERROR("Bad mfn in p2m_frame_list[%u]", x);
-            dump_bad_pseudophysmap_entry(ctx, local_fl[x]);
-            errno = ERANGE;
-            goto err;
-        }
-
-        ctx->x86_pv.p2m_pfns[x] = mfn_to_pfn(ctx, local_fl[x]);
-    }
-
-    rc = 0;
 err:
 
     free(local_fl);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:57:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:57: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 1aJ2G4-0007qO-ET; Tue, 12 Jan 2016 16:57:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2G2-0007q1-Uv
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:23 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	1D/B2-12831-27035965; Tue, 12 Jan 2016 16:57:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1452617840!15419967!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34389 invoked from network); 12 Jan 2016 16:57:21 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:57:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2GI-0007Cw-5h
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2G0-0005TC-Ip
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:20 +0000
Date: Tue, 12 Jan 2016 16:57:20 +0000
Message-Id: <E1aJ2G0-0005TC-Ip@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: split mapping p2m leaves into 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 c2474dfe7588b5c8a05d1a3a458306130f4ce76b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Jan 7 13:36:51 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:49:33 2016 +0000

    libxc: split mapping p2m leaves into a separate function
    
    In order to prepare using the virtual mapped linear p2m list for
    migration split mapping of the p2m leaf pages into a separate function.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_sr_save_x86_pv.c |   77 +++++++++++++++++++++++----------------
 1 files changed, 45 insertions(+), 32 deletions(-)

diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c
index c8d6f0b..d7acd37 100644
--- a/tools/libxc/xc_sr_save_x86_pv.c
+++ b/tools/libxc/xc_sr_save_x86_pv.c
@@ -68,6 +68,50 @@ static int copy_mfns_from_guest(const struct xc_sr_context *ctx,
 }
 
 /*
+ * Map the p2m leave pages and build an array of their pfns.
+ */
+static int map_p2m_leaves(struct xc_sr_context *ctx, xen_pfn_t *mfns,
+                          size_t n_mfns)
+{
+    xc_interface *xch = ctx->xch;
+    unsigned x;
+
+    ctx->x86_pv.p2m = xc_map_foreign_pages(xch, ctx->domid, PROT_READ,
+                                           mfns, n_mfns);
+    if ( !ctx->x86_pv.p2m )
+    {
+        PERROR("Failed to map p2m frames");
+        return -1;
+    }
+
+    ctx->save.p2m_size = ctx->x86_pv.max_pfn + 1;
+    ctx->x86_pv.p2m_frames = n_mfns;
+    ctx->x86_pv.p2m_pfns = malloc(n_mfns * sizeof(*mfns));
+    if ( !ctx->x86_pv.p2m_pfns )
+    {
+        ERROR("Cannot allocate %zu bytes for p2m pfns list",
+              n_mfns * sizeof(*mfns));
+        return -1;
+    }
+
+    /* Convert leaf frames from mfns to pfns. */
+    for ( x = 0; x < n_mfns; ++x )
+    {
+        if ( !mfn_in_pseudophysmap(ctx, mfns[x]) )
+        {
+            ERROR("Bad mfn in p2m_frame_list[%u]", x);
+            dump_bad_pseudophysmap_entry(ctx, mfns[x]);
+            errno = ERANGE;
+            return -1;
+        }
+
+        ctx->x86_pv.p2m_pfns[x] = mfn_to_pfn(ctx, mfns[x]);
+    }
+
+    return 0;
+}
+
+/*
  * Walk the guests frame list list and frame list to identify and map the
  * frames making up the guests p2m table.  Construct a list of pfns making up
  * the table.
@@ -173,7 +217,6 @@ static int map_p2m(struct xc_sr_context *ctx)
     ctx->x86_pv.p2m_frames = (ctx->x86_pv.max_pfn + fpp) / fpp;
     DPRINTF("max_pfn %#lx, p2m_frames %d", ctx->x86_pv.max_pfn,
             ctx->x86_pv.p2m_frames);
-    ctx->save.p2m_size = ctx->x86_pv.max_pfn + 1;
     fl_entries  = (ctx->x86_pv.max_pfn / fpp) + 1;
 
     /* Map the guest mid p2m frames. */
@@ -211,38 +254,8 @@ static int map_p2m(struct xc_sr_context *ctx)
     }
 
     /* Map the p2m leaves themselves. */
-    ctx->x86_pv.p2m = xc_map_foreign_pages(xch, ctx->domid, PROT_READ,
-                                           local_fl, fl_entries);
-    if ( !ctx->x86_pv.p2m )
-    {
-        PERROR("Failed to map p2m frames");
-        goto err;
-    }
+    rc = map_p2m_leaves(ctx, local_fl, fl_entries);
 
-    ctx->x86_pv.p2m_frames = fl_entries;
-    ctx->x86_pv.p2m_pfns = malloc(local_fl_size);
-    if ( !ctx->x86_pv.p2m_pfns )
-    {
-        ERROR("Cannot allocate %zu bytes for p2m pfns list",
-              local_fl_size);
-        goto err;
-    }
-
-    /* Convert leaf frames from mfns to pfns. */
-    for ( x = 0; x < fl_entries; ++x )
-    {
-        if ( !mfn_in_pseudophysmap(ctx, local_fl[x]) )
-        {
-            ERROR("Bad mfn in p2m_frame_list[%u]", x);
-            dump_bad_pseudophysmap_entry(ctx, local_fl[x]);
-            errno = ERANGE;
-            goto err;
-        }
-
-        ctx->x86_pv.p2m_pfns[x] = mfn_to_pfn(ctx, local_fl[x]);
-    }
-
-    rc = 0;
 err:
 
     free(local_fl);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:57:35 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:57: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 1aJ2GF-0007si-Jn; Tue, 12 Jan 2016 16:57: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 1aJ2GD-0007sD-Pf
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:33 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	0E/67-02499-D7035965; Tue, 12 Jan 2016 16:57:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1452617851!15534003!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 680 invoked from network); 12 Jan 2016 16:57:32 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:57:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2GS-0007D4-Fx
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2GA-0005U4-Rz
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:30 +0000
Date: Tue, 12 Jan 2016 16:57:30 +0000
Message-Id: <E1aJ2GA-0005U4-Rz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: support of linear p2m list for
	migration of pv-domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7bf74582b343603cb0826d808cd7da43326452a5
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Jan 7 13:36:52 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:49:33 2016 +0000

    libxc: support of linear p2m list for migration of pv-domains
    
    In order to be able to migrate pv-domains with more than 512 GB of RAM
    the p2m information can be specified by the guest kernel via a virtual
    mapped linear p2m list instead of a 3 level tree.
    
    Add support for this new p2m format in libxc.
    
    As the sanity checking of the virtual p2m address needs defines for the
    xen regions use those defines when doing page table checks as well.
    There were two harmless off by one errors in normalise_pagetable()
    being fixed by using those defines (xen_last set to 512 instead of
    511), the other one is fixed directly.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_sr_common_x86_pv.h |    7 ++
 tools/libxc/xc_sr_save_x86_pv.c   |  194 ++++++++++++++++++++++++++++++++++---
 2 files changed, 188 insertions(+), 13 deletions(-)

diff --git a/tools/libxc/xc_sr_common_x86_pv.h b/tools/libxc/xc_sr_common_x86_pv.h
index 3234944..f80c753 100644
--- a/tools/libxc/xc_sr_common_x86_pv.h
+++ b/tools/libxc/xc_sr_common_x86_pv.h
@@ -3,6 +3,13 @@
 
 #include "xc_sr_common_x86.h"
 
+/* Virtual address ranges reserved for hypervisor. */
+#define HYPERVISOR_VIRT_START_X86_64 0xFFFF800000000000ULL
+#define HYPERVISOR_VIRT_END_X86_64   0xFFFF87FFFFFFFFFFULL
+
+#define HYPERVISOR_VIRT_START_X86_32 0x00000000F5800000ULL
+#define HYPERVISOR_VIRT_END_X86_32   0x00000000FFFFFFFFULL
+
 /*
  * Convert an mfn to a pfn, given Xen's m2p table.
  *
diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c
index d7acd37..5448f32 100644
--- a/tools/libxc/xc_sr_save_x86_pv.c
+++ b/tools/libxc/xc_sr_save_x86_pv.c
@@ -3,6 +3,12 @@
 
 #include "xc_sr_common_x86_pv.h"
 
+/* Check a 64 bit virtual address for being canonical. */
+static inline bool is_canonical_address(xen_vaddr_t vaddr)
+{
+    return ((int64_t)vaddr >> 47) == ((int64_t)vaddr >> 63);
+}
+
 /*
  * Maps the guests shared info page.
  */
@@ -116,7 +122,7 @@ static int map_p2m_leaves(struct xc_sr_context *ctx, xen_pfn_t *mfns,
  * frames making up the guests p2m table.  Construct a list of pfns making up
  * the table.
  */
-static int map_p2m(struct xc_sr_context *ctx)
+static int map_p2m_tree(struct xc_sr_context *ctx)
 {
     /* Terminology:
      *
@@ -138,8 +144,6 @@ static int map_p2m(struct xc_sr_context *ctx)
     void *guest_fl = NULL;
     size_t local_fl_size;
 
-    ctx->x86_pv.max_pfn = GET_FIELD(ctx->x86_pv.shinfo, arch.max_pfn,
-                                    ctx->x86_pv.width) - 1;
     fpp = PAGE_SIZE / ctx->x86_pv.width;
     fll_entries = (ctx->x86_pv.max_pfn / (fpp * fpp)) + 1;
     if ( fll_entries > fpp )
@@ -270,6 +274,170 @@ err:
 }
 
 /*
+ * Map the guest p2m frames specified via a cr3 value, a virtual address, and
+ * the maximum pfn. PTE entries are 64 bits for both, 32 and 64 bit guests as
+ * in 32 bit case we support PAE guests only.
+ */
+static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
+{
+    xc_interface *xch = ctx->xch;
+    xen_vaddr_t p2m_vaddr, p2m_end, mask, off;
+    xen_pfn_t p2m_mfn, mfn, saved_mfn, max_pfn;
+    uint64_t *ptes;
+    xen_pfn_t *mfns;
+    unsigned fpp, n_pages, level, shift, idx_start, idx_end, idx, saved_idx;
+    int rc = -1;
+
+    p2m_mfn = cr3_to_mfn(ctx, p2m_cr3);
+    assert(p2m_mfn != 0);
+    if ( p2m_mfn > ctx->x86_pv.max_mfn )
+    {
+        ERROR("Bad p2m_cr3 value %#" PRIx64, p2m_cr3);
+        errno = ERANGE;
+        return -1;
+    }
+
+    p2m_vaddr = GET_FIELD(ctx->x86_pv.shinfo, arch.p2m_vaddr,
+                          ctx->x86_pv.width);
+    fpp = PAGE_SIZE / ctx->x86_pv.width;
+    ctx->x86_pv.p2m_frames = ctx->x86_pv.max_pfn / fpp + 1;
+    p2m_end = p2m_vaddr + ctx->x86_pv.p2m_frames * PAGE_SIZE - 1;
+
+    if ( ctx->x86_pv.width == 8 )
+    {
+        mask = 0x0000ffffffffffffULL;
+        if ( !is_canonical_address(p2m_vaddr) ||
+             !is_canonical_address(p2m_end) ||
+             p2m_end < p2m_vaddr ||
+             (p2m_vaddr <= HYPERVISOR_VIRT_END_X86_64 &&
+              p2m_end > HYPERVISOR_VIRT_START_X86_64) )
+        {
+            ERROR("Bad virtual p2m address range %#" PRIx64 "-%#" PRIx64,
+                  p2m_vaddr, p2m_end);
+            errno = ERANGE;
+            return -1;
+        }
+    }
+    else
+    {
+        mask = 0x00000000ffffffffULL;
+        if ( p2m_vaddr > mask || p2m_end > mask || p2m_end < p2m_vaddr ||
+             (p2m_vaddr <= HYPERVISOR_VIRT_END_X86_32 &&
+              p2m_end > HYPERVISOR_VIRT_START_X86_32) )
+        {
+            ERROR("Bad virtual p2m address range %#" PRIx64 "-%#" PRIx64,
+                  p2m_vaddr, p2m_end);
+            errno = ERANGE;
+            return -1;
+        }
+    }
+
+    DPRINTF("p2m list from %#" PRIx64 " to %#" PRIx64 ", root at %#lx",
+            p2m_vaddr, p2m_end, p2m_mfn);
+    DPRINTF("max_pfn %#lx, p2m_frames %d", ctx->x86_pv.max_pfn,
+            ctx->x86_pv.p2m_frames);
+
+    mfns = malloc(sizeof(*mfns));
+    if ( !mfns )
+    {
+        ERROR("Cannot allocate memory for array of %u mfns", 1);
+        goto err;
+    }
+    mfns[0] = p2m_mfn;
+    off = 0;
+    saved_mfn = 0;
+    idx_start = idx_end = saved_idx = 0;
+
+    for ( level = ctx->x86_pv.levels; level > 0; level-- )
+    {
+        n_pages = idx_end - idx_start + 1;
+        ptes = xc_map_foreign_pages(xch, ctx->domid, PROT_READ, mfns, n_pages);
+        if ( !ptes )
+        {
+            PERROR("Failed to map %u page table pages for p2m list", n_pages);
+            goto err;
+        }
+        free(mfns);
+
+        shift = level * 9 + 3;
+        idx_start = ((p2m_vaddr - off) & mask) >> shift;
+        idx_end = ((p2m_end - off) & mask) >> shift;
+        idx = idx_end - idx_start + 1;
+        mfns = malloc(sizeof(*mfns) * idx);
+        if ( !mfns )
+        {
+            ERROR("Cannot allocate memory for array of %u mfns", idx);
+            goto err;
+        }
+
+        for ( idx = idx_start; idx <= idx_end; idx++ )
+        {
+            mfn = pte_to_frame(ptes[idx]);
+            if ( mfn == 0 || mfn > ctx->x86_pv.max_mfn )
+            {
+                ERROR("Bad mfn %#lx during page table walk for vaddr %#" PRIx64 " at level %d of p2m list",
+                      mfn, off + ((xen_vaddr_t)idx << shift), level);
+                errno = ERANGE;
+                goto err;
+            }
+            mfns[idx - idx_start] = mfn;
+
+            /* Maximum pfn check at level 2. Same reasoning as for p2m tree. */
+            if ( level == 2 )
+            {
+                if ( mfn != saved_mfn )
+                {
+                    saved_mfn = mfn;
+                    saved_idx = idx - idx_start;
+                }
+            }
+        }
+
+        if ( level == 2 )
+        {
+            max_pfn = ((xen_pfn_t)saved_idx << 9) * fpp - 1;
+            if ( max_pfn < ctx->x86_pv.max_pfn )
+            {
+                ctx->x86_pv.max_pfn = max_pfn;
+                ctx->x86_pv.p2m_frames = (ctx->x86_pv.max_pfn + fpp) / fpp;
+                p2m_end = p2m_vaddr + ctx->x86_pv.p2m_frames * PAGE_SIZE - 1;
+                idx_end = idx_start + saved_idx;
+            }
+        }
+
+        munmap(ptes, n_pages * PAGE_SIZE);
+        ptes = NULL;
+        off = p2m_vaddr & ((mask >> shift) << shift);
+    }
+
+    /* Map the p2m leaves themselves. */
+    rc = map_p2m_leaves(ctx, mfns, idx_end - idx_start + 1);
+
+err:
+    free(mfns);
+    if ( ptes )
+        munmap(ptes, n_pages * PAGE_SIZE);
+
+    return rc;
+}
+
+/*
+ * Map the guest p2m frames.
+ * Depending on guest support this might either be a virtual mapped linear
+ * list (preferred format) or a 3 level tree linked via mfns.
+ */
+static int map_p2m(struct xc_sr_context *ctx)
+{
+    uint64_t p2m_cr3;
+
+    ctx->x86_pv.max_pfn = GET_FIELD(ctx->x86_pv.shinfo, arch.max_pfn,
+                                    ctx->x86_pv.width) - 1;
+    p2m_cr3 = GET_FIELD(ctx->x86_pv.shinfo, arch.p2m_cr3, ctx->x86_pv.width);
+
+    return p2m_cr3 ? map_p2m_list(ctx, p2m_cr3) : map_p2m_tree(ctx);
+}
+
+/*
  * Obtain a specific vcpus basic state and write an X86_PV_VCPU_BASIC record
  * into the stream.  Performs mfn->pfn conversion on architectural state.
  */
@@ -681,8 +849,10 @@ static int normalise_pagetable(struct xc_sr_context *ctx, const uint64_t *src,
         /* 64bit guests only have Xen mappings in their L4 tables. */
         if ( type == XEN_DOMCTL_PFINFO_L4TAB )
         {
-            xen_first = 256;
-            xen_last = 271;
+            xen_first = (HYPERVISOR_VIRT_START_X86_64 >>
+                         L4_PAGETABLE_SHIFT_X86_64) & 511;
+            xen_last = (HYPERVISOR_VIRT_END_X86_64 >>
+                        L4_PAGETABLE_SHIFT_X86_64) & 511;
         }
     }
     else
@@ -698,21 +868,19 @@ static int normalise_pagetable(struct xc_sr_context *ctx, const uint64_t *src,
             /* 32bit guests can only use the first 4 entries of their L3 tables.
              * All other are potentially used by Xen. */
             xen_first = 4;
-            xen_last = 512;
+            xen_last = 511;
             break;
 
         case XEN_DOMCTL_PFINFO_L2TAB:
             /* It is hard to spot Xen mappings in a 32bit guest's L2.  Most
              * are normal but only a few will have Xen mappings.
-             *
-             * 428 = (HYPERVISOR_VIRT_START_PAE >> L2_PAGETABLE_SHIFT_PAE)&0x1ff
-             *
-             * ...which is conveniently unavailable to us in a 64bit build.
              */
-            if ( pte_to_frame(src[428]) == ctx->x86_pv.compat_m2p_mfn0 )
+            i = (HYPERVISOR_VIRT_START_X86_32 >> L2_PAGETABLE_SHIFT_PAE) & 511;
+            if ( pte_to_frame(src[i]) == ctx->x86_pv.compat_m2p_mfn0 )
             {
-                xen_first = 428;
-                xen_last = 512;
+                xen_first = i;
+                xen_last = (HYPERVISOR_VIRT_END_X86_32 >>
+                            L2_PAGETABLE_SHIFT_PAE) & 511;
             }
             break;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:57:35 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:57: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 1aJ2GF-0007si-Jn; Tue, 12 Jan 2016 16:57: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 1aJ2GD-0007sD-Pf
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:33 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	0E/67-02499-D7035965; Tue, 12 Jan 2016 16:57:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1452617851!15534003!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 680 invoked from network); 12 Jan 2016 16:57:32 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:57:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2GS-0007D4-Fx
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2GA-0005U4-Rz
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:30 +0000
Date: Tue, 12 Jan 2016 16:57:30 +0000
Message-Id: <E1aJ2GA-0005U4-Rz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: support of linear p2m list for
	migration of pv-domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7bf74582b343603cb0826d808cd7da43326452a5
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Jan 7 13:36:52 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:49:33 2016 +0000

    libxc: support of linear p2m list for migration of pv-domains
    
    In order to be able to migrate pv-domains with more than 512 GB of RAM
    the p2m information can be specified by the guest kernel via a virtual
    mapped linear p2m list instead of a 3 level tree.
    
    Add support for this new p2m format in libxc.
    
    As the sanity checking of the virtual p2m address needs defines for the
    xen regions use those defines when doing page table checks as well.
    There were two harmless off by one errors in normalise_pagetable()
    being fixed by using those defines (xen_last set to 512 instead of
    511), the other one is fixed directly.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_sr_common_x86_pv.h |    7 ++
 tools/libxc/xc_sr_save_x86_pv.c   |  194 ++++++++++++++++++++++++++++++++++---
 2 files changed, 188 insertions(+), 13 deletions(-)

diff --git a/tools/libxc/xc_sr_common_x86_pv.h b/tools/libxc/xc_sr_common_x86_pv.h
index 3234944..f80c753 100644
--- a/tools/libxc/xc_sr_common_x86_pv.h
+++ b/tools/libxc/xc_sr_common_x86_pv.h
@@ -3,6 +3,13 @@
 
 #include "xc_sr_common_x86.h"
 
+/* Virtual address ranges reserved for hypervisor. */
+#define HYPERVISOR_VIRT_START_X86_64 0xFFFF800000000000ULL
+#define HYPERVISOR_VIRT_END_X86_64   0xFFFF87FFFFFFFFFFULL
+
+#define HYPERVISOR_VIRT_START_X86_32 0x00000000F5800000ULL
+#define HYPERVISOR_VIRT_END_X86_32   0x00000000FFFFFFFFULL
+
 /*
  * Convert an mfn to a pfn, given Xen's m2p table.
  *
diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c
index d7acd37..5448f32 100644
--- a/tools/libxc/xc_sr_save_x86_pv.c
+++ b/tools/libxc/xc_sr_save_x86_pv.c
@@ -3,6 +3,12 @@
 
 #include "xc_sr_common_x86_pv.h"
 
+/* Check a 64 bit virtual address for being canonical. */
+static inline bool is_canonical_address(xen_vaddr_t vaddr)
+{
+    return ((int64_t)vaddr >> 47) == ((int64_t)vaddr >> 63);
+}
+
 /*
  * Maps the guests shared info page.
  */
@@ -116,7 +122,7 @@ static int map_p2m_leaves(struct xc_sr_context *ctx, xen_pfn_t *mfns,
  * frames making up the guests p2m table.  Construct a list of pfns making up
  * the table.
  */
-static int map_p2m(struct xc_sr_context *ctx)
+static int map_p2m_tree(struct xc_sr_context *ctx)
 {
     /* Terminology:
      *
@@ -138,8 +144,6 @@ static int map_p2m(struct xc_sr_context *ctx)
     void *guest_fl = NULL;
     size_t local_fl_size;
 
-    ctx->x86_pv.max_pfn = GET_FIELD(ctx->x86_pv.shinfo, arch.max_pfn,
-                                    ctx->x86_pv.width) - 1;
     fpp = PAGE_SIZE / ctx->x86_pv.width;
     fll_entries = (ctx->x86_pv.max_pfn / (fpp * fpp)) + 1;
     if ( fll_entries > fpp )
@@ -270,6 +274,170 @@ err:
 }
 
 /*
+ * Map the guest p2m frames specified via a cr3 value, a virtual address, and
+ * the maximum pfn. PTE entries are 64 bits for both, 32 and 64 bit guests as
+ * in 32 bit case we support PAE guests only.
+ */
+static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
+{
+    xc_interface *xch = ctx->xch;
+    xen_vaddr_t p2m_vaddr, p2m_end, mask, off;
+    xen_pfn_t p2m_mfn, mfn, saved_mfn, max_pfn;
+    uint64_t *ptes;
+    xen_pfn_t *mfns;
+    unsigned fpp, n_pages, level, shift, idx_start, idx_end, idx, saved_idx;
+    int rc = -1;
+
+    p2m_mfn = cr3_to_mfn(ctx, p2m_cr3);
+    assert(p2m_mfn != 0);
+    if ( p2m_mfn > ctx->x86_pv.max_mfn )
+    {
+        ERROR("Bad p2m_cr3 value %#" PRIx64, p2m_cr3);
+        errno = ERANGE;
+        return -1;
+    }
+
+    p2m_vaddr = GET_FIELD(ctx->x86_pv.shinfo, arch.p2m_vaddr,
+                          ctx->x86_pv.width);
+    fpp = PAGE_SIZE / ctx->x86_pv.width;
+    ctx->x86_pv.p2m_frames = ctx->x86_pv.max_pfn / fpp + 1;
+    p2m_end = p2m_vaddr + ctx->x86_pv.p2m_frames * PAGE_SIZE - 1;
+
+    if ( ctx->x86_pv.width == 8 )
+    {
+        mask = 0x0000ffffffffffffULL;
+        if ( !is_canonical_address(p2m_vaddr) ||
+             !is_canonical_address(p2m_end) ||
+             p2m_end < p2m_vaddr ||
+             (p2m_vaddr <= HYPERVISOR_VIRT_END_X86_64 &&
+              p2m_end > HYPERVISOR_VIRT_START_X86_64) )
+        {
+            ERROR("Bad virtual p2m address range %#" PRIx64 "-%#" PRIx64,
+                  p2m_vaddr, p2m_end);
+            errno = ERANGE;
+            return -1;
+        }
+    }
+    else
+    {
+        mask = 0x00000000ffffffffULL;
+        if ( p2m_vaddr > mask || p2m_end > mask || p2m_end < p2m_vaddr ||
+             (p2m_vaddr <= HYPERVISOR_VIRT_END_X86_32 &&
+              p2m_end > HYPERVISOR_VIRT_START_X86_32) )
+        {
+            ERROR("Bad virtual p2m address range %#" PRIx64 "-%#" PRIx64,
+                  p2m_vaddr, p2m_end);
+            errno = ERANGE;
+            return -1;
+        }
+    }
+
+    DPRINTF("p2m list from %#" PRIx64 " to %#" PRIx64 ", root at %#lx",
+            p2m_vaddr, p2m_end, p2m_mfn);
+    DPRINTF("max_pfn %#lx, p2m_frames %d", ctx->x86_pv.max_pfn,
+            ctx->x86_pv.p2m_frames);
+
+    mfns = malloc(sizeof(*mfns));
+    if ( !mfns )
+    {
+        ERROR("Cannot allocate memory for array of %u mfns", 1);
+        goto err;
+    }
+    mfns[0] = p2m_mfn;
+    off = 0;
+    saved_mfn = 0;
+    idx_start = idx_end = saved_idx = 0;
+
+    for ( level = ctx->x86_pv.levels; level > 0; level-- )
+    {
+        n_pages = idx_end - idx_start + 1;
+        ptes = xc_map_foreign_pages(xch, ctx->domid, PROT_READ, mfns, n_pages);
+        if ( !ptes )
+        {
+            PERROR("Failed to map %u page table pages for p2m list", n_pages);
+            goto err;
+        }
+        free(mfns);
+
+        shift = level * 9 + 3;
+        idx_start = ((p2m_vaddr - off) & mask) >> shift;
+        idx_end = ((p2m_end - off) & mask) >> shift;
+        idx = idx_end - idx_start + 1;
+        mfns = malloc(sizeof(*mfns) * idx);
+        if ( !mfns )
+        {
+            ERROR("Cannot allocate memory for array of %u mfns", idx);
+            goto err;
+        }
+
+        for ( idx = idx_start; idx <= idx_end; idx++ )
+        {
+            mfn = pte_to_frame(ptes[idx]);
+            if ( mfn == 0 || mfn > ctx->x86_pv.max_mfn )
+            {
+                ERROR("Bad mfn %#lx during page table walk for vaddr %#" PRIx64 " at level %d of p2m list",
+                      mfn, off + ((xen_vaddr_t)idx << shift), level);
+                errno = ERANGE;
+                goto err;
+            }
+            mfns[idx - idx_start] = mfn;
+
+            /* Maximum pfn check at level 2. Same reasoning as for p2m tree. */
+            if ( level == 2 )
+            {
+                if ( mfn != saved_mfn )
+                {
+                    saved_mfn = mfn;
+                    saved_idx = idx - idx_start;
+                }
+            }
+        }
+
+        if ( level == 2 )
+        {
+            max_pfn = ((xen_pfn_t)saved_idx << 9) * fpp - 1;
+            if ( max_pfn < ctx->x86_pv.max_pfn )
+            {
+                ctx->x86_pv.max_pfn = max_pfn;
+                ctx->x86_pv.p2m_frames = (ctx->x86_pv.max_pfn + fpp) / fpp;
+                p2m_end = p2m_vaddr + ctx->x86_pv.p2m_frames * PAGE_SIZE - 1;
+                idx_end = idx_start + saved_idx;
+            }
+        }
+
+        munmap(ptes, n_pages * PAGE_SIZE);
+        ptes = NULL;
+        off = p2m_vaddr & ((mask >> shift) << shift);
+    }
+
+    /* Map the p2m leaves themselves. */
+    rc = map_p2m_leaves(ctx, mfns, idx_end - idx_start + 1);
+
+err:
+    free(mfns);
+    if ( ptes )
+        munmap(ptes, n_pages * PAGE_SIZE);
+
+    return rc;
+}
+
+/*
+ * Map the guest p2m frames.
+ * Depending on guest support this might either be a virtual mapped linear
+ * list (preferred format) or a 3 level tree linked via mfns.
+ */
+static int map_p2m(struct xc_sr_context *ctx)
+{
+    uint64_t p2m_cr3;
+
+    ctx->x86_pv.max_pfn = GET_FIELD(ctx->x86_pv.shinfo, arch.max_pfn,
+                                    ctx->x86_pv.width) - 1;
+    p2m_cr3 = GET_FIELD(ctx->x86_pv.shinfo, arch.p2m_cr3, ctx->x86_pv.width);
+
+    return p2m_cr3 ? map_p2m_list(ctx, p2m_cr3) : map_p2m_tree(ctx);
+}
+
+/*
  * Obtain a specific vcpus basic state and write an X86_PV_VCPU_BASIC record
  * into the stream.  Performs mfn->pfn conversion on architectural state.
  */
@@ -681,8 +849,10 @@ static int normalise_pagetable(struct xc_sr_context *ctx, const uint64_t *src,
         /* 64bit guests only have Xen mappings in their L4 tables. */
         if ( type == XEN_DOMCTL_PFINFO_L4TAB )
         {
-            xen_first = 256;
-            xen_last = 271;
+            xen_first = (HYPERVISOR_VIRT_START_X86_64 >>
+                         L4_PAGETABLE_SHIFT_X86_64) & 511;
+            xen_last = (HYPERVISOR_VIRT_END_X86_64 >>
+                        L4_PAGETABLE_SHIFT_X86_64) & 511;
         }
     }
     else
@@ -698,21 +868,19 @@ static int normalise_pagetable(struct xc_sr_context *ctx, const uint64_t *src,
             /* 32bit guests can only use the first 4 entries of their L3 tables.
              * All other are potentially used by Xen. */
             xen_first = 4;
-            xen_last = 512;
+            xen_last = 511;
             break;
 
         case XEN_DOMCTL_PFINFO_L2TAB:
             /* It is hard to spot Xen mappings in a 32bit guest's L2.  Most
              * are normal but only a few will have Xen mappings.
-             *
-             * 428 = (HYPERVISOR_VIRT_START_PAE >> L2_PAGETABLE_SHIFT_PAE)&0x1ff
-             *
-             * ...which is conveniently unavailable to us in a 64bit build.
              */
-            if ( pte_to_frame(src[428]) == ctx->x86_pv.compat_m2p_mfn0 )
+            i = (HYPERVISOR_VIRT_START_X86_32 >> L2_PAGETABLE_SHIFT_PAE) & 511;
+            if ( pte_to_frame(src[i]) == ctx->x86_pv.compat_m2p_mfn0 )
             {
-                xen_first = 428;
-                xen_last = 512;
+                xen_first = i;
+                xen_last = (HYPERVISOR_VIRT_END_X86_32 >>
+                            L2_PAGETABLE_SHIFT_PAE) & 511;
             }
             break;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:57:45 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:57: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 1aJ2GP-0007vH-RY; Tue, 12 Jan 2016 16:57:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2GN-0007ug-MT
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:43 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	EA/65-09708-78035965; Tue, 12 Jan 2016 16:57:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1452617861!9700488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18953 invoked from network); 12 Jan 2016 16:57:42 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:57:42 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Gc-0007DC-RZ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2GL-0005UQ-88
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:41 +0000
Date: Tue, 12 Jan 2016 16:57:41 +0000
Message-Id: <E1aJ2GL-0005UQ-88@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: stop migration in case of p2m
	list structural changes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8429374f4410f4c7769170a1423a6404664151a7
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Jan 7 13:36:53 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:49:34 2016 +0000

    libxc: stop migration in case of p2m list structural changes
    
    With support of the virtual mapped linear p2m list for migration it is
    now possible to detect structural changes of the p2m list which before
    would either lead to a crashing or otherwise wrong behaving domU.
    
    A guest supporting the linear p2m list will increment the
    p2m_generation counter located in the shared info page before and after
    each modification of a mapping related to the p2m list. A change of
    that counter can be detected by the tools and reacted upon.
    
    As such a change should occur only very rarely once the domU is up the
    most simple reaction is to cancel migration in such an event.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_sr_common.h       |   12 ++++++++++
 tools/libxc/xc_sr_save.c         |    7 +++++-
 tools/libxc/xc_sr_save_x86_hvm.c |    7 ++++++
 tools/libxc/xc_sr_save_x86_pv.c  |   45 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 70 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_sr_common.h b/tools/libxc/xc_sr_common.h
index 9aecde2..60b43e8 100644
--- a/tools/libxc/xc_sr_common.h
+++ b/tools/libxc/xc_sr_common.h
@@ -83,6 +83,15 @@ struct xc_sr_save_ops
     int (*end_of_checkpoint)(struct xc_sr_context *ctx);
 
     /**
+     * Check state of guest to decide whether it makes sense to continue
+     * migration.  This is called in each iteration or checkpoint to check
+     * whether all criteria for the migration are still met.  If that's not
+     * the case either migration is cancelled via a bad rc or the situation
+     * is handled, e.g. by sending appropriate records.
+     */
+    int (*check_vm_state)(struct xc_sr_context *ctx);
+
+    /**
      * Clean up the local environment.  Will be called exactly once, either
      * after a successful save, or upon encountering an error.
      */
@@ -280,6 +289,9 @@ struct xc_sr_context
             /* Read-only mapping of guests shared info page */
             shared_info_any_t *shinfo;
 
+            /* p2m generation count for verifying validity of local p2m. */
+            uint64_t p2m_generation;
+
             union
             {
                 struct
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index cefcef5..88d85ef 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -394,7 +394,8 @@ static int send_dirty_pages(struct xc_sr_context *ctx,
         DPRINTF("Bitmap contained more entries than expected...");
 
     xc_report_progress_step(xch, entries, entries);
-    return 0;
+
+    return ctx->save.ops.check_vm_state(ctx);
 }
 
 /*
@@ -751,6 +752,10 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type)
         if ( rc )
             goto err;
 
+        rc = ctx->save.ops.check_vm_state(ctx);
+        if ( rc )
+            goto err;
+
         if ( ctx->save.live )
             rc = send_domain_memory_live(ctx);
         else if ( ctx->save.checkpointed )
diff --git a/tools/libxc/xc_sr_save_x86_hvm.c b/tools/libxc/xc_sr_save_x86_hvm.c
index f3d6cee..e347b3b 100644
--- a/tools/libxc/xc_sr_save_x86_hvm.c
+++ b/tools/libxc/xc_sr_save_x86_hvm.c
@@ -175,6 +175,12 @@ static int x86_hvm_start_of_checkpoint(struct xc_sr_context *ctx)
     return 0;
 }
 
+static int x86_hvm_check_vm_state(struct xc_sr_context *ctx)
+{
+    /* no-op */
+    return 0;
+}
+
 static int x86_hvm_end_of_checkpoint(struct xc_sr_context *ctx)
 {
     int rc;
@@ -221,6 +227,7 @@ struct xc_sr_save_ops save_ops_x86_hvm =
     .start_of_stream     = x86_hvm_start_of_stream,
     .start_of_checkpoint = x86_hvm_start_of_checkpoint,
     .end_of_checkpoint   = x86_hvm_end_of_checkpoint,
+    .check_vm_state      = x86_hvm_check_vm_state,
     .cleanup             = x86_hvm_cleanup,
 };
 
diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c
index 5448f32..4deb58f 100644
--- a/tools/libxc/xc_sr_save_x86_pv.c
+++ b/tools/libxc/xc_sr_save_x86_pv.c
@@ -274,6 +274,39 @@ err:
 }
 
 /*
+ * Get p2m_generation count.
+ * Returns an error if the generation count has changed since the last call.
+ */
+static int get_p2m_generation(struct xc_sr_context *ctx)
+{
+    uint64_t p2m_generation;
+    int rc;
+
+    p2m_generation = GET_FIELD(ctx->x86_pv.shinfo, arch.p2m_generation,
+                               ctx->x86_pv.width);
+
+    rc = (p2m_generation == ctx->x86_pv.p2m_generation) ? 0 : -1;
+    ctx->x86_pv.p2m_generation = p2m_generation;
+
+    return rc;
+}
+
+static int x86_pv_check_vm_state_p2m_list(struct xc_sr_context *ctx)
+{
+    xc_interface *xch = ctx->xch;
+    int rc;
+
+    if ( !ctx->save.live )
+        return 0;
+
+    rc = get_p2m_generation(ctx);
+    if ( rc )
+        ERROR("p2m generation count changed. Migration aborted.");
+
+    return rc;
+}
+
+/*
  * Map the guest p2m frames specified via a cr3 value, a virtual address, and
  * the maximum pfn. PTE entries are 64 bits for both, 32 and 64 bit guests as
  * in 32 bit case we support PAE guests only.
@@ -297,6 +330,8 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
         return -1;
     }
 
+    get_p2m_generation(ctx);
+
     p2m_vaddr = GET_FIELD(ctx->x86_pv.shinfo, arch.p2m_vaddr,
                           ctx->x86_pv.width);
     fpp = PAGE_SIZE / ctx->x86_pv.width;
@@ -430,6 +465,7 @@ static int map_p2m(struct xc_sr_context *ctx)
 {
     uint64_t p2m_cr3;
 
+    ctx->x86_pv.p2m_generation = ~0ULL;
     ctx->x86_pv.max_pfn = GET_FIELD(ctx->x86_pv.shinfo, arch.max_pfn,
                                     ctx->x86_pv.width) - 1;
     p2m_cr3 = GET_FIELD(ctx->x86_pv.shinfo, arch.p2m_cr3, ctx->x86_pv.width);
@@ -1069,6 +1105,14 @@ static int x86_pv_end_of_checkpoint(struct xc_sr_context *ctx)
     return 0;
 }
 
+static int x86_pv_check_vm_state(struct xc_sr_context *ctx)
+{
+    if ( ctx->x86_pv.p2m_generation == ~0ULL )
+        return 0;
+
+    return x86_pv_check_vm_state_p2m_list(ctx);
+}
+
 /*
  * save_ops function.  Cleanup.
  */
@@ -1096,6 +1140,7 @@ struct xc_sr_save_ops save_ops_x86_pv =
     .start_of_stream     = x86_pv_start_of_stream,
     .start_of_checkpoint = x86_pv_start_of_checkpoint,
     .end_of_checkpoint   = x86_pv_end_of_checkpoint,
+    .check_vm_state      = x86_pv_check_vm_state,
     .cleanup             = x86_pv_cleanup,
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:57:45 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:57: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 1aJ2GP-0007vH-RY; Tue, 12 Jan 2016 16:57:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2GN-0007ug-MT
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:43 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	EA/65-09708-78035965; Tue, 12 Jan 2016 16:57:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1452617861!9700488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18953 invoked from network); 12 Jan 2016 16:57:42 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:57:42 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Gc-0007DC-RZ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2GL-0005UQ-88
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:41 +0000
Date: Tue, 12 Jan 2016 16:57:41 +0000
Message-Id: <E1aJ2GL-0005UQ-88@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: stop migration in case of p2m
	list structural changes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8429374f4410f4c7769170a1423a6404664151a7
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Jan 7 13:36:53 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:49:34 2016 +0000

    libxc: stop migration in case of p2m list structural changes
    
    With support of the virtual mapped linear p2m list for migration it is
    now possible to detect structural changes of the p2m list which before
    would either lead to a crashing or otherwise wrong behaving domU.
    
    A guest supporting the linear p2m list will increment the
    p2m_generation counter located in the shared info page before and after
    each modification of a mapping related to the p2m list. A change of
    that counter can be detected by the tools and reacted upon.
    
    As such a change should occur only very rarely once the domU is up the
    most simple reaction is to cancel migration in such an event.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_sr_common.h       |   12 ++++++++++
 tools/libxc/xc_sr_save.c         |    7 +++++-
 tools/libxc/xc_sr_save_x86_hvm.c |    7 ++++++
 tools/libxc/xc_sr_save_x86_pv.c  |   45 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 70 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_sr_common.h b/tools/libxc/xc_sr_common.h
index 9aecde2..60b43e8 100644
--- a/tools/libxc/xc_sr_common.h
+++ b/tools/libxc/xc_sr_common.h
@@ -83,6 +83,15 @@ struct xc_sr_save_ops
     int (*end_of_checkpoint)(struct xc_sr_context *ctx);
 
     /**
+     * Check state of guest to decide whether it makes sense to continue
+     * migration.  This is called in each iteration or checkpoint to check
+     * whether all criteria for the migration are still met.  If that's not
+     * the case either migration is cancelled via a bad rc or the situation
+     * is handled, e.g. by sending appropriate records.
+     */
+    int (*check_vm_state)(struct xc_sr_context *ctx);
+
+    /**
      * Clean up the local environment.  Will be called exactly once, either
      * after a successful save, or upon encountering an error.
      */
@@ -280,6 +289,9 @@ struct xc_sr_context
             /* Read-only mapping of guests shared info page */
             shared_info_any_t *shinfo;
 
+            /* p2m generation count for verifying validity of local p2m. */
+            uint64_t p2m_generation;
+
             union
             {
                 struct
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index cefcef5..88d85ef 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -394,7 +394,8 @@ static int send_dirty_pages(struct xc_sr_context *ctx,
         DPRINTF("Bitmap contained more entries than expected...");
 
     xc_report_progress_step(xch, entries, entries);
-    return 0;
+
+    return ctx->save.ops.check_vm_state(ctx);
 }
 
 /*
@@ -751,6 +752,10 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type)
         if ( rc )
             goto err;
 
+        rc = ctx->save.ops.check_vm_state(ctx);
+        if ( rc )
+            goto err;
+
         if ( ctx->save.live )
             rc = send_domain_memory_live(ctx);
         else if ( ctx->save.checkpointed )
diff --git a/tools/libxc/xc_sr_save_x86_hvm.c b/tools/libxc/xc_sr_save_x86_hvm.c
index f3d6cee..e347b3b 100644
--- a/tools/libxc/xc_sr_save_x86_hvm.c
+++ b/tools/libxc/xc_sr_save_x86_hvm.c
@@ -175,6 +175,12 @@ static int x86_hvm_start_of_checkpoint(struct xc_sr_context *ctx)
     return 0;
 }
 
+static int x86_hvm_check_vm_state(struct xc_sr_context *ctx)
+{
+    /* no-op */
+    return 0;
+}
+
 static int x86_hvm_end_of_checkpoint(struct xc_sr_context *ctx)
 {
     int rc;
@@ -221,6 +227,7 @@ struct xc_sr_save_ops save_ops_x86_hvm =
     .start_of_stream     = x86_hvm_start_of_stream,
     .start_of_checkpoint = x86_hvm_start_of_checkpoint,
     .end_of_checkpoint   = x86_hvm_end_of_checkpoint,
+    .check_vm_state      = x86_hvm_check_vm_state,
     .cleanup             = x86_hvm_cleanup,
 };
 
diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c
index 5448f32..4deb58f 100644
--- a/tools/libxc/xc_sr_save_x86_pv.c
+++ b/tools/libxc/xc_sr_save_x86_pv.c
@@ -274,6 +274,39 @@ err:
 }
 
 /*
+ * Get p2m_generation count.
+ * Returns an error if the generation count has changed since the last call.
+ */
+static int get_p2m_generation(struct xc_sr_context *ctx)
+{
+    uint64_t p2m_generation;
+    int rc;
+
+    p2m_generation = GET_FIELD(ctx->x86_pv.shinfo, arch.p2m_generation,
+                               ctx->x86_pv.width);
+
+    rc = (p2m_generation == ctx->x86_pv.p2m_generation) ? 0 : -1;
+    ctx->x86_pv.p2m_generation = p2m_generation;
+
+    return rc;
+}
+
+static int x86_pv_check_vm_state_p2m_list(struct xc_sr_context *ctx)
+{
+    xc_interface *xch = ctx->xch;
+    int rc;
+
+    if ( !ctx->save.live )
+        return 0;
+
+    rc = get_p2m_generation(ctx);
+    if ( rc )
+        ERROR("p2m generation count changed. Migration aborted.");
+
+    return rc;
+}
+
+/*
  * Map the guest p2m frames specified via a cr3 value, a virtual address, and
  * the maximum pfn. PTE entries are 64 bits for both, 32 and 64 bit guests as
  * in 32 bit case we support PAE guests only.
@@ -297,6 +330,8 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
         return -1;
     }
 
+    get_p2m_generation(ctx);
+
     p2m_vaddr = GET_FIELD(ctx->x86_pv.shinfo, arch.p2m_vaddr,
                           ctx->x86_pv.width);
     fpp = PAGE_SIZE / ctx->x86_pv.width;
@@ -430,6 +465,7 @@ static int map_p2m(struct xc_sr_context *ctx)
 {
     uint64_t p2m_cr3;
 
+    ctx->x86_pv.p2m_generation = ~0ULL;
     ctx->x86_pv.max_pfn = GET_FIELD(ctx->x86_pv.shinfo, arch.max_pfn,
                                     ctx->x86_pv.width) - 1;
     p2m_cr3 = GET_FIELD(ctx->x86_pv.shinfo, arch.p2m_cr3, ctx->x86_pv.width);
@@ -1069,6 +1105,14 @@ static int x86_pv_end_of_checkpoint(struct xc_sr_context *ctx)
     return 0;
 }
 
+static int x86_pv_check_vm_state(struct xc_sr_context *ctx)
+{
+    if ( ctx->x86_pv.p2m_generation == ~0ULL )
+        return 0;
+
+    return x86_pv_check_vm_state_p2m_list(ctx);
+}
+
 /*
  * save_ops function.  Cleanup.
  */
@@ -1096,6 +1140,7 @@ struct xc_sr_save_ops save_ops_x86_pv =
     .start_of_stream     = x86_pv_start_of_stream,
     .start_of_checkpoint = x86_pv_start_of_checkpoint,
     .end_of_checkpoint   = x86_pv_end_of_checkpoint,
+    .check_vm_state      = x86_pv_check_vm_state,
     .cleanup             = x86_pv_cleanup,
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:57:55 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:57: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 1aJ2GZ-0007y4-V0; Tue, 12 Jan 2016 16:57:55 +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 1aJ2GY-0007xT-0i
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:54 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	6E/53-09570-19035965; Tue, 12 Jan 2016 16:57:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1452617871!15534067!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2566 invoked from network); 12 Jan 2016 16:57:52 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:57:52 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Gn-0007Dm-20
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2GV-0005Up-FE
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:51 +0000
Date: Tue, 12 Jan 2016 16:57:51 +0000
Message-Id: <E1aJ2GV-0005Up-FE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: set flag for support of linear
	p2m list in domain builder
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc6d609371217f0afb94531a015b8a8042d35ce4
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Jan 7 13:36:54 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:49:34 2016 +0000

    libxc: set flag for support of linear p2m list in domain builder
    
    Set the SIF_VIRT_P2M_4TOOLS flag for pv-domUs in the domain builder
    to indicate the Xen tools have full support for the virtual mapped
    linear p2m list.
    
    This will enable pv-domUs to drop support of the 3 level p2m tree
    and use the linear list only. Without setting this flag some kernels
    might limit themselves to 512 GB memory size in order not to break
    migration.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/features/migration.pandoc    |    7 ++++---
 tools/libxc/xc_dom_compat_linux.c |    2 +-
 tools/libxc/xc_dom_core.c         |    2 ++
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/docs/features/migration.pandoc b/docs/features/migration.pandoc
index 9852a19..151c50d 100644
--- a/docs/features/migration.pandoc
+++ b/docs/features/migration.pandoc
@@ -1,5 +1,5 @@
 % Migration
-% Revision 1
+% Revision 2
 
 \clearpage
 
@@ -95,7 +95,6 @@ scenarios, which will involve starting with VMs from Xen 4.5
 # Areas for improvement
 
 * Arm support
-* Linear P2M support for x86 PV
 * Live looping parameters
 
 # Known issues
@@ -105,7 +104,8 @@ scenarios, which will involve starting with VMs from Xen 4.5
 * x86 HVM with nested-virt (no relevant information included in the
   stream)
 * x86 PV ballooning (P2M marked dirty, target frame not marked)
-* x86 PV P2M structure changes (not noticed, stale mappings used)
+* x86 PV P2M structure changes (not noticed, stale mappings used) for
+  guests not using the linear p2m layout
 
 # References
 
@@ -120,4 +120,5 @@ for Migration v2
 Date       Revision Version  Notes
 ---------- -------- -------- -------------------------------------------
 2015-10-24 1        Xen 4.6  Document written
+2015-12-11 2        Xen 4.7  Support of linear p2m list
 ---------- -------- -------- -------------------------------------------
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c
index abbc09f..c922c61 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -59,7 +59,7 @@ int xc_linux_build(xc_interface *xch, uint32_t domid,
          ((rc = xc_dom_ramdisk_file(dom, initrd_name)) != 0) )
         goto out;
 
-    dom->flags = flags;
+    dom->flags |= flags;
     dom->console_evtchn = console_evtchn;
     dom->xenstore_evtchn = store_evtchn;
 
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 2061ba6..55c779d 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -777,6 +777,8 @@ struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
     dom->parms.elf_paddr_offset = UNSET_ADDR;
     dom->parms.p2m_base = UNSET_ADDR;
 
+    dom->flags = SIF_VIRT_P2M_4TOOLS;
+
     dom->alloc_malloc += sizeof(*dom);
     return dom;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:57:55 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:57: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 1aJ2GZ-0007y4-V0; Tue, 12 Jan 2016 16:57:55 +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 1aJ2GY-0007xT-0i
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:54 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	6E/53-09570-19035965; Tue, 12 Jan 2016 16:57:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1452617871!15534067!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2566 invoked from network); 12 Jan 2016 16:57:52 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:57:52 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Gn-0007Dm-20
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2GV-0005Up-FE
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:57:51 +0000
Date: Tue, 12 Jan 2016 16:57:51 +0000
Message-Id: <E1aJ2GV-0005Up-FE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: set flag for support of linear
	p2m list in domain builder
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc6d609371217f0afb94531a015b8a8042d35ce4
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Jan 7 13:36:54 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:49:34 2016 +0000

    libxc: set flag for support of linear p2m list in domain builder
    
    Set the SIF_VIRT_P2M_4TOOLS flag for pv-domUs in the domain builder
    to indicate the Xen tools have full support for the virtual mapped
    linear p2m list.
    
    This will enable pv-domUs to drop support of the 3 level p2m tree
    and use the linear list only. Without setting this flag some kernels
    might limit themselves to 512 GB memory size in order not to break
    migration.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/features/migration.pandoc    |    7 ++++---
 tools/libxc/xc_dom_compat_linux.c |    2 +-
 tools/libxc/xc_dom_core.c         |    2 ++
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/docs/features/migration.pandoc b/docs/features/migration.pandoc
index 9852a19..151c50d 100644
--- a/docs/features/migration.pandoc
+++ b/docs/features/migration.pandoc
@@ -1,5 +1,5 @@
 % Migration
-% Revision 1
+% Revision 2
 
 \clearpage
 
@@ -95,7 +95,6 @@ scenarios, which will involve starting with VMs from Xen 4.5
 # Areas for improvement
 
 * Arm support
-* Linear P2M support for x86 PV
 * Live looping parameters
 
 # Known issues
@@ -105,7 +104,8 @@ scenarios, which will involve starting with VMs from Xen 4.5
 * x86 HVM with nested-virt (no relevant information included in the
   stream)
 * x86 PV ballooning (P2M marked dirty, target frame not marked)
-* x86 PV P2M structure changes (not noticed, stale mappings used)
+* x86 PV P2M structure changes (not noticed, stale mappings used) for
+  guests not using the linear p2m layout
 
 # References
 
@@ -120,4 +120,5 @@ for Migration v2
 Date       Revision Version  Notes
 ---------- -------- -------- -------------------------------------------
 2015-10-24 1        Xen 4.6  Document written
+2015-12-11 2        Xen 4.7  Support of linear p2m list
 ---------- -------- -------- -------------------------------------------
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c
index abbc09f..c922c61 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -59,7 +59,7 @@ int xc_linux_build(xc_interface *xch, uint32_t domid,
          ((rc = xc_dom_ramdisk_file(dom, initrd_name)) != 0) )
         goto out;
 
-    dom->flags = flags;
+    dom->flags |= flags;
     dom->console_evtchn = console_evtchn;
     dom->xenstore_evtchn = store_evtchn;
 
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 2061ba6..55c779d 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -777,6 +777,8 @@ struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
     dom->parms.elf_paddr_offset = UNSET_ADDR;
     dom->parms.p2m_base = UNSET_ADDR;
 
+    dom->flags = SIF_VIRT_P2M_4TOOLS;
+
     dom->alloc_malloc += sizeof(*dom);
     return dom;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:58:06 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:58:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2Gk-00081f-2W; Tue, 12 Jan 2016 16:58: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 1aJ2Gi-00081G-A6
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:04 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	11/BB-28228-B9035965; Tue, 12 Jan 2016 16:58:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1452617881!14376904!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7221 invoked from network); 12 Jan 2016 16:58:02 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:58:02 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Gx-0007Du-9x
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Gf-0005VK-Ln
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:01 +0000
Date: Tue, 12 Jan 2016 16:58:01 +0000
Message-Id: <E1aJ2Gf-0005VK-Ln@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Don't write terminating NULL
	character to command string
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8345512febd09e39c55bdf76ee0fb41b32562f45
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Wed Jan 6 15:03:21 2016 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:51:06 2016 +0000

    libxc: Don't write terminating NULL character to command string
    
    When copying boot command string for HVMlite guests we explicitly write
    '\0' at MAX_GUEST_CMDLINE offset. Unless the string is close to
    MAX_GUEST_CMDLINE in length this write will end up in the wrong place,
    beyond the end of the mapped range.
    
    We don't need to limit the size of command string to some arbitrary
    number. Any size that can be successfully allocated and mapped is valid
    and so the string is guaranteed to be NULL-terminated (since we use
    strlen, which needs terminating '\0', to calculate allocation size).
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_x86.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 3960875..b8d2904 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -676,8 +676,7 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 
         if ( dom->cmdline )
         {
-            strncpy(cmdline, dom->cmdline, MAX_GUEST_CMDLINE);
-            cmdline[MAX_GUEST_CMDLINE - 1] = '\0';
+            strncpy(cmdline, dom->cmdline, cmdline_size);
             start_info->cmdline_paddr = (seg.pfn << PAGE_SHIFT) +
                                 ((uintptr_t)cmdline - (uintptr_t)start_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 Tue Jan 12 16:58:06 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:58:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2Gk-00081f-2W; Tue, 12 Jan 2016 16:58: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 1aJ2Gi-00081G-A6
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:04 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	11/BB-28228-B9035965; Tue, 12 Jan 2016 16:58:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1452617881!14376904!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7221 invoked from network); 12 Jan 2016 16:58:02 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:58:02 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Gx-0007Du-9x
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Gf-0005VK-Ln
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:01 +0000
Date: Tue, 12 Jan 2016 16:58:01 +0000
Message-Id: <E1aJ2Gf-0005VK-Ln@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Don't write terminating NULL
	character to command string
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8345512febd09e39c55bdf76ee0fb41b32562f45
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Wed Jan 6 15:03:21 2016 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:51:06 2016 +0000

    libxc: Don't write terminating NULL character to command string
    
    When copying boot command string for HVMlite guests we explicitly write
    '\0' at MAX_GUEST_CMDLINE offset. Unless the string is close to
    MAX_GUEST_CMDLINE in length this write will end up in the wrong place,
    beyond the end of the mapped range.
    
    We don't need to limit the size of command string to some arbitrary
    number. Any size that can be successfully allocated and mapped is valid
    and so the string is guaranteed to be NULL-terminated (since we use
    strlen, which needs terminating '\0', to calculate allocation size).
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_x86.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 3960875..b8d2904 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -676,8 +676,7 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 
         if ( dom->cmdline )
         {
-            strncpy(cmdline, dom->cmdline, MAX_GUEST_CMDLINE);
-            cmdline[MAX_GUEST_CMDLINE - 1] = '\0';
+            strncpy(cmdline, dom->cmdline, cmdline_size);
             start_info->cmdline_paddr = (seg.pfn << PAGE_SHIFT) +
                                 ((uintptr_t)cmdline - (uintptr_t)start_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 Tue Jan 12 16:58:15 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:58:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2Gt-000842-5q; Tue, 12 Jan 2016 16:58: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 1aJ2Gs-00083f-4X
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:14 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	36/10-31122-5A035965; Tue, 12 Jan 2016 16:58:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1452617892!9697971!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21132 invoked from network); 12 Jan 2016 16:58:12 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:58:12 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2H7-0007Eb-Ir
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Gp-0005Vn-Vf
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:12 +0000
Date: Tue, 12 Jan 2016 16:58:11 +0000
Message-Id: <E1aJ2Gp-0005Vn-Vf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: remove mini-os when doing
	make distclean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5178da0a246808634be2a12cd17511932ce922c3
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Jan 7 09:53:16 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:51:41 2016 +0000

    stubdom: remove mini-os when doing make distclean
    
    make distclean does not remove mini-os. Do so when cleaning stubdom.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 8a9331f..a8e9523 100644
--- a/Makefile
+++ b/Makefile
@@ -209,6 +209,7 @@ distclean-stubdom:
 ifeq (x86_64,$(XEN_TARGET_ARCH))
 	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom distclean
 endif
+	rm -rf extras/mini-os extras/mini-os-remote
 
 .PHONY: distclean-docs
 distclean-docs:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:58:15 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:58:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2Gt-000842-5q; Tue, 12 Jan 2016 16:58: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 1aJ2Gs-00083f-4X
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:14 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	36/10-31122-5A035965; Tue, 12 Jan 2016 16:58:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1452617892!9697971!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21132 invoked from network); 12 Jan 2016 16:58:12 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:58:12 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2H7-0007Eb-Ir
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Gp-0005Vn-Vf
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:12 +0000
Date: Tue, 12 Jan 2016 16:58:11 +0000
Message-Id: <E1aJ2Gp-0005Vn-Vf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom: remove mini-os when doing
	make distclean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5178da0a246808634be2a12cd17511932ce922c3
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Jan 7 09:53:16 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:51:41 2016 +0000

    stubdom: remove mini-os when doing make distclean
    
    make distclean does not remove mini-os. Do so when cleaning stubdom.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 8a9331f..a8e9523 100644
--- a/Makefile
+++ b/Makefile
@@ -209,6 +209,7 @@ distclean-stubdom:
 ifeq (x86_64,$(XEN_TARGET_ARCH))
 	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom distclean
 endif
+	rm -rf extras/mini-os extras/mini-os-remote
 
 .PHONY: distclean-docs
 distclean-docs:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:58:25 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:58: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 1aJ2H3-00086M-A0; Tue, 12 Jan 2016 16:58: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 1aJ2H2-000869-P0
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:24 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	E0/CC-02745-FA035965; Tue, 12 Jan 2016 16:58:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1452617902!5791596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56171 invoked from network); 12 Jan 2016 16:58:23 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:58:23 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2HH-0007Ej-RV
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2H0-0005W9-8A
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:22 +0000
Date: Tue, 12 Jan 2016 16:58:22 +0000
Message-Id: <E1aJ2H0-0005W9-8A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: add distclean target to
	libs/toollog Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6884e2b727047583a7953d898d8acb06b0f4dd0f
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Jan 7 09:25:01 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:52:03 2016 +0000

    tools: add distclean target to libs/toollog Makefile
    
    The new logging library Makefile doesn't support the distclean target.
    Add it.
    
    Also remove all created shared library versions via the clean target.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libs/toollog/Makefile |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile
index bd12403..9bfd179 100644
--- a/tools/libs/toollog/Makefile
+++ b/tools/libs/toollog/Makefile
@@ -57,3 +57,7 @@ TAGS:
 .PHONY: clean
 clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -f libxentoollog.so.$(MAJOR).$(MINOR) libxentoollog.so.$(MAJOR)
+
+.PHONY: distclean
+distclean: clean
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:58:25 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:58: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 1aJ2H3-00086M-A0; Tue, 12 Jan 2016 16:58: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 1aJ2H2-000869-P0
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:24 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	E0/CC-02745-FA035965; Tue, 12 Jan 2016 16:58:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1452617902!5791596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56171 invoked from network); 12 Jan 2016 16:58:23 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:58:23 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2HH-0007Ej-RV
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2H0-0005W9-8A
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:22 +0000
Date: Tue, 12 Jan 2016 16:58:22 +0000
Message-Id: <E1aJ2H0-0005W9-8A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: add distclean target to
	libs/toollog Makefile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6884e2b727047583a7953d898d8acb06b0f4dd0f
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Jan 7 09:25:01 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:52:03 2016 +0000

    tools: add distclean target to libs/toollog Makefile
    
    The new logging library Makefile doesn't support the distclean target.
    Add it.
    
    Also remove all created shared library versions via the clean target.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libs/toollog/Makefile |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile
index bd12403..9bfd179 100644
--- a/tools/libs/toollog/Makefile
+++ b/tools/libs/toollog/Makefile
@@ -57,3 +57,7 @@ TAGS:
 .PHONY: clean
 clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -f libxentoollog.so.$(MAJOR).$(MINOR) libxentoollog.so.$(MAJOR)
+
+.PHONY: distclean
+distclean: clean
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:58:36 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:58: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 1aJ2HE-00089V-HT; Tue, 12 Jan 2016 16:58: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 1aJ2HC-00089D-WE
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:35 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	73/60-31122-AB035965; Tue, 12 Jan 2016 16:58:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1452617913!9689920!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40890 invoked from network); 12 Jan 2016 16:58:33 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:58:33 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2HS-0007Er-7k
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2HA-0005XE-H3
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:32 +0000
Date: Tue, 12 Jan 2016 16:58:32 +0000
Message-Id: <E1aJ2HA-0005XE-H3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: ignore writes to
	GICD_ICACTIVER ... GICD_ICACTIVERN
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68778eeaa3babedba9677400f63f1e7564bba561
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed Jan 6 17:21:25 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:53:43 2016 +0000

    xen/arm: ignore writes to GICD_ICACTIVER ... GICD_ICACTIVERN
    
    Injecting a fault to the guest just because it is writing to one of the
    GICD_ICACTIVER registers, which are part of the GICv2 and GICv3 specs,
    is harsh. Additionally it causes recent linux kernels to fail to boot on
    Xen.
    
    Ignore writes to GICD_ICACTIVER ... GICD_ICACTIVERN instead, to solve
    the boot issue and for backportability. However implementing the
    registers properly might a better long term solution.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c |    3 +--
 xen/arch/arm/vgic-v3.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 944b004..9adb4a9 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -494,11 +494,10 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 0;
 
     case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
-        if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ICACTIVER%d\n",
                v, r, gicd_reg - GICD_ICACTIVER);
-        return 0;
+        goto write_ignore_32;
 
     case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 5893b71..dba2449 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -621,11 +621,10 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         return 0;
 
     case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
-        if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ICACTIVER%d\n",
                v, name, r, reg - GICD_ICACTIVER);
-        return 0;
+        goto write_ignore_32;
 
     case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:58:36 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:58: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 1aJ2HE-00089V-HT; Tue, 12 Jan 2016 16:58: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 1aJ2HC-00089D-WE
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:35 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	73/60-31122-AB035965; Tue, 12 Jan 2016 16:58:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1452617913!9689920!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40890 invoked from network); 12 Jan 2016 16:58:33 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:58:33 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2HS-0007Er-7k
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2HA-0005XE-H3
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:32 +0000
Date: Tue, 12 Jan 2016 16:58:32 +0000
Message-Id: <E1aJ2HA-0005XE-H3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: ignore writes to
	GICD_ICACTIVER ... GICD_ICACTIVERN
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68778eeaa3babedba9677400f63f1e7564bba561
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed Jan 6 17:21:25 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jan 7 12:53:43 2016 +0000

    xen/arm: ignore writes to GICD_ICACTIVER ... GICD_ICACTIVERN
    
    Injecting a fault to the guest just because it is writing to one of the
    GICD_ICACTIVER registers, which are part of the GICv2 and GICv3 specs,
    is harsh. Additionally it causes recent linux kernels to fail to boot on
    Xen.
    
    Ignore writes to GICD_ICACTIVER ... GICD_ICACTIVERN instead, to solve
    the boot issue and for backportability. However implementing the
    registers properly might a better long term solution.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c |    3 +--
 xen/arch/arm/vgic-v3.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 944b004..9adb4a9 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -494,11 +494,10 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 0;
 
     case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
-        if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ICACTIVER%d\n",
                v, r, gicd_reg - GICD_ICACTIVER);
-        return 0;
+        goto write_ignore_32;
 
     case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 5893b71..dba2449 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -621,11 +621,10 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         return 0;
 
     case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
-        if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ICACTIVER%d\n",
                v, name, r, reg - GICD_ICACTIVER);
-        return 0;
+        goto write_ignore_32;
 
     case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:58:46 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:58:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2HO-0008BV-Mt; Tue, 12 Jan 2016 16:58:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2HN-0008BB-D8
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:45 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	5E/66-09708-4C035965; Tue, 12 Jan 2016 16:58:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1452617923!9819879!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11387 invoked from network); 12 Jan 2016 16:58:44 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:58:44 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Hc-0007Ey-Ny
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2HL-0005Xb-4e
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:43 +0000
Date: Tue, 12 Jan 2016 16:58:43 +0000
Message-Id: <E1aJ2HL-0005Xb-4e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: misc printk() adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c68b6fa2b68b23014f2947c2f8e331660e999c73
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 7 15:15:01 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:15:01 2016 +0100

    x86: misc printk() adjustments
    
    - a missing newline
    - missing log levels (in Dom0-only messages)
    - one dprintk() -> printk() conversion
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/acpi/power.c |    2 +-
 xen/arch/x86/io_apic.c    |   17 +++++++++--------
 xen/arch/x86/x86_64/mm.c  |    5 +++--
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 7eaae6e..2885e31 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -268,7 +268,7 @@ int acpi_enter_sleep(struct xenpf_enter_acpi_sleep *sleep)
     else if ( sleep->val_b &&
               ((sleep->val_a ^ sleep->val_b) & ACPI_BITMASK_SLEEP_ENABLE) )
     {
-        gdprintk(XENLOG_ERR, "Mismatched pm1a/pm1b setting.");
+        gdprintk(XENLOG_ERR, "Mismatched pm1a/pm1b setting\n");
         return -EINVAL;
     }
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index c2229ad..7b9cf16 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2310,13 +2310,14 @@ int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)
     return 0;
 }
 
-#define WARN_BOGUS_WRITE(f, a...)                                       \
-    dprintk(XENLOG_INFO, "\n%s: "                                        \
-            "apic=%d, pin=%d, irq=%d\n"                 \
-            "%s: new_entry=%08x\n"                      \
-            "%s: " f, __FUNCTION__, apic, pin, irq,        \
-            __FUNCTION__, *(u32 *)&rte,           \
-            __FUNCTION__ , ##a )
+#define WARN_BOGUS_WRITE(f, a...)                       \
+    dprintk(XENLOG_INFO, "\n"                           \
+            XENLOG_INFO "%s: apic=%d, pin=%d, irq=%d\n" \
+            XENLOG_INFO "%s: new_entry=%08x\n"          \
+            XENLOG_INFO "%s: " f "\n",                  \
+            __func__, apic, pin, irq,                   \
+            __func__, *(u32 *)&rte,                     \
+            __func__, ##a )
 
 int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 {
@@ -2388,7 +2389,7 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
         rte.vector = desc->arch.vector;
         if ( *(u32*)&rte != ret )
             WARN_BOGUS_WRITE("old_entry=%08x pirq=%d\n%s: "
-                             "Attempt to modify IO-APIC pin for in-use IRQ!\n",
+                             "Attempt to modify IO-APIC pin for in-use IRQ!",
                              ret, pirq, __FUNCTION__);
         return 0;
     }
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index bbbf8e3..2228898 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -1366,8 +1366,9 @@ int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm)
 
     if ( !valid_numa_range(spfn << PAGE_SHIFT, epfn << PAGE_SHIFT, node) )
     {
-        dprintk(XENLOG_WARNING, "spfn %lx ~ epfn %lx pxm %x node %x"
-            "is not numa valid", spfn, epfn, pxm, node);
+        printk(XENLOG_WARNING
+               "pfn range %lx..%lx PXM %x node %x is not NUMA-valid\n",
+               spfn, epfn, pxm, node);
         return -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 Tue Jan 12 16:58:46 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:58:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2HO-0008BV-Mt; Tue, 12 Jan 2016 16:58:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2HN-0008BB-D8
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:45 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	5E/66-09708-4C035965; Tue, 12 Jan 2016 16:58:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1452617923!9819879!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11387 invoked from network); 12 Jan 2016 16:58:44 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:58:44 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Hc-0007Ey-Ny
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2HL-0005Xb-4e
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:43 +0000
Date: Tue, 12 Jan 2016 16:58:43 +0000
Message-Id: <E1aJ2HL-0005Xb-4e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: misc printk() adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c68b6fa2b68b23014f2947c2f8e331660e999c73
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 7 15:15:01 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:15:01 2016 +0100

    x86: misc printk() adjustments
    
    - a missing newline
    - missing log levels (in Dom0-only messages)
    - one dprintk() -> printk() conversion
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/acpi/power.c |    2 +-
 xen/arch/x86/io_apic.c    |   17 +++++++++--------
 xen/arch/x86/x86_64/mm.c  |    5 +++--
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 7eaae6e..2885e31 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -268,7 +268,7 @@ int acpi_enter_sleep(struct xenpf_enter_acpi_sleep *sleep)
     else if ( sleep->val_b &&
               ((sleep->val_a ^ sleep->val_b) & ACPI_BITMASK_SLEEP_ENABLE) )
     {
-        gdprintk(XENLOG_ERR, "Mismatched pm1a/pm1b setting.");
+        gdprintk(XENLOG_ERR, "Mismatched pm1a/pm1b setting\n");
         return -EINVAL;
     }
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index c2229ad..7b9cf16 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2310,13 +2310,14 @@ int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)
     return 0;
 }
 
-#define WARN_BOGUS_WRITE(f, a...)                                       \
-    dprintk(XENLOG_INFO, "\n%s: "                                        \
-            "apic=%d, pin=%d, irq=%d\n"                 \
-            "%s: new_entry=%08x\n"                      \
-            "%s: " f, __FUNCTION__, apic, pin, irq,        \
-            __FUNCTION__, *(u32 *)&rte,           \
-            __FUNCTION__ , ##a )
+#define WARN_BOGUS_WRITE(f, a...)                       \
+    dprintk(XENLOG_INFO, "\n"                           \
+            XENLOG_INFO "%s: apic=%d, pin=%d, irq=%d\n" \
+            XENLOG_INFO "%s: new_entry=%08x\n"          \
+            XENLOG_INFO "%s: " f "\n",                  \
+            __func__, apic, pin, irq,                   \
+            __func__, *(u32 *)&rte,                     \
+            __func__, ##a )
 
 int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 {
@@ -2388,7 +2389,7 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
         rte.vector = desc->arch.vector;
         if ( *(u32*)&rte != ret )
             WARN_BOGUS_WRITE("old_entry=%08x pirq=%d\n%s: "
-                             "Attempt to modify IO-APIC pin for in-use IRQ!\n",
+                             "Attempt to modify IO-APIC pin for in-use IRQ!",
                              ret, pirq, __FUNCTION__);
         return 0;
     }
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index bbbf8e3..2228898 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -1366,8 +1366,9 @@ int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm)
 
     if ( !valid_numa_range(spfn << PAGE_SHIFT, epfn << PAGE_SHIFT, node) )
     {
-        dprintk(XENLOG_WARNING, "spfn %lx ~ epfn %lx pxm %x node %x"
-            "is not numa valid", spfn, epfn, pxm, node);
+        printk(XENLOG_WARNING
+               "pfn range %lx..%lx PXM %x node %x is not NUMA-valid\n",
+               spfn, epfn, pxm, node);
         return -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 Tue Jan 12 16:58:57 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:58: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 1aJ2HY-0008DU-VB; Tue, 12 Jan 2016 16:58: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 1aJ2HX-0008DC-UP
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:56 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	97/44-25435-FC035965; Tue, 12 Jan 2016 16:58:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1452617933!12587624!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54451 invoked from network); 12 Jan 2016 16:58:54 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:58:54 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Hn-0007FZ-0N
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2HV-0005Y0-DF
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:53 +0000
Date: Tue, 12 Jan 2016 16:58:53 +0000
Message-Id: <E1aJ2HV-0005Y0-DF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] convert FLASK_ENABLE to Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b36bf230270baba4f0fe35b230ea8b80ebb2c4a7
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Thu Jan 7 15:18:45 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:18:45 2016 +0100

    convert FLASK_ENABLE to Kconfig
    
    Converts the Config.mk option of FLASK_ENABLE into a Kconfig option for
    the hypervisor called CONFIG_FLASK. This commit knowingly breaks the
    dependent relationship on XSM_ENABLE which is addressed when XSM_ENABLE
    is converted to Kconfig.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 Config.mk                |    1 -
 INSTALL                  |    6 +++++-
 docs/misc/xsm-flask.txt  |    5 +++--
 xen/Rules.mk             |    1 -
 xen/common/Kconfig       |   11 +++++++++++
 xen/include/Makefile     |    2 +-
 xen/include/xen/config.h |    2 +-
 xen/include/xen/sched.h  |    2 +-
 xen/xsm/Makefile         |    2 +-
 9 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/Config.mk b/Config.mk
index a3be5ed..1315918 100644
--- a/Config.mk
+++ b/Config.mk
@@ -214,7 +214,6 @@ EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
 # Enable XSM security module (by default, Flask).
 XSM_ENABLE ?= n
-FLASK_ENABLE ?= $(XSM_ENABLE)
 
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
diff --git a/INSTALL b/INSTALL
index b7e426c..c51447b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -278,7 +278,11 @@ PYTHON_PREFIX_ARG=
 The hypervisor may be build with XSM support, which can be changed with
 the following variables.
 XSM_ENABLE=y
-FLASK_ENABLE=y
+
+The hypervisor may be build with Flask support, which can be changed
+by running:
+make -C xen menuconfig
+and enabling Flask in the 'Common Features' menu.
 
 Do a build for coverage.
 coverage=y
diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index 7249f40..f2f0fd4 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -172,8 +172,9 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE and
-FLASK_ENABLE to "y"; this change requires a make clean and rebuild.
+framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
+"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
+Features'; this change requires a make clean and rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 8839dca..489cfd1 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -53,7 +53,6 @@ CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
-CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 046e257..6373b7f 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -8,6 +8,17 @@ config COMPAT
 	  HVM and PV guests. HVMLoader makes 32-bit hypercalls irrespective
 	  of the destination runmode of the guest.
 
+config FLASK
+	bool "FLux Advanced Security Kernel support"
+	default n
+	--help---
+	  Enables the FLASK (FLux Advanced Security Kernel) support which
+	  provides a mandatory access control framework by which security
+	  enforcement, isolation, and auditing can be achieved with fine
+	  granular control via a security policy.
+
+	  If unsure, say N.
+
 # Select HAS_DEVICE_TREE if device tree is supported
 config HAS_DEVICE_TREE
 	bool
diff --git a/xen/include/Makefile b/xen/include/Makefile
index 94ba3d8..9c8188b 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -28,7 +28,7 @@ headers-$(CONFIG_X86)     += compat/arch-x86/xen.h
 headers-$(CONFIG_X86)     += compat/arch-x86/xen-$(compat-arch-y).h
 headers-$(CONFIG_X86)     += compat/hvm/hvm_vcpu.h
 headers-y                 += compat/arch-$(compat-arch-y).h compat/pmu.h compat/xlat.h
-headers-$(FLASK_ENABLE)   += compat/xsm/flask_op.h
+headers-$(CONFIG_FLASK)   += compat/xsm/flask_op.h
 
 cppflags-y                := -include public/xen-compat.h
 cppflags-$(CONFIG_X86)    += -m32
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index 7595599..bba015a 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -86,7 +86,7 @@
 #define mk_unsigned_long(x) x
 #endif /* !__ASSEMBLY__ */
 
-#ifdef FLASK_ENABLE
+#ifdef CONFIG_FLASK
 #define XSM_MAGIC 0xf97cff8c
 /* Maintain statistics on the access vector cache */
 #define FLASK_AVC_STATS 1
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index fc61fc3..6ea3cc7 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -119,7 +119,7 @@ struct evtchn
          */
         void *generic;
 #endif
-#ifdef FLASK_ENABLE
+#ifdef CONFIG_FLASK
         /*
          * Inlining the contents of the structure for FLASK avoids unneeded
          * allocations, and on 64-bit platforms with only FLASK enabled,
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index 16c13b5..d29e71c 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -4,4 +4,4 @@ obj-y += xsm_policy.o
 obj-y += dummy.o
 endif
 
-subdir-$(FLASK_ENABLE) += flask
+subdir-$(CONFIG_FLASK) += flask
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:58:57 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:58: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 1aJ2HY-0008DU-VB; Tue, 12 Jan 2016 16:58: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 1aJ2HX-0008DC-UP
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:56 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	97/44-25435-FC035965; Tue, 12 Jan 2016 16:58:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1452617933!12587624!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54451 invoked from network); 12 Jan 2016 16:58:54 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:58:54 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Hn-0007FZ-0N
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2HV-0005Y0-DF
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:58:53 +0000
Date: Tue, 12 Jan 2016 16:58:53 +0000
Message-Id: <E1aJ2HV-0005Y0-DF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] convert FLASK_ENABLE to Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b36bf230270baba4f0fe35b230ea8b80ebb2c4a7
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Thu Jan 7 15:18:45 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:18:45 2016 +0100

    convert FLASK_ENABLE to Kconfig
    
    Converts the Config.mk option of FLASK_ENABLE into a Kconfig option for
    the hypervisor called CONFIG_FLASK. This commit knowingly breaks the
    dependent relationship on XSM_ENABLE which is addressed when XSM_ENABLE
    is converted to Kconfig.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 Config.mk                |    1 -
 INSTALL                  |    6 +++++-
 docs/misc/xsm-flask.txt  |    5 +++--
 xen/Rules.mk             |    1 -
 xen/common/Kconfig       |   11 +++++++++++
 xen/include/Makefile     |    2 +-
 xen/include/xen/config.h |    2 +-
 xen/include/xen/sched.h  |    2 +-
 xen/xsm/Makefile         |    2 +-
 9 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/Config.mk b/Config.mk
index a3be5ed..1315918 100644
--- a/Config.mk
+++ b/Config.mk
@@ -214,7 +214,6 @@ EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
 # Enable XSM security module (by default, Flask).
 XSM_ENABLE ?= n
-FLASK_ENABLE ?= $(XSM_ENABLE)
 
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
diff --git a/INSTALL b/INSTALL
index b7e426c..c51447b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -278,7 +278,11 @@ PYTHON_PREFIX_ARG=
 The hypervisor may be build with XSM support, which can be changed with
 the following variables.
 XSM_ENABLE=y
-FLASK_ENABLE=y
+
+The hypervisor may be build with Flask support, which can be changed
+by running:
+make -C xen menuconfig
+and enabling Flask in the 'Common Features' menu.
 
 Do a build for coverage.
 coverage=y
diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index 7249f40..f2f0fd4 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -172,8 +172,9 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE and
-FLASK_ENABLE to "y"; this change requires a make clean and rebuild.
+framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
+"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
+Features'; this change requires a make clean and rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 8839dca..489cfd1 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -53,7 +53,6 @@ CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
-CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 046e257..6373b7f 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -8,6 +8,17 @@ config COMPAT
 	  HVM and PV guests. HVMLoader makes 32-bit hypercalls irrespective
 	  of the destination runmode of the guest.
 
+config FLASK
+	bool "FLux Advanced Security Kernel support"
+	default n
+	--help---
+	  Enables the FLASK (FLux Advanced Security Kernel) support which
+	  provides a mandatory access control framework by which security
+	  enforcement, isolation, and auditing can be achieved with fine
+	  granular control via a security policy.
+
+	  If unsure, say N.
+
 # Select HAS_DEVICE_TREE if device tree is supported
 config HAS_DEVICE_TREE
 	bool
diff --git a/xen/include/Makefile b/xen/include/Makefile
index 94ba3d8..9c8188b 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -28,7 +28,7 @@ headers-$(CONFIG_X86)     += compat/arch-x86/xen.h
 headers-$(CONFIG_X86)     += compat/arch-x86/xen-$(compat-arch-y).h
 headers-$(CONFIG_X86)     += compat/hvm/hvm_vcpu.h
 headers-y                 += compat/arch-$(compat-arch-y).h compat/pmu.h compat/xlat.h
-headers-$(FLASK_ENABLE)   += compat/xsm/flask_op.h
+headers-$(CONFIG_FLASK)   += compat/xsm/flask_op.h
 
 cppflags-y                := -include public/xen-compat.h
 cppflags-$(CONFIG_X86)    += -m32
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index 7595599..bba015a 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -86,7 +86,7 @@
 #define mk_unsigned_long(x) x
 #endif /* !__ASSEMBLY__ */
 
-#ifdef FLASK_ENABLE
+#ifdef CONFIG_FLASK
 #define XSM_MAGIC 0xf97cff8c
 /* Maintain statistics on the access vector cache */
 #define FLASK_AVC_STATS 1
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index fc61fc3..6ea3cc7 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -119,7 +119,7 @@ struct evtchn
          */
         void *generic;
 #endif
-#ifdef FLASK_ENABLE
+#ifdef CONFIG_FLASK
         /*
          * Inlining the contents of the structure for FLASK avoids unneeded
          * allocations, and on 64-bit platforms with only FLASK enabled,
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index 16c13b5..d29e71c 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -4,4 +4,4 @@ obj-y += xsm_policy.o
 obj-y += dummy.o
 endif
 
-subdir-$(FLASK_ENABLE) += flask
+subdir-$(CONFIG_FLASK) += flask
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:59:08 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:59:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2Hk-0008Fw-3j; Tue, 12 Jan 2016 16:59: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 1aJ2Hi-0008FZ-AW
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:06 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	E2/F1-13487-9D035965; Tue, 12 Jan 2016 16:59:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1452617944!15418746!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45854 invoked from network); 12 Jan 2016 16:59:04 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:59:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Hx-0007Fh-BM
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Hf-0005YZ-L7
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:03 +0000
Date: Tue, 12 Jan 2016 16:59:03 +0000
Message-Id: <E1aJ2Hf-0005YZ-L7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] convert XSM_ENABLE to Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b2ab5d88b2d2ab0155101a0a6922025064061af
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Thu Jan 7 15:25:58 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:25:58 2016 +0100

    convert XSM_ENABLE to Kconfig
    
    Converts the existing XSM_ENABLE flag from Config.mk to CONFIG_XSM
    within Kconfig. This also re-adds the dependency of CONFIG_FLASK on
    CONFIG_XSM.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 Config.mk                    |    3 ---
 INSTALL                      |    8 ++------
 docs/misc/xsm-flask.txt      |    6 +++---
 xen/Rules.mk                 |    1 -
 xen/common/Kconfig           |   39 +++++++++++++++++++++++++++++++++++++--
 xen/include/asm-x86/config.h |    4 ----
 xen/include/xen/sched.h      |    2 +-
 xen/include/xsm/dummy.h      |   10 +++++-----
 xen/include/xsm/xsm.h        |    6 +++---
 xen/xsm/Makefile             |    6 ++----
 10 files changed, 53 insertions(+), 32 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1315918..62f8209 100644
--- a/Config.mk
+++ b/Config.mk
@@ -212,9 +212,6 @@ APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
-# Enable XSM security module (by default, Flask).
-XSM_ENABLE ?= n
-
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
 # the internet.  The original download URL is preserved as a comment
diff --git a/INSTALL b/INSTALL
index c51447b..3d2e86a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -275,14 +275,10 @@ Building the python tools may fail unless certain options are passed to
 setup.py. Config.mk contains additional info how to use this variable.
 PYTHON_PREFIX_ARG=
 
-The hypervisor may be build with XSM support, which can be changed with
-the following variables.
-XSM_ENABLE=y
-
-The hypervisor may be build with Flask support, which can be changed
+he hypervisor may be build with XSM/Flask support, which can be changed
 by running:
 make -C xen menuconfig
-and enabling Flask in the 'Common Features' menu.
+and enabling XSM/Flask in the 'Common Features' menu.
 
 Do a build for coverage.
 coverage=y
diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index f2f0fd4..fb2fe9f 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -172,9 +172,9 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
-"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
-Features'; this change requires a make clean and rebuild.
+framework is disabled. Running 'make -C xen menuconfig' and enabling XSM
+and FLASK inside 'Common Features'; this change requires a make clean and
+rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 489cfd1..bdd8ccf 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -52,7 +52,6 @@ CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
 CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
-CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 6373b7f..eadfc3b 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -10,8 +10,9 @@ config COMPAT
 
 config FLASK
 	bool "FLux Advanced Security Kernel support"
-	default n
-	--help---
+	default y
+	depends on XSM
+	---help---
 	  Enables the FLASK (FLux Advanced Security Kernel) support which
 	  provides a mandatory access control framework by which security
 	  enforcement, isolation, and auditing can be achieved with fine
@@ -62,4 +63,38 @@ config KEXEC
 
 	  If unsure, say Y.
 
+# Allows "late" initialization of the hardware domain
+config LATE_HWDOM
+	bool "dedicated hardware domain"
+	default n
+	depends on XSM && X86
+	---help---
+	  Allows the creation of a dedicated hardware domain distinct from
+	  domain 0 that manages devices without needing access to other
+	  privileged functionality such as the ability to manage domains.
+	  This requires that the actual domain 0 be a stub domain that
+	  constructs the actual hardware domain instead of initializing the
+	  hardware itself.  Because the hardware domain needs access to
+	  hypercalls not available to unprivileged guests, an XSM policy
+	  is required to properly define the privilege of these domains.
+
+	  This feature does nothing if the "hardware_dom" boot parameter is
+	  not present.  If this feature is being used for security, it should
+	  be combined with an IOMMU in strict mode.
+
+	  If unsure, say N.
+
+# Enable/Disable XSM support
+config XSM
+	bool "Xen Security Modules support"
+	default n
+	---help---
+	  Enables the security framework known as Xen Security Modules which
+	  allows administrators fine-grained control over a Xen domain and
+	  its capabilities by defining permissible interactions between domains,
+	  the hypervisor itself, and related resources such as memory and
+	  devices.
+
+	  If unsure, say N.
+
 endmenu
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index f25d92e..3305a75 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -52,10 +52,6 @@
 
 #define CONFIG_MULTIBOOT 1
 
-#ifdef XSM_ENABLE
-#define CONFIG_LATE_HWDOM 1
-#endif
-
 #define HZ 100
 
 #define OPT_CONSOLE_STR "vga"
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6ea3cc7..e1428f7 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -110,7 +110,7 @@ struct evtchn
     u8 priority;
     u8 last_priority;
     u16 last_vcpu_id;
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
     union {
 #ifdef XSM_NEED_GENERIC_EVTCHN_SSID
         /*
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 81fba40..55b84f0 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -27,9 +27,9 @@
 /* DO NOT implement this function; it is supposed to trigger link errors */
 void __xsm_action_mismatch_detected(void);
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
-/* In XSM_ENABLE builds, this header file is included from xsm/dummy.c, and
+/* In CONFIG_XSM builds, this header file is included from xsm/dummy.c, and
  * contains static (not inline) functions compiled to the dummy XSM module.
  * There is no xsm_default_t argument available, so the value from the assertion
  * is used to initialize the variable.
@@ -39,9 +39,9 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID void
 #define XSM_ASSERT_ACTION(def) xsm_default_t action = def; (void)action
 
-#else /* XSM_ENABLE */
+#else /* CONFIG_XSM */
 
-/* In !XSM_ENABLE builds, this header file is included from xsm/xsm.h, and
+/* In !CONFIG_XSM builds, this header file is included from xsm/xsm.h, and
  * contains inline functions for each XSM hook. These functions also perform
  * compile-time checks on the xsm_default_t argument to ensure that the behavior
  * of the dummy XSM module is the same as the behavior with XSM disabled.
@@ -51,7 +51,7 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID xsm_default_t action
 #define XSM_ASSERT_ACTION(def) LINKER_BUG_ON(def != action)
 
-#endif /* XSM_ENABLE */
+#endif /* CONFIG_XSM */
 
 static always_inline int xsm_default_action(
     xsm_default_t action, struct domain *src, struct domain *target)
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 3fc3824..2c365cd 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -194,7 +194,7 @@ struct xsm_operations {
 #endif
 };
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
 extern struct xsm_operations *xsm_ops;
 
@@ -752,7 +752,7 @@ extern int unregister_xsm(struct xsm_operations *ops);
 extern struct xsm_operations dummy_xsm_ops;
 extern void xsm_fixup_ops(struct xsm_operations *ops);
 
-#else /* XSM_ENABLE */
+#else /* CONFIG_XSM */
 
 #include <xsm/dummy.h>
 
@@ -772,6 +772,6 @@ static inline int xsm_dt_init(void)
 }
 #endif
 
-#endif /* XSM_ENABLE */
+#endif /* CONFIG_XSM */
 
 #endif /* __XSM_H */
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index d29e71c..3252c46 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -1,7 +1,5 @@
 obj-y += xsm_core.o
-ifeq ($(XSM_ENABLE),y)
-obj-y += xsm_policy.o
-obj-y += dummy.o
-endif
+obj-$(CONFIG_XSM) += xsm_policy.o
+obj-$(CONFIG_XSM) += dummy.o
 
 subdir-$(CONFIG_FLASK) += flask
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:59:08 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:59:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2Hk-0008Fw-3j; Tue, 12 Jan 2016 16:59: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 1aJ2Hi-0008FZ-AW
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:06 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	E2/F1-13487-9D035965; Tue, 12 Jan 2016 16:59:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1452617944!15418746!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45854 invoked from network); 12 Jan 2016 16:59:04 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:59:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Hx-0007Fh-BM
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Hf-0005YZ-L7
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:03 +0000
Date: Tue, 12 Jan 2016 16:59:03 +0000
Message-Id: <E1aJ2Hf-0005YZ-L7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] convert XSM_ENABLE to Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b2ab5d88b2d2ab0155101a0a6922025064061af
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Thu Jan 7 15:25:58 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:25:58 2016 +0100

    convert XSM_ENABLE to Kconfig
    
    Converts the existing XSM_ENABLE flag from Config.mk to CONFIG_XSM
    within Kconfig. This also re-adds the dependency of CONFIG_FLASK on
    CONFIG_XSM.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 Config.mk                    |    3 ---
 INSTALL                      |    8 ++------
 docs/misc/xsm-flask.txt      |    6 +++---
 xen/Rules.mk                 |    1 -
 xen/common/Kconfig           |   39 +++++++++++++++++++++++++++++++++++++--
 xen/include/asm-x86/config.h |    4 ----
 xen/include/xen/sched.h      |    2 +-
 xen/include/xsm/dummy.h      |   10 +++++-----
 xen/include/xsm/xsm.h        |    6 +++---
 xen/xsm/Makefile             |    6 ++----
 10 files changed, 53 insertions(+), 32 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1315918..62f8209 100644
--- a/Config.mk
+++ b/Config.mk
@@ -212,9 +212,6 @@ APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
-# Enable XSM security module (by default, Flask).
-XSM_ENABLE ?= n
-
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
 # the internet.  The original download URL is preserved as a comment
diff --git a/INSTALL b/INSTALL
index c51447b..3d2e86a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -275,14 +275,10 @@ Building the python tools may fail unless certain options are passed to
 setup.py. Config.mk contains additional info how to use this variable.
 PYTHON_PREFIX_ARG=
 
-The hypervisor may be build with XSM support, which can be changed with
-the following variables.
-XSM_ENABLE=y
-
-The hypervisor may be build with Flask support, which can be changed
+he hypervisor may be build with XSM/Flask support, which can be changed
 by running:
 make -C xen menuconfig
-and enabling Flask in the 'Common Features' menu.
+and enabling XSM/Flask in the 'Common Features' menu.
 
 Do a build for coverage.
 coverage=y
diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index f2f0fd4..fb2fe9f 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -172,9 +172,9 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
-"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
-Features'; this change requires a make clean and rebuild.
+framework is disabled. Running 'make -C xen menuconfig' and enabling XSM
+and FLASK inside 'Common Features'; this change requires a make clean and
+rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 489cfd1..bdd8ccf 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -52,7 +52,6 @@ CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
 CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
-CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 6373b7f..eadfc3b 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -10,8 +10,9 @@ config COMPAT
 
 config FLASK
 	bool "FLux Advanced Security Kernel support"
-	default n
-	--help---
+	default y
+	depends on XSM
+	---help---
 	  Enables the FLASK (FLux Advanced Security Kernel) support which
 	  provides a mandatory access control framework by which security
 	  enforcement, isolation, and auditing can be achieved with fine
@@ -62,4 +63,38 @@ config KEXEC
 
 	  If unsure, say Y.
 
+# Allows "late" initialization of the hardware domain
+config LATE_HWDOM
+	bool "dedicated hardware domain"
+	default n
+	depends on XSM && X86
+	---help---
+	  Allows the creation of a dedicated hardware domain distinct from
+	  domain 0 that manages devices without needing access to other
+	  privileged functionality such as the ability to manage domains.
+	  This requires that the actual domain 0 be a stub domain that
+	  constructs the actual hardware domain instead of initializing the
+	  hardware itself.  Because the hardware domain needs access to
+	  hypercalls not available to unprivileged guests, an XSM policy
+	  is required to properly define the privilege of these domains.
+
+	  This feature does nothing if the "hardware_dom" boot parameter is
+	  not present.  If this feature is being used for security, it should
+	  be combined with an IOMMU in strict mode.
+
+	  If unsure, say N.
+
+# Enable/Disable XSM support
+config XSM
+	bool "Xen Security Modules support"
+	default n
+	---help---
+	  Enables the security framework known as Xen Security Modules which
+	  allows administrators fine-grained control over a Xen domain and
+	  its capabilities by defining permissible interactions between domains,
+	  the hypervisor itself, and related resources such as memory and
+	  devices.
+
+	  If unsure, say N.
+
 endmenu
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index f25d92e..3305a75 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -52,10 +52,6 @@
 
 #define CONFIG_MULTIBOOT 1
 
-#ifdef XSM_ENABLE
-#define CONFIG_LATE_HWDOM 1
-#endif
-
 #define HZ 100
 
 #define OPT_CONSOLE_STR "vga"
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6ea3cc7..e1428f7 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -110,7 +110,7 @@ struct evtchn
     u8 priority;
     u8 last_priority;
     u16 last_vcpu_id;
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
     union {
 #ifdef XSM_NEED_GENERIC_EVTCHN_SSID
         /*
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 81fba40..55b84f0 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -27,9 +27,9 @@
 /* DO NOT implement this function; it is supposed to trigger link errors */
 void __xsm_action_mismatch_detected(void);
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
-/* In XSM_ENABLE builds, this header file is included from xsm/dummy.c, and
+/* In CONFIG_XSM builds, this header file is included from xsm/dummy.c, and
  * contains static (not inline) functions compiled to the dummy XSM module.
  * There is no xsm_default_t argument available, so the value from the assertion
  * is used to initialize the variable.
@@ -39,9 +39,9 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID void
 #define XSM_ASSERT_ACTION(def) xsm_default_t action = def; (void)action
 
-#else /* XSM_ENABLE */
+#else /* CONFIG_XSM */
 
-/* In !XSM_ENABLE builds, this header file is included from xsm/xsm.h, and
+/* In !CONFIG_XSM builds, this header file is included from xsm/xsm.h, and
  * contains inline functions for each XSM hook. These functions also perform
  * compile-time checks on the xsm_default_t argument to ensure that the behavior
  * of the dummy XSM module is the same as the behavior with XSM disabled.
@@ -51,7 +51,7 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID xsm_default_t action
 #define XSM_ASSERT_ACTION(def) LINKER_BUG_ON(def != action)
 
-#endif /* XSM_ENABLE */
+#endif /* CONFIG_XSM */
 
 static always_inline int xsm_default_action(
     xsm_default_t action, struct domain *src, struct domain *target)
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 3fc3824..2c365cd 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -194,7 +194,7 @@ struct xsm_operations {
 #endif
 };
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
 extern struct xsm_operations *xsm_ops;
 
@@ -752,7 +752,7 @@ extern int unregister_xsm(struct xsm_operations *ops);
 extern struct xsm_operations dummy_xsm_ops;
 extern void xsm_fixup_ops(struct xsm_operations *ops);
 
-#else /* XSM_ENABLE */
+#else /* CONFIG_XSM */
 
 #include <xsm/dummy.h>
 
@@ -772,6 +772,6 @@ static inline int xsm_dt_init(void)
 }
 #endif
 
-#endif /* XSM_ENABLE */
+#endif /* CONFIG_XSM */
 
 #endif /* __XSM_H */
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index d29e71c..3252c46 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -1,7 +1,5 @@
 obj-y += xsm_core.o
-ifeq ($(XSM_ENABLE),y)
-obj-y += xsm_policy.o
-obj-y += dummy.o
-endif
+obj-$(CONFIG_XSM) += xsm_policy.o
+obj-$(CONFIG_XSM) += dummy.o
 
 subdir-$(CONFIG_FLASK) += flask
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:59:22 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:59: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 1aJ2Hy-0008JD-72; Tue, 12 Jan 2016 16:59:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Hw-0008I0-QE
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:20 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	16/52-13487-3E035965; Tue, 12 Jan 2016 16:59:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1452617954!15405078!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26453 invoked from network); 12 Jan 2016 16:59:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:59:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2I7-0007GY-LQ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Hq-0005Yy-26
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:14 +0000
Date: Tue, 12 Jan 2016 16:59:14 +0000
Message-Id: <E1aJ2Hq-0005Yy-26@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: check more carefully which
	bits are allowed to be written to 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 31af0d76759328161cb5db73b50b23dded51e15c
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 7 15:26:37 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:26:37 2016 +0100

    x86/VPMU: check more carefully which bits are allowed to be written to MSRs
    
    Current Intel VPMU emulation needs to perform more checks when writing
    PMU MSRs on guest's behalf:
    * MSR_CORE_PERF_GLOBAL_CTRL is not checked at all
    * MSR_CORE_PERF_FIXED_CTR_CTRL has more reserved bits in PMU version 2
    * MSR_CORE_PERF_GLOBAL_OVF_CTRL's bit 61 is allowed on versions greater
    * than 2.
    
    We can also use precomputed mask in core2_vpmu_do_interrupt().
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/cpu/vpmu_intel.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 3eff1ae..03cfe50 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -87,7 +87,7 @@ static unsigned int __read_mostly arch_pmc_cnt, fixed_pmc_cnt;
 /* Masks used for testing whether and MSR is valid */
 #define ARCH_CTRL_MASK  (~((1ull << 32) - 1) | (1ull << 21))
 static uint64_t __read_mostly fixed_ctrl_mask, fixed_counters_mask;
-static uint64_t __read_mostly global_ovf_ctrl_mask;
+static uint64_t __read_mostly global_ovf_ctrl_mask, global_ctrl_mask;
 
 /* Total size of PMU registers block (copied to/from PV(H) guest) */
 static unsigned int __read_mostly regs_sz;
@@ -392,6 +392,8 @@ static int core2_vpmu_verify(struct vcpu *v)
 
     if ( core2_vpmu_cxt->global_ovf_ctrl & global_ovf_ctrl_mask )
         return -EINVAL;
+    if ( core2_vpmu_cxt->global_ctrl & global_ctrl_mask )
+        return -EINVAL;
 
     fixed_ctrl = core2_vpmu_cxt->fixed_ctrl;
     if ( fixed_ctrl & fixed_ctrl_mask )
@@ -627,6 +629,8 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         gdprintk(XENLOG_WARNING, "Guest setting of DTS is ignored.\n");
         return 0;
     case MSR_CORE_PERF_GLOBAL_CTRL:
+        if ( msr_content & global_ctrl_mask )
+            return -EINVAL;
         core2_vpmu_cxt->global_ctrl = msr_content;
         break;
     case MSR_CORE_PERF_FIXED_CTR_CTRL:
@@ -820,7 +824,7 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
         if ( is_pmc_quirk )
             handle_pmc_quirk(msr_content);
         core2_vpmu_cxt->global_status |= msr_content;
-        msr_content = 0xC000000700000000 | ((1 << arch_pmc_cnt) - 1);
+        msr_content = ~global_ovf_ctrl_mask;
         wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, msr_content);
     }
     else
@@ -1001,10 +1005,20 @@ int __init core2_vpmu_init(void)
     full_width_write = (caps >> 13) & 1;
 
     fixed_ctrl_mask = ~((1ull << (fixed_pmc_cnt * FIXED_CTR_CTRL_BITS)) - 1);
+    if ( version == 2 )
+        fixed_ctrl_mask |= 0x444;
     fixed_counters_mask = ~((1ull << core2_get_bitwidth_fix_count()) - 1);
+    global_ctrl_mask = ~((((1ULL << fixed_pmc_cnt) - 1) << 32) |
+                         ((1ULL << arch_pmc_cnt) - 1));
     global_ovf_ctrl_mask = ~(0xC000000000000000 |
                              (((1ULL << fixed_pmc_cnt) - 1) << 32) |
                              ((1ULL << arch_pmc_cnt) - 1));
+    if ( version > 2 )
+        /*
+         * Even though we don't support Uncore counters guests should be
+         * able to clear all available overflows.
+         */
+        global_ovf_ctrl_mask &= ~(1ULL << 61);
 
     regs_sz = (sizeof(struct xen_pmu_intel_ctxt) - regs_off) +
               sizeof(uint64_t) * fixed_pmc_cnt +
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:59:22 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:59: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 1aJ2Hy-0008JD-72; Tue, 12 Jan 2016 16:59:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Hw-0008I0-QE
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:20 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	16/52-13487-3E035965; Tue, 12 Jan 2016 16:59:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1452617954!15405078!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26453 invoked from network); 12 Jan 2016 16:59:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:59:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2I7-0007GY-LQ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Hq-0005Yy-26
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:14 +0000
Date: Tue, 12 Jan 2016 16:59:14 +0000
Message-Id: <E1aJ2Hq-0005Yy-26@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: check more carefully which
	bits are allowed to be written to 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 31af0d76759328161cb5db73b50b23dded51e15c
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 7 15:26:37 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:26:37 2016 +0100

    x86/VPMU: check more carefully which bits are allowed to be written to MSRs
    
    Current Intel VPMU emulation needs to perform more checks when writing
    PMU MSRs on guest's behalf:
    * MSR_CORE_PERF_GLOBAL_CTRL is not checked at all
    * MSR_CORE_PERF_FIXED_CTR_CTRL has more reserved bits in PMU version 2
    * MSR_CORE_PERF_GLOBAL_OVF_CTRL's bit 61 is allowed on versions greater
    * than 2.
    
    We can also use precomputed mask in core2_vpmu_do_interrupt().
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/cpu/vpmu_intel.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 3eff1ae..03cfe50 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -87,7 +87,7 @@ static unsigned int __read_mostly arch_pmc_cnt, fixed_pmc_cnt;
 /* Masks used for testing whether and MSR is valid */
 #define ARCH_CTRL_MASK  (~((1ull << 32) - 1) | (1ull << 21))
 static uint64_t __read_mostly fixed_ctrl_mask, fixed_counters_mask;
-static uint64_t __read_mostly global_ovf_ctrl_mask;
+static uint64_t __read_mostly global_ovf_ctrl_mask, global_ctrl_mask;
 
 /* Total size of PMU registers block (copied to/from PV(H) guest) */
 static unsigned int __read_mostly regs_sz;
@@ -392,6 +392,8 @@ static int core2_vpmu_verify(struct vcpu *v)
 
     if ( core2_vpmu_cxt->global_ovf_ctrl & global_ovf_ctrl_mask )
         return -EINVAL;
+    if ( core2_vpmu_cxt->global_ctrl & global_ctrl_mask )
+        return -EINVAL;
 
     fixed_ctrl = core2_vpmu_cxt->fixed_ctrl;
     if ( fixed_ctrl & fixed_ctrl_mask )
@@ -627,6 +629,8 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         gdprintk(XENLOG_WARNING, "Guest setting of DTS is ignored.\n");
         return 0;
     case MSR_CORE_PERF_GLOBAL_CTRL:
+        if ( msr_content & global_ctrl_mask )
+            return -EINVAL;
         core2_vpmu_cxt->global_ctrl = msr_content;
         break;
     case MSR_CORE_PERF_FIXED_CTR_CTRL:
@@ -820,7 +824,7 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
         if ( is_pmc_quirk )
             handle_pmc_quirk(msr_content);
         core2_vpmu_cxt->global_status |= msr_content;
-        msr_content = 0xC000000700000000 | ((1 << arch_pmc_cnt) - 1);
+        msr_content = ~global_ovf_ctrl_mask;
         wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, msr_content);
     }
     else
@@ -1001,10 +1005,20 @@ int __init core2_vpmu_init(void)
     full_width_write = (caps >> 13) & 1;
 
     fixed_ctrl_mask = ~((1ull << (fixed_pmc_cnt * FIXED_CTR_CTRL_BITS)) - 1);
+    if ( version == 2 )
+        fixed_ctrl_mask |= 0x444;
     fixed_counters_mask = ~((1ull << core2_get_bitwidth_fix_count()) - 1);
+    global_ctrl_mask = ~((((1ULL << fixed_pmc_cnt) - 1) << 32) |
+                         ((1ULL << arch_pmc_cnt) - 1));
     global_ovf_ctrl_mask = ~(0xC000000000000000 |
                              (((1ULL << fixed_pmc_cnt) - 1) << 32) |
                              ((1ULL << arch_pmc_cnt) - 1));
+    if ( version > 2 )
+        /*
+         * Even though we don't support Uncore counters guests should be
+         * able to clear all available overflows.
+         */
+        global_ovf_ctrl_mask &= ~(1ULL << 61);
 
     regs_sz = (sizeof(struct xen_pmu_intel_ctxt) - regs_off) +
               sizeof(uint64_t) * fixed_pmc_cnt +
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:59:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:59: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 1aJ2I4-0008Kl-Ar; Tue, 12 Jan 2016 16:59: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 1aJ2I2-0008KN-Ms
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:26 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	5F/7E-07651-EE035965; Tue, 12 Jan 2016 16:59:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1452617964!7915012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18831 invoked from network); 12 Jan 2016 16:59:25 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:59:25 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2IH-0007Gs-Us
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2I0-0005ZK-BO
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:24 +0000
Date: Tue, 12 Jan 2016 16:59:24 +0000
Message-Id: <E1aJ2I0-0005ZK-BO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: don't allow any non-zero
	writes to MSR_IA32_PEBS_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 fb424bf6b5b0df0155ab4e56a1b8f67e6470fa46
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 7 15:27:16 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:27:16 2016 +0100

    x86/VPMU: don't allow any non-zero writes to MSR_IA32_PEBS_ENABLE
    
    Calculation reserved bits for MSR_IA32_PEBS_ENABLE is model-dependent
    and since we don't support PEBS anyway we shouldn't allow any writes to
    it (but let's still permit guests wishing to disable PEBS).
    
    We should also report PEBS as unsupported to HVM, just like we do on PV.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/cpu/vpmu_intel.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 03cfe50..a179717 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -264,7 +264,6 @@ static void core2_vpmu_set_msr_bitmap(unsigned long *msr_bitmap)
          clear_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
 
     clear_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR_CTRL), msr_bitmap);
-    clear_bit(msraddr_to_bitpos(MSR_IA32_PEBS_ENABLE), msr_bitmap);
     clear_bit(msraddr_to_bitpos(MSR_IA32_DS_AREA), msr_bitmap);
 }
 
@@ -296,7 +295,6 @@ static void core2_vpmu_unset_msr_bitmap(unsigned long *msr_bitmap)
         set_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
 
     set_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR_CTRL), msr_bitmap);
-    set_bit(msraddr_to_bitpos(MSR_IA32_PEBS_ENABLE), msr_bitmap);
     set_bit(msraddr_to_bitpos(MSR_IA32_DS_AREA), msr_bitmap);
 }
 
@@ -368,7 +366,6 @@ static inline void __core2_vpmu_load(struct vcpu *v)
     wrmsrl(MSR_CORE_PERF_FIXED_CTR_CTRL, core2_vpmu_cxt->fixed_ctrl);
     if ( vpmu_is_set(vcpu_vpmu(v), VPMU_CPU_HAS_DS) )
         wrmsrl(MSR_IA32_DS_AREA, core2_vpmu_cxt->ds_area);
-    wrmsrl(MSR_IA32_PEBS_ENABLE, core2_vpmu_cxt->pebs_enable);
 
     if ( !has_hvm_container_vcpu(v) )
     {
@@ -394,6 +391,8 @@ static int core2_vpmu_verify(struct vcpu *v)
         return -EINVAL;
     if ( core2_vpmu_cxt->global_ctrl & global_ctrl_mask )
         return -EINVAL;
+    if ( core2_vpmu_cxt->pebs_enable )
+        return -EINVAL;
 
     fixed_ctrl = core2_vpmu_cxt->fixed_ctrl;
     if ( fixed_ctrl & fixed_ctrl_mask )
@@ -606,10 +605,9 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
                  "MSR_PERF_GLOBAL_STATUS(0x38E)!\n");
         return -EINVAL;
     case MSR_IA32_PEBS_ENABLE:
-        if ( msr_content & 1 )
-            gdprintk(XENLOG_WARNING, "Guest is trying to enable PEBS, "
-                     "which is not supported.\n");
-        core2_vpmu_cxt->pebs_enable = msr_content;
+        if ( msr_content )
+            /* PEBS is reported as unavailable in MSR_IA32_MISC_ENABLE */
+            return -EINVAL;
         return 0;
     case MSR_IA32_DS_AREA:
         if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
@@ -733,6 +731,7 @@ static int core2_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
         /* Extension for BTS */
         if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) )
             *msr_content &= ~MSR_IA32_MISC_ENABLE_BTS_UNAVAIL;
+        *msr_content |= MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL;
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:59:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:59: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 1aJ2I4-0008Kl-Ar; Tue, 12 Jan 2016 16:59: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 1aJ2I2-0008KN-Ms
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:26 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	5F/7E-07651-EE035965; Tue, 12 Jan 2016 16:59:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1452617964!7915012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18831 invoked from network); 12 Jan 2016 16:59:25 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:59:25 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2IH-0007Gs-Us
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2I0-0005ZK-BO
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:24 +0000
Date: Tue, 12 Jan 2016 16:59:24 +0000
Message-Id: <E1aJ2I0-0005ZK-BO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: don't allow any non-zero
	writes to MSR_IA32_PEBS_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 fb424bf6b5b0df0155ab4e56a1b8f67e6470fa46
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 7 15:27:16 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:27:16 2016 +0100

    x86/VPMU: don't allow any non-zero writes to MSR_IA32_PEBS_ENABLE
    
    Calculation reserved bits for MSR_IA32_PEBS_ENABLE is model-dependent
    and since we don't support PEBS anyway we shouldn't allow any writes to
    it (but let's still permit guests wishing to disable PEBS).
    
    We should also report PEBS as unsupported to HVM, just like we do on PV.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/cpu/vpmu_intel.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 03cfe50..a179717 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -264,7 +264,6 @@ static void core2_vpmu_set_msr_bitmap(unsigned long *msr_bitmap)
          clear_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
 
     clear_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR_CTRL), msr_bitmap);
-    clear_bit(msraddr_to_bitpos(MSR_IA32_PEBS_ENABLE), msr_bitmap);
     clear_bit(msraddr_to_bitpos(MSR_IA32_DS_AREA), msr_bitmap);
 }
 
@@ -296,7 +295,6 @@ static void core2_vpmu_unset_msr_bitmap(unsigned long *msr_bitmap)
         set_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
 
     set_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR_CTRL), msr_bitmap);
-    set_bit(msraddr_to_bitpos(MSR_IA32_PEBS_ENABLE), msr_bitmap);
     set_bit(msraddr_to_bitpos(MSR_IA32_DS_AREA), msr_bitmap);
 }
 
@@ -368,7 +366,6 @@ static inline void __core2_vpmu_load(struct vcpu *v)
     wrmsrl(MSR_CORE_PERF_FIXED_CTR_CTRL, core2_vpmu_cxt->fixed_ctrl);
     if ( vpmu_is_set(vcpu_vpmu(v), VPMU_CPU_HAS_DS) )
         wrmsrl(MSR_IA32_DS_AREA, core2_vpmu_cxt->ds_area);
-    wrmsrl(MSR_IA32_PEBS_ENABLE, core2_vpmu_cxt->pebs_enable);
 
     if ( !has_hvm_container_vcpu(v) )
     {
@@ -394,6 +391,8 @@ static int core2_vpmu_verify(struct vcpu *v)
         return -EINVAL;
     if ( core2_vpmu_cxt->global_ctrl & global_ctrl_mask )
         return -EINVAL;
+    if ( core2_vpmu_cxt->pebs_enable )
+        return -EINVAL;
 
     fixed_ctrl = core2_vpmu_cxt->fixed_ctrl;
     if ( fixed_ctrl & fixed_ctrl_mask )
@@ -606,10 +605,9 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
                  "MSR_PERF_GLOBAL_STATUS(0x38E)!\n");
         return -EINVAL;
     case MSR_IA32_PEBS_ENABLE:
-        if ( msr_content & 1 )
-            gdprintk(XENLOG_WARNING, "Guest is trying to enable PEBS, "
-                     "which is not supported.\n");
-        core2_vpmu_cxt->pebs_enable = msr_content;
+        if ( msr_content )
+            /* PEBS is reported as unavailable in MSR_IA32_MISC_ENABLE */
+            return -EINVAL;
         return 0;
     case MSR_IA32_DS_AREA:
         if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
@@ -733,6 +731,7 @@ static int core2_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
         /* Extension for BTS */
         if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) )
             *msr_content &= ~MSR_IA32_MISC_ENABLE_BTS_UNAVAIL;
+        *msr_content |= MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL;
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:59:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:59: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 1aJ2IE-0008Mw-IF; Tue, 12 Jan 2016 16:59: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 1aJ2IC-0008MV-Ss
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:37 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	6D/37-09708-8F035965; Tue, 12 Jan 2016 16:59:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1452617974!8082049!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34196 invoked from network); 12 Jan 2016 16:59:35 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:59:35 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2IS-0007H3-8y
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2IA-0005aC-LA
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:34 +0000
Date: Tue, 12 Jan 2016 16:59:34 +0000
Message-Id: <E1aJ2IA-0005aC-LA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remove dups in x86 and x86_64 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 373c3cf6dd0674fc2aa95f7db6b9add851817076
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Thu Jan 7 15:27:43 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:27:43 2016 +0100

    remove dups in x86 and x86_64 variables
    
    Currently the Xen build uses x86 and x86_64 variables as well as
    CONFIG_X86 and CONFIG_X86_64. This just removes the duplication. The
    CONFIG_ variables are now managed by Kconfig but existed previously so
    this duplication existed prior to the Kconfig migration.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Feng Wu <feng.wu@intel.com>
    
    $(CONFIG_X86_64) -> y in x86 makefiles.
    $(CONFIG_X86_64) -> $(CONFIG_X86) in non-x86 makefiles.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Rules.mk                         |    2 +-
 xen/arch/x86/Makefile                |    7 +++----
 xen/arch/x86/Rules.mk                |    4 ----
 xen/arch/x86/efi/Makefile            |    2 +-
 xen/arch/x86/mm/Makefile             |    6 +++---
 xen/arch/x86/mm/hap/Makefile         |    2 +-
 xen/common/Makefile                  |    2 +-
 xen/drivers/acpi/Makefile            |    6 +++---
 xen/drivers/passthrough/Makefile     |    8 ++++----
 xen/drivers/passthrough/vtd/Makefile |    2 +-
 10 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index bdd8ccf..8bd1098 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -45,7 +45,7 @@ ALL_OBJS-y               += $(BASEDIR)/common/built_in.o
 ALL_OBJS-y               += $(BASEDIR)/drivers/built_in.o
 ALL_OBJS-y               += $(BASEDIR)/xsm/built_in.o
 ALL_OBJS-y               += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
-ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
+ALL_OBJS-$(CONFIG_X86)   += $(BASEDIR)/crypto/built_in.o
 
 CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index d4e507a..8e6e901 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -4,8 +4,7 @@ subdir-y += genapic
 subdir-y += hvm
 subdir-y += mm
 subdir-y += oprofile
-
-subdir-$(x86_64) += x86_64
+subdir-y += x86_64
 
 obj-bin-y += alternative.init.o
 obj-y += apic.o
@@ -67,8 +66,8 @@ obj-$(crash_debug) += gdbstub.o
 
 x86_emulate.o: x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h
 
-efi-$(x86_64) := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \
-                                -O $(BASEDIR)/include/xen/compile.h ]; then \
+efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \
+                      -O $(BASEDIR)/include/xen/compile.h ]; then \
                          echo '$(TARGET).efi'; fi)
 
 $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 4ca69a1..b76a754 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -22,10 +22,6 @@ $(call as-insn-check,CFLAGS,CC,".equ \"x\"$$(comma)1", \
                      -U__OBJECT_LABEL__ -DHAVE_GAS_QUOTED_SYM \
                      '-D__OBJECT_LABEL__=$(subst $(BASEDIR)/,,$(CURDIR))/$$@')
 
-x86 := y
-x86_32 := n
-x86_64 := y
-
 shadow-paging ?= y
 bigmem        ?= n
 
diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile
index 1daa7ac..5099430 100644
--- a/xen/arch/x86/efi/Makefile
+++ b/xen/arch/x86/efi/Makefile
@@ -4,7 +4,7 @@ obj-y += stub.o
 
 create = test -e $(1) || touch -t 199901010000 $(1)
 
-efi := $(filter y,$(x86_64)$(shell rm -f disabled))
+efi := y$(shell rm -f disabled)
 efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c check.c 2>disabled && echo y))
 efi := $(if $(efi),$(shell $(LD) -mi386pep --subsystem=10 -o check.efi check.o 2>disabled && echo y))
 efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(call create,runtime.o)))
diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile
index aeccdfc..9804c3a 100644
--- a/xen/arch/x86/mm/Makefile
+++ b/xen/arch/x86/mm/Makefile
@@ -6,9 +6,9 @@ obj-y += p2m.o p2m-pt.o p2m-ept.o p2m-pod.o
 obj-y += altp2m.o
 obj-y += guest_walk_2.o
 obj-y += guest_walk_3.o
-obj-$(x86_64) += guest_walk_4.o
-obj-$(x86_64) += mem_paging.o
-obj-$(x86_64) += mem_sharing.o
+obj-y += guest_walk_4.o
+obj-y += mem_paging.o
+obj-y += mem_sharing.o
 
 guest_walk_%.o: guest_walk.c Makefile
 	$(CC) $(CFLAGS) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
diff --git a/xen/arch/x86/mm/hap/Makefile b/xen/arch/x86/mm/hap/Makefile
index 68f2bb5..b6299f3 100644
--- a/xen/arch/x86/mm/hap/Makefile
+++ b/xen/arch/x86/mm/hap/Makefile
@@ -1,7 +1,7 @@
 obj-y += hap.o
 obj-y += guest_walk_2level.o
 obj-y += guest_walk_3level.o
-obj-$(x86_64) += guest_walk_4level.o
+obj-y += guest_walk_4level.o
 obj-y += nested_hap.o
 obj-y += nested_ept.o
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 8ab15ba..9f8b214 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -65,7 +65,7 @@ obj-$(xenoprof)    += xenoprof.o
 
 obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o tmem_xen.o xlat.o)
 
-subdir-$(x86_64) += hvm
+subdir-$(CONFIG_X86) += hvm
 
 subdir-$(coverage) += gcov
 
diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile
index 3bb626e..d8a4299 100644
--- a/xen/drivers/acpi/Makefile
+++ b/xen/drivers/acpi/Makefile
@@ -1,11 +1,11 @@
 subdir-y += tables
 subdir-y += utilities
-subdir-$(x86) += apei
+subdir-$(CONFIG_X86) += apei
 
 obj-bin-y += tables.init.o
 obj-$(HAS_NUMA) += numa.o
 obj-y += osl.o
 obj-y += pmstat.o
 
-obj-$(x86) += hwregs.o
-obj-$(x86) += reboot.o
+obj-$(CONFIG_X86) += hwregs.o
+obj-$(CONFIG_X86) += reboot.o
diff --git a/xen/drivers/passthrough/Makefile b/xen/drivers/passthrough/Makefile
index a6657c5..ca84e36 100644
--- a/xen/drivers/passthrough/Makefile
+++ b/xen/drivers/passthrough/Makefile
@@ -1,9 +1,9 @@
-subdir-$(x86) += vtd
-subdir-$(x86) += amd
-subdir-$(x86_64) += x86
+subdir-$(CONFIG_X86) += vtd
+subdir-$(CONFIG_X86) += amd
+subdir-$(CONFIG_X86) += x86
 subdir-$(arm) += arm
 
 obj-y += iommu.o
-obj-$(x86) += io.o
+obj-$(CONFIG_X86) += io.o
 obj-$(CONFIG_HAS_PCI) += pci.o
 obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o
diff --git a/xen/drivers/passthrough/vtd/Makefile b/xen/drivers/passthrough/vtd/Makefile
index 56d0153..f302653 100644
--- a/xen/drivers/passthrough/vtd/Makefile
+++ b/xen/drivers/passthrough/vtd/Makefile
@@ -1,4 +1,4 @@
-subdir-$(x86) += x86
+subdir-$(CONFIG_X86) += x86
 
 obj-y += iommu.o
 obj-y += dmar.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 Tue Jan 12 16:59:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:59: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 1aJ2IE-0008Mw-IF; Tue, 12 Jan 2016 16:59: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 1aJ2IC-0008MV-Ss
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:37 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	6D/37-09708-8F035965; Tue, 12 Jan 2016 16:59:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1452617974!8082049!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34196 invoked from network); 12 Jan 2016 16:59:35 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:59:35 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2IS-0007H3-8y
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2IA-0005aC-LA
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:34 +0000
Date: Tue, 12 Jan 2016 16:59:34 +0000
Message-Id: <E1aJ2IA-0005aC-LA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remove dups in x86 and x86_64 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 373c3cf6dd0674fc2aa95f7db6b9add851817076
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Thu Jan 7 15:27:43 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:27:43 2016 +0100

    remove dups in x86 and x86_64 variables
    
    Currently the Xen build uses x86 and x86_64 variables as well as
    CONFIG_X86 and CONFIG_X86_64. This just removes the duplication. The
    CONFIG_ variables are now managed by Kconfig but existed previously so
    this duplication existed prior to the Kconfig migration.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Feng Wu <feng.wu@intel.com>
    
    $(CONFIG_X86_64) -> y in x86 makefiles.
    $(CONFIG_X86_64) -> $(CONFIG_X86) in non-x86 makefiles.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Rules.mk                         |    2 +-
 xen/arch/x86/Makefile                |    7 +++----
 xen/arch/x86/Rules.mk                |    4 ----
 xen/arch/x86/efi/Makefile            |    2 +-
 xen/arch/x86/mm/Makefile             |    6 +++---
 xen/arch/x86/mm/hap/Makefile         |    2 +-
 xen/common/Makefile                  |    2 +-
 xen/drivers/acpi/Makefile            |    6 +++---
 xen/drivers/passthrough/Makefile     |    8 ++++----
 xen/drivers/passthrough/vtd/Makefile |    2 +-
 10 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index bdd8ccf..8bd1098 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -45,7 +45,7 @@ ALL_OBJS-y               += $(BASEDIR)/common/built_in.o
 ALL_OBJS-y               += $(BASEDIR)/drivers/built_in.o
 ALL_OBJS-y               += $(BASEDIR)/xsm/built_in.o
 ALL_OBJS-y               += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
-ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
+ALL_OBJS-$(CONFIG_X86)   += $(BASEDIR)/crypto/built_in.o
 
 CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index d4e507a..8e6e901 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -4,8 +4,7 @@ subdir-y += genapic
 subdir-y += hvm
 subdir-y += mm
 subdir-y += oprofile
-
-subdir-$(x86_64) += x86_64
+subdir-y += x86_64
 
 obj-bin-y += alternative.init.o
 obj-y += apic.o
@@ -67,8 +66,8 @@ obj-$(crash_debug) += gdbstub.o
 
 x86_emulate.o: x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h
 
-efi-$(x86_64) := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \
-                                -O $(BASEDIR)/include/xen/compile.h ]; then \
+efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \
+                      -O $(BASEDIR)/include/xen/compile.h ]; then \
                          echo '$(TARGET).efi'; fi)
 
 $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 4ca69a1..b76a754 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -22,10 +22,6 @@ $(call as-insn-check,CFLAGS,CC,".equ \"x\"$$(comma)1", \
                      -U__OBJECT_LABEL__ -DHAVE_GAS_QUOTED_SYM \
                      '-D__OBJECT_LABEL__=$(subst $(BASEDIR)/,,$(CURDIR))/$$@')
 
-x86 := y
-x86_32 := n
-x86_64 := y
-
 shadow-paging ?= y
 bigmem        ?= n
 
diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile
index 1daa7ac..5099430 100644
--- a/xen/arch/x86/efi/Makefile
+++ b/xen/arch/x86/efi/Makefile
@@ -4,7 +4,7 @@ obj-y += stub.o
 
 create = test -e $(1) || touch -t 199901010000 $(1)
 
-efi := $(filter y,$(x86_64)$(shell rm -f disabled))
+efi := y$(shell rm -f disabled)
 efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c check.c 2>disabled && echo y))
 efi := $(if $(efi),$(shell $(LD) -mi386pep --subsystem=10 -o check.efi check.o 2>disabled && echo y))
 efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(call create,runtime.o)))
diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile
index aeccdfc..9804c3a 100644
--- a/xen/arch/x86/mm/Makefile
+++ b/xen/arch/x86/mm/Makefile
@@ -6,9 +6,9 @@ obj-y += p2m.o p2m-pt.o p2m-ept.o p2m-pod.o
 obj-y += altp2m.o
 obj-y += guest_walk_2.o
 obj-y += guest_walk_3.o
-obj-$(x86_64) += guest_walk_4.o
-obj-$(x86_64) += mem_paging.o
-obj-$(x86_64) += mem_sharing.o
+obj-y += guest_walk_4.o
+obj-y += mem_paging.o
+obj-y += mem_sharing.o
 
 guest_walk_%.o: guest_walk.c Makefile
 	$(CC) $(CFLAGS) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
diff --git a/xen/arch/x86/mm/hap/Makefile b/xen/arch/x86/mm/hap/Makefile
index 68f2bb5..b6299f3 100644
--- a/xen/arch/x86/mm/hap/Makefile
+++ b/xen/arch/x86/mm/hap/Makefile
@@ -1,7 +1,7 @@
 obj-y += hap.o
 obj-y += guest_walk_2level.o
 obj-y += guest_walk_3level.o
-obj-$(x86_64) += guest_walk_4level.o
+obj-y += guest_walk_4level.o
 obj-y += nested_hap.o
 obj-y += nested_ept.o
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 8ab15ba..9f8b214 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -65,7 +65,7 @@ obj-$(xenoprof)    += xenoprof.o
 
 obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o tmem_xen.o xlat.o)
 
-subdir-$(x86_64) += hvm
+subdir-$(CONFIG_X86) += hvm
 
 subdir-$(coverage) += gcov
 
diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile
index 3bb626e..d8a4299 100644
--- a/xen/drivers/acpi/Makefile
+++ b/xen/drivers/acpi/Makefile
@@ -1,11 +1,11 @@
 subdir-y += tables
 subdir-y += utilities
-subdir-$(x86) += apei
+subdir-$(CONFIG_X86) += apei
 
 obj-bin-y += tables.init.o
 obj-$(HAS_NUMA) += numa.o
 obj-y += osl.o
 obj-y += pmstat.o
 
-obj-$(x86) += hwregs.o
-obj-$(x86) += reboot.o
+obj-$(CONFIG_X86) += hwregs.o
+obj-$(CONFIG_X86) += reboot.o
diff --git a/xen/drivers/passthrough/Makefile b/xen/drivers/passthrough/Makefile
index a6657c5..ca84e36 100644
--- a/xen/drivers/passthrough/Makefile
+++ b/xen/drivers/passthrough/Makefile
@@ -1,9 +1,9 @@
-subdir-$(x86) += vtd
-subdir-$(x86) += amd
-subdir-$(x86_64) += x86
+subdir-$(CONFIG_X86) += vtd
+subdir-$(CONFIG_X86) += amd
+subdir-$(CONFIG_X86) += x86
 subdir-$(arm) += arm
 
 obj-y += iommu.o
-obj-$(x86) += io.o
+obj-$(CONFIG_X86) += io.o
 obj-$(CONFIG_HAS_PCI) += pci.o
 obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o
diff --git a/xen/drivers/passthrough/vtd/Makefile b/xen/drivers/passthrough/vtd/Makefile
index 56d0153..f302653 100644
--- a/xen/drivers/passthrough/vtd/Makefile
+++ b/xen/drivers/passthrough/vtd/Makefile
@@ -1,4 +1,4 @@
-subdir-$(x86) += x86
+subdir-$(CONFIG_X86) += x86
 
 obj-y += iommu.o
 obj-y += dmar.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 Tue Jan 12 16:59:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:59:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2IP-0008P8-Nk; Tue, 12 Jan 2016 16:59: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 1aJ2IN-0008Of-EX
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:47 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	05/67-02940-20135965; Tue, 12 Jan 2016 16:59:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1452617985!15419325!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39342 invoked from network); 12 Jan 2016 16:59:46 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:59:46 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ic-0007Jz-Im
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2IK-0005aY-VZ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:44 +0000
Date: Tue, 12 Jan 2016 16:59:44 +0000
Message-Id: <E1aJ2IK-0005aY-VZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] credit: remove pointless local
	variable 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 9c419ee77f3e6c3a90a4a08c8682b4216bed8cb0
Author:     Joshua Otto <jtotto@uwaterloo.ca>
AuthorDate: Thu Jan 7 15:28:08 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:28:08 2016 +0100

    credit: remove pointless local variable initialization
    
    Coverity CID 1343301
    
    No functional changes.
    
    Signed-off-by: Joshua Otto <jtotto@uwaterloo.ca>
---
 xen/common/sched_credit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 0dce790..02afddf 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1792,7 +1792,7 @@ csched_dump_pcpu(const struct scheduler *ops, int cpu)
     struct csched_private *prv = CSCHED_PRIV(ops);
     struct csched_pcpu *spc;
     struct csched_vcpu *svc;
-    spinlock_t *lock = lock;
+    spinlock_t *lock;
     unsigned long flags;
     int loop;
 #define cpustr keyhandler_scratch
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:59:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:59:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2IP-0008P8-Nk; Tue, 12 Jan 2016 16:59: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 1aJ2IN-0008Of-EX
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:47 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	05/67-02940-20135965; Tue, 12 Jan 2016 16:59:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1452617985!15419325!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39342 invoked from network); 12 Jan 2016 16:59:46 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:59:46 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ic-0007Jz-Im
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2IK-0005aY-VZ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:44 +0000
Date: Tue, 12 Jan 2016 16:59:44 +0000
Message-Id: <E1aJ2IK-0005aY-VZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] credit: remove pointless local
	variable 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 9c419ee77f3e6c3a90a4a08c8682b4216bed8cb0
Author:     Joshua Otto <jtotto@uwaterloo.ca>
AuthorDate: Thu Jan 7 15:28:08 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:28:08 2016 +0100

    credit: remove pointless local variable initialization
    
    Coverity CID 1343301
    
    No functional changes.
    
    Signed-off-by: Joshua Otto <jtotto@uwaterloo.ca>
---
 xen/common/sched_credit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 0dce790..02afddf 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1792,7 +1792,7 @@ csched_dump_pcpu(const struct scheduler *ops, int cpu)
     struct csched_private *prv = CSCHED_PRIV(ops);
     struct csched_pcpu *spc;
     struct csched_vcpu *svc;
-    spinlock_t *lock = lock;
+    spinlock_t *lock;
     unsigned long flags;
     int loop;
 #define cpustr keyhandler_scratch
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 16:59:57 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:59: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 1aJ2IX-0008Qx-SZ; Tue, 12 Jan 2016 16:59:57 +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 1aJ2IX-0008Qk-Dc
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:57 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	FA/87-09708-C0135965; Tue, 12 Jan 2016 16:59:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1452617995!8082090!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35685 invoked from network); 12 Jan 2016 16:59:56 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:59:56 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Im-0007K7-TD
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2IV-0005az-98
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:55 +0000
Date: Tue, 12 Jan 2016 16:59:55 +0000
Message-Id: <E1aJ2IV-0005az-98@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/io/netif.h: document transmit
	and receive wire formats separately
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 03809ae77daf17a7e3104019758aa4c4b23b631c
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Thu Jan 7 15:28:33 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:28:33 2016 +0100

    public/io/netif.h: document transmit and receive wire formats separately
    
    Currently there is no documented wire format for guest receive-side
    packets but the location of the 'wire format' comment block suggests
    it is the same as transmit-side. This is almost true but there is a
    subtle difference in the use of the 'size' field for the first fragment.
    
    For clarity this patch creates separate comment blocks for receive
    and transmit side packet wire formats, tries to be more clear about the
    distinction between 'fragments' and 'extras', and documents the subtlety
    concerning the size field of the first fragment.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 xen/include/public/io/netif.h |   39 ++++++++++++++++++++++++++-------------
 1 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index e103cf3..1790ea0 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -151,22 +151,22 @@
  */
 
 /*
- * This is the 'wire' format for packets:
- *  Request 1: netif_tx_request_t -- NETTXF_* (any flags)
- * [Request 2: netif_extra_info_t] (only if request 1 has
- *                                  NETTXF_extra_info)
- * [Request 3: netif_extra_info_t] (only if request 2 has
- *                                  XEN_NETIF_EXTRA_MORE)
- *  Request 4: netif_tx_request_t -- NETTXF_more_data
- *  Request 5: netif_tx_request_t -- NETTXF_more_data
- *  ...
- *  Request N: netif_tx_request_t -- 0
- */
-
-/*
  * Guest transmit
  * ==============
  *
+ * This is the 'wire' format for packets:
+ *  Fragment 1: netif_tx_request_t  - flags = NETTXF_*
+ *                                    size = total packet size
+ * [Extra 1: netif_extra_info_t]    - (only if fragment 1 flags include
+ *                                     NETTXF_extra_info)
+ * [Extra N: netif_extra_info_t]    - (only if extra N-1 flags include
+ *                                     XEN_NETIF_EXTRA_MORE)
+ *  ...
+ *  Fragment N: netif_tx_request_t  - (only if fragment N-1 flags include
+ *                                     NETTXF_more_data)
+ *                                    flags = 0
+ *                                    size = fragment size
+ *
  * Ring slot size is 12 octets, however not all request/response
  * structs use the full size.
  *
@@ -202,6 +202,19 @@
  * Guest receive
  * =============
  *
+ * This is the 'wire' format for packets:
+ *  Fragment 1: netif_rx_request_t  - flags = NETRXF_*
+ *                                    size = fragment size
+ * [Extra 1: netif_extra_info_t]    - (only if fragment 1 flags include
+ *                                     NETRXF_extra_info)
+ * [Extra N: netif_extra_info_t]    - (only if extra N-1 flags include
+ *                                     XEN_NETIF_EXTRA_MORE)
+ *  ...
+ *  Fragment N: netif_rx_request_t  - (only if fragment N-1 flags include
+ *                                     NETRXF_more_data)
+ *                                    flags = 0
+ *                                    size = fragment size
+ *
  * Ring slot size is 8 octets.
  *
  * rx request (netif_rx_request_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 Tue Jan 12 16:59:57 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 16:59: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 1aJ2IX-0008Qx-SZ; Tue, 12 Jan 2016 16:59:57 +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 1aJ2IX-0008Qk-Dc
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:57 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	FA/87-09708-C0135965; Tue, 12 Jan 2016 16:59:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1452617995!8082090!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35685 invoked from network); 12 Jan 2016 16:59:56 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 16:59:56 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Im-0007K7-TD
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2IV-0005az-98
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 16:59:55 +0000
Date: Tue, 12 Jan 2016 16:59:55 +0000
Message-Id: <E1aJ2IV-0005az-98@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/io/netif.h: document transmit
	and receive wire formats separately
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 03809ae77daf17a7e3104019758aa4c4b23b631c
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Thu Jan 7 15:28:33 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 15:28:33 2016 +0100

    public/io/netif.h: document transmit and receive wire formats separately
    
    Currently there is no documented wire format for guest receive-side
    packets but the location of the 'wire format' comment block suggests
    it is the same as transmit-side. This is almost true but there is a
    subtle difference in the use of the 'size' field for the first fragment.
    
    For clarity this patch creates separate comment blocks for receive
    and transmit side packet wire formats, tries to be more clear about the
    distinction between 'fragments' and 'extras', and documents the subtlety
    concerning the size field of the first fragment.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
 xen/include/public/io/netif.h |   39 ++++++++++++++++++++++++++-------------
 1 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index e103cf3..1790ea0 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -151,22 +151,22 @@
  */
 
 /*
- * This is the 'wire' format for packets:
- *  Request 1: netif_tx_request_t -- NETTXF_* (any flags)
- * [Request 2: netif_extra_info_t] (only if request 1 has
- *                                  NETTXF_extra_info)
- * [Request 3: netif_extra_info_t] (only if request 2 has
- *                                  XEN_NETIF_EXTRA_MORE)
- *  Request 4: netif_tx_request_t -- NETTXF_more_data
- *  Request 5: netif_tx_request_t -- NETTXF_more_data
- *  ...
- *  Request N: netif_tx_request_t -- 0
- */
-
-/*
  * Guest transmit
  * ==============
  *
+ * This is the 'wire' format for packets:
+ *  Fragment 1: netif_tx_request_t  - flags = NETTXF_*
+ *                                    size = total packet size
+ * [Extra 1: netif_extra_info_t]    - (only if fragment 1 flags include
+ *                                     NETTXF_extra_info)
+ * [Extra N: netif_extra_info_t]    - (only if extra N-1 flags include
+ *                                     XEN_NETIF_EXTRA_MORE)
+ *  ...
+ *  Fragment N: netif_tx_request_t  - (only if fragment N-1 flags include
+ *                                     NETTXF_more_data)
+ *                                    flags = 0
+ *                                    size = fragment size
+ *
  * Ring slot size is 12 octets, however not all request/response
  * structs use the full size.
  *
@@ -202,6 +202,19 @@
  * Guest receive
  * =============
  *
+ * This is the 'wire' format for packets:
+ *  Fragment 1: netif_rx_request_t  - flags = NETRXF_*
+ *                                    size = fragment size
+ * [Extra 1: netif_extra_info_t]    - (only if fragment 1 flags include
+ *                                     NETRXF_extra_info)
+ * [Extra N: netif_extra_info_t]    - (only if extra N-1 flags include
+ *                                     XEN_NETIF_EXTRA_MORE)
+ *  ...
+ *  Fragment N: netif_rx_request_t  - (only if fragment N-1 flags include
+ *                                     NETRXF_more_data)
+ *                                    flags = 0
+ *                                    size = fragment size
+ *
  * Ring slot size is 8 octets.
  *
  * rx request (netif_rx_request_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 Tue Jan 12 17:00:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:00: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 1aJ2Ii-0008VI-VX; Tue, 12 Jan 2016 17:00: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 1aJ2Ii-0008VB-8U
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:08 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	4A/97-08977-71135965; Tue, 12 Jan 2016 17:00:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1452618005!9693374!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62677 invoked from network); 12 Jan 2016 17:00:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:00:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ix-0007KI-4I
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2If-0005cD-H0
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:05 +0000
Date: Tue, 12 Jan 2016 17:00:05 +0000
Message-Id: <E1aJ2If-0005cD-H0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPI 5.0: Add new/changed tables to
	headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b415b3a0f27956b74bd42bc88bb2f70efac03179
Author:     Bob Moore <robert.moore@intel.com>
AuthorDate: Thu Jan 7 17:33:09 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:33:09 2016 +0100

    ACPI 5.0: Add new/changed tables to headers
    
    Adds new file, actbl3.h
    
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lin Ming <ming.m.lin@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>
    [Linux commit c5bd6537329e66a8b36234f19a36d94b72d07394]
    [only port changes of Generic Interrupt and Generic Distributor, other
    changes already exist]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/include/acpi/actbl1.h |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index 9311e3a..ca13bc1 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -639,7 +639,9 @@ enum acpi_madt_type {
 	ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
 	ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
 	ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
-	ACPI_MADT_TYPE_RESERVED = 11	/* 11 and greater are reserved */
+	ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
+	ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
+	ACPI_MADT_TYPE_RESERVED = 13	/* 13 and greater are reserved */
 };
 
 /*
@@ -760,11 +762,36 @@ struct acpi_madt_local_x2apic_nmi {
 	u8 reserved[3];
 };
 
+/* 11: Generic Interrupt (ACPI 5.0) */
+
+struct acpi_madt_generic_interrupt {
+	struct acpi_subtable_header header;
+	u16 reserved;		/* Reserved - must be zero */
+	u32 gic_id;
+	u32 uid;
+	u32 flags;
+	u32 parking_version;
+	u32 performance_interrupt;
+	u64 parked_address;
+	u64 base_address;
+};
+
+/* 12: Generic Distributor (ACPI 5.0) */
+
+struct acpi_madt_generic_distributor {
+	struct acpi_subtable_header header;
+	u16 reserved;		/* Reserved - must be zero */
+	u32 gic_id;
+	u64 base_address;
+	u32 global_irq_base;
+	u32 reserved2;		/* Reserved - must be zero */
+};
+
 /*
  * Common flags fields for MADT subtables
  */
 
-/* MADT Local APIC flags (lapic_flags) */
+/* MADT Local APIC flags (lapic_flags) and GIC flags */
 
 #define ACPI_MADT_ENABLED           (1)	/* 00: Processor is usable if 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 Tue Jan 12 17:00:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:00: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 1aJ2Ii-0008VI-VX; Tue, 12 Jan 2016 17:00: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 1aJ2Ii-0008VB-8U
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:08 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	4A/97-08977-71135965; Tue, 12 Jan 2016 17:00:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1452618005!9693374!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62677 invoked from network); 12 Jan 2016 17:00:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:00:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ix-0007KI-4I
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2If-0005cD-H0
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:05 +0000
Date: Tue, 12 Jan 2016 17:00:05 +0000
Message-Id: <E1aJ2If-0005cD-H0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPI 5.0: Add new/changed tables to
	headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b415b3a0f27956b74bd42bc88bb2f70efac03179
Author:     Bob Moore <robert.moore@intel.com>
AuthorDate: Thu Jan 7 17:33:09 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:33:09 2016 +0100

    ACPI 5.0: Add new/changed tables to headers
    
    Adds new file, actbl3.h
    
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lin Ming <ming.m.lin@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>
    [Linux commit c5bd6537329e66a8b36234f19a36d94b72d07394]
    [only port changes of Generic Interrupt and Generic Distributor, other
    changes already exist]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/include/acpi/actbl1.h |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index 9311e3a..ca13bc1 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -639,7 +639,9 @@ enum acpi_madt_type {
 	ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
 	ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
 	ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
-	ACPI_MADT_TYPE_RESERVED = 11	/* 11 and greater are reserved */
+	ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
+	ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
+	ACPI_MADT_TYPE_RESERVED = 13	/* 13 and greater are reserved */
 };
 
 /*
@@ -760,11 +762,36 @@ struct acpi_madt_local_x2apic_nmi {
 	u8 reserved[3];
 };
 
+/* 11: Generic Interrupt (ACPI 5.0) */
+
+struct acpi_madt_generic_interrupt {
+	struct acpi_subtable_header header;
+	u16 reserved;		/* Reserved - must be zero */
+	u32 gic_id;
+	u32 uid;
+	u32 flags;
+	u32 parking_version;
+	u32 performance_interrupt;
+	u64 parked_address;
+	u64 base_address;
+};
+
+/* 12: Generic Distributor (ACPI 5.0) */
+
+struct acpi_madt_generic_distributor {
+	struct acpi_subtable_header header;
+	u16 reserved;		/* Reserved - must be zero */
+	u32 gic_id;
+	u64 base_address;
+	u32 global_irq_base;
+	u32 reserved2;		/* Reserved - must be zero */
+};
+
 /*
  * Common flags fields for MADT subtables
  */
 
-/* MADT Local APIC flags (lapic_flags) */
+/* MADT Local APIC flags (lapic_flags) and GIC flags */
 
 #define ACPI_MADT_ENABLED           (1)	/* 00: Processor is usable if 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 Tue Jan 12 17:00:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:00: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 1aJ2Ix-00006H-JC; Tue, 12 Jan 2016 17:00: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 1aJ2Iw-00005A-29
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:22 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	73/75-29649-12135965; Tue, 12 Jan 2016 17:00:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1452618016!14865354!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32785 invoked from network); 12 Jan 2016 17:00:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:00:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2J7-0007Kx-BQ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ip-0005cp-Ow
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:15 +0000
Date: Tue, 12 Jan 2016 17:00:15 +0000
Message-Id: <E1aJ2Ip-0005cp-Ow@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA/ARM: ACPI 5.1: Update for MADT
	changes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5c3abb9a16b10a5940906da499ea39365ed0735e
Author:     Tomasz Nowicki <tomasz.nowicki@linaro.org>
AuthorDate: Thu Jan 7 17:33:31 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:33:31 2016 +0100

    ACPICA/ARM: ACPI 5.1: Update for MADT changes
    
    New subtables and changes to other subtables. Tomasz Nowicki.
    
    Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
    Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit d0c383e48d1b6cdc39cf9cc2f082bbb6f3c28b89]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl1.h |   44 +++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index ca13bc1..e28853e 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -641,7 +641,9 @@ enum acpi_madt_type {
 	ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
 	ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
 	ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
-	ACPI_MADT_TYPE_RESERVED = 13	/* 13 and greater are reserved */
+	ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
+	ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
+	ACPI_MADT_TYPE_RESERVED = 15	/* 15 and greater are reserved */
 };
 
 /*
@@ -767,15 +769,26 @@ struct acpi_madt_local_x2apic_nmi {
 struct acpi_madt_generic_interrupt {
 	struct acpi_subtable_header header;
 	u16 reserved;		/* Reserved - must be zero */
-	u32 gic_id;
+	u32 cpu_interface_number;
 	u32 uid;
 	u32 flags;
 	u32 parking_version;
 	u32 performance_interrupt;
 	u64 parked_address;
 	u64 base_address;
+	u64 gicv_base_address;
+	u64 gich_base_address;
+	u32 vgic_interrupt;
+	u64 gicr_base_address;
+	u64 arm_mpidr;
 };
 
+/* Masks for Flags field above */
+
+/* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
+#define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1) /* 01: Performance Interrupt Mode */
+#define ACPI_MADT_VGIC_IRQ_MODE         (1<<2) /* 02: VGIC Maintenance Interrupt mode */
+
 /* 12: Generic Distributor (ACPI 5.0) */
 
 struct acpi_madt_generic_distributor {
@@ -787,11 +800,36 @@ struct acpi_madt_generic_distributor {
 	u32 reserved2;		/* Reserved - must be zero */
 };
 
+/* 13: Generic MSI Frame (ACPI 5.1) */
+
+struct acpi_madt_generic_msi_frame {
+	struct acpi_subtable_header header;
+	u16 reserved;		/* reserved - must be zero */
+	u32 msi_frame_id;
+	u64 base_address;
+	u32 flags;
+	u16 spi_count;
+	u16 spi_base;
+};
+
+/* Masks for Flags field above */
+
+#define ACPI_MADT_OVERRIDE_SPI_VALUES	(1)
+
+/* 14: Generic Redistributor (ACPI 5.1) */
+
+struct acpi_madt_generic_redistributor {
+	struct acpi_subtable_header header;
+	u16 reserved;		/* reserved - must be zero */
+	u64 base_address;
+	u32 length;
+};
+
 /*
  * Common flags fields for MADT subtables
  */
 
-/* MADT Local APIC flags (lapic_flags) and GIC flags */
+/* MADT Local APIC flags */
 
 #define ACPI_MADT_ENABLED           (1)	/* 00: Processor is usable if 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 Tue Jan 12 17:00:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:00: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 1aJ2Ix-00006H-JC; Tue, 12 Jan 2016 17:00: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 1aJ2Iw-00005A-29
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:22 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	73/75-29649-12135965; Tue, 12 Jan 2016 17:00:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1452618016!14865354!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32785 invoked from network); 12 Jan 2016 17:00:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:00:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2J7-0007Kx-BQ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Ip-0005cp-Ow
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:15 +0000
Date: Tue, 12 Jan 2016 17:00:15 +0000
Message-Id: <E1aJ2Ip-0005cp-Ow@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA/ARM: ACPI 5.1: Update for MADT
	changes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5c3abb9a16b10a5940906da499ea39365ed0735e
Author:     Tomasz Nowicki <tomasz.nowicki@linaro.org>
AuthorDate: Thu Jan 7 17:33:31 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:33:31 2016 +0100

    ACPICA/ARM: ACPI 5.1: Update for MADT changes
    
    New subtables and changes to other subtables. Tomasz Nowicki.
    
    Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
    Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit d0c383e48d1b6cdc39cf9cc2f082bbb6f3c28b89]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl1.h |   44 +++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index ca13bc1..e28853e 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -641,7 +641,9 @@ enum acpi_madt_type {
 	ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
 	ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
 	ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
-	ACPI_MADT_TYPE_RESERVED = 13	/* 13 and greater are reserved */
+	ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
+	ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
+	ACPI_MADT_TYPE_RESERVED = 15	/* 15 and greater are reserved */
 };
 
 /*
@@ -767,15 +769,26 @@ struct acpi_madt_local_x2apic_nmi {
 struct acpi_madt_generic_interrupt {
 	struct acpi_subtable_header header;
 	u16 reserved;		/* Reserved - must be zero */
-	u32 gic_id;
+	u32 cpu_interface_number;
 	u32 uid;
 	u32 flags;
 	u32 parking_version;
 	u32 performance_interrupt;
 	u64 parked_address;
 	u64 base_address;
+	u64 gicv_base_address;
+	u64 gich_base_address;
+	u32 vgic_interrupt;
+	u64 gicr_base_address;
+	u64 arm_mpidr;
 };
 
+/* Masks for Flags field above */
+
+/* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
+#define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1) /* 01: Performance Interrupt Mode */
+#define ACPI_MADT_VGIC_IRQ_MODE         (1<<2) /* 02: VGIC Maintenance Interrupt mode */
+
 /* 12: Generic Distributor (ACPI 5.0) */
 
 struct acpi_madt_generic_distributor {
@@ -787,11 +800,36 @@ struct acpi_madt_generic_distributor {
 	u32 reserved2;		/* Reserved - must be zero */
 };
 
+/* 13: Generic MSI Frame (ACPI 5.1) */
+
+struct acpi_madt_generic_msi_frame {
+	struct acpi_subtable_header header;
+	u16 reserved;		/* reserved - must be zero */
+	u32 msi_frame_id;
+	u64 base_address;
+	u32 flags;
+	u16 spi_count;
+	u16 spi_base;
+};
+
+/* Masks for Flags field above */
+
+#define ACPI_MADT_OVERRIDE_SPI_VALUES	(1)
+
+/* 14: Generic Redistributor (ACPI 5.1) */
+
+struct acpi_madt_generic_redistributor {
+	struct acpi_subtable_header header;
+	u16 reserved;		/* reserved - must be zero */
+	u64 base_address;
+	u32 length;
+};
+
 /*
  * Common flags fields for MADT subtables
  */
 
-/* MADT Local APIC flags (lapic_flags) and GIC flags */
+/* MADT Local APIC flags */
 
 #define ACPI_MADT_ENABLED           (1)	/* 00: Processor is usable if 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 Tue Jan 12 17:00:29 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:00: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 1aJ2J3-00008A-MU; Tue, 12 Jan 2016 17:00: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 1aJ2J2-00007j-IH
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:28 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	CF/5E-10115-B2135965; Tue, 12 Jan 2016 17:00:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1452618026!12588000!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 608 invoked from network); 12 Jan 2016 17:00:27 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:00:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2JH-0007L6-LH
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2J0-0005dL-0c
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:26 +0000
Date: Tue, 12 Jan 2016 17:00:26 +0000
Message-Id: <E1aJ2J0-0005dL-0c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA: ACPI 6.0: Add changes for MADT
	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 9931ec37b02738d957bc9e41977d3b41b714c618
Author:     Bob Moore <robert.moore@intel.com>
AuthorDate: Thu Jan 7 17:33:55 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:33:55 2016 +0100

    ACPICA: ACPI 6.0: Add changes for MADT table
    
    ACPICA commit 02cbb41232bccf7a91967140cab95d5f48291f21
    
    New subtable type. Some additions to existing subtables.
    
    Link: https://github.com/acpica/acpica/commit/02cbb412
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit 0cff8dc0099f6d4f7431181918b37a472bcd1bbb]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl1.h |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index e28853e..afb1545 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -643,7 +643,8 @@ enum acpi_madt_type {
 	ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
 	ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
 	ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
-	ACPI_MADT_TYPE_RESERVED = 15	/* 15 and greater are reserved */
+	ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
+	ACPI_MADT_TYPE_RESERVED = 16	/* 16 and greater are reserved */
 };
 
 /*
@@ -764,7 +765,7 @@ struct acpi_madt_local_x2apic_nmi {
 	u8 reserved[3];
 };
 
-/* 11: Generic Interrupt (ACPI 5.0) */
+/* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
 
 struct acpi_madt_generic_interrupt {
 	struct acpi_subtable_header header;
@@ -781,6 +782,8 @@ struct acpi_madt_generic_interrupt {
 	u32 vgic_interrupt;
 	u64 gicr_base_address;
 	u64 arm_mpidr;
+	u8 efficiency_class;
+	u8 reserved2[3];
 };
 
 /* Masks for Flags field above */
@@ -789,7 +792,7 @@ struct acpi_madt_generic_interrupt {
 #define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1) /* 01: Performance Interrupt Mode */
 #define ACPI_MADT_VGIC_IRQ_MODE         (1<<2) /* 02: VGIC Maintenance Interrupt mode */
 
-/* 12: Generic Distributor (ACPI 5.0) */
+/* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
 
 struct acpi_madt_generic_distributor {
 	struct acpi_subtable_header header;
@@ -797,7 +800,8 @@ struct acpi_madt_generic_distributor {
 	u32 gic_id;
 	u64 base_address;
 	u32 global_irq_base;
-	u32 reserved2;		/* Reserved - must be zero */
+	u8 version;
+	u8 reserved2[3];	/* Reserved - must be zero */
 };
 
 /* 13: Generic MSI Frame (ACPI 5.1) */
@@ -825,6 +829,16 @@ struct acpi_madt_generic_redistributor {
 	u32 length;
 };
 
+/* 15: Generic Translator (ACPI 6.0) */
+
+struct acpi_madt_generic_translator {
+	struct acpi_subtable_header header;
+	u16 reserved;           /* reserved - must be zero */
+	u32 translation_id;
+	u64 base_address;
+	u32 reserved2;
+};
+
 /*
  * Common flags fields for MADT subtables
  */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:00:29 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:00: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 1aJ2J3-00008A-MU; Tue, 12 Jan 2016 17:00: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 1aJ2J2-00007j-IH
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:28 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	CF/5E-10115-B2135965; Tue, 12 Jan 2016 17:00:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1452618026!12588000!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 608 invoked from network); 12 Jan 2016 17:00:27 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:00:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2JH-0007L6-LH
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2J0-0005dL-0c
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:26 +0000
Date: Tue, 12 Jan 2016 17:00:26 +0000
Message-Id: <E1aJ2J0-0005dL-0c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA: ACPI 6.0: Add changes for MADT
	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 9931ec37b02738d957bc9e41977d3b41b714c618
Author:     Bob Moore <robert.moore@intel.com>
AuthorDate: Thu Jan 7 17:33:55 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:33:55 2016 +0100

    ACPICA: ACPI 6.0: Add changes for MADT table
    
    ACPICA commit 02cbb41232bccf7a91967140cab95d5f48291f21
    
    New subtable type. Some additions to existing subtables.
    
    Link: https://github.com/acpica/acpica/commit/02cbb412
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit 0cff8dc0099f6d4f7431181918b37a472bcd1bbb]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl1.h |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index e28853e..afb1545 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -643,7 +643,8 @@ enum acpi_madt_type {
 	ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
 	ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
 	ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
-	ACPI_MADT_TYPE_RESERVED = 15	/* 15 and greater are reserved */
+	ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
+	ACPI_MADT_TYPE_RESERVED = 16	/* 16 and greater are reserved */
 };
 
 /*
@@ -764,7 +765,7 @@ struct acpi_madt_local_x2apic_nmi {
 	u8 reserved[3];
 };
 
-/* 11: Generic Interrupt (ACPI 5.0) */
+/* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
 
 struct acpi_madt_generic_interrupt {
 	struct acpi_subtable_header header;
@@ -781,6 +782,8 @@ struct acpi_madt_generic_interrupt {
 	u32 vgic_interrupt;
 	u64 gicr_base_address;
 	u64 arm_mpidr;
+	u8 efficiency_class;
+	u8 reserved2[3];
 };
 
 /* Masks for Flags field above */
@@ -789,7 +792,7 @@ struct acpi_madt_generic_interrupt {
 #define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1) /* 01: Performance Interrupt Mode */
 #define ACPI_MADT_VGIC_IRQ_MODE         (1<<2) /* 02: VGIC Maintenance Interrupt mode */
 
-/* 12: Generic Distributor (ACPI 5.0) */
+/* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
 
 struct acpi_madt_generic_distributor {
 	struct acpi_subtable_header header;
@@ -797,7 +800,8 @@ struct acpi_madt_generic_distributor {
 	u32 gic_id;
 	u64 base_address;
 	u32 global_irq_base;
-	u32 reserved2;		/* Reserved - must be zero */
+	u8 version;
+	u8 reserved2[3];	/* Reserved - must be zero */
 };
 
 /* 13: Generic MSI Frame (ACPI 5.1) */
@@ -825,6 +829,16 @@ struct acpi_madt_generic_redistributor {
 	u32 length;
 };
 
+/* 15: Generic Translator (ACPI 6.0) */
+
+struct acpi_madt_generic_translator {
+	struct acpi_subtable_header header;
+	u16 reserved;           /* reserved - must be zero */
+	u32 translation_id;
+	u64 base_address;
+	u32 reserved2;
+};
+
 /*
  * Common flags fields for MADT subtables
  */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:00:40 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:00:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2JD-0000BL-VQ; Tue, 12 Jan 2016 17:00:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2JC-0000As-QH
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:38 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	94/66-10715-63135965; Tue, 12 Jan 2016 17:00:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1452618036!14377561!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27018 invoked from network); 12 Jan 2016 17:00:37 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:00:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2JR-0007LI-VA
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2JA-0005eZ-Bl
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:36 +0000
Date: Tue, 12 Jan 2016 17:00:36 +0000
Message-Id: <E1aJ2JA-0005eZ-Bl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA: ACPI 6.0: Add values for MADT
	GIC version 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 4cb27026788fbad957f897ce7261bbc525d57164
Author:     Hanjun Guo <hanjun.guo@linaro.org>
AuthorDate: Thu Jan 7 17:34:13 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:34:13 2016 +0100

    ACPICA: ACPI 6.0: Add values for MADT GIC version field
    
    ACPICA commit 4b100dc43e8baee8c8b4891b23bc7ad03eba6a28
    
    Support for the new version field in the generic distributor
    subtable. Hanjun Guo <hanjun.guo@linaro.org>
    
    Link: https://github.com/acpica/acpica/commit/4b100dc4
    Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit a8bd0f07eb594df51845d33f272fb1952fec1a6f]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl1.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index afb1545..ed5cd2d 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -804,6 +804,17 @@ struct acpi_madt_generic_distributor {
 	u8 reserved2[3];	/* Reserved - must be zero */
 };
 
+/* Values for Version field above */
+
+enum acpi_madt_gic_version {
+	ACPI_MADT_GIC_VERSION_NONE = 0,
+	ACPI_MADT_GIC_VERSION_V1 = 1,
+	ACPI_MADT_GIC_VERSION_V2 = 2,
+	ACPI_MADT_GIC_VERSION_V3 = 3,
+	ACPI_MADT_GIC_VERSION_V4 = 4,
+	ACPI_MADT_GIC_VERSION_RESERVED = 5      /* 5 and greater are reserved */
+};
+
 /* 13: Generic MSI Frame (ACPI 5.1) */
 
 struct acpi_madt_generic_msi_frame {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:00:40 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:00:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2JD-0000BL-VQ; Tue, 12 Jan 2016 17:00:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2JC-0000As-QH
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:38 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	94/66-10715-63135965; Tue, 12 Jan 2016 17:00:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1452618036!14377561!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27018 invoked from network); 12 Jan 2016 17:00:37 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:00:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2JR-0007LI-VA
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2JA-0005eZ-Bl
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:36 +0000
Date: Tue, 12 Jan 2016 17:00:36 +0000
Message-Id: <E1aJ2JA-0005eZ-Bl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA: ACPI 6.0: Add values for MADT
	GIC version 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 4cb27026788fbad957f897ce7261bbc525d57164
Author:     Hanjun Guo <hanjun.guo@linaro.org>
AuthorDate: Thu Jan 7 17:34:13 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:34:13 2016 +0100

    ACPICA: ACPI 6.0: Add values for MADT GIC version field
    
    ACPICA commit 4b100dc43e8baee8c8b4891b23bc7ad03eba6a28
    
    Support for the new version field in the generic distributor
    subtable. Hanjun Guo <hanjun.guo@linaro.org>
    
    Link: https://github.com/acpica/acpica/commit/4b100dc4
    Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit a8bd0f07eb594df51845d33f272fb1952fec1a6f]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl1.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index afb1545..ed5cd2d 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -804,6 +804,17 @@ struct acpi_madt_generic_distributor {
 	u8 reserved2[3];	/* Reserved - must be zero */
 };
 
+/* Values for Version field above */
+
+enum acpi_madt_gic_version {
+	ACPI_MADT_GIC_VERSION_NONE = 0,
+	ACPI_MADT_GIC_VERSION_V1 = 1,
+	ACPI_MADT_GIC_VERSION_V2 = 2,
+	ACPI_MADT_GIC_VERSION_V3 = 3,
+	ACPI_MADT_GIC_VERSION_V4 = 4,
+	ACPI_MADT_GIC_VERSION_RESERVED = 5      /* 5 and greater are reserved */
+};
+
 /* 13: Generic MSI Frame (ACPI 5.1) */
 
 struct acpi_madt_generic_msi_frame {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:00:51 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:00: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 1aJ2JP-0000ER-4E; Tue, 12 Jan 2016 17:00: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 1aJ2JN-0000Dk-3E
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:49 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	DB/52-07651-04135965; Tue, 12 Jan 2016 17:00:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1452618046!15336063!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12219 invoked from network); 12 Jan 2016 17:00:47 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:00:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Jc-0007Lt-7W
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2JK-0005f7-Kc
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:46 +0000
Date: Tue, 12 Jan 2016 17:00:46 +0000
Message-Id: <E1aJ2JK-0005f7-Kc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA/ARM: ACPI 5.1: Update for FADT
	changes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d829211592ca7d64c040f797e68d85cbf8ae7a4f
Author:     Graeme Gregory <graeme.gregory@linaro.org>
AuthorDate: Thu Jan 7 17:34:32 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:34:32 2016 +0100

    ACPICA/ARM: ACPI 5.1: Update for FADT changes
    
    Adds ARM flags and FADT minor revision. Graeme Gregory.
    
    Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
    Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit 9eb1105babb8948c402ff785f5b43e35f79c0a0c]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl.h |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/include/acpi/actbl.h b/xen/include/acpi/actbl.h
index 401bc9d..3079176 100644
--- a/xen/include/acpi/actbl.h
+++ b/xen/include/acpi/actbl.h
@@ -244,7 +244,8 @@ struct acpi_table_fadt {
 	u32 flags;		/* Miscellaneous flag bits (see below for individual flags) */
 	struct acpi_generic_address reset_register;	/* 64-bit address of the Reset register */
 	u8 reset_value;		/* Value to write to the reset_register port to reset the system */
-	u8 reserved4[3];	/* Reserved, must be zero */
+	u16 arm_boot_flags;     /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
+	u8 minor_revision;      /* FADT Minor Revision (ACPI 5.1) */
 	u64 Xfacs;		/* 64-bit physical address of FACS */
 	u64 Xdsdt;		/* 64-bit physical address of DSDT */
 	struct acpi_generic_address xpm1a_event_block;	/* 64-bit Extended Power Mgt 1a Event Reg Blk address */
@@ -260,7 +261,7 @@ struct acpi_table_fadt {
 	u64 hypervisor_id;      /* Hypervisor Vendor ID (ACPI 6.0) */
 };
 
-/* Masks for FADT Boot Architecture Flags (boot_flags) */
+/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) */
 
 #define ACPI_FADT_LEGACY_DEVICES    (1)  	/* 00: [V2] System has LPC or ISA bus devices */
 #define ACPI_FADT_8042              (1<<1)	/* 01: [V3] System has an 8042 controller on port 60/64 */
@@ -271,6 +272,11 @@ struct acpi_table_fadt {
 
 #define FADT2_REVISION_ID               3
 
+/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
+
+#define ACPI_FADT_PSCI_COMPLIANT    (1)        /* 00:  [V5+] PSCI 0.2+ is implemented */
+#define ACPI_FADT_PSCI_USE_HVC      (1<<1)     /* 01:  [V5+] HVC must be used instead of SMC as the PSCI conduit */
+
 /* Masks for FADT flags */
 
 #define ACPI_FADT_WBINVD            (1)	/* 00: [V1] The wbinvd instruction works properly */
@@ -347,7 +353,7 @@ enum acpi_prefered_pm_profiles {
  *     FADT V6 size: 0x114
  */
 #define ACPI_FADT_V1_SIZE       (u32) (ACPI_FADT_OFFSET (flags) + 4)
-#define ACPI_FADT_V2_SIZE       (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3)
+#define ACPI_FADT_V2_SIZE       (u32) (ACPI_FADT_OFFSET (minor_revision) + 1)
 #define ACPI_FADT_V3_SIZE       (u32) (ACPI_FADT_OFFSET (sleep_control))
 #define ACPI_FADT_V5_SIZE       (u32) (ACPI_FADT_OFFSET (hypervisor_id))
 #define ACPI_FADT_V6_SIZE       (u32) (sizeof (struct acpi_table_fadt))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:00:51 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:00: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 1aJ2JP-0000ER-4E; Tue, 12 Jan 2016 17:00: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 1aJ2JN-0000Dk-3E
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:49 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	DB/52-07651-04135965; Tue, 12 Jan 2016 17:00:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1452618046!15336063!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12219 invoked from network); 12 Jan 2016 17:00:47 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:00:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Jc-0007Lt-7W
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2JK-0005f7-Kc
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:46 +0000
Date: Tue, 12 Jan 2016 17:00:46 +0000
Message-Id: <E1aJ2JK-0005f7-Kc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA/ARM: ACPI 5.1: Update for FADT
	changes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d829211592ca7d64c040f797e68d85cbf8ae7a4f
Author:     Graeme Gregory <graeme.gregory@linaro.org>
AuthorDate: Thu Jan 7 17:34:32 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:34:32 2016 +0100

    ACPICA/ARM: ACPI 5.1: Update for FADT changes
    
    Adds ARM flags and FADT minor revision. Graeme Gregory.
    
    Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
    Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit 9eb1105babb8948c402ff785f5b43e35f79c0a0c]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl.h |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/include/acpi/actbl.h b/xen/include/acpi/actbl.h
index 401bc9d..3079176 100644
--- a/xen/include/acpi/actbl.h
+++ b/xen/include/acpi/actbl.h
@@ -244,7 +244,8 @@ struct acpi_table_fadt {
 	u32 flags;		/* Miscellaneous flag bits (see below for individual flags) */
 	struct acpi_generic_address reset_register;	/* 64-bit address of the Reset register */
 	u8 reset_value;		/* Value to write to the reset_register port to reset the system */
-	u8 reserved4[3];	/* Reserved, must be zero */
+	u16 arm_boot_flags;     /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
+	u8 minor_revision;      /* FADT Minor Revision (ACPI 5.1) */
 	u64 Xfacs;		/* 64-bit physical address of FACS */
 	u64 Xdsdt;		/* 64-bit physical address of DSDT */
 	struct acpi_generic_address xpm1a_event_block;	/* 64-bit Extended Power Mgt 1a Event Reg Blk address */
@@ -260,7 +261,7 @@ struct acpi_table_fadt {
 	u64 hypervisor_id;      /* Hypervisor Vendor ID (ACPI 6.0) */
 };
 
-/* Masks for FADT Boot Architecture Flags (boot_flags) */
+/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) */
 
 #define ACPI_FADT_LEGACY_DEVICES    (1)  	/* 00: [V2] System has LPC or ISA bus devices */
 #define ACPI_FADT_8042              (1<<1)	/* 01: [V3] System has an 8042 controller on port 60/64 */
@@ -271,6 +272,11 @@ struct acpi_table_fadt {
 
 #define FADT2_REVISION_ID               3
 
+/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
+
+#define ACPI_FADT_PSCI_COMPLIANT    (1)        /* 00:  [V5+] PSCI 0.2+ is implemented */
+#define ACPI_FADT_PSCI_USE_HVC      (1<<1)     /* 01:  [V5+] HVC must be used instead of SMC as the PSCI conduit */
+
 /* Masks for FADT flags */
 
 #define ACPI_FADT_WBINVD            (1)	/* 00: [V1] The wbinvd instruction works properly */
@@ -347,7 +353,7 @@ enum acpi_prefered_pm_profiles {
  *     FADT V6 size: 0x114
  */
 #define ACPI_FADT_V1_SIZE       (u32) (ACPI_FADT_OFFSET (flags) + 4)
-#define ACPI_FADT_V2_SIZE       (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3)
+#define ACPI_FADT_V2_SIZE       (u32) (ACPI_FADT_OFFSET (minor_revision) + 1)
 #define ACPI_FADT_V3_SIZE       (u32) (ACPI_FADT_OFFSET (sleep_control))
 #define ACPI_FADT_V5_SIZE       (u32) (ACPI_FADT_OFFSET (hypervisor_id))
 #define ACPI_FADT_V6_SIZE       (u32) (sizeof (struct acpi_table_fadt))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:01:00 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:01:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2JY-0000H1-9C; Tue, 12 Jan 2016 17:01: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 1aJ2JX-0000GG-7G
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:59 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	55/27-29649-A4135965; Tue, 12 Jan 2016 17:00:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1452618057!15534726!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45709 invoked from network); 12 Jan 2016 17:00:57 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:00:57 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Jm-0007M1-GU
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2JU-0005fe-Rq
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:56 +0000
Date: Tue, 12 Jan 2016 17:00:56 +0000
Message-Id: <E1aJ2JU-0005fe-Rq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA/ARM: ACPI 5.1: Update for GTDT
	table changes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 52c18917db09afd8e3331ce26300c57848535f04
Author:     Tomasz Nowicki <tomasz.nowicki@linaro.org>
AuthorDate: Thu Jan 7 17:34:50 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:34:50 2016 +0100

    ACPICA/ARM: ACPI 5.1: Update for GTDT table changes
    
    New fields and new subtables. Tomasz Nowicki.
    
    Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
    Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit 54ea4247d389059674aaacad7af224459b135fb9]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl3.h |   93 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 78 insertions(+), 15 deletions(-)

diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index 8c61b5f..39f1f36 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -241,33 +241,96 @@ struct acpi_s3pt_suspend {
 
 /*******************************************************************************
  *
- * GTDT - Generic Timer Description Table (ACPI 5.0)
- *        Version 1
+ * GTDT - Generic Timer Description Table (ACPI 5.1)
+ *        Version 2
  *
  ******************************************************************************/
 
 struct acpi_table_gtdt {
 	struct acpi_table_header header;	/* Common ACPI table header */
-	u64 address;
-	u32 flags;
-	u32 secure_pl1_interrupt;
-	u32 secure_pl1_flags;
-	u32 non_secure_pl1_interrupt;
-	u32 non_secure_pl1_flags;
+	u64 counter_block_addresss;
+	u32 reserved;
+	u32 secure_el1_interrupt;
+	u32 secure_el1_flags;
+	u32 non_secure_el1_interrupt;
+	u32 non_secure_el1_flags;
 	u32 virtual_timer_interrupt;
 	u32 virtual_timer_flags;
-	u32 non_secure_pl2_interrupt;
-	u32 non_secure_pl2_flags;
+	u32 non_secure_el2_interrupt;
+	u32 non_secure_el2_flags;
+	u64 counter_read_block_address;
+	u32 platform_timer_count;
+	u32 platform_timer_offset;
 };
 
-/* Values for Flags field above */
+/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
+
+#define ACPI_GTDT_INTERRUPT_MODE        (1)
+#define ACPI_GTDT_INTERRUPT_POLARITY    (1<<1)
+#define ACPI_GTDT_ALWAYS_ON             (1<<2)
+
+/* Common GTDT subtable header */
+
+struct acpi_gtdt_header {
+	u8 type;
+	u16 length;
+};
+
+/* Values for GTDT subtable type above */
+
+enum acpi_gtdt_type {
+	ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
+	ACPI_GTDT_TYPE_WATCHDOG = 1,
+	ACPI_GTDT_TYPE_RESERVED = 2	/* 2 and greater are reserved */
+};
 
-#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
+/* GTDT Subtables, correspond to Type in struct acpi_gtdt_header */
+
+/* 0: Generic Timer Block */
+
+struct acpi_gtdt_timer_block {
+	struct acpi_gtdt_header header;
+	u8 reserved;
+	u64 block_address;
+	u32 timer_count;
+	u32 timer_offset;
+};
+
+/* Timer Sub-Structure, one per timer */
+
+struct acpi_gtdt_timer_entry {
+	u8 frame_number;
+	u8 reserved[3];
+	u64 base_address;
+	u64 el0_base_address;
+	u32 timer_interrupt;
+	u32 timer_flags;
+	u32 virtual_timer_interrupt;
+	u32 virtual_timer_flags;
+	u32 common_flags;
+};
+
+/* Flag Definitions: common_flags above */
+
+#define ACPI_GTDT_GT_IS_SECURE_TIMER	(1)
+#define ACPI_GTDT_GT_ALWAYS_ON		(1<<1)
+
+/* 1: SBSA Generic Watchdog Structure */
+
+struct acpi_gtdt_watchdog {
+	struct acpi_gtdt_header header;
+	u8 reserved;
+	u64 refresh_frame_address;
+	u64 control_frame_address;
+	u32 timer_interrupt;
+	u32 timer_flags;
+};
 
-/* Values for all "TimerFlags" fields above */
+/* Flag Definitions: timer_flags above */
 
-#define ACPI_GTDT_INTERRUPT_MODE            1
-#define ACPI_GTDT_INTERRUPT_POLARITY        2
+#define ACPI_GTDT_WATCHDOG_IRQ_MODE         (1)
+#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY     (1<<1)
+#define ACPI_GTDT_WATCHDOG_SECURE           (1<<2)
 
 /*******************************************************************************
  *
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:01:00 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:01:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ2JY-0000H1-9C; Tue, 12 Jan 2016 17:01: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 1aJ2JX-0000GG-7G
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:59 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	55/27-29649-A4135965; Tue, 12 Jan 2016 17:00:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1452618057!15534726!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45709 invoked from network); 12 Jan 2016 17:00:57 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:00:57 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Jm-0007M1-GU
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2JU-0005fe-Rq
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:00:56 +0000
Date: Tue, 12 Jan 2016 17:00:56 +0000
Message-Id: <E1aJ2JU-0005fe-Rq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA/ARM: ACPI 5.1: Update for GTDT
	table changes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 52c18917db09afd8e3331ce26300c57848535f04
Author:     Tomasz Nowicki <tomasz.nowicki@linaro.org>
AuthorDate: Thu Jan 7 17:34:50 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:34:50 2016 +0100

    ACPICA/ARM: ACPI 5.1: Update for GTDT table changes
    
    New fields and new subtables. Tomasz Nowicki.
    
    Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
    Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit 54ea4247d389059674aaacad7af224459b135fb9]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl3.h |   93 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 78 insertions(+), 15 deletions(-)

diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index 8c61b5f..39f1f36 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -241,33 +241,96 @@ struct acpi_s3pt_suspend {
 
 /*******************************************************************************
  *
- * GTDT - Generic Timer Description Table (ACPI 5.0)
- *        Version 1
+ * GTDT - Generic Timer Description Table (ACPI 5.1)
+ *        Version 2
  *
  ******************************************************************************/
 
 struct acpi_table_gtdt {
 	struct acpi_table_header header;	/* Common ACPI table header */
-	u64 address;
-	u32 flags;
-	u32 secure_pl1_interrupt;
-	u32 secure_pl1_flags;
-	u32 non_secure_pl1_interrupt;
-	u32 non_secure_pl1_flags;
+	u64 counter_block_addresss;
+	u32 reserved;
+	u32 secure_el1_interrupt;
+	u32 secure_el1_flags;
+	u32 non_secure_el1_interrupt;
+	u32 non_secure_el1_flags;
 	u32 virtual_timer_interrupt;
 	u32 virtual_timer_flags;
-	u32 non_secure_pl2_interrupt;
-	u32 non_secure_pl2_flags;
+	u32 non_secure_el2_interrupt;
+	u32 non_secure_el2_flags;
+	u64 counter_read_block_address;
+	u32 platform_timer_count;
+	u32 platform_timer_offset;
 };
 
-/* Values for Flags field above */
+/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
+
+#define ACPI_GTDT_INTERRUPT_MODE        (1)
+#define ACPI_GTDT_INTERRUPT_POLARITY    (1<<1)
+#define ACPI_GTDT_ALWAYS_ON             (1<<2)
+
+/* Common GTDT subtable header */
+
+struct acpi_gtdt_header {
+	u8 type;
+	u16 length;
+};
+
+/* Values for GTDT subtable type above */
+
+enum acpi_gtdt_type {
+	ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
+	ACPI_GTDT_TYPE_WATCHDOG = 1,
+	ACPI_GTDT_TYPE_RESERVED = 2	/* 2 and greater are reserved */
+};
 
-#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
+/* GTDT Subtables, correspond to Type in struct acpi_gtdt_header */
+
+/* 0: Generic Timer Block */
+
+struct acpi_gtdt_timer_block {
+	struct acpi_gtdt_header header;
+	u8 reserved;
+	u64 block_address;
+	u32 timer_count;
+	u32 timer_offset;
+};
+
+/* Timer Sub-Structure, one per timer */
+
+struct acpi_gtdt_timer_entry {
+	u8 frame_number;
+	u8 reserved[3];
+	u64 base_address;
+	u64 el0_base_address;
+	u32 timer_interrupt;
+	u32 timer_flags;
+	u32 virtual_timer_interrupt;
+	u32 virtual_timer_flags;
+	u32 common_flags;
+};
+
+/* Flag Definitions: common_flags above */
+
+#define ACPI_GTDT_GT_IS_SECURE_TIMER	(1)
+#define ACPI_GTDT_GT_ALWAYS_ON		(1<<1)
+
+/* 1: SBSA Generic Watchdog Structure */
+
+struct acpi_gtdt_watchdog {
+	struct acpi_gtdt_header header;
+	u8 reserved;
+	u64 refresh_frame_address;
+	u64 control_frame_address;
+	u32 timer_interrupt;
+	u32 timer_flags;
+};
 
-/* Values for all "TimerFlags" fields above */
+/* Flag Definitions: timer_flags above */
 
-#define ACPI_GTDT_INTERRUPT_MODE            1
-#define ACPI_GTDT_INTERRUPT_POLARITY        2
+#define ACPI_GTDT_WATCHDOG_IRQ_MODE         (1)
+#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY     (1<<1)
+#define ACPI_GTDT_WATCHDOG_SECURE           (1<<2)
 
 /*******************************************************************************
  *
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:01:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:01: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 1aJ2Ji-0000JM-DT; Tue, 12 Jan 2016 17:01: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 1aJ2Jh-0000Iw-Df
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:09 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	AE/83-14900-45135965; Tue, 12 Jan 2016 17:01:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1452618067!7915458!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33247 invoked from network); 12 Jan 2016 17:01:08 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:01:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Jw-0007MD-Pn
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Jf-0005gJ-5V
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:07 +0000
Date: Tue, 12 Jan 2016 17:01:07 +0000
Message-Id: <E1aJ2Jf-0005gJ-5V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA: Headers: Add GTDT flag
	definitions for the timer subtable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 93de2b9992acf5bda83c8982721fb0fa6fc95b00
Author:     Hanjun Guo <hanjun.guo@linaro.org>
AuthorDate: Thu Jan 7 17:35:08 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:35:08 2016 +0100

    ACPICA: Headers: Add GTDT flag definitions for the timer subtable
    
    Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit 34ea065e5e607dcbb249046c42a491f8b24ad849]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/include/acpi/actbl3.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index 39f1f36..c472045 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -310,10 +310,15 @@ struct acpi_gtdt_timer_entry {
 	u32 common_flags;
 };
 
+/* Flag Definitions: timer_flags and virtual_timer_flags above */
+
+#define ACPI_GTDT_GT_IRQ_MODE		    (1)
+#define ACPI_GTDT_GT_IRQ_POLARITY	    (1<<1)
+
 /* Flag Definitions: common_flags above */
 
-#define ACPI_GTDT_GT_IS_SECURE_TIMER	(1)
-#define ACPI_GTDT_GT_ALWAYS_ON		(1<<1)
+#define ACPI_GTDT_GT_IS_SECURE_TIMER	    (1)
+#define ACPI_GTDT_GT_ALWAYS_ON		    (1<<1)
 
 /* 1: SBSA Generic Watchdog Structure */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:01:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:01: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 1aJ2Ji-0000JM-DT; Tue, 12 Jan 2016 17:01: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 1aJ2Jh-0000Iw-Df
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:09 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	AE/83-14900-45135965; Tue, 12 Jan 2016 17:01:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1452618067!7915458!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33247 invoked from network); 12 Jan 2016 17:01:08 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:01:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Jw-0007MD-Pn
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Jf-0005gJ-5V
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:07 +0000
Date: Tue, 12 Jan 2016 17:01:07 +0000
Message-Id: <E1aJ2Jf-0005gJ-5V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA: Headers: Add GTDT flag
	definitions for the timer subtable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 93de2b9992acf5bda83c8982721fb0fa6fc95b00
Author:     Hanjun Guo <hanjun.guo@linaro.org>
AuthorDate: Thu Jan 7 17:35:08 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:35:08 2016 +0100

    ACPICA: Headers: Add GTDT flag definitions for the timer subtable
    
    Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit 34ea065e5e607dcbb249046c42a491f8b24ad849]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/include/acpi/actbl3.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index 39f1f36..c472045 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -310,10 +310,15 @@ struct acpi_gtdt_timer_entry {
 	u32 common_flags;
 };
 
+/* Flag Definitions: timer_flags and virtual_timer_flags above */
+
+#define ACPI_GTDT_GT_IRQ_MODE		    (1)
+#define ACPI_GTDT_GT_IRQ_POLARITY	    (1<<1)
+
 /* Flag Definitions: common_flags above */
 
-#define ACPI_GTDT_GT_IS_SECURE_TIMER	(1)
-#define ACPI_GTDT_GT_ALWAYS_ON		(1<<1)
+#define ACPI_GTDT_GT_IS_SECURE_TIMER	    (1)
+#define ACPI_GTDT_GT_ALWAYS_ON		    (1<<1)
 
 /* 1: SBSA Generic Watchdog Structure */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:01:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:01: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 1aJ2Js-0000Ln-Hg; Tue, 12 Jan 2016 17:01: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 1aJ2Js-0000Lc-1F
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:20 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	DD/28-13487-F5135965; Tue, 12 Jan 2016 17:01:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1452618077!15112932!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13558 invoked from network); 12 Jan 2016 17:01:18 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:01:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2K7-0007N4-AT
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Jp-0005gi-Fp
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:17 +0000
Date: Tue, 12 Jan 2016 17:01:17 +0000
Message-Id: <E1aJ2Jp-0005gi-Fp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA: ACPI 6.0: Add support for STAO
	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 18eed42622b698e99f2950c293ae969ccaffe9ef
Author:     Bob Moore <robert.moore@intel.com>
AuthorDate: Thu Jan 7 17:35:27 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:35:27 2016 +0100

    ACPICA: ACPI 6.0: Add support for STAO table
    
    Link: https://github.com/acpica/acpica/commit/532bf402
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit 37e12657f8922ebc62f696494c56c81db509053e]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl3.h |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index c472045..0a67784 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -68,6 +68,7 @@
 #define ACPI_SIG_PCCT           "PCCT"	/* Platform Communications Channel Table */
 #define ACPI_SIG_PMTT           "PMTT"	/* Platform Memory Topology Table */
 #define ACPI_SIG_RASF           "RASF"	/* RAS Feature table */
+#define ACPI_SIG_STAO           "STAO" /* Status Override table */
 
 #define ACPI_SIG_S3PT           "S3PT"	/* S3 Performance (sub)Table */
 #define ACPI_SIG_PCCS           "PCC"	/* PCC Shared Memory Region */
@@ -618,6 +619,21 @@ enum acpi_rasf_status {
 #define ACPI_RASF_ERROR                 (1<<2)
 #define ACPI_RASF_STATUS                (0x1F<<3)
 
+/*******************************************************************************
+ *
+ * STAO - Status Override Table (_STA override) - ACPI 6.0
+ *        Version 1
+ *
+ * Conforms to "ACPI Specification for Status Override Table"
+ * 6 January 2015
+ *
+ ******************************************************************************/
+
+struct acpi_table_stao {
+	struct acpi_table_header header;	/* Common ACPI table header */
+	u8 ignore_uart;
+};
+
 /* Reset to default packing */
 
 #pragma pack()
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:01:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:01: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 1aJ2Js-0000Ln-Hg; Tue, 12 Jan 2016 17:01: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 1aJ2Js-0000Lc-1F
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:20 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	DD/28-13487-F5135965; Tue, 12 Jan 2016 17:01:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1452618077!15112932!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13558 invoked from network); 12 Jan 2016 17:01:18 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:01:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2K7-0007N4-AT
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Jp-0005gi-Fp
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:17 +0000
Date: Tue, 12 Jan 2016 17:01:17 +0000
Message-Id: <E1aJ2Jp-0005gi-Fp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPICA: ACPI 6.0: Add support for STAO
	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 18eed42622b698e99f2950c293ae969ccaffe9ef
Author:     Bob Moore <robert.moore@intel.com>
AuthorDate: Thu Jan 7 17:35:27 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 7 17:35:27 2016 +0100

    ACPICA: ACPI 6.0: Add support for STAO table
    
    Link: https://github.com/acpica/acpica/commit/532bf402
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lv Zheng <lv.zheng@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit 37e12657f8922ebc62f696494c56c81db509053e]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl3.h |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index c472045..0a67784 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -68,6 +68,7 @@
 #define ACPI_SIG_PCCT           "PCCT"	/* Platform Communications Channel Table */
 #define ACPI_SIG_PMTT           "PMTT"	/* Platform Memory Topology Table */
 #define ACPI_SIG_RASF           "RASF"	/* RAS Feature table */
+#define ACPI_SIG_STAO           "STAO" /* Status Override table */
 
 #define ACPI_SIG_S3PT           "S3PT"	/* S3 Performance (sub)Table */
 #define ACPI_SIG_PCCS           "PCC"	/* PCC Shared Memory Region */
@@ -618,6 +619,21 @@ enum acpi_rasf_status {
 #define ACPI_RASF_ERROR                 (1<<2)
 #define ACPI_RASF_STATUS                (0x1F<<3)
 
+/*******************************************************************************
+ *
+ * STAO - Status Override Table (_STA override) - ACPI 6.0
+ *        Version 1
+ *
+ * Conforms to "ACPI Specification for Status Override Table"
+ * 6 January 2015
+ *
+ ******************************************************************************/
+
+struct acpi_table_stao {
+	struct acpi_table_header header;	/* Common ACPI table header */
+	u8 ignore_uart;
+};
+
 /* Reset to default packing */
 
 #pragma pack()
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:01:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:01: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 1aJ2K3-0000O4-Mg; Tue, 12 Jan 2016 17:01: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 1aJ2K2-0000No-Pf
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:30 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	D9/52-02807-96135965; Tue, 12 Jan 2016 17:01:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1452618088!14865687!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44156 invoked from network); 12 Jan 2016 17:01:29 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:01:29 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2KH-0007NC-L5
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2K0-0005hC-0B
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:28 +0000
Date: Tue, 12 Jan 2016 17:01:28 +0000
Message-Id: <E1aJ2K0-0005hC-0B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix missing XSM_ENABLE change
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9754544a55d3a290e3198c36198e66d059033a38
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Fri Jan 8 10:46:47 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 8 10:46:47 2016 +0100

    fix missing XSM_ENABLE change
    
    This is broken from "xen: convert XSM_ENABLE to Kconfig"
    6d5293032f5fc1c65f7a73548afaa3caa8e0105a. This hunk was dropped when I
    made my v2 for some reason.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/xsm/xsm_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index 2a74496..5e432de 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -17,7 +17,7 @@
 #include <xen/hypercall.h>
 #include <xsm/xsm.h>
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
 #define XSM_FRAMEWORK_VERSION    "1.0.0"
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:01:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:01: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 1aJ2K3-0000O4-Mg; Tue, 12 Jan 2016 17:01: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 1aJ2K2-0000No-Pf
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:30 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	D9/52-02807-96135965; Tue, 12 Jan 2016 17:01:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1452618088!14865687!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44156 invoked from network); 12 Jan 2016 17:01:29 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:01:29 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2KH-0007NC-L5
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2K0-0005hC-0B
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:28 +0000
Date: Tue, 12 Jan 2016 17:01:28 +0000
Message-Id: <E1aJ2K0-0005hC-0B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix missing XSM_ENABLE change
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9754544a55d3a290e3198c36198e66d059033a38
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Fri Jan 8 10:46:47 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 8 10:46:47 2016 +0100

    fix missing XSM_ENABLE change
    
    This is broken from "xen: convert XSM_ENABLE to Kconfig"
    6d5293032f5fc1c65f7a73548afaa3caa8e0105a. This hunk was dropped when I
    made my v2 for some reason.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/xsm/xsm_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index 2a74496..5e432de 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -17,7 +17,7 @@
 #include <xen/hypercall.h>
 #include <xsm/xsm.h>
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
 #define XSM_FRAMEWORK_VERSION    "1.0.0"
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:01:41 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:01: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 1aJ2KD-0000QW-RK; Tue, 12 Jan 2016 17:01: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 1aJ2KC-0000Q4-QM
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:40 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	71/35-28791-47135965; Tue, 12 Jan 2016 17:01:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1452618098!16359371!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8475 invoked from network); 12 Jan 2016 17:01:39 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:01:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2KR-0007NK-VS
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2KA-0005i7-B5
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:38 +0000
Date: Tue, 12 Jan 2016 17:01:38 +0000
Message-Id: <E1aJ2KA-0005i7-B5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/time: use correct guest TSC
	frequency in tsc_set_info()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a449aa43d88164789b3f60ed3bbd64dae897da8
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Fri Jan 8 10:48:10 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 8 10:48:10 2016 +0100

    x86/time: use correct guest TSC frequency in tsc_set_info()
    
    When TSC_MODE_PVRDTSCP is used for a HVM container and TSC scaling is
    available, use the non-zero value of argument gtsc_khz of tsc_set_info()
    as the guest TSC frequency rather than using the host TSC
    frequency. Otherwise, TSC scaling will not be able get the correct ratio
    between the host and guest TSC frequencies.
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/time.c          |    9 +++++++--
 xen/include/asm-x86/domain.h |    9 ++++++---
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index b5223cf..ee4d755 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1838,6 +1838,8 @@ void tsc_set_info(struct domain *d,
 
     switch ( d->arch.tsc_mode = tsc_mode )
     {
+        bool_t enable_tsc_scaling;
+
     case TSC_MODE_DEFAULT:
     case TSC_MODE_ALWAYS_EMULATE:
         d->arch.vtsc_offset = get_s_time() - elapsed_nsec;
@@ -1864,7 +1866,9 @@ void tsc_set_info(struct domain *d,
     case TSC_MODE_PVRDTSCP:
         d->arch.vtsc = !boot_cpu_has(X86_FEATURE_RDTSCP) ||
                        !host_tsc_is_safe();
-        d->arch.tsc_khz = cpu_khz;
+        enable_tsc_scaling = has_hvm_container_domain(d) &&
+                             cpu_has_tsc_ratio && !d->arch.vtsc;
+        d->arch.tsc_khz = (enable_tsc_scaling && gtsc_khz) ? gtsc_khz : cpu_khz;
         set_time_scale(&d->arch.vtsc_to_ns, d->arch.tsc_khz * 1000 );
         d->arch.ns_to_vtsc = scale_reciprocal(d->arch.vtsc_to_ns);
         if ( d->arch.vtsc )
@@ -1872,7 +1876,8 @@ void tsc_set_info(struct domain *d,
         else {
             /* when using native TSC, offset is nsec relative to power-on
              * of physical machine */
-            d->arch.vtsc_offset = scale_delta(rdtsc(), &d->arch.vtsc_to_ns) -
+            d->arch.vtsc_offset = scale_delta(rdtsc(),
+                                              &this_cpu(cpu_time).tsc_scale) -
                                   elapsed_nsec;
         }
         break;
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index e8f7037..405adef 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -347,9 +347,12 @@ struct arch_domain
     s_time_t vtsc_last;      /* previous TSC value (guarantee monotonicity) */
     spinlock_t vtsc_lock;
     uint64_t vtsc_offset;    /* adjustment for save/restore/migrate */
-    uint32_t tsc_khz;        /* cached khz for certain emulated cases */
-    struct time_scale vtsc_to_ns; /* scaling for certain emulated cases */
-    struct time_scale ns_to_vtsc; /* scaling for certain emulated cases */
+    uint32_t tsc_khz;        /* cached guest khz for certain emulated or
+                                hardware TSC scaling cases */
+    struct time_scale vtsc_to_ns; /* scaling for certain emulated or
+                                     hardware TSC scaling cases */
+    struct time_scale ns_to_vtsc; /* scaling for certain emulated or
+                                     hardware TSC scaling cases */
     uint32_t incarnation;    /* incremented every restore or live migrate
                                 (possibly other cases in the future */
 #if !defined(NDEBUG) || defined(PERF_COUNTERS)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:01:41 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:01: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 1aJ2KD-0000QW-RK; Tue, 12 Jan 2016 17:01: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 1aJ2KC-0000Q4-QM
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:40 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	71/35-28791-47135965; Tue, 12 Jan 2016 17:01:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1452618098!16359371!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8475 invoked from network); 12 Jan 2016 17:01:39 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:01:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2KR-0007NK-VS
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2KA-0005i7-B5
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:38 +0000
Date: Tue, 12 Jan 2016 17:01:38 +0000
Message-Id: <E1aJ2KA-0005i7-B5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/time: use correct guest TSC
	frequency in tsc_set_info()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a449aa43d88164789b3f60ed3bbd64dae897da8
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Fri Jan 8 10:48:10 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 8 10:48:10 2016 +0100

    x86/time: use correct guest TSC frequency in tsc_set_info()
    
    When TSC_MODE_PVRDTSCP is used for a HVM container and TSC scaling is
    available, use the non-zero value of argument gtsc_khz of tsc_set_info()
    as the guest TSC frequency rather than using the host TSC
    frequency. Otherwise, TSC scaling will not be able get the correct ratio
    between the host and guest TSC frequencies.
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/time.c          |    9 +++++++--
 xen/include/asm-x86/domain.h |    9 ++++++---
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index b5223cf..ee4d755 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1838,6 +1838,8 @@ void tsc_set_info(struct domain *d,
 
     switch ( d->arch.tsc_mode = tsc_mode )
     {
+        bool_t enable_tsc_scaling;
+
     case TSC_MODE_DEFAULT:
     case TSC_MODE_ALWAYS_EMULATE:
         d->arch.vtsc_offset = get_s_time() - elapsed_nsec;
@@ -1864,7 +1866,9 @@ void tsc_set_info(struct domain *d,
     case TSC_MODE_PVRDTSCP:
         d->arch.vtsc = !boot_cpu_has(X86_FEATURE_RDTSCP) ||
                        !host_tsc_is_safe();
-        d->arch.tsc_khz = cpu_khz;
+        enable_tsc_scaling = has_hvm_container_domain(d) &&
+                             cpu_has_tsc_ratio && !d->arch.vtsc;
+        d->arch.tsc_khz = (enable_tsc_scaling && gtsc_khz) ? gtsc_khz : cpu_khz;
         set_time_scale(&d->arch.vtsc_to_ns, d->arch.tsc_khz * 1000 );
         d->arch.ns_to_vtsc = scale_reciprocal(d->arch.vtsc_to_ns);
         if ( d->arch.vtsc )
@@ -1872,7 +1876,8 @@ void tsc_set_info(struct domain *d,
         else {
             /* when using native TSC, offset is nsec relative to power-on
              * of physical machine */
-            d->arch.vtsc_offset = scale_delta(rdtsc(), &d->arch.vtsc_to_ns) -
+            d->arch.vtsc_offset = scale_delta(rdtsc(),
+                                              &this_cpu(cpu_time).tsc_scale) -
                                   elapsed_nsec;
         }
         break;
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index e8f7037..405adef 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -347,9 +347,12 @@ struct arch_domain
     s_time_t vtsc_last;      /* previous TSC value (guarantee monotonicity) */
     spinlock_t vtsc_lock;
     uint64_t vtsc_offset;    /* adjustment for save/restore/migrate */
-    uint32_t tsc_khz;        /* cached khz for certain emulated cases */
-    struct time_scale vtsc_to_ns; /* scaling for certain emulated cases */
-    struct time_scale ns_to_vtsc; /* scaling for certain emulated cases */
+    uint32_t tsc_khz;        /* cached guest khz for certain emulated or
+                                hardware TSC scaling cases */
+    struct time_scale vtsc_to_ns; /* scaling for certain emulated or
+                                     hardware TSC scaling cases */
+    struct time_scale ns_to_vtsc; /* scaling for certain emulated or
+                                     hardware TSC scaling cases */
     uint32_t incarnation;    /* incremented every restore or live migrate
                                 (possibly other cases in the future */
 #if !defined(NDEBUG) || defined(PERF_COUNTERS)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:01:52 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:01: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 1aJ2KO-0000T2-2v; Tue, 12 Jan 2016 17:01:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2KN-0000Sg-6S
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:51 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	4C/22-32641-E7135965; Tue, 12 Jan 2016 17:01:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1452618108!15407428!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23568 invoked from network); 12 Jan 2016 17:01:49 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:01:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Kc-0007Nu-7t
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2KK-0005in-Ka
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:48 +0000
Date: Tue, 12 Jan 2016 17:01:48 +0000
Message-Id: <E1aJ2KK-0005in-Ka@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/time: use correct guest TSC
	frequency in tsc_get_info()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 75904ac35f589b420d6d30415a64888b121d6484
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Fri Jan 8 10:48:29 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 8 10:48:29 2016 +0100

    x86/time: use correct guest TSC frequency in tsc_get_info()
    
    When the TSC mode of a HVM container is TSC_MODE_DEFAULT or
    TSC_MODE_PVRDTSCP and no TSC emulation is used, the existing
    tsc_get_info() uses the host TSC frequency (cpu_khz) as the guest TSC
    frequency. However, tsc_set_info() may set the guest TSC frequency to a
    value different than the host. In order to keep consistent to
    tsc_set_info(), this patch makes tsc_get_info() use the value set by
    tsc_set_info() as the guest TSC frequency.
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/time.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index ee4d755..ec3f33e 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1749,6 +1749,9 @@ void tsc_get_info(struct domain *d, uint32_t *tsc_mode,
                   uint64_t *elapsed_nsec, uint32_t *gtsc_khz,
                   uint32_t *incarnation)
 {
+    bool_t enable_tsc_scaling = has_hvm_container_domain(d) &&
+                                cpu_has_tsc_ratio && !d->arch.vtsc;
+
     *incarnation = d->arch.incarnation;
     *tsc_mode = d->arch.tsc_mode;
 
@@ -1769,7 +1772,7 @@ void tsc_get_info(struct domain *d, uint32_t *tsc_mode,
         }
         tsc = rdtsc();
         *elapsed_nsec = scale_delta(tsc, &d->arch.vtsc_to_ns);
-        *gtsc_khz = cpu_khz;
+        *gtsc_khz = enable_tsc_scaling ? d->arch.tsc_khz : cpu_khz;
         break;
     case TSC_MODE_PVRDTSCP:
         if ( d->arch.vtsc )
@@ -1780,9 +1783,10 @@ void tsc_get_info(struct domain *d, uint32_t *tsc_mode,
         else
         {
             tsc = rdtsc();
-            *elapsed_nsec = scale_delta(tsc, &d->arch.vtsc_to_ns) -
+            *elapsed_nsec = scale_delta(tsc, &this_cpu(cpu_time).tsc_scale) -
                             d->arch.vtsc_offset;
-            *gtsc_khz = 0; /* ignored by tsc_set_info */
+            *gtsc_khz = enable_tsc_scaling ? d->arch.tsc_khz
+                                           : 0 /* ignored by tsc_set_info */;
         }
         break;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:01:52 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:01: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 1aJ2KO-0000T2-2v; Tue, 12 Jan 2016 17:01:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2KN-0000Sg-6S
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:51 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	4C/22-32641-E7135965; Tue, 12 Jan 2016 17:01:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1452618108!15407428!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23568 invoked from network); 12 Jan 2016 17:01:49 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:01:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Kc-0007Nu-7t
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2KK-0005in-Ka
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:48 +0000
Date: Tue, 12 Jan 2016 17:01:48 +0000
Message-Id: <E1aJ2KK-0005in-Ka@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/time: use correct guest TSC
	frequency in tsc_get_info()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 75904ac35f589b420d6d30415a64888b121d6484
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Fri Jan 8 10:48:29 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 8 10:48:29 2016 +0100

    x86/time: use correct guest TSC frequency in tsc_get_info()
    
    When the TSC mode of a HVM container is TSC_MODE_DEFAULT or
    TSC_MODE_PVRDTSCP and no TSC emulation is used, the existing
    tsc_get_info() uses the host TSC frequency (cpu_khz) as the guest TSC
    frequency. However, tsc_set_info() may set the guest TSC frequency to a
    value different than the host. In order to keep consistent to
    tsc_set_info(), this patch makes tsc_get_info() use the value set by
    tsc_set_info() as the guest TSC frequency.
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/time.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index ee4d755..ec3f33e 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1749,6 +1749,9 @@ void tsc_get_info(struct domain *d, uint32_t *tsc_mode,
                   uint64_t *elapsed_nsec, uint32_t *gtsc_khz,
                   uint32_t *incarnation)
 {
+    bool_t enable_tsc_scaling = has_hvm_container_domain(d) &&
+                                cpu_has_tsc_ratio && !d->arch.vtsc;
+
     *incarnation = d->arch.incarnation;
     *tsc_mode = d->arch.tsc_mode;
 
@@ -1769,7 +1772,7 @@ void tsc_get_info(struct domain *d, uint32_t *tsc_mode,
         }
         tsc = rdtsc();
         *elapsed_nsec = scale_delta(tsc, &d->arch.vtsc_to_ns);
-        *gtsc_khz = cpu_khz;
+        *gtsc_khz = enable_tsc_scaling ? d->arch.tsc_khz : cpu_khz;
         break;
     case TSC_MODE_PVRDTSCP:
         if ( d->arch.vtsc )
@@ -1780,9 +1783,10 @@ void tsc_get_info(struct domain *d, uint32_t *tsc_mode,
         else
         {
             tsc = rdtsc();
-            *elapsed_nsec = scale_delta(tsc, &d->arch.vtsc_to_ns) -
+            *elapsed_nsec = scale_delta(tsc, &this_cpu(cpu_time).tsc_scale) -
                             d->arch.vtsc_offset;
-            *gtsc_khz = 0; /* ignored by tsc_set_info */
+            *gtsc_khz = enable_tsc_scaling ? d->arch.tsc_khz
+                                           : 0 /* ignored by tsc_set_info */;
         }
         break;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:02:02 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:02: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 1aJ2KY-0000WM-74; Tue, 12 Jan 2016 17:02:02 +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 1aJ2KX-0000W4-8x
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:01 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	72/1A-08977-88135965; Tue, 12 Jan 2016 17:02:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1452618119!9690578!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60300 invoked from network); 12 Jan 2016 17:01:59 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:01:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Km-0007O2-HY
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2KU-0005jD-UN
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:58 +0000
Date: Tue, 12 Jan 2016 17:01:58 +0000
Message-Id: <E1aJ2KU-0005jD-UN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Adjust error handling in
	map_p2m_list() to fix CentOS 7 build
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ce95dc84e3a28716997be92e2ad85d3e70dbb73a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 8 14:38:03 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 8 15:16:22 2016 +0000

    tools/libxc: Adjust error handling in map_p2m_list() to fix CentOS 7 build
    
    The "goto err;" for malloc() error handling would cause the cleanup code
    to use 'ptes' before it had been initialised, and causing a build
    failure because of -Werror=maybe-uninitialised.
    
    Use "goto err;" consistently for all error handling.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_sr_save_x86_pv.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c
index 4deb58f..4a29460 100644
--- a/tools/libxc/xc_sr_save_x86_pv.c
+++ b/tools/libxc/xc_sr_save_x86_pv.c
@@ -316,8 +316,8 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
     xc_interface *xch = ctx->xch;
     xen_vaddr_t p2m_vaddr, p2m_end, mask, off;
     xen_pfn_t p2m_mfn, mfn, saved_mfn, max_pfn;
-    uint64_t *ptes;
-    xen_pfn_t *mfns;
+    uint64_t *ptes = NULL;
+    xen_pfn_t *mfns = NULL;
     unsigned fpp, n_pages, level, shift, idx_start, idx_end, idx, saved_idx;
     int rc = -1;
 
@@ -327,7 +327,7 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
     {
         ERROR("Bad p2m_cr3 value %#" PRIx64, p2m_cr3);
         errno = ERANGE;
-        return -1;
+        goto err;
     }
 
     get_p2m_generation(ctx);
@@ -350,7 +350,7 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
             ERROR("Bad virtual p2m address range %#" PRIx64 "-%#" PRIx64,
                   p2m_vaddr, p2m_end);
             errno = ERANGE;
-            return -1;
+            goto err;
         }
     }
     else
@@ -363,7 +363,7 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
             ERROR("Bad virtual p2m address range %#" PRIx64 "-%#" PRIx64,
                   p2m_vaddr, p2m_end);
             errno = ERANGE;
-            return -1;
+            goto err;
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:02:02 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:02: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 1aJ2KY-0000WM-74; Tue, 12 Jan 2016 17:02:02 +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 1aJ2KX-0000W4-8x
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:01 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	72/1A-08977-88135965; Tue, 12 Jan 2016 17:02:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1452618119!9690578!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60300 invoked from network); 12 Jan 2016 17:01:59 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:01:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Km-0007O2-HY
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2KU-0005jD-UN
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:01:58 +0000
Date: Tue, 12 Jan 2016 17:01:58 +0000
Message-Id: <E1aJ2KU-0005jD-UN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Adjust error handling in
	map_p2m_list() to fix CentOS 7 build
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ce95dc84e3a28716997be92e2ad85d3e70dbb73a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 8 14:38:03 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 8 15:16:22 2016 +0000

    tools/libxc: Adjust error handling in map_p2m_list() to fix CentOS 7 build
    
    The "goto err;" for malloc() error handling would cause the cleanup code
    to use 'ptes' before it had been initialised, and causing a build
    failure because of -Werror=maybe-uninitialised.
    
    Use "goto err;" consistently for all error handling.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_sr_save_x86_pv.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libxc/xc_sr_save_x86_pv.c b/tools/libxc/xc_sr_save_x86_pv.c
index 4deb58f..4a29460 100644
--- a/tools/libxc/xc_sr_save_x86_pv.c
+++ b/tools/libxc/xc_sr_save_x86_pv.c
@@ -316,8 +316,8 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
     xc_interface *xch = ctx->xch;
     xen_vaddr_t p2m_vaddr, p2m_end, mask, off;
     xen_pfn_t p2m_mfn, mfn, saved_mfn, max_pfn;
-    uint64_t *ptes;
-    xen_pfn_t *mfns;
+    uint64_t *ptes = NULL;
+    xen_pfn_t *mfns = NULL;
     unsigned fpp, n_pages, level, shift, idx_start, idx_end, idx, saved_idx;
     int rc = -1;
 
@@ -327,7 +327,7 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
     {
         ERROR("Bad p2m_cr3 value %#" PRIx64, p2m_cr3);
         errno = ERANGE;
-        return -1;
+        goto err;
     }
 
     get_p2m_generation(ctx);
@@ -350,7 +350,7 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
             ERROR("Bad virtual p2m address range %#" PRIx64 "-%#" PRIx64,
                   p2m_vaddr, p2m_end);
             errno = ERANGE;
-            return -1;
+            goto err;
         }
     }
     else
@@ -363,7 +363,7 @@ static int map_p2m_list(struct xc_sr_context *ctx, uint64_t p2m_cr3)
             ERROR("Bad virtual p2m address range %#" PRIx64 "-%#" PRIx64,
                   p2m_vaddr, p2m_end);
             errno = ERANGE;
-            return -1;
+            goto err;
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:02:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:02: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 1aJ2Kj-0000Z8-Cb; Tue, 12 Jan 2016 17:02:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Kh-0000Yb-HG
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:11 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	25/9A-06091-29135965; Tue, 12 Jan 2016 17:02:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1452618129!15419491!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4593 invoked from network); 12 Jan 2016 17:02:10 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:02:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Kw-0007OA-PO
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Kf-0005jm-5h
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:09 +0000
Date: Tue, 12 Jan 2016 17:02:09 +0000
Message-Id: <E1aJ2Kf-0005jm-5h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "fix missing XSM_ENABLE change"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 828dee90268854467ef4baf6cfe90e43b7448c08
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 8 17:34:16 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 8 17:34:16 2016 +0100

    Revert "fix missing XSM_ENABLE change"
    
    This reverts commit 9754544a55d3a290e3198c36198e66d059033a38,
    as the one it fixes needs reverting.
---
 xen/xsm/xsm_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index 5e432de..2a74496 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -17,7 +17,7 @@
 #include <xen/hypercall.h>
 #include <xsm/xsm.h>
 
-#ifdef CONFIG_XSM
+#ifdef XSM_ENABLE
 
 #define XSM_FRAMEWORK_VERSION    "1.0.0"
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:02:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:02: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 1aJ2Kj-0000Z8-Cb; Tue, 12 Jan 2016 17:02:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Kh-0000Yb-HG
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:11 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	25/9A-06091-29135965; Tue, 12 Jan 2016 17:02:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1452618129!15419491!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4593 invoked from network); 12 Jan 2016 17:02:10 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:02:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Kw-0007OA-PO
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Kf-0005jm-5h
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:09 +0000
Date: Tue, 12 Jan 2016 17:02:09 +0000
Message-Id: <E1aJ2Kf-0005jm-5h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "fix missing XSM_ENABLE change"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 828dee90268854467ef4baf6cfe90e43b7448c08
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 8 17:34:16 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 8 17:34:16 2016 +0100

    Revert "fix missing XSM_ENABLE change"
    
    This reverts commit 9754544a55d3a290e3198c36198e66d059033a38,
    as the one it fixes needs reverting.
---
 xen/xsm/xsm_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index 5e432de..2a74496 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -17,7 +17,7 @@
 #include <xen/hypercall.h>
 #include <xsm/xsm.h>
 
-#ifdef CONFIG_XSM
+#ifdef XSM_ENABLE
 
 #define XSM_FRAMEWORK_VERSION    "1.0.0"
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:02:23 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:02: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 1aJ2Kt-0000bJ-GT; Tue, 12 Jan 2016 17:02:23 +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 1aJ2Ks-0000b1-7D
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:22 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	93/73-03235-D9135965; Tue, 12 Jan 2016 17:02:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1452618139!15405793!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49778 invoked from network); 12 Jan 2016 17:02:20 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:02:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2L7-0007Oo-A2
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Kp-0005kE-Ep
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:19 +0000
Date: Tue, 12 Jan 2016 17:02:19 +0000
Message-Id: <E1aJ2Kp-0005kE-Ep@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "convert XSM_ENABLE to Kconfig"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a307566bb563f1f25c1c262d45a4150490c8a01e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 8 17:34:53 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 8 17:34:53 2016 +0100

    Revert "convert XSM_ENABLE to Kconfig"
    
    This reverts commit 2b2ab5d88b2d2ab0155101a0a6922025064061af,
    as osstest needs to be ready first.
---
 Config.mk                    |    3 +++
 INSTALL                      |    8 ++++++--
 docs/misc/xsm-flask.txt      |    6 +++---
 xen/Rules.mk                 |    1 +
 xen/common/Kconfig           |   39 ++-------------------------------------
 xen/include/asm-x86/config.h |    4 ++++
 xen/include/xen/sched.h      |    2 +-
 xen/include/xsm/dummy.h      |   10 +++++-----
 xen/include/xsm/xsm.h        |    6 +++---
 xen/xsm/Makefile             |    6 ++++--
 10 files changed, 32 insertions(+), 53 deletions(-)

diff --git a/Config.mk b/Config.mk
index 62f8209..1315918 100644
--- a/Config.mk
+++ b/Config.mk
@@ -212,6 +212,9 @@ APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
+# Enable XSM security module (by default, Flask).
+XSM_ENABLE ?= n
+
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
 # the internet.  The original download URL is preserved as a comment
diff --git a/INSTALL b/INSTALL
index 3d2e86a..c51447b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -275,10 +275,14 @@ Building the python tools may fail unless certain options are passed to
 setup.py. Config.mk contains additional info how to use this variable.
 PYTHON_PREFIX_ARG=
 
-he hypervisor may be build with XSM/Flask support, which can be changed
+The hypervisor may be build with XSM support, which can be changed with
+the following variables.
+XSM_ENABLE=y
+
+The hypervisor may be build with Flask support, which can be changed
 by running:
 make -C xen menuconfig
-and enabling XSM/Flask in the 'Common Features' menu.
+and enabling Flask in the 'Common Features' menu.
 
 Do a build for coverage.
 coverage=y
diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index fb2fe9f..f2f0fd4 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -172,9 +172,9 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Running 'make -C xen menuconfig' and enabling XSM
-and FLASK inside 'Common Features'; this change requires a make clean and
-rebuild.
+framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
+"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
+Features'; this change requires a make clean and rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 8bd1098..9e4e6ff 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -52,6 +52,7 @@ CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
 CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
+CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index eadfc3b..6373b7f 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -10,9 +10,8 @@ config COMPAT
 
 config FLASK
 	bool "FLux Advanced Security Kernel support"
-	default y
-	depends on XSM
-	---help---
+	default n
+	--help---
 	  Enables the FLASK (FLux Advanced Security Kernel) support which
 	  provides a mandatory access control framework by which security
 	  enforcement, isolation, and auditing can be achieved with fine
@@ -63,38 +62,4 @@ config KEXEC
 
 	  If unsure, say Y.
 
-# Allows "late" initialization of the hardware domain
-config LATE_HWDOM
-	bool "dedicated hardware domain"
-	default n
-	depends on XSM && X86
-	---help---
-	  Allows the creation of a dedicated hardware domain distinct from
-	  domain 0 that manages devices without needing access to other
-	  privileged functionality such as the ability to manage domains.
-	  This requires that the actual domain 0 be a stub domain that
-	  constructs the actual hardware domain instead of initializing the
-	  hardware itself.  Because the hardware domain needs access to
-	  hypercalls not available to unprivileged guests, an XSM policy
-	  is required to properly define the privilege of these domains.
-
-	  This feature does nothing if the "hardware_dom" boot parameter is
-	  not present.  If this feature is being used for security, it should
-	  be combined with an IOMMU in strict mode.
-
-	  If unsure, say N.
-
-# Enable/Disable XSM support
-config XSM
-	bool "Xen Security Modules support"
-	default n
-	---help---
-	  Enables the security framework known as Xen Security Modules which
-	  allows administrators fine-grained control over a Xen domain and
-	  its capabilities by defining permissible interactions between domains,
-	  the hypervisor itself, and related resources such as memory and
-	  devices.
-
-	  If unsure, say N.
-
 endmenu
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index 3305a75..f25d92e 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -52,6 +52,10 @@
 
 #define CONFIG_MULTIBOOT 1
 
+#ifdef XSM_ENABLE
+#define CONFIG_LATE_HWDOM 1
+#endif
+
 #define HZ 100
 
 #define OPT_CONSOLE_STR "vga"
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index e1428f7..6ea3cc7 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -110,7 +110,7 @@ struct evtchn
     u8 priority;
     u8 last_priority;
     u16 last_vcpu_id;
-#ifdef CONFIG_XSM
+#ifdef XSM_ENABLE
     union {
 #ifdef XSM_NEED_GENERIC_EVTCHN_SSID
         /*
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 55b84f0..81fba40 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -27,9 +27,9 @@
 /* DO NOT implement this function; it is supposed to trigger link errors */
 void __xsm_action_mismatch_detected(void);
 
-#ifdef CONFIG_XSM
+#ifdef XSM_ENABLE
 
-/* In CONFIG_XSM builds, this header file is included from xsm/dummy.c, and
+/* In XSM_ENABLE builds, this header file is included from xsm/dummy.c, and
  * contains static (not inline) functions compiled to the dummy XSM module.
  * There is no xsm_default_t argument available, so the value from the assertion
  * is used to initialize the variable.
@@ -39,9 +39,9 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID void
 #define XSM_ASSERT_ACTION(def) xsm_default_t action = def; (void)action
 
-#else /* CONFIG_XSM */
+#else /* XSM_ENABLE */
 
-/* In !CONFIG_XSM builds, this header file is included from xsm/xsm.h, and
+/* In !XSM_ENABLE builds, this header file is included from xsm/xsm.h, and
  * contains inline functions for each XSM hook. These functions also perform
  * compile-time checks on the xsm_default_t argument to ensure that the behavior
  * of the dummy XSM module is the same as the behavior with XSM disabled.
@@ -51,7 +51,7 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID xsm_default_t action
 #define XSM_ASSERT_ACTION(def) LINKER_BUG_ON(def != action)
 
-#endif /* CONFIG_XSM */
+#endif /* XSM_ENABLE */
 
 static always_inline int xsm_default_action(
     xsm_default_t action, struct domain *src, struct domain *target)
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 2c365cd..3fc3824 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -194,7 +194,7 @@ struct xsm_operations {
 #endif
 };
 
-#ifdef CONFIG_XSM
+#ifdef XSM_ENABLE
 
 extern struct xsm_operations *xsm_ops;
 
@@ -752,7 +752,7 @@ extern int unregister_xsm(struct xsm_operations *ops);
 extern struct xsm_operations dummy_xsm_ops;
 extern void xsm_fixup_ops(struct xsm_operations *ops);
 
-#else /* CONFIG_XSM */
+#else /* XSM_ENABLE */
 
 #include <xsm/dummy.h>
 
@@ -772,6 +772,6 @@ static inline int xsm_dt_init(void)
 }
 #endif
 
-#endif /* CONFIG_XSM */
+#endif /* XSM_ENABLE */
 
 #endif /* __XSM_H */
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index 3252c46..d29e71c 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -1,5 +1,7 @@
 obj-y += xsm_core.o
-obj-$(CONFIG_XSM) += xsm_policy.o
-obj-$(CONFIG_XSM) += dummy.o
+ifeq ($(XSM_ENABLE),y)
+obj-y += xsm_policy.o
+obj-y += dummy.o
+endif
 
 subdir-$(CONFIG_FLASK) += flask
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:02:23 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:02: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 1aJ2Kt-0000bJ-GT; Tue, 12 Jan 2016 17:02:23 +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 1aJ2Ks-0000b1-7D
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:22 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	93/73-03235-D9135965; Tue, 12 Jan 2016 17:02:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1452618139!15405793!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49778 invoked from network); 12 Jan 2016 17:02:20 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:02:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2L7-0007Oo-A2
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2Kp-0005kE-Ep
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:19 +0000
Date: Tue, 12 Jan 2016 17:02:19 +0000
Message-Id: <E1aJ2Kp-0005kE-Ep@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "convert XSM_ENABLE to Kconfig"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a307566bb563f1f25c1c262d45a4150490c8a01e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 8 17:34:53 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 8 17:34:53 2016 +0100

    Revert "convert XSM_ENABLE to Kconfig"
    
    This reverts commit 2b2ab5d88b2d2ab0155101a0a6922025064061af,
    as osstest needs to be ready first.
---
 Config.mk                    |    3 +++
 INSTALL                      |    8 ++++++--
 docs/misc/xsm-flask.txt      |    6 +++---
 xen/Rules.mk                 |    1 +
 xen/common/Kconfig           |   39 ++-------------------------------------
 xen/include/asm-x86/config.h |    4 ++++
 xen/include/xen/sched.h      |    2 +-
 xen/include/xsm/dummy.h      |   10 +++++-----
 xen/include/xsm/xsm.h        |    6 +++---
 xen/xsm/Makefile             |    6 ++++--
 10 files changed, 32 insertions(+), 53 deletions(-)

diff --git a/Config.mk b/Config.mk
index 62f8209..1315918 100644
--- a/Config.mk
+++ b/Config.mk
@@ -212,6 +212,9 @@ APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
+# Enable XSM security module (by default, Flask).
+XSM_ENABLE ?= n
+
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
 # the internet.  The original download URL is preserved as a comment
diff --git a/INSTALL b/INSTALL
index 3d2e86a..c51447b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -275,10 +275,14 @@ Building the python tools may fail unless certain options are passed to
 setup.py. Config.mk contains additional info how to use this variable.
 PYTHON_PREFIX_ARG=
 
-he hypervisor may be build with XSM/Flask support, which can be changed
+The hypervisor may be build with XSM support, which can be changed with
+the following variables.
+XSM_ENABLE=y
+
+The hypervisor may be build with Flask support, which can be changed
 by running:
 make -C xen menuconfig
-and enabling XSM/Flask in the 'Common Features' menu.
+and enabling Flask in the 'Common Features' menu.
 
 Do a build for coverage.
 coverage=y
diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index fb2fe9f..f2f0fd4 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -172,9 +172,9 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Running 'make -C xen menuconfig' and enabling XSM
-and FLASK inside 'Common Features'; this change requires a make clean and
-rebuild.
+framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
+"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
+Features'; this change requires a make clean and rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 8bd1098..9e4e6ff 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -52,6 +52,7 @@ CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
 CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
+CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index eadfc3b..6373b7f 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -10,9 +10,8 @@ config COMPAT
 
 config FLASK
 	bool "FLux Advanced Security Kernel support"
-	default y
-	depends on XSM
-	---help---
+	default n
+	--help---
 	  Enables the FLASK (FLux Advanced Security Kernel) support which
 	  provides a mandatory access control framework by which security
 	  enforcement, isolation, and auditing can be achieved with fine
@@ -63,38 +62,4 @@ config KEXEC
 
 	  If unsure, say Y.
 
-# Allows "late" initialization of the hardware domain
-config LATE_HWDOM
-	bool "dedicated hardware domain"
-	default n
-	depends on XSM && X86
-	---help---
-	  Allows the creation of a dedicated hardware domain distinct from
-	  domain 0 that manages devices without needing access to other
-	  privileged functionality such as the ability to manage domains.
-	  This requires that the actual domain 0 be a stub domain that
-	  constructs the actual hardware domain instead of initializing the
-	  hardware itself.  Because the hardware domain needs access to
-	  hypercalls not available to unprivileged guests, an XSM policy
-	  is required to properly define the privilege of these domains.
-
-	  This feature does nothing if the "hardware_dom" boot parameter is
-	  not present.  If this feature is being used for security, it should
-	  be combined with an IOMMU in strict mode.
-
-	  If unsure, say N.
-
-# Enable/Disable XSM support
-config XSM
-	bool "Xen Security Modules support"
-	default n
-	---help---
-	  Enables the security framework known as Xen Security Modules which
-	  allows administrators fine-grained control over a Xen domain and
-	  its capabilities by defining permissible interactions between domains,
-	  the hypervisor itself, and related resources such as memory and
-	  devices.
-
-	  If unsure, say N.
-
 endmenu
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index 3305a75..f25d92e 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -52,6 +52,10 @@
 
 #define CONFIG_MULTIBOOT 1
 
+#ifdef XSM_ENABLE
+#define CONFIG_LATE_HWDOM 1
+#endif
+
 #define HZ 100
 
 #define OPT_CONSOLE_STR "vga"
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index e1428f7..6ea3cc7 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -110,7 +110,7 @@ struct evtchn
     u8 priority;
     u8 last_priority;
     u16 last_vcpu_id;
-#ifdef CONFIG_XSM
+#ifdef XSM_ENABLE
     union {
 #ifdef XSM_NEED_GENERIC_EVTCHN_SSID
         /*
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 55b84f0..81fba40 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -27,9 +27,9 @@
 /* DO NOT implement this function; it is supposed to trigger link errors */
 void __xsm_action_mismatch_detected(void);
 
-#ifdef CONFIG_XSM
+#ifdef XSM_ENABLE
 
-/* In CONFIG_XSM builds, this header file is included from xsm/dummy.c, and
+/* In XSM_ENABLE builds, this header file is included from xsm/dummy.c, and
  * contains static (not inline) functions compiled to the dummy XSM module.
  * There is no xsm_default_t argument available, so the value from the assertion
  * is used to initialize the variable.
@@ -39,9 +39,9 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID void
 #define XSM_ASSERT_ACTION(def) xsm_default_t action = def; (void)action
 
-#else /* CONFIG_XSM */
+#else /* XSM_ENABLE */
 
-/* In !CONFIG_XSM builds, this header file is included from xsm/xsm.h, and
+/* In !XSM_ENABLE builds, this header file is included from xsm/xsm.h, and
  * contains inline functions for each XSM hook. These functions also perform
  * compile-time checks on the xsm_default_t argument to ensure that the behavior
  * of the dummy XSM module is the same as the behavior with XSM disabled.
@@ -51,7 +51,7 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID xsm_default_t action
 #define XSM_ASSERT_ACTION(def) LINKER_BUG_ON(def != action)
 
-#endif /* CONFIG_XSM */
+#endif /* XSM_ENABLE */
 
 static always_inline int xsm_default_action(
     xsm_default_t action, struct domain *src, struct domain *target)
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 2c365cd..3fc3824 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -194,7 +194,7 @@ struct xsm_operations {
 #endif
 };
 
-#ifdef CONFIG_XSM
+#ifdef XSM_ENABLE
 
 extern struct xsm_operations *xsm_ops;
 
@@ -752,7 +752,7 @@ extern int unregister_xsm(struct xsm_operations *ops);
 extern struct xsm_operations dummy_xsm_ops;
 extern void xsm_fixup_ops(struct xsm_operations *ops);
 
-#else /* CONFIG_XSM */
+#else /* XSM_ENABLE */
 
 #include <xsm/dummy.h>
 
@@ -772,6 +772,6 @@ static inline int xsm_dt_init(void)
 }
 #endif
 
-#endif /* CONFIG_XSM */
+#endif /* XSM_ENABLE */
 
 #endif /* __XSM_H */
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index 3252c46..d29e71c 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -1,5 +1,7 @@
 obj-y += xsm_core.o
-obj-$(CONFIG_XSM) += xsm_policy.o
-obj-$(CONFIG_XSM) += dummy.o
+ifeq ($(XSM_ENABLE),y)
+obj-y += xsm_policy.o
+obj-y += dummy.o
+endif
 
 subdir-$(CONFIG_FLASK) += flask
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:02:34 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:02: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 1aJ2L4-0000d0-KH; Tue, 12 Jan 2016 17:02:34 +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 1aJ2L2-0000ci-Ff
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:32 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	C6/E3-03235-7A135965; Tue, 12 Jan 2016 17:02:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1452618150!15100550!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 53039 invoked from network); 12 Jan 2016 17:02:31 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:02:31 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2LH-0007Ow-Kl
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2L0-0005kb-0J
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:30 +0000
Date: Tue, 12 Jan 2016 17:02:30 +0000
Message-Id: <E1aJ2L0-0005kb-0J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "convert FLASK_ENABLE to
	Kconfig"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f7347a282420a5edc74afb31e7c42c2765f24de5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 8 17:35:30 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 8 17:35:30 2016 +0100

    Revert "convert FLASK_ENABLE to Kconfig"
    
    This reverts commit b36bf230270baba4f0fe35b230ea8b80ebb2c4a7,
    as osstest needs to be ready first.
---
 Config.mk                |    1 +
 INSTALL                  |    6 +-----
 docs/misc/xsm-flask.txt  |    5 ++---
 xen/Rules.mk             |    1 +
 xen/common/Kconfig       |   11 -----------
 xen/include/Makefile     |    2 +-
 xen/include/xen/config.h |    2 +-
 xen/include/xen/sched.h  |    2 +-
 xen/xsm/Makefile         |    2 +-
 9 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1315918..a3be5ed 100644
--- a/Config.mk
+++ b/Config.mk
@@ -214,6 +214,7 @@ EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
 # Enable XSM security module (by default, Flask).
 XSM_ENABLE ?= n
+FLASK_ENABLE ?= $(XSM_ENABLE)
 
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
diff --git a/INSTALL b/INSTALL
index c51447b..b7e426c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -278,11 +278,7 @@ PYTHON_PREFIX_ARG=
 The hypervisor may be build with XSM support, which can be changed with
 the following variables.
 XSM_ENABLE=y
-
-The hypervisor may be build with Flask support, which can be changed
-by running:
-make -C xen menuconfig
-and enabling Flask in the 'Common Features' menu.
+FLASK_ENABLE=y
 
 Do a build for coverage.
 coverage=y
diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index f2f0fd4..7249f40 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -172,9 +172,8 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
-"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
-Features'; this change requires a make clean and rebuild.
+framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE and
+FLASK_ENABLE to "y"; this change requires a make clean and rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 9e4e6ff..f7ddc69 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -53,6 +53,7 @@ CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
+CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 6373b7f..046e257 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -8,17 +8,6 @@ config COMPAT
 	  HVM and PV guests. HVMLoader makes 32-bit hypercalls irrespective
 	  of the destination runmode of the guest.
 
-config FLASK
-	bool "FLux Advanced Security Kernel support"
-	default n
-	--help---
-	  Enables the FLASK (FLux Advanced Security Kernel) support which
-	  provides a mandatory access control framework by which security
-	  enforcement, isolation, and auditing can be achieved with fine
-	  granular control via a security policy.
-
-	  If unsure, say N.
-
 # Select HAS_DEVICE_TREE if device tree is supported
 config HAS_DEVICE_TREE
 	bool
diff --git a/xen/include/Makefile b/xen/include/Makefile
index 9c8188b..94ba3d8 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -28,7 +28,7 @@ headers-$(CONFIG_X86)     += compat/arch-x86/xen.h
 headers-$(CONFIG_X86)     += compat/arch-x86/xen-$(compat-arch-y).h
 headers-$(CONFIG_X86)     += compat/hvm/hvm_vcpu.h
 headers-y                 += compat/arch-$(compat-arch-y).h compat/pmu.h compat/xlat.h
-headers-$(CONFIG_FLASK)   += compat/xsm/flask_op.h
+headers-$(FLASK_ENABLE)   += compat/xsm/flask_op.h
 
 cppflags-y                := -include public/xen-compat.h
 cppflags-$(CONFIG_X86)    += -m32
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index bba015a..7595599 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -86,7 +86,7 @@
 #define mk_unsigned_long(x) x
 #endif /* !__ASSEMBLY__ */
 
-#ifdef CONFIG_FLASK
+#ifdef FLASK_ENABLE
 #define XSM_MAGIC 0xf97cff8c
 /* Maintain statistics on the access vector cache */
 #define FLASK_AVC_STATS 1
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6ea3cc7..fc61fc3 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -119,7 +119,7 @@ struct evtchn
          */
         void *generic;
 #endif
-#ifdef CONFIG_FLASK
+#ifdef FLASK_ENABLE
         /*
          * Inlining the contents of the structure for FLASK avoids unneeded
          * allocations, and on 64-bit platforms with only FLASK enabled,
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index d29e71c..16c13b5 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -4,4 +4,4 @@ obj-y += xsm_policy.o
 obj-y += dummy.o
 endif
 
-subdir-$(CONFIG_FLASK) += flask
+subdir-$(FLASK_ENABLE) += flask
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 17:02:34 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 17:02: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 1aJ2L4-0000d0-KH; Tue, 12 Jan 2016 17:02:34 +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 1aJ2L2-0000ci-Ff
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:32 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	C6/E3-03235-7A135965; Tue, 12 Jan 2016 17:02:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1452618150!15100550!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 53039 invoked from network); 12 Jan 2016 17:02:31 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 17:02:31 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2LH-0007Ow-Kl
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ2L0-0005kb-0J
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 17:02:30 +0000
Date: Tue, 12 Jan 2016 17:02:30 +0000
Message-Id: <E1aJ2L0-0005kb-0J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "convert FLASK_ENABLE to
	Kconfig"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f7347a282420a5edc74afb31e7c42c2765f24de5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jan 8 17:35:30 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 8 17:35:30 2016 +0100

    Revert "convert FLASK_ENABLE to Kconfig"
    
    This reverts commit b36bf230270baba4f0fe35b230ea8b80ebb2c4a7,
    as osstest needs to be ready first.
---
 Config.mk                |    1 +
 INSTALL                  |    6 +-----
 docs/misc/xsm-flask.txt  |    5 ++---
 xen/Rules.mk             |    1 +
 xen/common/Kconfig       |   11 -----------
 xen/include/Makefile     |    2 +-
 xen/include/xen/config.h |    2 +-
 xen/include/xen/sched.h  |    2 +-
 xen/xsm/Makefile         |    2 +-
 9 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1315918..a3be5ed 100644
--- a/Config.mk
+++ b/Config.mk
@@ -214,6 +214,7 @@ EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
 # Enable XSM security module (by default, Flask).
 XSM_ENABLE ?= n
+FLASK_ENABLE ?= $(XSM_ENABLE)
 
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
diff --git a/INSTALL b/INSTALL
index c51447b..b7e426c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -278,11 +278,7 @@ PYTHON_PREFIX_ARG=
 The hypervisor may be build with XSM support, which can be changed with
 the following variables.
 XSM_ENABLE=y
-
-The hypervisor may be build with Flask support, which can be changed
-by running:
-make -C xen menuconfig
-and enabling Flask in the 'Common Features' menu.
+FLASK_ENABLE=y
 
 Do a build for coverage.
 coverage=y
diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index f2f0fd4..7249f40 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -172,9 +172,8 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
-"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
-Features'; this change requires a make clean and rebuild.
+framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE and
+FLASK_ENABLE to "y"; this change requires a make clean and rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 9e4e6ff..f7ddc69 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -53,6 +53,7 @@ CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
+CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 6373b7f..046e257 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -8,17 +8,6 @@ config COMPAT
 	  HVM and PV guests. HVMLoader makes 32-bit hypercalls irrespective
 	  of the destination runmode of the guest.
 
-config FLASK
-	bool "FLux Advanced Security Kernel support"
-	default n
-	--help---
-	  Enables the FLASK (FLux Advanced Security Kernel) support which
-	  provides a mandatory access control framework by which security
-	  enforcement, isolation, and auditing can be achieved with fine
-	  granular control via a security policy.
-
-	  If unsure, say N.
-
 # Select HAS_DEVICE_TREE if device tree is supported
 config HAS_DEVICE_TREE
 	bool
diff --git a/xen/include/Makefile b/xen/include/Makefile
index 9c8188b..94ba3d8 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -28,7 +28,7 @@ headers-$(CONFIG_X86)     += compat/arch-x86/xen.h
 headers-$(CONFIG_X86)     += compat/arch-x86/xen-$(compat-arch-y).h
 headers-$(CONFIG_X86)     += compat/hvm/hvm_vcpu.h
 headers-y                 += compat/arch-$(compat-arch-y).h compat/pmu.h compat/xlat.h
-headers-$(CONFIG_FLASK)   += compat/xsm/flask_op.h
+headers-$(FLASK_ENABLE)   += compat/xsm/flask_op.h
 
 cppflags-y                := -include public/xen-compat.h
 cppflags-$(CONFIG_X86)    += -m32
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index bba015a..7595599 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -86,7 +86,7 @@
 #define mk_unsigned_long(x) x
 #endif /* !__ASSEMBLY__ */
 
-#ifdef CONFIG_FLASK
+#ifdef FLASK_ENABLE
 #define XSM_MAGIC 0xf97cff8c
 /* Maintain statistics on the access vector cache */
 #define FLASK_AVC_STATS 1
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6ea3cc7..fc61fc3 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -119,7 +119,7 @@ struct evtchn
          */
         void *generic;
 #endif
-#ifdef CONFIG_FLASK
+#ifdef FLASK_ENABLE
         /*
          * Inlining the contents of the structure for FLASK avoids unneeded
          * allocations, and on 64-bit platforms with only FLASK enabled,
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index d29e71c..16c13b5 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -4,4 +4,4 @@ obj-y += xsm_policy.o
 obj-y += dummy.o
 endif
 
-subdir-$(CONFIG_FLASK) += flask
+subdir-$(FLASK_ENABLE) += flask
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 22:55:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 22:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ7qI-0008MI-Vs; Tue, 12 Jan 2016 22:55: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 1aJ7qH-0008Lz-PQ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 22:55:09 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	6F/6E-28228-A4485965; Tue, 12 Jan 2016 22:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1452639304!16364448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19308 invoked from network); 12 Jan 2016 22:55:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 22:55:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ7qU-000663-AB
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 22:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ7qB-0004Or-Na
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 22:55:04 +0000
Date: Tue, 12 Jan 2016 22:55:03 +0000
Message-Id: <E1aJ7qB-0004Or-Na@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.5] xen/blkif: Avoid double
	access to src->nr_segments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a83c1576bd330965784cfea72c7fc6e9b1838fdc
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:09:58 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:35:44 2015 +0000

    xen/blkif: Avoid double access to src->nr_segments
    
    src is stored in shared memory and src->nr_segments is dereferenced
    twice at the end of the function.  If a compiler decides to compile this
    into two separate memory accesses then the size limitation could be
    bypassed.
    
    Fix it by removing the double access to src->nr_segments.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/block/xen_blkif.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/block/xen_blkif.h b/hw/block/xen_blkif.h
index 711b692..c68487cb 100644
--- a/hw/block/xen_blkif.h
+++ b/hw/block/xen_blkif.h
@@ -85,8 +85,10 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
 		d->nr_sectors = s->nr_sectors;
 		return;
 	}
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
@@ -106,8 +108,10 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
 		d->nr_sectors = s->nr_sectors;
 		return;
 	}
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 22:55:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 22:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ7qI-0008MI-Vs; Tue, 12 Jan 2016 22:55: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 1aJ7qH-0008Lz-PQ
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 22:55:09 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	6F/6E-28228-A4485965; Tue, 12 Jan 2016 22:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1452639304!16364448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19308 invoked from network); 12 Jan 2016 22:55:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 22:55:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ7qU-000663-AB
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 22:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ7qB-0004Or-Na
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 22:55:04 +0000
Date: Tue, 12 Jan 2016 22:55:03 +0000
Message-Id: <E1aJ7qB-0004Or-Na@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.5] xen/blkif: Avoid double
	access to src->nr_segments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a83c1576bd330965784cfea72c7fc6e9b1838fdc
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:09:58 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:35:44 2015 +0000

    xen/blkif: Avoid double access to src->nr_segments
    
    src is stored in shared memory and src->nr_segments is dereferenced
    twice at the end of the function.  If a compiler decides to compile this
    into two separate memory accesses then the size limitation could be
    bypassed.
    
    Fix it by removing the double access to src->nr_segments.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/block/xen_blkif.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/block/xen_blkif.h b/hw/block/xen_blkif.h
index 711b692..c68487cb 100644
--- a/hw/block/xen_blkif.h
+++ b/hw/block/xen_blkif.h
@@ -85,8 +85,10 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
 		d->nr_sectors = s->nr_sectors;
 		return;
 	}
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
@@ -106,8 +108,10 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
 		d->nr_sectors = s->nr_sectors;
 		return;
 	}
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 22:55:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 22:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ7qQ-0008NC-3O; Tue, 12 Jan 2016 22:55: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 1aJ7qO-0008Mz-Nf
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 22:55:16 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	74/E6-08977-45485965; Tue, 12 Jan 2016 22:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1452639314!9740976!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19821 invoked from network); 12 Jan 2016 22:55:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 22:55:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ7qe-000667-Ix
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 22:55:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ7qM-0004PD-AA
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 22:55:14 +0000
Date: Tue, 12 Jan 2016 22:55:14 +0000
Message-Id: <E1aJ7qM-0004PD-AA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.5] xenfb: avoid reading twice
	the same fields from the shared page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 32bba3499008c847e08858f310d65806e0bade36
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:10:09 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:35:50 2015 +0000

    xenfb: avoid reading twice the same fields from the shared page
    
    Reading twice the same field could give the guest an attack of
    opportunity. In the case of event->type, gcc could compile the switch
    statement into a jump table, effectively ending up reading the type
    field multiple times.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/display/xenfb.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 07ddc9d..0c00bc4 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -777,18 +777,20 @@ static void xenfb_invalidate(void *opaque)
 
 static void xenfb_handle_events(struct XenFB *xenfb)
 {
-    uint32_t prod, cons;
+    uint32_t prod, cons, out_cons;
     struct xenfb_page *page = xenfb->c.page;
 
     prod = page->out_prod;
-    if (prod == page->out_cons)
+    out_cons = page->out_cons;
+    if (prod == out_cons)
 	return;
     xen_rmb();		/* ensure we see ring contents up to prod */
-    for (cons = page->out_cons; cons != prod; cons++) {
+    for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
+        uint8_t type = event->type;
 	int x, y, w, h;
 
-	switch (event->type) {
+	switch (type) {
 	case XENFB_TYPE_UPDATE:
 	    if (xenfb->up_count == UP_QUEUE)
 		xenfb->up_fullscreen = 1;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Tue Jan 12 22:55:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 Jan 2016 22:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJ7qQ-0008NC-3O; Tue, 12 Jan 2016 22:55: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 1aJ7qO-0008Mz-Nf
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 22:55:16 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	74/E6-08977-45485965; Tue, 12 Jan 2016 22:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1452639314!9740976!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19821 invoked from network); 12 Jan 2016 22:55:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jan 2016 22:55:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ7qe-000667-Ix
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 22:55:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJ7qM-0004PD-AA
	for xen-changelog@lists.xensource.com; Tue, 12 Jan 2016 22:55:14 +0000
Date: Tue, 12 Jan 2016 22:55:14 +0000
Message-Id: <E1aJ7qM-0004PD-AA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.5] xenfb: avoid reading twice
	the same fields from the shared page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 32bba3499008c847e08858f310d65806e0bade36
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:10:09 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:35:50 2015 +0000

    xenfb: avoid reading twice the same fields from the shared page
    
    Reading twice the same field could give the guest an attack of
    opportunity. In the case of event->type, gcc could compile the switch
    statement into a jump table, effectively ending up reading the type
    field multiple times.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/display/xenfb.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 07ddc9d..0c00bc4 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -777,18 +777,20 @@ static void xenfb_invalidate(void *opaque)
 
 static void xenfb_handle_events(struct XenFB *xenfb)
 {
-    uint32_t prod, cons;
+    uint32_t prod, cons, out_cons;
     struct xenfb_page *page = xenfb->c.page;
 
     prod = page->out_prod;
-    if (prod == page->out_cons)
+    out_cons = page->out_cons;
+    if (prod == out_cons)
 	return;
     xen_rmb();		/* ensure we see ring contents up to prod */
-    for (cons = page->out_cons; cons != prod; cons++) {
+    for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
+        uint8_t type = event->type;
 	int x, y, w, h;
 
-	switch (event->type) {
+	switch (type) {
 	case XENFB_TYPE_UPDATE:
 	    if (xenfb->up_count == UP_QUEUE)
 		xenfb->up_fullscreen = 1;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Thu Jan 14 05:22:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 Jan 2016 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 1aJaMK-0006nb-Le; Thu, 14 Jan 2016 05: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 1aJaMJ-0006nT-0K
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 05:22:07 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	F5/4E-31122-E7037965; Thu, 14 Jan 2016 05:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1452748924!10012046!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3797 invoked from network); 14 Jan 2016 05:22:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2016 05:22:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJaMc-0007t7-2J
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 05:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJaMG-00061M-Iw
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 05:22:04 +0000
Date: Thu, 14 Jan 2016 05:22:04 +0000
Message-Id: <E1aJaMG-00061M-Iw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.3] xen/blkif: Avoid double
	access to src->nr_segments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ca37f03bc0df4d4a2c5aef4c3c445a183e6bd11b
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:44:58 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:52:06 2015 +0000

    xen/blkif: Avoid double access to src->nr_segments
    
    src is stored in shared memory and src->nr_segments is dereferenced
    twice at the end of the function.  If a compiler decides to compile this
    into two separate memory accesses then the size limitation could be
    bypassed.
    
    Fix it by removing the double access to src->nr_segments.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_blkif.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/xen_blkif.h b/hw/xen_blkif.h
index c0f4136..24188f4 100644
--- a/hw/xen_blkif.h
+++ b/hw/xen_blkif.h
@@ -79,8 +79,10 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
 	dst->handle = src->handle;
 	dst->id = src->id;
 	dst->sector_number = src->sector_number;
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
@@ -94,8 +96,10 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
 	dst->handle = src->handle;
 	dst->id = src->id;
 	dst->sector_number = src->sector_number;
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
--
generated by git-patchbot for /home/xen/git/qemu-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 Jan 14 05:22:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 Jan 2016 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 1aJaMK-0006nb-Le; Thu, 14 Jan 2016 05: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 1aJaMJ-0006nT-0K
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 05:22:07 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	F5/4E-31122-E7037965; Thu, 14 Jan 2016 05:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1452748924!10012046!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3797 invoked from network); 14 Jan 2016 05:22:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2016 05:22:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJaMc-0007t7-2J
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 05:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJaMG-00061M-Iw
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 05:22:04 +0000
Date: Thu, 14 Jan 2016 05:22:04 +0000
Message-Id: <E1aJaMG-00061M-Iw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.3] xen/blkif: Avoid double
	access to src->nr_segments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ca37f03bc0df4d4a2c5aef4c3c445a183e6bd11b
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:44:58 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:52:06 2015 +0000

    xen/blkif: Avoid double access to src->nr_segments
    
    src is stored in shared memory and src->nr_segments is dereferenced
    twice at the end of the function.  If a compiler decides to compile this
    into two separate memory accesses then the size limitation could be
    bypassed.
    
    Fix it by removing the double access to src->nr_segments.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_blkif.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/xen_blkif.h b/hw/xen_blkif.h
index c0f4136..24188f4 100644
--- a/hw/xen_blkif.h
+++ b/hw/xen_blkif.h
@@ -79,8 +79,10 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
 	dst->handle = src->handle;
 	dst->id = src->id;
 	dst->sector_number = src->sector_number;
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
@@ -94,8 +96,10 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
 	dst->handle = src->handle;
 	dst->id = src->id;
 	dst->sector_number = src->sector_number;
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
--
generated by git-patchbot for /home/xen/git/qemu-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 Jan 14 05:22:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 Jan 2016 05:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJaMU-0006ob-Pw; Thu, 14 Jan 2016 05:22: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 1aJaMT-0006oR-Qx
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 05:22:17 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	C9/4A-17089-98037965; Thu, 14 Jan 2016 05:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1452748935!15495753!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32540 invoked from network); 14 Jan 2016 05:22:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2016 05:22:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJaMm-0007tF-JP
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 05:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJaMQ-00061v-W5
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 05:22:15 +0000
Date: Thu, 14 Jan 2016 05:22:14 +0000
Message-Id: <E1aJaMQ-00061v-W5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.3] xenfb: avoid reading twice
	the same fields from the shared page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6e184363e64a0610c35ca231bfc73cea56eb02f3
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:45:14 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:52:12 2015 +0000

    xenfb: avoid reading twice the same fields from the shared page
    
    Reading twice the same field could give the guest an attack of
    opportunity. In the case of event->type, gcc could compile the switch
    statement into a jump table, effectively ending up reading the type
    field multiple times.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xenfb.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/xenfb.c b/hw/xenfb.c
index 442a63a..6251353 100644
--- a/hw/xenfb.c
+++ b/hw/xenfb.c
@@ -798,18 +798,20 @@ static void xenfb_invalidate(void *opaque)
 
 static void xenfb_handle_events(struct XenFB *xenfb)
 {
-    uint32_t prod, cons;
+    uint32_t prod, cons, out_cons;
     struct xenfb_page *page = xenfb->c.page;
 
     prod = page->out_prod;
-    if (prod == page->out_cons)
+    out_cons = page->out_cons;
+    if (prod == out_cons)
 	return;
     xen_rmb();		/* ensure we see ring contents up to prod */
-    for (cons = page->out_cons; cons != prod; cons++) {
+    for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
+        uint8_t type = event->type;
 	int x, y, w, h;
 
-	switch (event->type) {
+	switch (type) {
 	case XENFB_TYPE_UPDATE:
 	    if (xenfb->up_count == UP_QUEUE)
 		xenfb->up_fullscreen = 1;
--
generated by git-patchbot for /home/xen/git/qemu-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 Jan 14 05:22:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 Jan 2016 05:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJaMU-0006ob-Pw; Thu, 14 Jan 2016 05:22: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 1aJaMT-0006oR-Qx
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 05:22:17 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	C9/4A-17089-98037965; Thu, 14 Jan 2016 05:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1452748935!15495753!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32540 invoked from network); 14 Jan 2016 05:22:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2016 05:22:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJaMm-0007tF-JP
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 05:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJaMQ-00061v-W5
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 05:22:15 +0000
Date: Thu, 14 Jan 2016 05:22:14 +0000
Message-Id: <E1aJaMQ-00061v-W5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.3] xenfb: avoid reading twice
	the same fields from the shared page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6e184363e64a0610c35ca231bfc73cea56eb02f3
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:45:14 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 15:52:12 2015 +0000

    xenfb: avoid reading twice the same fields from the shared page
    
    Reading twice the same field could give the guest an attack of
    opportunity. In the case of event->type, gcc could compile the switch
    statement into a jump table, effectively ending up reading the type
    field multiple times.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xenfb.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/xenfb.c b/hw/xenfb.c
index 442a63a..6251353 100644
--- a/hw/xenfb.c
+++ b/hw/xenfb.c
@@ -798,18 +798,20 @@ static void xenfb_invalidate(void *opaque)
 
 static void xenfb_handle_events(struct XenFB *xenfb)
 {
-    uint32_t prod, cons;
+    uint32_t prod, cons, out_cons;
     struct xenfb_page *page = xenfb->c.page;
 
     prod = page->out_prod;
-    if (prod == page->out_cons)
+    out_cons = page->out_cons;
+    if (prod == out_cons)
 	return;
     xen_rmb();		/* ensure we see ring contents up to prod */
-    for (cons = page->out_cons; cons != prod; cons++) {
+    for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
+        uint8_t type = event->type;
 	int x, y, w, h;
 
-	switch (event->type) {
+	switch (type) {
 	case XENFB_TYPE_UPDATE:
 	    if (xenfb->up_count == UP_QUEUE)
 		xenfb->up_fullscreen = 1;
--
generated by git-patchbot for /home/xen/git/qemu-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 Jan 14 09:55:15 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 Jan 2016 09:55: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 1aJecb-0007nl-0N; Thu, 14 Jan 2016 09:55: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 1aJecZ-0007nd-44
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 09:55:11 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	84/EC-31122-E7077965; Thu, 14 Jan 2016 09:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1452765304!10157053!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 63654 invoked from network); 14 Jan 2016 09:55:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2016 09:55:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJeco-0005NQ-5a
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 09:55:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJecS-00035S-29
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 09:55:04 +0000
Date: Thu, 14 Jan 2016 09:55:04 +0000
Message-Id: <E1aJecS-00035S-29@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.2] xen/blkif: Avoid double
	access to src->nr_segments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 74fab2ef4c0ba42af477e9e445c9883cc45cf9e6
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:44:58 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 16:00:32 2015 +0000

    xen/blkif: Avoid double access to src->nr_segments
    
    src is stored in shared memory and src->nr_segments is dereferenced
    twice at the end of the function.  If a compiler decides to compile this
    into two separate memory accesses then the size limitation could be
    bypassed.
    
    Fix it by removing the double access to src->nr_segments.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_blkif.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/xen_blkif.h b/hw/xen_blkif.h
index c0f4136..24188f4 100644
--- a/hw/xen_blkif.h
+++ b/hw/xen_blkif.h
@@ -79,8 +79,10 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
 	dst->handle = src->handle;
 	dst->id = src->id;
 	dst->sector_number = src->sector_number;
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
@@ -94,8 +96,10 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
 	dst->handle = src->handle;
 	dst->id = src->id;
 	dst->sector_number = src->sector_number;
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
--
generated by git-patchbot for /home/xen/git/qemu-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 Jan 14 09:55:15 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 Jan 2016 09:55: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 1aJecb-0007nl-0N; Thu, 14 Jan 2016 09:55: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 1aJecZ-0007nd-44
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 09:55:11 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	84/EC-31122-E7077965; Thu, 14 Jan 2016 09:55:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1452765304!10157053!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 63654 invoked from network); 14 Jan 2016 09:55:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2016 09:55:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJeco-0005NQ-5a
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 09:55:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJecS-00035S-29
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 09:55:04 +0000
Date: Thu, 14 Jan 2016 09:55:04 +0000
Message-Id: <E1aJecS-00035S-29@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.2] xen/blkif: Avoid double
	access to src->nr_segments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 74fab2ef4c0ba42af477e9e445c9883cc45cf9e6
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:44:58 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 16:00:32 2015 +0000

    xen/blkif: Avoid double access to src->nr_segments
    
    src is stored in shared memory and src->nr_segments is dereferenced
    twice at the end of the function.  If a compiler decides to compile this
    into two separate memory accesses then the size limitation could be
    bypassed.
    
    Fix it by removing the double access to src->nr_segments.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_blkif.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/xen_blkif.h b/hw/xen_blkif.h
index c0f4136..24188f4 100644
--- a/hw/xen_blkif.h
+++ b/hw/xen_blkif.h
@@ -79,8 +79,10 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
 	dst->handle = src->handle;
 	dst->id = src->id;
 	dst->sector_number = src->sector_number;
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
@@ -94,8 +96,10 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
 	dst->handle = src->handle;
 	dst->id = src->id;
 	dst->sector_number = src->sector_number;
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
--
generated by git-patchbot for /home/xen/git/qemu-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 Jan 14 09:55:19 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 Jan 2016 09:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJech-0007ob-3b; Thu, 14 Jan 2016 09:55: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 1aJecf-0007oI-3b
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 09:55:17 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	2F/AB-21594-48077965; Thu, 14 Jan 2016 09:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1452765314!15795557!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38027 invoked from network); 14 Jan 2016 09:55:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2016 09:55:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJecy-0005Na-ED
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 09:55:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJecc-00035w-JD
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 09:55:14 +0000
Date: Thu, 14 Jan 2016 09:55:14 +0000
Message-Id: <E1aJecc-00035w-JD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.2] xenfb: avoid reading twice
	the same fields from the shared page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5081fc1c773d2a83ec7a867f030323b8b6956cd1
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:45:14 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 16:00:38 2015 +0000

    xenfb: avoid reading twice the same fields from the shared page
    
    Reading twice the same field could give the guest an attack of
    opportunity. In the case of event->type, gcc could compile the switch
    statement into a jump table, effectively ending up reading the type
    field multiple times.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xenfb.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/xenfb.c b/hw/xenfb.c
index 338800a..9cf603a 100644
--- a/hw/xenfb.c
+++ b/hw/xenfb.c
@@ -798,18 +798,20 @@ static void xenfb_invalidate(void *opaque)
 
 static void xenfb_handle_events(struct XenFB *xenfb)
 {
-    uint32_t prod, cons;
+    uint32_t prod, cons, out_cons;
     struct xenfb_page *page = xenfb->c.page;
 
     prod = page->out_prod;
-    if (prod == page->out_cons)
+    out_cons = page->out_cons;
+    if (prod == out_cons)
 	return;
     xen_rmb();		/* ensure we see ring contents up to prod */
-    for (cons = page->out_cons; cons != prod; cons++) {
+    for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
+        uint8_t type = event->type;
 	int x, y, w, h;
 
-	switch (event->type) {
+	switch (type) {
 	case XENFB_TYPE_UPDATE:
 	    if (xenfb->up_count == UP_QUEUE)
 		xenfb->up_fullscreen = 1;
--
generated by git-patchbot for /home/xen/git/qemu-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 Jan 14 09:55:19 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 Jan 2016 09:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aJech-0007ob-3b; Thu, 14 Jan 2016 09:55: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 1aJecf-0007oI-3b
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 09:55:17 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	2F/AB-21594-48077965; Thu, 14 Jan 2016 09:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1452765314!15795557!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38027 invoked from network); 14 Jan 2016 09:55:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Jan 2016 09:55:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJecy-0005Na-ED
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 09:55:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aJecc-00035w-JD
	for xen-changelog@lists.xensource.com; Thu, 14 Jan 2016 09:55:14 +0000
Date: Thu, 14 Jan 2016 09:55:14 +0000
Message-Id: <E1aJecc-00035w-JD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen stable-4.2] xenfb: avoid reading twice
	the same fields from the shared page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5081fc1c773d2a83ec7a867f030323b8b6956cd1
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 18 15:45:14 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Dec 18 16:00:38 2015 +0000

    xenfb: avoid reading twice the same fields from the shared page
    
    Reading twice the same field could give the guest an attack of
    opportunity. In the case of event->type, gcc could compile the switch
    statement into a jump table, effectively ending up reading the type
    field multiple times.
    
    This is part of XSA-155.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xenfb.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/xenfb.c b/hw/xenfb.c
index 338800a..9cf603a 100644
--- a/hw/xenfb.c
+++ b/hw/xenfb.c
@@ -798,18 +798,20 @@ static void xenfb_invalidate(void *opaque)
 
 static void xenfb_handle_events(struct XenFB *xenfb)
 {
-    uint32_t prod, cons;
+    uint32_t prod, cons, out_cons;
     struct xenfb_page *page = xenfb->c.page;
 
     prod = page->out_prod;
-    if (prod == page->out_cons)
+    out_cons = page->out_cons;
+    if (prod == out_cons)
 	return;
     xen_rmb();		/* ensure we see ring contents up to prod */
-    for (cons = page->out_cons; cons != prod; cons++) {
+    for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
+        uint8_t type = event->type;
 	int x, y, w, h;
 
-	switch (event->type) {
+	switch (type) {
 	case XENFB_TYPE_UPDATE:
 	    if (xenfb->up_count == UP_QUEUE)
 		xenfb->up_fullscreen = 1;
--
generated by git-patchbot for /home/xen/git/qemu-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 Tue Jan 19 16:11:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Jan 2016 16:11: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 1aLYs7-00040G-UT; Tue, 19 Jan 2016 16:11: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 1aLYs6-000409-Qk
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:06 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	F3/FB-09708-A106E965; Tue, 19 Jan 2016 16:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1453219864!9334539!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18236 invoked from network); 19 Jan 2016 16:11:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2016 16:11:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsc-0002OL-Q5
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYs3-0007Yf-Py
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:03 +0000
Date: Tue, 19 Jan 2016 16:11:03 +0000
Message-Id: <E1aLYs3-0007Yf-Py@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] xen_disk: treat "vhd" as "vpc"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 08e79a8eafa763b7a3b9b9896cf76e5d7fee0324
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 4 14:41:02 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Jan 18 16:08:36 2016 +0000

    xen_disk: treat "vhd" as "vpc"
    
    The Xen toolstack uses "vhd" to specify a disk in VHD format, however
    the name of the driver in QEMU is "vpc". Replace "vhd" with "vpc", so
    that QEMU can find the right driver to use for it.
    
    upstream-commit-id: fc3e493bc8e96ef4bf7ae4f035f43cb39382c936
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/block/xen_disk.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 267d8a8..37e14d1 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -811,6 +811,9 @@ static int blk_init(struct XenDevice *xendev)
     if (!strcmp("aio", blkdev->fileproto)) {
         blkdev->fileproto = "raw";
     }
+    if (!strcmp("vhd", blkdev->fileproto)) {
+        blkdev->fileproto = "vpc";
+    }
     if (blkdev->mode == NULL) {
         blkdev->mode = xenstore_read_be_str(&blkdev->xendev, "mode");
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 19 16:11:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Jan 2016 16:11: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 1aLYs7-00040G-UT; Tue, 19 Jan 2016 16:11: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 1aLYs6-000409-Qk
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:06 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	F3/FB-09708-A106E965; Tue, 19 Jan 2016 16:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1453219864!9334539!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18236 invoked from network); 19 Jan 2016 16:11:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2016 16:11:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsc-0002OL-Q5
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYs3-0007Yf-Py
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:03 +0000
Date: Tue, 19 Jan 2016 16:11:03 +0000
Message-Id: <E1aLYs3-0007Yf-Py@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] xen_disk: treat "vhd" as "vpc"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 08e79a8eafa763b7a3b9b9896cf76e5d7fee0324
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Dec 4 14:41:02 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Jan 18 16:08:36 2016 +0000

    xen_disk: treat "vhd" as "vpc"
    
    The Xen toolstack uses "vhd" to specify a disk in VHD format, however
    the name of the driver in QEMU is "vpc". Replace "vhd" with "vpc", so
    that QEMU can find the right driver to use for it.
    
    upstream-commit-id: fc3e493bc8e96ef4bf7ae4f035f43cb39382c936
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/block/xen_disk.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 267d8a8..37e14d1 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -811,6 +811,9 @@ static int blk_init(struct XenDevice *xendev)
     if (!strcmp("aio", blkdev->fileproto)) {
         blkdev->fileproto = "raw";
     }
+    if (!strcmp("vhd", blkdev->fileproto)) {
+        blkdev->fileproto = "vpc";
+    }
     if (blkdev->mode == NULL) {
         blkdev->mode = xenstore_read_be_str(&blkdev->xendev, "mode");
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 19 16:11:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Jan 2016 16:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aLYsI-000438-2n; Tue, 19 Jan 2016 16:11: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 1aLYsG-00042y-S2
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:17 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	87/C9-21594-4206E965; Tue, 19 Jan 2016 16:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1453219874!16827907!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37186 invoked from network); 19 Jan 2016 16:11:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2016 16:11:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsn-0002PC-4a
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsE-0007ZI-5l
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:14 +0000
Date: Tue, 19 Jan 2016 16:11:14 +0000
Message-Id: <E1aLYsE-0007ZI-5l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] xen/MSI-X: latch MSI-X table
	writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b324ef9654764e09e3507ee4932deee9e24510b5
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Wed Dec 9 15:45:29 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Jan 18 16:09:23 2016 +0000

    xen/MSI-X: latch MSI-X table writes
    
    The remaining log message in pci_msix_write() is wrong, as there guest
    behavior may only appear to be wrong: For one, the old logic didn't
    take the mask-all bit into account. And then this shouldn't depend on
    host device state (i.e. the host may have masked the entry without the
    guest having done so). Plus these writes shouldn't be dropped even when
    an entry gets unmasked. Instead, if they can't be made take effect
    right away, they should take effect on the next unmasking or enabling
    operation - the specification explicitly describes such caching
    behavior.
    
    upstream-commit-id: f0ada3608ac13cf13f4e2955ed348dc93a38ac45
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen/xen_pt.h             |    4 +-
 hw/xen/xen_pt_config_init.c |    2 +
 hw/xen/xen_pt_msi.c         |   74 ++++++++++++++++--------------------------
 3 files changed, 32 insertions(+), 48 deletions(-)

diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h
index c545280..4f922f4 100644
--- a/hw/xen/xen_pt.h
+++ b/hw/xen/xen_pt.h
@@ -187,13 +187,13 @@ typedef struct XenPTMSIXEntry {
     int pirq;
     uint64_t addr;
     uint32_t data;
-    uint32_t vector_ctrl;
+    uint32_t latch[4];
     bool updated; /* indicate whether MSI ADDR or DATA is updated */
-    bool warned;  /* avoid issuing (bogus) warning more than once */
 } XenPTMSIXEntry;
 typedef struct XenPTMSIX {
     uint32_t ctrl_offset;
     bool enabled;
+    bool maskall;
     int total_entries;
     int bar_index;
     uint64_t table_base;
diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
index 3a60080..7b42f41 100644
--- a/hw/xen/xen_pt_config_init.c
+++ b/hw/xen/xen_pt_config_init.c
@@ -1499,6 +1499,8 @@ static int xen_pt_msixctrl_reg_write(XenPCIPassthroughState *s,
         xen_pt_msix_disable(s);
     }
 
+    s->msix->maskall = *val & PCI_MSIX_FLAGS_MASKALL;
+
     debug_msix_enabled_old = s->msix->enabled;
     s->msix->enabled = !!(*val & PCI_MSIX_FLAGS_ENABLE);
     if (s->msix->enabled != debug_msix_enabled_old) {
diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c
index 82de2bc..e10cd2a 100644
--- a/hw/xen/xen_pt_msi.c
+++ b/hw/xen/xen_pt_msi.c
@@ -25,6 +25,7 @@
 #define XEN_PT_GFLAGSSHIFT_DELIV_MODE     12
 #define XEN_PT_GFLAGSSHIFT_TRG_MODE       15
 
+#define latch(fld) latch[PCI_MSIX_ENTRY_##fld / sizeof(uint32_t)]
 
 /*
  * Helpers
@@ -314,7 +315,8 @@ static int msix_set_enable(XenPCIPassthroughState *s, bool enabled)
                            enabled);
 }
 
-static int xen_pt_msix_update_one(XenPCIPassthroughState *s, int entry_nr)
+static int xen_pt_msix_update_one(XenPCIPassthroughState *s, int entry_nr,
+                                  uint32_t vec_ctrl)
 {
     XenPTMSIXEntry *entry = NULL;
     int pirq;
@@ -332,6 +334,19 @@ static int xen_pt_msix_update_one(XenPCIPassthroughState *s, int entry_nr)
 
     pirq = entry->pirq;
 
+    /*
+     * Update the entry addr and data to the latest values only when the
+     * entry is masked or they are all masked, as required by the spec.
+     * Addr and data changes while the MSI-X entry is unmasked get deferred
+     * until the next masked -> unmasked transition.
+     */
+    if (pirq == XEN_PT_UNASSIGNED_PIRQ || s->msix->maskall ||
+        (vec_ctrl & PCI_MSIX_ENTRY_CTRL_MASKBIT)) {
+        entry->addr = entry->latch(LOWER_ADDR) |
+                      ((uint64_t)entry->latch(UPPER_ADDR) << 32);
+        entry->data = entry->latch(DATA);
+    }
+
     rc = msi_msix_setup(s, entry->addr, entry->data, &pirq, true, entry_nr,
                         entry->pirq == XEN_PT_UNASSIGNED_PIRQ);
     if (rc) {
@@ -357,7 +372,7 @@ int xen_pt_msix_update(XenPCIPassthroughState *s)
     int i;
 
     for (i = 0; i < msix->total_entries; i++) {
-        xen_pt_msix_update_one(s, i);
+        xen_pt_msix_update_one(s, i, msix->msix_entry[i].latch(VECTOR_CTRL));
     }
 
     return 0;
@@ -406,35 +421,15 @@ int xen_pt_msix_update_remap(XenPCIPassthroughState *s, int bar_index)
 
 static uint32_t get_entry_value(XenPTMSIXEntry *e, int offset)
 {
-    switch (offset) {
-    case PCI_MSIX_ENTRY_LOWER_ADDR:
-        return e->addr & UINT32_MAX;
-    case PCI_MSIX_ENTRY_UPPER_ADDR:
-        return e->addr >> 32;
-    case PCI_MSIX_ENTRY_DATA:
-        return e->data;
-    case PCI_MSIX_ENTRY_VECTOR_CTRL:
-        return e->vector_ctrl;
-    default:
-        return 0;
-    }
+    return !(offset % sizeof(*e->latch))
+           ? e->latch[offset / sizeof(*e->latch)] : 0;
 }
 
 static void set_entry_value(XenPTMSIXEntry *e, int offset, uint32_t val)
 {
-    switch (offset) {
-    case PCI_MSIX_ENTRY_LOWER_ADDR:
-        e->addr = (e->addr & ((uint64_t)UINT32_MAX << 32)) | val;
-        break;
-    case PCI_MSIX_ENTRY_UPPER_ADDR:
-        e->addr = (uint64_t)val << 32 | (e->addr & UINT32_MAX);
-        break;
-    case PCI_MSIX_ENTRY_DATA:
-        e->data = val;
-        break;
-    case PCI_MSIX_ENTRY_VECTOR_CTRL:
-        e->vector_ctrl = val;
-        break;
+    if (!(offset % sizeof(*e->latch)))
+    {
+        e->latch[offset / sizeof(*e->latch)] = val;
     }
 }
 
@@ -454,39 +449,26 @@ static void pci_msix_write(void *opaque, hwaddr addr,
     offset = addr % PCI_MSIX_ENTRY_SIZE;
 
     if (offset != PCI_MSIX_ENTRY_VECTOR_CTRL) {
-        const volatile uint32_t *vec_ctrl;
-
         if (get_entry_value(entry, offset) == val
             && entry->pirq != XEN_PT_UNASSIGNED_PIRQ) {
             return;
         }
 
+        entry->updated = true;
+    } else if (msix->enabled && entry->updated &&
+               !(val & PCI_MSIX_ENTRY_CTRL_MASKBIT)) {
+        const volatile uint32_t *vec_ctrl;
+
         /*
          * If Xen intercepts the mask bit access, entry->vec_ctrl may not be
          * up-to-date. Read from hardware directly.
          */
         vec_ctrl = s->msix->phys_iomem_base + entry_nr * PCI_MSIX_ENTRY_SIZE
             + PCI_MSIX_ENTRY_VECTOR_CTRL;
-
-        if (msix->enabled && !(*vec_ctrl & PCI_MSIX_ENTRY_CTRL_MASKBIT)) {
-            if (!entry->warned) {
-                entry->warned = true;
-                XEN_PT_ERR(&s->dev, "Can't update msix entry %d since MSI-X is"
-                           " already enabled.\n", entry_nr);
-            }
-            return;
-        }
-
-        entry->updated = true;
+        xen_pt_msix_update_one(s, entry_nr, *vec_ctrl);
     }
 
     set_entry_value(entry, offset, val);
-
-    if (offset == PCI_MSIX_ENTRY_VECTOR_CTRL) {
-        if (msix->enabled && !(val & PCI_MSIX_ENTRY_CTRL_MASKBIT)) {
-            xen_pt_msix_update_one(s, entry_nr);
-        }
-    }
 }
 
 static uint64_t pci_msix_read(void *opaque, hwaddr addr,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 19 16:11:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Jan 2016 16:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aLYsI-000438-2n; Tue, 19 Jan 2016 16:11: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 1aLYsG-00042y-S2
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:17 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	87/C9-21594-4206E965; Tue, 19 Jan 2016 16:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1453219874!16827907!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37186 invoked from network); 19 Jan 2016 16:11:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2016 16:11:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsn-0002PC-4a
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsE-0007ZI-5l
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:14 +0000
Date: Tue, 19 Jan 2016 16:11:14 +0000
Message-Id: <E1aLYsE-0007ZI-5l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] xen/MSI-X: latch MSI-X table
	writes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b324ef9654764e09e3507ee4932deee9e24510b5
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Wed Dec 9 15:45:29 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Jan 18 16:09:23 2016 +0000

    xen/MSI-X: latch MSI-X table writes
    
    The remaining log message in pci_msix_write() is wrong, as there guest
    behavior may only appear to be wrong: For one, the old logic didn't
    take the mask-all bit into account. And then this shouldn't depend on
    host device state (i.e. the host may have masked the entry without the
    guest having done so). Plus these writes shouldn't be dropped even when
    an entry gets unmasked. Instead, if they can't be made take effect
    right away, they should take effect on the next unmasking or enabling
    operation - the specification explicitly describes such caching
    behavior.
    
    upstream-commit-id: f0ada3608ac13cf13f4e2955ed348dc93a38ac45
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen/xen_pt.h             |    4 +-
 hw/xen/xen_pt_config_init.c |    2 +
 hw/xen/xen_pt_msi.c         |   74 ++++++++++++++++--------------------------
 3 files changed, 32 insertions(+), 48 deletions(-)

diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h
index c545280..4f922f4 100644
--- a/hw/xen/xen_pt.h
+++ b/hw/xen/xen_pt.h
@@ -187,13 +187,13 @@ typedef struct XenPTMSIXEntry {
     int pirq;
     uint64_t addr;
     uint32_t data;
-    uint32_t vector_ctrl;
+    uint32_t latch[4];
     bool updated; /* indicate whether MSI ADDR or DATA is updated */
-    bool warned;  /* avoid issuing (bogus) warning more than once */
 } XenPTMSIXEntry;
 typedef struct XenPTMSIX {
     uint32_t ctrl_offset;
     bool enabled;
+    bool maskall;
     int total_entries;
     int bar_index;
     uint64_t table_base;
diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
index 3a60080..7b42f41 100644
--- a/hw/xen/xen_pt_config_init.c
+++ b/hw/xen/xen_pt_config_init.c
@@ -1499,6 +1499,8 @@ static int xen_pt_msixctrl_reg_write(XenPCIPassthroughState *s,
         xen_pt_msix_disable(s);
     }
 
+    s->msix->maskall = *val & PCI_MSIX_FLAGS_MASKALL;
+
     debug_msix_enabled_old = s->msix->enabled;
     s->msix->enabled = !!(*val & PCI_MSIX_FLAGS_ENABLE);
     if (s->msix->enabled != debug_msix_enabled_old) {
diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c
index 82de2bc..e10cd2a 100644
--- a/hw/xen/xen_pt_msi.c
+++ b/hw/xen/xen_pt_msi.c
@@ -25,6 +25,7 @@
 #define XEN_PT_GFLAGSSHIFT_DELIV_MODE     12
 #define XEN_PT_GFLAGSSHIFT_TRG_MODE       15
 
+#define latch(fld) latch[PCI_MSIX_ENTRY_##fld / sizeof(uint32_t)]
 
 /*
  * Helpers
@@ -314,7 +315,8 @@ static int msix_set_enable(XenPCIPassthroughState *s, bool enabled)
                            enabled);
 }
 
-static int xen_pt_msix_update_one(XenPCIPassthroughState *s, int entry_nr)
+static int xen_pt_msix_update_one(XenPCIPassthroughState *s, int entry_nr,
+                                  uint32_t vec_ctrl)
 {
     XenPTMSIXEntry *entry = NULL;
     int pirq;
@@ -332,6 +334,19 @@ static int xen_pt_msix_update_one(XenPCIPassthroughState *s, int entry_nr)
 
     pirq = entry->pirq;
 
+    /*
+     * Update the entry addr and data to the latest values only when the
+     * entry is masked or they are all masked, as required by the spec.
+     * Addr and data changes while the MSI-X entry is unmasked get deferred
+     * until the next masked -> unmasked transition.
+     */
+    if (pirq == XEN_PT_UNASSIGNED_PIRQ || s->msix->maskall ||
+        (vec_ctrl & PCI_MSIX_ENTRY_CTRL_MASKBIT)) {
+        entry->addr = entry->latch(LOWER_ADDR) |
+                      ((uint64_t)entry->latch(UPPER_ADDR) << 32);
+        entry->data = entry->latch(DATA);
+    }
+
     rc = msi_msix_setup(s, entry->addr, entry->data, &pirq, true, entry_nr,
                         entry->pirq == XEN_PT_UNASSIGNED_PIRQ);
     if (rc) {
@@ -357,7 +372,7 @@ int xen_pt_msix_update(XenPCIPassthroughState *s)
     int i;
 
     for (i = 0; i < msix->total_entries; i++) {
-        xen_pt_msix_update_one(s, i);
+        xen_pt_msix_update_one(s, i, msix->msix_entry[i].latch(VECTOR_CTRL));
     }
 
     return 0;
@@ -406,35 +421,15 @@ int xen_pt_msix_update_remap(XenPCIPassthroughState *s, int bar_index)
 
 static uint32_t get_entry_value(XenPTMSIXEntry *e, int offset)
 {
-    switch (offset) {
-    case PCI_MSIX_ENTRY_LOWER_ADDR:
-        return e->addr & UINT32_MAX;
-    case PCI_MSIX_ENTRY_UPPER_ADDR:
-        return e->addr >> 32;
-    case PCI_MSIX_ENTRY_DATA:
-        return e->data;
-    case PCI_MSIX_ENTRY_VECTOR_CTRL:
-        return e->vector_ctrl;
-    default:
-        return 0;
-    }
+    return !(offset % sizeof(*e->latch))
+           ? e->latch[offset / sizeof(*e->latch)] : 0;
 }
 
 static void set_entry_value(XenPTMSIXEntry *e, int offset, uint32_t val)
 {
-    switch (offset) {
-    case PCI_MSIX_ENTRY_LOWER_ADDR:
-        e->addr = (e->addr & ((uint64_t)UINT32_MAX << 32)) | val;
-        break;
-    case PCI_MSIX_ENTRY_UPPER_ADDR:
-        e->addr = (uint64_t)val << 32 | (e->addr & UINT32_MAX);
-        break;
-    case PCI_MSIX_ENTRY_DATA:
-        e->data = val;
-        break;
-    case PCI_MSIX_ENTRY_VECTOR_CTRL:
-        e->vector_ctrl = val;
-        break;
+    if (!(offset % sizeof(*e->latch)))
+    {
+        e->latch[offset / sizeof(*e->latch)] = val;
     }
 }
 
@@ -454,39 +449,26 @@ static void pci_msix_write(void *opaque, hwaddr addr,
     offset = addr % PCI_MSIX_ENTRY_SIZE;
 
     if (offset != PCI_MSIX_ENTRY_VECTOR_CTRL) {
-        const volatile uint32_t *vec_ctrl;
-
         if (get_entry_value(entry, offset) == val
             && entry->pirq != XEN_PT_UNASSIGNED_PIRQ) {
             return;
         }
 
+        entry->updated = true;
+    } else if (msix->enabled && entry->updated &&
+               !(val & PCI_MSIX_ENTRY_CTRL_MASKBIT)) {
+        const volatile uint32_t *vec_ctrl;
+
         /*
          * If Xen intercepts the mask bit access, entry->vec_ctrl may not be
          * up-to-date. Read from hardware directly.
          */
         vec_ctrl = s->msix->phys_iomem_base + entry_nr * PCI_MSIX_ENTRY_SIZE
             + PCI_MSIX_ENTRY_VECTOR_CTRL;
-
-        if (msix->enabled && !(*vec_ctrl & PCI_MSIX_ENTRY_CTRL_MASKBIT)) {
-            if (!entry->warned) {
-                entry->warned = true;
-                XEN_PT_ERR(&s->dev, "Can't update msix entry %d since MSI-X is"
-                           " already enabled.\n", entry_nr);
-            }
-            return;
-        }
-
-        entry->updated = true;
+        xen_pt_msix_update_one(s, entry_nr, *vec_ctrl);
     }
 
     set_entry_value(entry, offset, val);
-
-    if (offset == PCI_MSIX_ENTRY_VECTOR_CTRL) {
-        if (msix->enabled && !(val & PCI_MSIX_ENTRY_CTRL_MASKBIT)) {
-            xen_pt_msix_update_one(s, entry_nr);
-        }
-    }
 }
 
 static uint64_t pci_msix_read(void *opaque, hwaddr addr,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 19 16:11:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Jan 2016 16:11: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 1aLYsS-00044n-6K; Tue, 19 Jan 2016 16:11: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 1aLYsR-00044P-0U
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:27 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	5E/A4-08479-E206E965; Tue, 19 Jan 2016 16:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1453219884!16738417!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38316 invoked from network); 19 Jan 2016 16:11:25 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2016 16:11:25 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsx-0002PK-Dp
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsO-0007aZ-Fn
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:24 +0000
Date: Tue, 19 Jan 2016 16:11:24 +0000
Message-Id: <E1aLYsO-0007aZ-Fn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] xen/MSI-X: really enforce
	alignment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6d80ef2a0939bfa4b1a12e022e74ccc20a069abe
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Wed Dec 9 15:46:57 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Jan 18 16:09:51 2016 +0000

    xen/MSI-X: really enforce alignment
    
    The way the generic infrastructure works the intention of not allowing
    unaligned accesses can't be achieved by simply setting .unaligned to
    false. The benefit is that we can now replace the conditionals in
    {get,set}_entry_value() by assert()-s.
    
    upstream-commit-id: bdfe5159cbaebf9e935786040459c56d23646d5a
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen/xen_pt_msi.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c
index e10cd2a..302a310 100644
--- a/hw/xen/xen_pt_msi.c
+++ b/hw/xen/xen_pt_msi.c
@@ -421,16 +421,14 @@ int xen_pt_msix_update_remap(XenPCIPassthroughState *s, int bar_index)
 
 static uint32_t get_entry_value(XenPTMSIXEntry *e, int offset)
 {
-    return !(offset % sizeof(*e->latch))
-           ? e->latch[offset / sizeof(*e->latch)] : 0;
+    assert(!(offset % sizeof(*e->latch)));
+    return e->latch[offset / sizeof(*e->latch)];
 }
 
 static void set_entry_value(XenPTMSIXEntry *e, int offset, uint32_t val)
 {
-    if (!(offset % sizeof(*e->latch)))
-    {
-        e->latch[offset / sizeof(*e->latch)] = val;
-    }
+    assert(!(offset % sizeof(*e->latch)));
+    e->latch[offset / sizeof(*e->latch)] = val;
 }
 
 static void pci_msix_write(void *opaque, hwaddr addr,
@@ -494,6 +492,12 @@ static uint64_t pci_msix_read(void *opaque, hwaddr addr,
     }
 }
 
+static bool pci_msix_accepts(void *opaque, hwaddr addr,
+                             unsigned size, bool is_write)
+{
+    return !(addr & (size - 1));
+}
+
 static const MemoryRegionOps pci_msix_ops = {
     .read = pci_msix_read,
     .write = pci_msix_write,
@@ -502,7 +506,13 @@ static const MemoryRegionOps pci_msix_ops = {
         .min_access_size = 4,
         .max_access_size = 4,
         .unaligned = false,
+        .accepts = pci_msix_accepts
     },
+    .impl = {
+        .min_access_size = 4,
+        .max_access_size = 4,
+        .unaligned = false
+    }
 };
 
 int xen_pt_msix_init(XenPCIPassthroughState *s, uint32_t base)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 19 16:11:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Jan 2016 16:11: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 1aLYsS-00044n-6K; Tue, 19 Jan 2016 16:11: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 1aLYsR-00044P-0U
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:27 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	5E/A4-08479-E206E965; Tue, 19 Jan 2016 16:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1453219884!16738417!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38316 invoked from network); 19 Jan 2016 16:11:25 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2016 16:11:25 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsx-0002PK-Dp
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsO-0007aZ-Fn
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:24 +0000
Date: Tue, 19 Jan 2016 16:11:24 +0000
Message-Id: <E1aLYsO-0007aZ-Fn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] xen/MSI-X: really enforce
	alignment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6d80ef2a0939bfa4b1a12e022e74ccc20a069abe
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Wed Dec 9 15:46:57 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Jan 18 16:09:51 2016 +0000

    xen/MSI-X: really enforce alignment
    
    The way the generic infrastructure works the intention of not allowing
    unaligned accesses can't be achieved by simply setting .unaligned to
    false. The benefit is that we can now replace the conditionals in
    {get,set}_entry_value() by assert()-s.
    
    upstream-commit-id: bdfe5159cbaebf9e935786040459c56d23646d5a
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen/xen_pt_msi.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c
index e10cd2a..302a310 100644
--- a/hw/xen/xen_pt_msi.c
+++ b/hw/xen/xen_pt_msi.c
@@ -421,16 +421,14 @@ int xen_pt_msix_update_remap(XenPCIPassthroughState *s, int bar_index)
 
 static uint32_t get_entry_value(XenPTMSIXEntry *e, int offset)
 {
-    return !(offset % sizeof(*e->latch))
-           ? e->latch[offset / sizeof(*e->latch)] : 0;
+    assert(!(offset % sizeof(*e->latch)));
+    return e->latch[offset / sizeof(*e->latch)];
 }
 
 static void set_entry_value(XenPTMSIXEntry *e, int offset, uint32_t val)
 {
-    if (!(offset % sizeof(*e->latch)))
-    {
-        e->latch[offset / sizeof(*e->latch)] = val;
-    }
+    assert(!(offset % sizeof(*e->latch)));
+    e->latch[offset / sizeof(*e->latch)] = val;
 }
 
 static void pci_msix_write(void *opaque, hwaddr addr,
@@ -494,6 +492,12 @@ static uint64_t pci_msix_read(void *opaque, hwaddr addr,
     }
 }
 
+static bool pci_msix_accepts(void *opaque, hwaddr addr,
+                             unsigned size, bool is_write)
+{
+    return !(addr & (size - 1));
+}
+
 static const MemoryRegionOps pci_msix_ops = {
     .read = pci_msix_read,
     .write = pci_msix_write,
@@ -502,7 +506,13 @@ static const MemoryRegionOps pci_msix_ops = {
         .min_access_size = 4,
         .max_access_size = 4,
         .unaligned = false,
+        .accepts = pci_msix_accepts
     },
+    .impl = {
+        .min_access_size = 4,
+        .max_access_size = 4,
+        .unaligned = false
+    }
 };
 
 int xen_pt_msix_init(XenPCIPassthroughState *s, uint32_t base)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 19 16:11:39 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Jan 2016 16:11: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 1aLYsd-000475-Aa; Tue, 19 Jan 2016 16:11:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsc-00046j-5Q
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:38 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	30/95-25438-9306E965; Tue, 19 Jan 2016 16:11:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1453219895!15947481!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42110 invoked from network); 19 Jan 2016 16:11:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2016 16:11:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYt7-0002Py-Rp
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:12:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsY-0007b2-Pb
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:34 +0000
Date: Tue, 19 Jan 2016 16:11:34 +0000
Message-Id: <E1aLYsY-0007b2-Pb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] xen/pass-through: correctly deal
	with RW1C 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 fcf6ac570c98a86361c430992355ee8dae681d75
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Wed Dec 9 15:47:28 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Jan 18 16:10:17 2016 +0000

    xen/pass-through: correctly deal with RW1C bits
    
    Introduce yet another mask for them, so that the generic routine can
    handle them, at once rendering xen_pt_pmcsr_reg_write() superfluous.
    
    upstream-commit-id: 55c8672c2e65276c19edd3323076518248730cca
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen/xen_pt.h             |    2 ++
 hw/xen/xen_pt_config_init.c |   38 ++++++++++++--------------------------
 2 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h
index 4f922f4..3749711 100644
--- a/hw/xen/xen_pt.h
+++ b/hw/xen/xen_pt.h
@@ -113,6 +113,8 @@ struct XenPTRegInfo {
     uint32_t res_mask;
     /* reg read only field mask (ON:RO/ROS, OFF:other) */
     uint32_t ro_mask;
+    /* reg read/write-1-clear field mask (ON:RW1C/RW1CS, OFF:other) */
+    uint32_t rw1c_mask;
     /* reg emulate field mask (ON:emu, OFF:passthrough) */
     uint32_t emu_mask;
     xen_pt_conf_reg_init init;
diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
index 7b42f41..a6100b1 100644
--- a/hw/xen/xen_pt_config_init.c
+++ b/hw/xen/xen_pt_config_init.c
@@ -179,7 +179,8 @@ static int xen_pt_byte_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry,
     *data = XEN_PT_MERGE_VALUE(*val, *data, writable_mask);
 
     /* create value for writing to I/O device register */
-    *val = XEN_PT_MERGE_VALUE(*val, dev_value, throughable_mask);
+    *val = XEN_PT_MERGE_VALUE(*val, dev_value & ~reg->rw1c_mask,
+                              throughable_mask);
 
     return 0;
 }
@@ -197,7 +198,8 @@ static int xen_pt_word_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry,
     *data = XEN_PT_MERGE_VALUE(*val, *data, writable_mask);
 
     /* create value for writing to I/O device register */
-    *val = XEN_PT_MERGE_VALUE(*val, dev_value, throughable_mask);
+    *val = XEN_PT_MERGE_VALUE(*val, dev_value & ~reg->rw1c_mask,
+                              throughable_mask);
 
     return 0;
 }
@@ -215,7 +217,8 @@ static int xen_pt_long_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry,
     *data = XEN_PT_MERGE_VALUE(*val, *data, writable_mask);
 
     /* create value for writing to I/O device register */
-    *val = XEN_PT_MERGE_VALUE(*val, dev_value, throughable_mask);
+    *val = XEN_PT_MERGE_VALUE(*val, dev_value & ~reg->rw1c_mask,
+                              throughable_mask);
 
     return 0;
 }
@@ -633,6 +636,7 @@ static XenPTRegInfo xen_pt_emu_reg_header0[] = {
         .init_val   = 0x0000,
         .res_mask   = 0x0007,
         .ro_mask    = 0x06F8,
+        .rw1c_mask  = 0xF900,
         .emu_mask   = 0x0010,
         .init       = xen_pt_status_reg_init,
         .u.w.read   = xen_pt_word_reg_read,
@@ -944,6 +948,7 @@ static XenPTRegInfo xen_pt_emu_reg_pcie[] = {
         .size       = 2,
         .res_mask   = 0xFFC0,
         .ro_mask    = 0x0030,
+        .rw1c_mask  = 0x000F,
         .init       = xen_pt_common_reg_init,
         .u.w.read   = xen_pt_word_reg_read,
         .u.w.write  = xen_pt_word_reg_write,
@@ -964,6 +969,7 @@ static XenPTRegInfo xen_pt_emu_reg_pcie[] = {
         .offset     = PCI_EXP_LNKSTA,
         .size       = 2,
         .ro_mask    = 0x3FFF,
+        .rw1c_mask  = 0xC000,
         .init       = xen_pt_common_reg_init,
         .u.w.read   = xen_pt_word_reg_read,
         .u.w.write  = xen_pt_word_reg_write,
@@ -1000,27 +1006,6 @@ static XenPTRegInfo xen_pt_emu_reg_pcie[] = {
  * Power Management Capability
  */
 
-/* write Power Management Control/Status register */
-static int xen_pt_pmcsr_reg_write(XenPCIPassthroughState *s,
-                                  XenPTReg *cfg_entry, uint16_t *val,
-                                  uint16_t dev_value, uint16_t valid_mask)
-{
-    XenPTRegInfo *reg = cfg_entry->reg;
-    uint16_t writable_mask = 0;
-    uint16_t throughable_mask = get_throughable_mask(s, reg, valid_mask);
-    uint16_t *data = cfg_entry->ptr.half_word;
-
-    /* modify emulate register */
-    writable_mask = reg->emu_mask & ~reg->ro_mask & valid_mask;
-    *data = XEN_PT_MERGE_VALUE(*val, *data, writable_mask);
-
-    /* create value for writing to I/O device register */
-    *val = XEN_PT_MERGE_VALUE(*val, dev_value & ~PCI_PM_CTRL_PME_STATUS,
-                              throughable_mask);
-
-    return 0;
-}
-
 /* Power Management Capability reg static information table */
 static XenPTRegInfo xen_pt_emu_reg_pm[] = {
     /* Next Pointer reg */
@@ -1051,11 +1036,12 @@ static XenPTRegInfo xen_pt_emu_reg_pm[] = {
         .size       = 2,
         .init_val   = 0x0008,
         .res_mask   = 0x00F0,
-        .ro_mask    = 0xE10C,
+        .ro_mask    = 0x610C,
+        .rw1c_mask  = 0x8000,
         .emu_mask   = 0x810B,
         .init       = xen_pt_common_reg_init,
         .u.w.read   = xen_pt_word_reg_read,
-        .u.w.write  = xen_pt_pmcsr_reg_write,
+        .u.w.write  = xen_pt_word_reg_write,
     },
     {
         .size = 0,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Jan 19 16:11:39 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 Jan 2016 16:11: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 1aLYsd-000475-Aa; Tue, 19 Jan 2016 16:11:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsc-00046j-5Q
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:38 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	30/95-25438-9306E965; Tue, 19 Jan 2016 16:11:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1453219895!15947481!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42110 invoked from network); 19 Jan 2016 16:11:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jan 2016 16:11:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYt7-0002Py-Rp
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:12:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLYsY-0007b2-Pb
	for xen-changelog@lists.xensource.com; Tue, 19 Jan 2016 16:11:34 +0000
Date: Tue, 19 Jan 2016 16:11:34 +0000
Message-Id: <E1aLYsY-0007b2-Pb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] xen/pass-through: correctly deal
	with RW1C 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 fcf6ac570c98a86361c430992355ee8dae681d75
Author:     Jan Beulich <JBeulich@suse.com>
AuthorDate: Wed Dec 9 15:47:28 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Jan 18 16:10:17 2016 +0000

    xen/pass-through: correctly deal with RW1C bits
    
    Introduce yet another mask for them, so that the generic routine can
    handle them, at once rendering xen_pt_pmcsr_reg_write() superfluous.
    
    upstream-commit-id: 55c8672c2e65276c19edd3323076518248730cca
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen/xen_pt.h             |    2 ++
 hw/xen/xen_pt_config_init.c |   38 ++++++++++++--------------------------
 2 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h
index 4f922f4..3749711 100644
--- a/hw/xen/xen_pt.h
+++ b/hw/xen/xen_pt.h
@@ -113,6 +113,8 @@ struct XenPTRegInfo {
     uint32_t res_mask;
     /* reg read only field mask (ON:RO/ROS, OFF:other) */
     uint32_t ro_mask;
+    /* reg read/write-1-clear field mask (ON:RW1C/RW1CS, OFF:other) */
+    uint32_t rw1c_mask;
     /* reg emulate field mask (ON:emu, OFF:passthrough) */
     uint32_t emu_mask;
     xen_pt_conf_reg_init init;
diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
index 7b42f41..a6100b1 100644
--- a/hw/xen/xen_pt_config_init.c
+++ b/hw/xen/xen_pt_config_init.c
@@ -179,7 +179,8 @@ static int xen_pt_byte_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry,
     *data = XEN_PT_MERGE_VALUE(*val, *data, writable_mask);
 
     /* create value for writing to I/O device register */
-    *val = XEN_PT_MERGE_VALUE(*val, dev_value, throughable_mask);
+    *val = XEN_PT_MERGE_VALUE(*val, dev_value & ~reg->rw1c_mask,
+                              throughable_mask);
 
     return 0;
 }
@@ -197,7 +198,8 @@ static int xen_pt_word_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry,
     *data = XEN_PT_MERGE_VALUE(*val, *data, writable_mask);
 
     /* create value for writing to I/O device register */
-    *val = XEN_PT_MERGE_VALUE(*val, dev_value, throughable_mask);
+    *val = XEN_PT_MERGE_VALUE(*val, dev_value & ~reg->rw1c_mask,
+                              throughable_mask);
 
     return 0;
 }
@@ -215,7 +217,8 @@ static int xen_pt_long_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry,
     *data = XEN_PT_MERGE_VALUE(*val, *data, writable_mask);
 
     /* create value for writing to I/O device register */
-    *val = XEN_PT_MERGE_VALUE(*val, dev_value, throughable_mask);
+    *val = XEN_PT_MERGE_VALUE(*val, dev_value & ~reg->rw1c_mask,
+                              throughable_mask);
 
     return 0;
 }
@@ -633,6 +636,7 @@ static XenPTRegInfo xen_pt_emu_reg_header0[] = {
         .init_val   = 0x0000,
         .res_mask   = 0x0007,
         .ro_mask    = 0x06F8,
+        .rw1c_mask  = 0xF900,
         .emu_mask   = 0x0010,
         .init       = xen_pt_status_reg_init,
         .u.w.read   = xen_pt_word_reg_read,
@@ -944,6 +948,7 @@ static XenPTRegInfo xen_pt_emu_reg_pcie[] = {
         .size       = 2,
         .res_mask   = 0xFFC0,
         .ro_mask    = 0x0030,
+        .rw1c_mask  = 0x000F,
         .init       = xen_pt_common_reg_init,
         .u.w.read   = xen_pt_word_reg_read,
         .u.w.write  = xen_pt_word_reg_write,
@@ -964,6 +969,7 @@ static XenPTRegInfo xen_pt_emu_reg_pcie[] = {
         .offset     = PCI_EXP_LNKSTA,
         .size       = 2,
         .ro_mask    = 0x3FFF,
+        .rw1c_mask  = 0xC000,
         .init       = xen_pt_common_reg_init,
         .u.w.read   = xen_pt_word_reg_read,
         .u.w.write  = xen_pt_word_reg_write,
@@ -1000,27 +1006,6 @@ static XenPTRegInfo xen_pt_emu_reg_pcie[] = {
  * Power Management Capability
  */
 
-/* write Power Management Control/Status register */
-static int xen_pt_pmcsr_reg_write(XenPCIPassthroughState *s,
-                                  XenPTReg *cfg_entry, uint16_t *val,
-                                  uint16_t dev_value, uint16_t valid_mask)
-{
-    XenPTRegInfo *reg = cfg_entry->reg;
-    uint16_t writable_mask = 0;
-    uint16_t throughable_mask = get_throughable_mask(s, reg, valid_mask);
-    uint16_t *data = cfg_entry->ptr.half_word;
-
-    /* modify emulate register */
-    writable_mask = reg->emu_mask & ~reg->ro_mask & valid_mask;
-    *data = XEN_PT_MERGE_VALUE(*val, *data, writable_mask);
-
-    /* create value for writing to I/O device register */
-    *val = XEN_PT_MERGE_VALUE(*val, dev_value & ~PCI_PM_CTRL_PME_STATUS,
-                              throughable_mask);
-
-    return 0;
-}
-
 /* Power Management Capability reg static information table */
 static XenPTRegInfo xen_pt_emu_reg_pm[] = {
     /* Next Pointer reg */
@@ -1051,11 +1036,12 @@ static XenPTRegInfo xen_pt_emu_reg_pm[] = {
         .size       = 2,
         .init_val   = 0x0008,
         .res_mask   = 0x00F0,
-        .ro_mask    = 0xE10C,
+        .ro_mask    = 0x610C,
+        .rw1c_mask  = 0x8000,
         .emu_mask   = 0x810B,
         .init       = xen_pt_common_reg_init,
         .u.w.read   = xen_pt_word_reg_read,
-        .u.w.write  = xen_pt_pmcsr_reg_write,
+        .u.w.write  = xen_pt_word_reg_write,
     },
     {
         .size = 0,
--
generated by git-patchbot for /home/xen/git/qemu-xen.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 Jan 20 13:00:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Jan 2016 13:00: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 1aLsMu-0007fy-5z; Wed, 20 Jan 2016 13:00: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 1aLsMt-0007fj-69
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 13:00:11 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	8F/13-07165-6D48F965; Wed, 20 Jan 2016 13:00:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1453294804!18092088!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23481 invoked from network); 20 Jan 2016 13:00:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2016 13:00:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLsNN-00048u-Jr
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 13:00:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLsMl-0006LP-Sq
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 13:00:04 +0000
Date: Wed, 20 Jan 2016 13:00:03 +0000
Message-Id: <E1aLsMl-0006LP-Sq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] oxenstored: Quota.merge: don't
	assume domain already 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 ba391da2e7c68aad131159c90733e0d39b85ed37
Author:     Jonathan Davies <jonathan.davies@citrix.com>
AuthorDate: Wed Nov 11 11:21:53 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Jan 19 13:41:21 2016 +0000

    oxenstored: Quota.merge: don't assume domain already exists
    
    In Quota.merge, we merge two quota hashtables, orig_quota and mod_quota, putting
    the results into dest_quota. These hashtables map domids to the number of
    entries currently owned by that domain.
    
    When mod_quota contains an entry for a domid that was not present in orig_quota
    (or dest_quota), the call to get_entry caused Quota.merge to raise a Not_found
    exception. This propagates back to the client as an ENOENT error, which is not
    an appropriate return value from some operations, such as transaction_end.
    
    This situation can arise when a transaction that introduces a domain (hence
    calling Quota.add_entry) needs to be coalesced due to concurrent xenstore
    activity.
    
    This patch handles the merge in the case where mod_quota contains an entry not
    present in orig_quota (or in dest_quota) by treating that hashtable as having
    existing value 0.
    
    Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 82ff7cbed64e3cc094d6812b3ad672c660649969)
---
 tools/ocaml/xenstored/quota.ml |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/quota.ml b/tools/ocaml/xenstored/quota.ml
index e6953c6..abcac91 100644
--- a/tools/ocaml/xenstored/quota.ml
+++ b/tools/ocaml/xenstored/quota.ml
@@ -83,6 +83,6 @@ let add quota diff =
 	Hashtbl.iter (fun id nb -> set_entry quota id (get_entry quota id + nb)) diff.cur
 
 let merge orig_quota mod_quota dest_quota =
-	  Hashtbl.iter (fun id nb -> let diff = nb - (get_entry orig_quota id) in
+	  Hashtbl.iter (fun id nb -> let diff = nb - (try get_entry orig_quota id with Not_found -> 0) in
 				if diff <> 0 then
-					set_entry dest_quota id ((get_entry dest_quota id) + diff)) mod_quota.cur
+					set_entry dest_quota id ((try get_entry dest_quota id with Not_found -> 0) + diff)) mod_quota.cur
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Jan 20 13:00:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Jan 2016 13:00: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 1aLsMu-0007fy-5z; Wed, 20 Jan 2016 13:00: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 1aLsMt-0007fj-69
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 13:00:11 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	8F/13-07165-6D48F965; Wed, 20 Jan 2016 13:00:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1453294804!18092088!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23481 invoked from network); 20 Jan 2016 13:00:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2016 13:00:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLsNN-00048u-Jr
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 13:00:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLsMl-0006LP-Sq
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 13:00:04 +0000
Date: Wed, 20 Jan 2016 13:00:03 +0000
Message-Id: <E1aLsMl-0006LP-Sq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] oxenstored: Quota.merge: don't
	assume domain already 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 ba391da2e7c68aad131159c90733e0d39b85ed37
Author:     Jonathan Davies <jonathan.davies@citrix.com>
AuthorDate: Wed Nov 11 11:21:53 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Jan 19 13:41:21 2016 +0000

    oxenstored: Quota.merge: don't assume domain already exists
    
    In Quota.merge, we merge two quota hashtables, orig_quota and mod_quota, putting
    the results into dest_quota. These hashtables map domids to the number of
    entries currently owned by that domain.
    
    When mod_quota contains an entry for a domid that was not present in orig_quota
    (or dest_quota), the call to get_entry caused Quota.merge to raise a Not_found
    exception. This propagates back to the client as an ENOENT error, which is not
    an appropriate return value from some operations, such as transaction_end.
    
    This situation can arise when a transaction that introduces a domain (hence
    calling Quota.add_entry) needs to be coalesced due to concurrent xenstore
    activity.
    
    This patch handles the merge in the case where mod_quota contains an entry not
    present in orig_quota (or in dest_quota) by treating that hashtable as having
    existing value 0.
    
    Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 82ff7cbed64e3cc094d6812b3ad672c660649969)
---
 tools/ocaml/xenstored/quota.ml |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/quota.ml b/tools/ocaml/xenstored/quota.ml
index e6953c6..abcac91 100644
--- a/tools/ocaml/xenstored/quota.ml
+++ b/tools/ocaml/xenstored/quota.ml
@@ -83,6 +83,6 @@ let add quota diff =
 	Hashtbl.iter (fun id nb -> set_entry quota id (get_entry quota id + nb)) diff.cur
 
 let merge orig_quota mod_quota dest_quota =
-	  Hashtbl.iter (fun id nb -> let diff = nb - (get_entry orig_quota id) in
+	  Hashtbl.iter (fun id nb -> let diff = nb - (try get_entry orig_quota id with Not_found -> 0) in
 				if diff <> 0 then
-					set_entry dest_quota id ((get_entry dest_quota id) + diff)) mod_quota.cur
+					set_entry dest_quota id ((try get_entry dest_quota id with Not_found -> 0) + diff)) mod_quota.cur
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Jan 20 13:00:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Jan 2016 13:00: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 1aLsN6-0007hR-Aj; Wed, 20 Jan 2016 13:00: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 1aLsN4-0007hF-LX
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 13:00:22 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	4E/6E-09708-5E48F965; Wed, 20 Jan 2016 13:00:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1453294815!11240062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47715 invoked from network); 20 Jan 2016 13:00:20 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2016 13:00:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLsNX-00048y-Vj
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 13:00:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLsMw-0006M7-RI
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 13:00:14 +0000
Date: Wed, 20 Jan 2016 13:00:14 +0000
Message-Id: <E1aLsMw-0006M7-RI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] tools/ocaml/xb: Correct
	calculations of data/space the ring
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6150df9f3f99ecbcbd9917002186d1d895b5602e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 10 10:46:44 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Jan 19 13:41:47 2016 +0000

    tools/ocaml/xb: Correct calculations of data/space the ring
    
    ml_interface_{read,write}() would miscalculate the quantity of
    data/space in the ring if it crossed the ring boundary, and incorrectly
    return a short read/write.
    
    This causes a protocol stall, as either side of the ring ends up waiting
    for what they believe to be the other side needing to take the next
    action.
    
    Correct the calculations to cope with crossing the ring boundary.
    
    In addition, correct the error detection.  It is a hard error if the
    producer index gets more than a ring size ahead of the consumer, or if
    the consumer ever overtakes the producer.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Reviewed-by: David Scott <dave@recoil.org>
    (cherry picked from commit 8a2c11f876e6cf9c74f2bcaed5a997adc57da888)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c |   64 ++++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index fd561a2..4737870 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -50,7 +50,7 @@ CAMLprim value ml_interface_read(value ml_interface,
 
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod; /* offsets only */
-	int to_read;
+	int total_data, data;
 	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->req_cons;
@@ -65,19 +65,28 @@ CAMLprim value ml_interface_read(value ml_interface,
 	if ((prod - cons) > XENSTORE_RING_SIZE)
 		caml_failwith("bad connection");
 
-	if (prod == cons) {
+	/* Check for any pending data at all. */
+	total_data = prod - cons;
+	if (total_data == 0) {
+		/* No pending data at all. */
 		result = 0;
 		goto exit;
 	}
-	cons = MASK_XENSTORE_IDX(cons);
-	prod = MASK_XENSTORE_IDX(prod);
-	if (prod > cons)
-		to_read = prod - cons;
-	else
-		to_read = XENSTORE_RING_SIZE - cons;
-	if (to_read < len)
-		len = to_read;
-	memcpy(buffer, intf->req + cons, len);
+	else if (total_data < len)
+		/* Some data - make a partial read. */
+		len = total_data;
+
+	/* Check whether data crosses the end of the ring. */
+	data = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(cons);
+	if (len < data)
+		/* Data within the remaining part of the ring. */
+		memcpy(buffer, intf->req + MASK_XENSTORE_IDX(cons), len);
+	else {
+		/* Data crosses the ring boundary. Read both halves. */
+		memcpy(buffer, intf->req + MASK_XENSTORE_IDX(cons), data);
+		memcpy(buffer + data, intf->req, len - data);
+	}
+
 	xen_mb();
 	intf->req_cons += len;
 	result = len;
@@ -100,7 +109,7 @@ CAMLprim value ml_interface_write(value ml_interface,
 
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod;
-	int can_write;
+	int total_space, space;
 	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->rsp_cons;
@@ -111,17 +120,32 @@ CAMLprim value ml_interface_write(value ml_interface,
 		caml_raise_constant(*caml_named_value("Xb.Reconnect"));
 
 	xen_mb();
-	if ( (prod - cons) >= XENSTORE_RING_SIZE ) {
+
+	if ((prod - cons) > XENSTORE_RING_SIZE)
+		caml_failwith("bad connection");
+
+	/* Check for space to write the full message. */
+	total_space = XENSTORE_RING_SIZE - (prod - cons);
+	if (total_space == 0) {
+		/* No space at all - exit having done nothing. */
 		result = 0;
 		goto exit;
 	}
-	if (MASK_XENSTORE_IDX(prod) >= MASK_XENSTORE_IDX(cons))
-		can_write = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
-	else 
-		can_write = MASK_XENSTORE_IDX(cons) - MASK_XENSTORE_IDX(prod);
-	if (can_write < len)
-		len = can_write;
-	memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
+	else if (total_space < len)
+		/* Some space - make a partial write. */
+		len = total_space;
+
+	/* Check for space until the ring wraps. */
+	space = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
+	if (len < space)
+		/* Message fits inside the remaining part of the ring. */
+		memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
+	else {
+		/* Message wraps around the end of the ring. Write both halves. */
+		memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, space);
+		memcpy(intf->rsp, buffer + space, len - space);
+	}
+
 	xen_mb();
 	intf->rsp_prod += len;
 	result = len;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Jan 20 13:00:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Jan 2016 13:00: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 1aLsN6-0007hR-Aj; Wed, 20 Jan 2016 13:00: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 1aLsN4-0007hF-LX
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 13:00:22 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	4E/6E-09708-5E48F965; Wed, 20 Jan 2016 13:00:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1453294815!11240062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47715 invoked from network); 20 Jan 2016 13:00:20 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2016 13:00:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLsNX-00048y-Vj
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 13:00:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aLsMw-0006M7-RI
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 13:00:14 +0000
Date: Wed, 20 Jan 2016 13:00:14 +0000
Message-Id: <E1aLsMw-0006M7-RI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] tools/ocaml/xb: Correct
	calculations of data/space the ring
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6150df9f3f99ecbcbd9917002186d1d895b5602e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 10 10:46:44 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Jan 19 13:41:47 2016 +0000

    tools/ocaml/xb: Correct calculations of data/space the ring
    
    ml_interface_{read,write}() would miscalculate the quantity of
    data/space in the ring if it crossed the ring boundary, and incorrectly
    return a short read/write.
    
    This causes a protocol stall, as either side of the ring ends up waiting
    for what they believe to be the other side needing to take the next
    action.
    
    Correct the calculations to cope with crossing the ring boundary.
    
    In addition, correct the error detection.  It is a hard error if the
    producer index gets more than a ring size ahead of the consumer, or if
    the consumer ever overtakes the producer.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Reviewed-by: David Scott <dave@recoil.org>
    (cherry picked from commit 8a2c11f876e6cf9c74f2bcaed5a997adc57da888)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c |   64 ++++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index fd561a2..4737870 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -50,7 +50,7 @@ CAMLprim value ml_interface_read(value ml_interface,
 
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod; /* offsets only */
-	int to_read;
+	int total_data, data;
 	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->req_cons;
@@ -65,19 +65,28 @@ CAMLprim value ml_interface_read(value ml_interface,
 	if ((prod - cons) > XENSTORE_RING_SIZE)
 		caml_failwith("bad connection");
 
-	if (prod == cons) {
+	/* Check for any pending data at all. */
+	total_data = prod - cons;
+	if (total_data == 0) {
+		/* No pending data at all. */
 		result = 0;
 		goto exit;
 	}
-	cons = MASK_XENSTORE_IDX(cons);
-	prod = MASK_XENSTORE_IDX(prod);
-	if (prod > cons)
-		to_read = prod - cons;
-	else
-		to_read = XENSTORE_RING_SIZE - cons;
-	if (to_read < len)
-		len = to_read;
-	memcpy(buffer, intf->req + cons, len);
+	else if (total_data < len)
+		/* Some data - make a partial read. */
+		len = total_data;
+
+	/* Check whether data crosses the end of the ring. */
+	data = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(cons);
+	if (len < data)
+		/* Data within the remaining part of the ring. */
+		memcpy(buffer, intf->req + MASK_XENSTORE_IDX(cons), len);
+	else {
+		/* Data crosses the ring boundary. Read both halves. */
+		memcpy(buffer, intf->req + MASK_XENSTORE_IDX(cons), data);
+		memcpy(buffer + data, intf->req, len - data);
+	}
+
 	xen_mb();
 	intf->req_cons += len;
 	result = len;
@@ -100,7 +109,7 @@ CAMLprim value ml_interface_write(value ml_interface,
 
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod;
-	int can_write;
+	int total_space, space;
 	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->rsp_cons;
@@ -111,17 +120,32 @@ CAMLprim value ml_interface_write(value ml_interface,
 		caml_raise_constant(*caml_named_value("Xb.Reconnect"));
 
 	xen_mb();
-	if ( (prod - cons) >= XENSTORE_RING_SIZE ) {
+
+	if ((prod - cons) > XENSTORE_RING_SIZE)
+		caml_failwith("bad connection");
+
+	/* Check for space to write the full message. */
+	total_space = XENSTORE_RING_SIZE - (prod - cons);
+	if (total_space == 0) {
+		/* No space at all - exit having done nothing. */
 		result = 0;
 		goto exit;
 	}
-	if (MASK_XENSTORE_IDX(prod) >= MASK_XENSTORE_IDX(cons))
-		can_write = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
-	else 
-		can_write = MASK_XENSTORE_IDX(cons) - MASK_XENSTORE_IDX(prod);
-	if (can_write < len)
-		len = can_write;
-	memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
+	else if (total_space < len)
+		/* Some space - make a partial write. */
+		len = total_space;
+
+	/* Check for space until the ring wraps. */
+	space = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
+	if (len < space)
+		/* Message fits inside the remaining part of the ring. */
+		memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
+	else {
+		/* Message wraps around the end of the ring. Write both halves. */
+		memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, space);
+		memcpy(intf->rsp, buffer + space, len - space);
+	}
+
 	xen_mb();
 	intf->rsp_prod += len;
 	result = len;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Jan 20 22:22:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Jan 2016 22:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aM18k-0003gc-23; Wed, 20 Jan 2016 22:22: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 1aM18i-0003gU-Em
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 22:22:08 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	3A/7C-02807-F8800A65; Wed, 20 Jan 2016 22:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1453328525!9626371!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35503 invoked from network); 20 Jan 2016 22:22:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2016 22:22:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aM19H-0000QN-Ml
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 22:22:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aM18e-0005IV-M8
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 22:22:05 +0000
Date: Wed, 20 Jan 2016 22:22:04 +0000
Message-Id: <E1aM18e-0005IV-M8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] oxenstored: Quota.merge: don't
	assume domain already 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 d603cb9ca5cc80eecfac14f8e4312dbb2f0d7a08
Author:     Jonathan Davies <jonathan.davies@citrix.com>
AuthorDate: Wed Nov 11 11:21:53 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Jan 19 13:42:32 2016 +0000

    oxenstored: Quota.merge: don't assume domain already exists
    
    In Quota.merge, we merge two quota hashtables, orig_quota and mod_quota, putting
    the results into dest_quota. These hashtables map domids to the number of
    entries currently owned by that domain.
    
    When mod_quota contains an entry for a domid that was not present in orig_quota
    (or dest_quota), the call to get_entry caused Quota.merge to raise a Not_found
    exception. This propagates back to the client as an ENOENT error, which is not
    an appropriate return value from some operations, such as transaction_end.
    
    This situation can arise when a transaction that introduces a domain (hence
    calling Quota.add_entry) needs to be coalesced due to concurrent xenstore
    activity.
    
    This patch handles the merge in the case where mod_quota contains an entry not
    present in orig_quota (or in dest_quota) by treating that hashtable as having
    existing value 0.
    
    Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 82ff7cbed64e3cc094d6812b3ad672c660649969)
    (cherry picked from commit ba391da2e7c68aad131159c90733e0d39b85ed37)
---
 tools/ocaml/xenstored/quota.ml |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/quota.ml b/tools/ocaml/xenstored/quota.ml
index e6953c6..abcac91 100644
--- a/tools/ocaml/xenstored/quota.ml
+++ b/tools/ocaml/xenstored/quota.ml
@@ -83,6 +83,6 @@ let add quota diff =
 	Hashtbl.iter (fun id nb -> set_entry quota id (get_entry quota id + nb)) diff.cur
 
 let merge orig_quota mod_quota dest_quota =
-	  Hashtbl.iter (fun id nb -> let diff = nb - (get_entry orig_quota id) in
+	  Hashtbl.iter (fun id nb -> let diff = nb - (try get_entry orig_quota id with Not_found -> 0) in
 				if diff <> 0 then
-					set_entry dest_quota id ((get_entry dest_quota id) + diff)) mod_quota.cur
+					set_entry dest_quota id ((try get_entry dest_quota id with Not_found -> 0) + diff)) mod_quota.cur
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Wed Jan 20 22:22:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Jan 2016 22:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aM18k-0003gc-23; Wed, 20 Jan 2016 22:22: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 1aM18i-0003gU-Em
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 22:22:08 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	3A/7C-02807-F8800A65; Wed, 20 Jan 2016 22:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1453328525!9626371!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35503 invoked from network); 20 Jan 2016 22:22:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2016 22:22:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aM19H-0000QN-Ml
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 22:22:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aM18e-0005IV-M8
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 22:22:05 +0000
Date: Wed, 20 Jan 2016 22:22:04 +0000
Message-Id: <E1aM18e-0005IV-M8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] oxenstored: Quota.merge: don't
	assume domain already 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 d603cb9ca5cc80eecfac14f8e4312dbb2f0d7a08
Author:     Jonathan Davies <jonathan.davies@citrix.com>
AuthorDate: Wed Nov 11 11:21:53 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Jan 19 13:42:32 2016 +0000

    oxenstored: Quota.merge: don't assume domain already exists
    
    In Quota.merge, we merge two quota hashtables, orig_quota and mod_quota, putting
    the results into dest_quota. These hashtables map domids to the number of
    entries currently owned by that domain.
    
    When mod_quota contains an entry for a domid that was not present in orig_quota
    (or dest_quota), the call to get_entry caused Quota.merge to raise a Not_found
    exception. This propagates back to the client as an ENOENT error, which is not
    an appropriate return value from some operations, such as transaction_end.
    
    This situation can arise when a transaction that introduces a domain (hence
    calling Quota.add_entry) needs to be coalesced due to concurrent xenstore
    activity.
    
    This patch handles the merge in the case where mod_quota contains an entry not
    present in orig_quota (or in dest_quota) by treating that hashtable as having
    existing value 0.
    
    Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 82ff7cbed64e3cc094d6812b3ad672c660649969)
    (cherry picked from commit ba391da2e7c68aad131159c90733e0d39b85ed37)
---
 tools/ocaml/xenstored/quota.ml |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/quota.ml b/tools/ocaml/xenstored/quota.ml
index e6953c6..abcac91 100644
--- a/tools/ocaml/xenstored/quota.ml
+++ b/tools/ocaml/xenstored/quota.ml
@@ -83,6 +83,6 @@ let add quota diff =
 	Hashtbl.iter (fun id nb -> set_entry quota id (get_entry quota id + nb)) diff.cur
 
 let merge orig_quota mod_quota dest_quota =
-	  Hashtbl.iter (fun id nb -> let diff = nb - (get_entry orig_quota id) in
+	  Hashtbl.iter (fun id nb -> let diff = nb - (try get_entry orig_quota id with Not_found -> 0) in
 				if diff <> 0 then
-					set_entry dest_quota id ((get_entry dest_quota id) + diff)) mod_quota.cur
+					set_entry dest_quota id ((try get_entry dest_quota id with Not_found -> 0) + diff)) mod_quota.cur
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Wed Jan 20 22:22:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Jan 2016 22:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aM18u-0003i7-6s; Wed, 20 Jan 2016 22:22: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 1aM18t-0003hk-0x
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 22:22:19 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	B9/C0-23366-A9800A65; Wed, 20 Jan 2016 22:22:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1453328536!18268958!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49664 invoked from network); 20 Jan 2016 22:22:17 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2016 22:22:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aM19S-0000QV-3x
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 22:22:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aM18p-0005Ja-UO
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 22:22:15 +0000
Date: Wed, 20 Jan 2016 22:22:15 +0000
Message-Id: <E1aM18p-0005Ja-UO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] tools/ocaml/xb: Correct
	calculations of data/space the ring
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a34fbcf30bbe5a9aa8b57d21e7afcfa7b78c520a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 10 10:46:44 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Jan 19 13:42:34 2016 +0000

    tools/ocaml/xb: Correct calculations of data/space the ring
    
    ml_interface_{read,write}() would miscalculate the quantity of
    data/space in the ring if it crossed the ring boundary, and incorrectly
    return a short read/write.
    
    This causes a protocol stall, as either side of the ring ends up waiting
    for what they believe to be the other side needing to take the next
    action.
    
    Correct the calculations to cope with crossing the ring boundary.
    
    In addition, correct the error detection.  It is a hard error if the
    producer index gets more than a ring size ahead of the consumer, or if
    the consumer ever overtakes the producer.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Reviewed-by: David Scott <dave@recoil.org>
    (cherry picked from commit 8a2c11f876e6cf9c74f2bcaed5a997adc57da888)
    (cherry picked from commit 6150df9f3f99ecbcbd9917002186d1d895b5602e)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c |   64 ++++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index fc9b0c5..3ebd6d0 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -50,7 +50,7 @@ CAMLprim value ml_interface_read(value ml_interface,
 
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod; /* offsets only */
-	int to_read;
+	int total_data, data;
 	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->req_cons;
@@ -65,19 +65,28 @@ CAMLprim value ml_interface_read(value ml_interface,
 	if ((prod - cons) > XENSTORE_RING_SIZE)
 		caml_failwith("bad connection");
 
-	if (prod == cons) {
+	/* Check for any pending data at all. */
+	total_data = prod - cons;
+	if (total_data == 0) {
+		/* No pending data at all. */
 		result = 0;
 		goto exit;
 	}
-	cons = MASK_XENSTORE_IDX(cons);
-	prod = MASK_XENSTORE_IDX(prod);
-	if (prod > cons)
-		to_read = prod - cons;
-	else
-		to_read = XENSTORE_RING_SIZE - cons;
-	if (to_read < len)
-		len = to_read;
-	memcpy(buffer, intf->req + cons, len);
+	else if (total_data < len)
+		/* Some data - make a partial read. */
+		len = total_data;
+
+	/* Check whether data crosses the end of the ring. */
+	data = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(cons);
+	if (len < data)
+		/* Data within the remaining part of the ring. */
+		memcpy(buffer, intf->req + MASK_XENSTORE_IDX(cons), len);
+	else {
+		/* Data crosses the ring boundary. Read both halves. */
+		memcpy(buffer, intf->req + MASK_XENSTORE_IDX(cons), data);
+		memcpy(buffer + data, intf->req, len - data);
+	}
+
 	xen_mb();
 	intf->req_cons += len;
 	result = len;
@@ -100,7 +109,7 @@ CAMLprim value ml_interface_write(value ml_interface,
 
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod;
-	int can_write;
+	int total_space, space;
 	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->rsp_cons;
@@ -111,17 +120,32 @@ CAMLprim value ml_interface_write(value ml_interface,
 		caml_raise_constant(*caml_named_value("Xb.Reconnect"));
 
 	xen_mb();
-	if ( (prod - cons) >= XENSTORE_RING_SIZE ) {
+
+	if ((prod - cons) > XENSTORE_RING_SIZE)
+		caml_failwith("bad connection");
+
+	/* Check for space to write the full message. */
+	total_space = XENSTORE_RING_SIZE - (prod - cons);
+	if (total_space == 0) {
+		/* No space at all - exit having done nothing. */
 		result = 0;
 		goto exit;
 	}
-	if (MASK_XENSTORE_IDX(prod) >= MASK_XENSTORE_IDX(cons))
-		can_write = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
-	else 
-		can_write = MASK_XENSTORE_IDX(cons) - MASK_XENSTORE_IDX(prod);
-	if (can_write < len)
-		len = can_write;
-	memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
+	else if (total_space < len)
+		/* Some space - make a partial write. */
+		len = total_space;
+
+	/* Check for space until the ring wraps. */
+	space = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
+	if (len < space)
+		/* Message fits inside the remaining part of the ring. */
+		memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
+	else {
+		/* Message wraps around the end of the ring. Write both halves. */
+		memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, space);
+		memcpy(intf->rsp, buffer + space, len - space);
+	}
+
 	xen_mb();
 	intf->rsp_prod += len;
 	result = len;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Wed Jan 20 22:22:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 Jan 2016 22:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aM18u-0003i7-6s; Wed, 20 Jan 2016 22:22: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 1aM18t-0003hk-0x
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 22:22:19 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	B9/C0-23366-A9800A65; Wed, 20 Jan 2016 22:22:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1453328536!18268958!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49664 invoked from network); 20 Jan 2016 22:22:17 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jan 2016 22:22:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aM19S-0000QV-3x
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 22:22:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aM18p-0005Ja-UO
	for xen-changelog@lists.xensource.com; Wed, 20 Jan 2016 22:22:15 +0000
Date: Wed, 20 Jan 2016 22:22:15 +0000
Message-Id: <E1aM18p-0005Ja-UO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] tools/ocaml/xb: Correct
	calculations of data/space the ring
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a34fbcf30bbe5a9aa8b57d21e7afcfa7b78c520a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 10 10:46:44 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Jan 19 13:42:34 2016 +0000

    tools/ocaml/xb: Correct calculations of data/space the ring
    
    ml_interface_{read,write}() would miscalculate the quantity of
    data/space in the ring if it crossed the ring boundary, and incorrectly
    return a short read/write.
    
    This causes a protocol stall, as either side of the ring ends up waiting
    for what they believe to be the other side needing to take the next
    action.
    
    Correct the calculations to cope with crossing the ring boundary.
    
    In addition, correct the error detection.  It is a hard error if the
    producer index gets more than a ring size ahead of the consumer, or if
    the consumer ever overtakes the producer.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Reviewed-by: David Scott <dave@recoil.org>
    (cherry picked from commit 8a2c11f876e6cf9c74f2bcaed5a997adc57da888)
    (cherry picked from commit 6150df9f3f99ecbcbd9917002186d1d895b5602e)
---
 tools/ocaml/libs/xb/xs_ring_stubs.c |   64 ++++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index fc9b0c5..3ebd6d0 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -50,7 +50,7 @@ CAMLprim value ml_interface_read(value ml_interface,
 
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod; /* offsets only */
-	int to_read;
+	int total_data, data;
 	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->req_cons;
@@ -65,19 +65,28 @@ CAMLprim value ml_interface_read(value ml_interface,
 	if ((prod - cons) > XENSTORE_RING_SIZE)
 		caml_failwith("bad connection");
 
-	if (prod == cons) {
+	/* Check for any pending data at all. */
+	total_data = prod - cons;
+	if (total_data == 0) {
+		/* No pending data at all. */
 		result = 0;
 		goto exit;
 	}
-	cons = MASK_XENSTORE_IDX(cons);
-	prod = MASK_XENSTORE_IDX(prod);
-	if (prod > cons)
-		to_read = prod - cons;
-	else
-		to_read = XENSTORE_RING_SIZE - cons;
-	if (to_read < len)
-		len = to_read;
-	memcpy(buffer, intf->req + cons, len);
+	else if (total_data < len)
+		/* Some data - make a partial read. */
+		len = total_data;
+
+	/* Check whether data crosses the end of the ring. */
+	data = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(cons);
+	if (len < data)
+		/* Data within the remaining part of the ring. */
+		memcpy(buffer, intf->req + MASK_XENSTORE_IDX(cons), len);
+	else {
+		/* Data crosses the ring boundary. Read both halves. */
+		memcpy(buffer, intf->req + MASK_XENSTORE_IDX(cons), data);
+		memcpy(buffer + data, intf->req, len - data);
+	}
+
 	xen_mb();
 	intf->req_cons += len;
 	result = len;
@@ -100,7 +109,7 @@ CAMLprim value ml_interface_write(value ml_interface,
 
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod;
-	int can_write;
+	int total_space, space;
 	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->rsp_cons;
@@ -111,17 +120,32 @@ CAMLprim value ml_interface_write(value ml_interface,
 		caml_raise_constant(*caml_named_value("Xb.Reconnect"));
 
 	xen_mb();
-	if ( (prod - cons) >= XENSTORE_RING_SIZE ) {
+
+	if ((prod - cons) > XENSTORE_RING_SIZE)
+		caml_failwith("bad connection");
+
+	/* Check for space to write the full message. */
+	total_space = XENSTORE_RING_SIZE - (prod - cons);
+	if (total_space == 0) {
+		/* No space at all - exit having done nothing. */
 		result = 0;
 		goto exit;
 	}
-	if (MASK_XENSTORE_IDX(prod) >= MASK_XENSTORE_IDX(cons))
-		can_write = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
-	else 
-		can_write = MASK_XENSTORE_IDX(cons) - MASK_XENSTORE_IDX(prod);
-	if (can_write < len)
-		len = can_write;
-	memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
+	else if (total_space < len)
+		/* Some space - make a partial write. */
+		len = total_space;
+
+	/* Check for space until the ring wraps. */
+	space = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
+	if (len < space)
+		/* Message fits inside the remaining part of the ring. */
+		memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
+	else {
+		/* Message wraps around the end of the ring. Write both halves. */
+		memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, space);
+		memcpy(intf->rsp, buffer + space, len - space);
+	}
+
 	xen_mb();
 	intf->rsp_prod += len;
 	result = len;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 11:22:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 11: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 1aMDJZ-000659-Hm; Thu, 21 Jan 2016 11:22: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 1aMDJY-00064Z-Nc
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:08 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	39/29-12635-F5FB0A65; Thu, 21 Jan 2016 11:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1453375326!17252466!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51689 invoked from network); 21 Jan 2016 11:22:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 11:22:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMDK9-0000EN-EI
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMDJV-0006Qg-9n
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:05 +0000
Date: Thu, 21 Jan 2016 11:22:05 +0000
Message-Id: <E1aMDJV-0006Qg-9n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/mm: PV superpage handling
	lacks sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 12fe3633c970fa83724599ee7b1b610c912eb837
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:08:27 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:08:27 2016 +0100

    x86/mm: PV superpage handling lacks sanity checks
    
    MMUEXT_{,UN}MARK_SUPER fail to check the input MFN for validity before
    dereferencing pointers into the superpage frame table.
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    
    get_superpage() has a similar issue.
    
    This is CVE-2016-1570 / XSA-167.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 47abf29a9255b2e7b94e56d66b455d0a584b68b8
    master date: 2016-01-20 13:49:23 +0100
---
 xen/arch/x86/mm.c |   29 +++++++----------------------
 1 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index dfae2e7..9f96be8 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2566,6 +2566,9 @@ int get_superpage(unsigned long mfn, struct domain *d)
 
     ASSERT(opt_allow_superpage);
 
+    if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+        return -EINVAL;
+
     spage = mfn_to_spage(mfn);
     y = spage->type_info;
     do {
@@ -3320,14 +3323,6 @@ long do_mmuext_op(
             unsigned long mfn;
             struct spage_info *spage;
 
-            mfn = op.arg1.mfn;
-            if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
-            {
-                MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
-                break;
-            }
-
             if ( !opt_allow_superpage )
             {
                 MEM_LOG("Superpages disallowed");
@@ -3336,16 +3331,6 @@ long do_mmuext_op(
                 break;
             }
 
-            spage = mfn_to_spage(mfn);
-            okay = (mark_superpage(spage, d) >= 0);
-            break;
-        }
-
-        case MMUEXT_UNMARK_SUPER:
-        {
-            unsigned long mfn;
-            struct spage_info *spage;
-
             mfn = op.arg1.mfn;
             if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
             {
@@ -3354,16 +3339,16 @@ long do_mmuext_op(
                 break;
             }
 
-            if ( !opt_allow_superpage )
+            if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
             {
-                MEM_LOG("Superpages disallowed");
                 okay = 0;
-                rc = -ENOSYS;
                 break;
             }
 
             spage = mfn_to_spage(mfn);
-            okay = (unmark_superpage(spage) >= 0);
+            okay = ((op.cmd == MMUEXT_MARK_SUPER
+                    ? mark_superpage(spage, d)
+                    : unmark_superpage(spage)) >= 0);
             break;
         }
 
--
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 Jan 21 11:22:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 11: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 1aMDJZ-000659-Hm; Thu, 21 Jan 2016 11:22: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 1aMDJY-00064Z-Nc
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:08 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	39/29-12635-F5FB0A65; Thu, 21 Jan 2016 11:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1453375326!17252466!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51689 invoked from network); 21 Jan 2016 11:22:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 11:22:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMDK9-0000EN-EI
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMDJV-0006Qg-9n
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:05 +0000
Date: Thu, 21 Jan 2016 11:22:05 +0000
Message-Id: <E1aMDJV-0006Qg-9n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/mm: PV superpage handling
	lacks sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 12fe3633c970fa83724599ee7b1b610c912eb837
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:08:27 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:08:27 2016 +0100

    x86/mm: PV superpage handling lacks sanity checks
    
    MMUEXT_{,UN}MARK_SUPER fail to check the input MFN for validity before
    dereferencing pointers into the superpage frame table.
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    
    get_superpage() has a similar issue.
    
    This is CVE-2016-1570 / XSA-167.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 47abf29a9255b2e7b94e56d66b455d0a584b68b8
    master date: 2016-01-20 13:49:23 +0100
---
 xen/arch/x86/mm.c |   29 +++++++----------------------
 1 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index dfae2e7..9f96be8 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2566,6 +2566,9 @@ int get_superpage(unsigned long mfn, struct domain *d)
 
     ASSERT(opt_allow_superpage);
 
+    if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+        return -EINVAL;
+
     spage = mfn_to_spage(mfn);
     y = spage->type_info;
     do {
@@ -3320,14 +3323,6 @@ long do_mmuext_op(
             unsigned long mfn;
             struct spage_info *spage;
 
-            mfn = op.arg1.mfn;
-            if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
-            {
-                MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
-                break;
-            }
-
             if ( !opt_allow_superpage )
             {
                 MEM_LOG("Superpages disallowed");
@@ -3336,16 +3331,6 @@ long do_mmuext_op(
                 break;
             }
 
-            spage = mfn_to_spage(mfn);
-            okay = (mark_superpage(spage, d) >= 0);
-            break;
-        }
-
-        case MMUEXT_UNMARK_SUPER:
-        {
-            unsigned long mfn;
-            struct spage_info *spage;
-
             mfn = op.arg1.mfn;
             if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
             {
@@ -3354,16 +3339,16 @@ long do_mmuext_op(
                 break;
             }
 
-            if ( !opt_allow_superpage )
+            if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
             {
-                MEM_LOG("Superpages disallowed");
                 okay = 0;
-                rc = -ENOSYS;
                 break;
             }
 
             spage = mfn_to_spage(mfn);
-            okay = (unmark_superpage(spage) >= 0);
+            okay = ((op.cmd == MMUEXT_MARK_SUPER
+                    ? mark_superpage(spage, d)
+                    : unmark_superpage(spage)) >= 0);
             break;
         }
 
--
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 Jan 21 11:22:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 11:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMDJk-00066m-M1; Thu, 21 Jan 2016 11:22: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 1aMDJj-00066a-1m
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:19 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	09/0F-21594-A6FB0A65; Thu, 21 Jan 2016 11:22:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1453375336!16982387!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64742 invoked from network); 21 Jan 2016 11:22:17 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 11:22:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMDKJ-0000ER-T8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMDJg-0006RZ-CK
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:16 +0000
Date: Thu, 21 Jan 2016 11:22:16 +0000
Message-Id: <E1aMDJg-0006RZ-CK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/VMX: prevent INVVPID failure
	due to non-canonical guest 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 f8aad022072157a41ad7a03d7596dc389eb66b70
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:09:21 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:09:21 2016 +0100

    x86/VMX: prevent INVVPID failure due to non-canonical guest address
    
    While INVLPG (and on SVM INVLPGA) don't fault on non-canonical
    addresses, INVVPID fails (in the "individual address" case) when passed
    such an address.
    
    Since such intercepted INVLPG are effectively no-ops anyway, don't fix
    this in vmx_invlpg_intercept(), but instead have paging_invlpg() never
    return true in such a case.
    
    This is CVE-2016-1571 / XSA-168.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: bf05e88ed7342a91cceba050b6c622accb809842
    master date: 2016-01-20 13:50:10 +0100
---
 xen/include/asm-x86/paging.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 0a7c73c..ef14d52 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -239,7 +239,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
  * or 0 if it's safe not to do so. */
 static inline int paging_invlpg(struct vcpu *v, unsigned long va)
 {
-    return paging_get_hostmode(v)->invlpg(v, va);
+    return is_canonical_address(va) && paging_get_hostmode(v)->invlpg(v, va);
 }
 
 /* Translate a guest virtual address to the frame number that the
--
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 Jan 21 11:22:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 11:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMDJk-00066m-M1; Thu, 21 Jan 2016 11:22: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 1aMDJj-00066a-1m
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:19 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	09/0F-21594-A6FB0A65; Thu, 21 Jan 2016 11:22:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1453375336!16982387!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64742 invoked from network); 21 Jan 2016 11:22:17 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 11:22:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMDKJ-0000ER-T8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMDJg-0006RZ-CK
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:16 +0000
Date: Thu, 21 Jan 2016 11:22:16 +0000
Message-Id: <E1aMDJg-0006RZ-CK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/VMX: prevent INVVPID failure
	due to non-canonical guest 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 f8aad022072157a41ad7a03d7596dc389eb66b70
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:09:21 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:09:21 2016 +0100

    x86/VMX: prevent INVVPID failure due to non-canonical guest address
    
    While INVLPG (and on SVM INVLPGA) don't fault on non-canonical
    addresses, INVVPID fails (in the "individual address" case) when passed
    such an address.
    
    Since such intercepted INVLPG are effectively no-ops anyway, don't fix
    this in vmx_invlpg_intercept(), but instead have paging_invlpg() never
    return true in such a case.
    
    This is CVE-2016-1571 / XSA-168.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: bf05e88ed7342a91cceba050b6c622accb809842
    master date: 2016-01-20 13:50:10 +0100
---
 xen/include/asm-x86/paging.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 0a7c73c..ef14d52 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -239,7 +239,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
  * or 0 if it's safe not to do so. */
 static inline int paging_invlpg(struct vcpu *v, unsigned long va)
 {
-    return paging_get_hostmode(v)->invlpg(v, va);
+    return is_canonical_address(va) && paging_get_hostmode(v)->invlpg(v, va);
 }
 
 /* Translate a guest virtual address to the frame number that the
--
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 Jan 21 11:22:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 11:22: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 1aMDJu-00068W-Uz; Thu, 21 Jan 2016 11:22: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 1aMDJt-00068J-On
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:29 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	EF/7E-16618-47FB0A65; Thu, 21 Jan 2016 11:22:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1453375347!18315664!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35036 invoked from network); 21 Jan 2016 11:22:28 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 11:22:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMDKU-0000Fh-CK
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:23:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMDJq-0006SH-QZ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:26 +0000
Date: Thu, 21 Jan 2016 11:22:26 +0000
Message-Id: <E1aMDJq-0006SH-QZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/vmx: Fix injection of #DB
	traps following XSA-156
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 425f7f77ce950f39236f7c13e288ce5198c3576a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 20 14:10:12 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:10:12 2016 +0100

    x86/vmx: Fix injection of #DB traps following XSA-156
    
    Most #DB exceptions are traps rather than faults, meaning that the instruction
    pointer in the exception frame points after the instruction rather than at it.
    
    However, VMX intercepts all have fault semantics, even when intercepting a
    trap.  Re-injecting an intercepted trap as a fault causes an infinite loop in
    the guest, by re-executing the same trapping instruction repeatedly.  This
    breaks debugging inside the guest.
    
    Introduce a helper which copies VM_EXIT_INTR_INTO to VM_ENTRY_INTR_INFO, and
    use it to mirror the intercepted interrupt back to the guest.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 0747bc8b4d85f3fc0ee1e58418418fa0229e8ff8
    master date: 2016-01-05 11:28:56 +0000
---
 xen/arch/x86/hvm/vmx/vmx.c |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index a8a9d58..f35119b 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2465,6 +2465,33 @@ static int vmx_handle_eoi_write(void)
     return 0;
 }
 
+/*
+ * Propagate VM_EXIT_INTR_INFO to VM_ENTRY_INTR_INFO.  Used to mirror an
+ * intercepted exception back to the guest as if Xen hadn't intercepted it.
+ *
+ * It is the callers responsibility to ensure that this function is only used
+ * in the context of an appropriate vmexit.
+ */
+static void vmx_propagate_intr(void)
+{
+    unsigned long intr, tmp;
+
+    __vmread(VM_EXIT_INTR_INFO, &intr);
+
+    ASSERT(intr & INTR_INFO_VALID_MASK);
+
+    __vmwrite(VM_ENTRY_INTR_INFO, intr);
+
+    if ( intr & INTR_INFO_DELIVER_CODE_MASK )
+    {
+        __vmread(VM_EXIT_INTR_ERROR_CODE, &tmp);
+        __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, tmp);
+    }
+
+    __vmread(VM_EXIT_INSTRUCTION_LEN, &tmp);
+    __vmwrite(VM_ENTRY_INSTRUCTION_LEN, tmp);
+}
+
 static void vmx_idtv_reinject(unsigned long idtv_info)
 {
 
@@ -2685,7 +2712,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | 0xffff0ff0);
             if ( !v->domain->debugger_attached )
-                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+                vmx_propagate_intr();
             else
                 domain_pause_for_debugger();
             break;
@@ -2754,8 +2781,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             break;
         case TRAP_alignment_check:
             HVMTRACE_1D(TRAP, vector);
-            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
-            hvm_inject_hw_exception(vector, ecode);
+            vmx_propagate_intr();
             break;
         case TRAP_nmi:
             if ( (intr_info & INTR_INFO_INTR_TYPE_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 Thu Jan 21 11:22:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 11:22: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 1aMDJu-00068W-Uz; Thu, 21 Jan 2016 11:22: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 1aMDJt-00068J-On
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:29 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	EF/7E-16618-47FB0A65; Thu, 21 Jan 2016 11:22:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1453375347!18315664!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35036 invoked from network); 21 Jan 2016 11:22:28 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 11:22:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMDKU-0000Fh-CK
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:23:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMDJq-0006SH-QZ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 11:22:26 +0000
Date: Thu, 21 Jan 2016 11:22:26 +0000
Message-Id: <E1aMDJq-0006SH-QZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/vmx: Fix injection of #DB
	traps following XSA-156
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 425f7f77ce950f39236f7c13e288ce5198c3576a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 20 14:10:12 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:10:12 2016 +0100

    x86/vmx: Fix injection of #DB traps following XSA-156
    
    Most #DB exceptions are traps rather than faults, meaning that the instruction
    pointer in the exception frame points after the instruction rather than at it.
    
    However, VMX intercepts all have fault semantics, even when intercepting a
    trap.  Re-injecting an intercepted trap as a fault causes an infinite loop in
    the guest, by re-executing the same trapping instruction repeatedly.  This
    breaks debugging inside the guest.
    
    Introduce a helper which copies VM_EXIT_INTR_INTO to VM_ENTRY_INTR_INFO, and
    use it to mirror the intercepted interrupt back to the guest.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 0747bc8b4d85f3fc0ee1e58418418fa0229e8ff8
    master date: 2016-01-05 11:28:56 +0000
---
 xen/arch/x86/hvm/vmx/vmx.c |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index a8a9d58..f35119b 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2465,6 +2465,33 @@ static int vmx_handle_eoi_write(void)
     return 0;
 }
 
+/*
+ * Propagate VM_EXIT_INTR_INFO to VM_ENTRY_INTR_INFO.  Used to mirror an
+ * intercepted exception back to the guest as if Xen hadn't intercepted it.
+ *
+ * It is the callers responsibility to ensure that this function is only used
+ * in the context of an appropriate vmexit.
+ */
+static void vmx_propagate_intr(void)
+{
+    unsigned long intr, tmp;
+
+    __vmread(VM_EXIT_INTR_INFO, &intr);
+
+    ASSERT(intr & INTR_INFO_VALID_MASK);
+
+    __vmwrite(VM_ENTRY_INTR_INFO, intr);
+
+    if ( intr & INTR_INFO_DELIVER_CODE_MASK )
+    {
+        __vmread(VM_EXIT_INTR_ERROR_CODE, &tmp);
+        __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, tmp);
+    }
+
+    __vmread(VM_EXIT_INSTRUCTION_LEN, &tmp);
+    __vmwrite(VM_ENTRY_INSTRUCTION_LEN, tmp);
+}
+
 static void vmx_idtv_reinject(unsigned long idtv_info)
 {
 
@@ -2685,7 +2712,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | 0xffff0ff0);
             if ( !v->domain->debugger_attached )
-                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+                vmx_propagate_intr();
             else
                 domain_pause_for_debugger();
             break;
@@ -2754,8 +2781,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             break;
         case TRAP_alignment_check:
             HVMTRACE_1D(TRAP, vector);
-            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
-            hvm_inject_hw_exception(vector, ecode);
+            vmx_propagate_intr();
             break;
         case TRAP_nmi:
             if ( (intr_info & INTR_INFO_INTR_TYPE_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 Thu Jan 21 16:55:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:55:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMIVo-0004Jq-25; Thu, 21 Jan 2016 16:55: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 1aMIVm-0004Je-BB
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:06 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	BD/7A-02745-96D01A65; Thu, 21 Jan 2016 16:55:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1453395304!17341116!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46233 invoked from network); 21 Jan 2016 16:55:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:55:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWN-00087G-RY
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIVj-0004QQ-AU
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:03 +0000
Date: Thu, 21 Jan 2016 16:55:03 +0000
Message-Id: <E1aMIVj-0004QQ-AU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/mm: PV superpage handling
	lacks sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fa109ca50760cc1f67eb7deed9d03e9f065ee293
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 13:53:33 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:53:33 2016 +0100

    x86/mm: PV superpage handling lacks sanity checks
    
    MMUEXT_{,UN}MARK_SUPER fail to check the input MFN for validity before
    dereferencing pointers into the superpage frame table.
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    
    get_superpage() has a similar issue.
    
    This is CVE-2016-1570 / XSA-167.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 47abf29a9255b2e7b94e56d66b455d0a584b68b8
    master date: 2016-01-20 13:49:23 +0100
---
 xen/arch/x86/mm.c |   37 ++++++++++++-------------------------
 1 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b65c3a5..854a635 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2624,6 +2624,9 @@ int get_superpage(unsigned long mfn, struct domain *d)
 
     ASSERT(opt_allow_superpage);
 
+    if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+        return -EINVAL;
+
     spage = mfn_to_spage(mfn);
     y = spage->type_info;
     do {
@@ -3401,42 +3404,26 @@ long do_mmuext_op(
         }
 
         case MMUEXT_MARK_SUPER:
+        case MMUEXT_UNMARK_SUPER:
         {
             unsigned long mfn = op.arg1.mfn;
 
-            if ( unlikely(d != pg_owner) )
-                rc = -EPERM;
-            else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
-            {
-                MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
-            }
-            else if ( !opt_allow_superpage )
+            if ( !opt_allow_superpage )
             {
                 MEM_LOG("Superpages disallowed");
                 rc = -ENOSYS;
             }
-            else
-                rc = mark_superpage(mfn_to_spage(mfn), d);
-            break;
-        }
-
-        case MMUEXT_UNMARK_SUPER:
-        {
-            unsigned long mfn = op.arg1.mfn;
-
-            if ( unlikely(d != pg_owner) )
+            else if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
-            else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
+            else if ( mfn & (L1_PAGETABLE_ENTRIES - 1) )
             {
                 MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
-            }
-            else if ( !opt_allow_superpage )
-            {
-                MEM_LOG("Superpages disallowed");
-                rc = -ENOSYS;
+                rc = -EINVAL;
             }
+            else if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+                rc = -EINVAL;
+            else if ( op.cmd == MMUEXT_MARK_SUPER )
+                rc = mark_superpage(mfn_to_spage(mfn), d);
             else
                 rc = unmark_superpage(mfn_to_spage(mfn));
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:55:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:55:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMIVo-0004Jq-25; Thu, 21 Jan 2016 16:55: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 1aMIVm-0004Je-BB
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:06 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	BD/7A-02745-96D01A65; Thu, 21 Jan 2016 16:55:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1453395304!17341116!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46233 invoked from network); 21 Jan 2016 16:55:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:55:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWN-00087G-RY
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIVj-0004QQ-AU
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:03 +0000
Date: Thu, 21 Jan 2016 16:55:03 +0000
Message-Id: <E1aMIVj-0004QQ-AU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/mm: PV superpage handling
	lacks sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fa109ca50760cc1f67eb7deed9d03e9f065ee293
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 13:53:33 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:53:33 2016 +0100

    x86/mm: PV superpage handling lacks sanity checks
    
    MMUEXT_{,UN}MARK_SUPER fail to check the input MFN for validity before
    dereferencing pointers into the superpage frame table.
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    
    get_superpage() has a similar issue.
    
    This is CVE-2016-1570 / XSA-167.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 47abf29a9255b2e7b94e56d66b455d0a584b68b8
    master date: 2016-01-20 13:49:23 +0100
---
 xen/arch/x86/mm.c |   37 ++++++++++++-------------------------
 1 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b65c3a5..854a635 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2624,6 +2624,9 @@ int get_superpage(unsigned long mfn, struct domain *d)
 
     ASSERT(opt_allow_superpage);
 
+    if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+        return -EINVAL;
+
     spage = mfn_to_spage(mfn);
     y = spage->type_info;
     do {
@@ -3401,42 +3404,26 @@ long do_mmuext_op(
         }
 
         case MMUEXT_MARK_SUPER:
+        case MMUEXT_UNMARK_SUPER:
         {
             unsigned long mfn = op.arg1.mfn;
 
-            if ( unlikely(d != pg_owner) )
-                rc = -EPERM;
-            else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
-            {
-                MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
-            }
-            else if ( !opt_allow_superpage )
+            if ( !opt_allow_superpage )
             {
                 MEM_LOG("Superpages disallowed");
                 rc = -ENOSYS;
             }
-            else
-                rc = mark_superpage(mfn_to_spage(mfn), d);
-            break;
-        }
-
-        case MMUEXT_UNMARK_SUPER:
-        {
-            unsigned long mfn = op.arg1.mfn;
-
-            if ( unlikely(d != pg_owner) )
+            else if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
-            else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
+            else if ( mfn & (L1_PAGETABLE_ENTRIES - 1) )
             {
                 MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
-            }
-            else if ( !opt_allow_superpage )
-            {
-                MEM_LOG("Superpages disallowed");
-                rc = -ENOSYS;
+                rc = -EINVAL;
             }
+            else if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+                rc = -EINVAL;
+            else if ( op.cmd == MMUEXT_MARK_SUPER )
+                rc = mark_superpage(mfn_to_spage(mfn), d);
             else
                 rc = unmark_superpage(mfn_to_spage(mfn));
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:55:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMIVy-0004LN-6p; Thu, 21 Jan 2016 16:55: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 1aMIVw-0004Ky-TZ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:17 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	7E/E5-08977-47D01A65; Thu, 21 Jan 2016 16:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1453395314!11402529!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41508 invoked from network); 21 Jan 2016 16:55:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:55:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWY-00087u-8J
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIVu-0004Qq-57
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:14 +0000
Date: Thu, 21 Jan 2016 16:55:14 +0000
Message-Id: <E1aMIVu-0004Qq-57@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/VMX: prevent INVVPID failure
	due to non-canonical guest 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 99e0fb590fab567221d3eec26d275473e1b05781
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 13:54:12 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:54:12 2016 +0100

    x86/VMX: prevent INVVPID failure due to non-canonical guest address
    
    While INVLPG (and on SVM INVLPGA) don't fault on non-canonical
    addresses, INVVPID fails (in the "individual address" case) when passed
    such an address.
    
    Since such intercepted INVLPG are effectively no-ops anyway, don't fix
    this in vmx_invlpg_intercept(), but instead have paging_invlpg() never
    return true in such a case.
    
    This is CVE-2016-1571 / XSA-168.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: bf05e88ed7342a91cceba050b6c622accb809842
    master date: 2016-01-20 13:50:10 +0100
---
 xen/include/asm-x86/paging.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 483b2d7..6215f57 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -245,7 +245,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
  * or 0 if it's safe not to do so. */
 static inline int paging_invlpg(struct vcpu *v, unsigned long va)
 {
-    return paging_get_hostmode(v)->invlpg(v, va);
+    return is_canonical_address(va) && paging_get_hostmode(v)->invlpg(v, va);
 }
 
 /* Translate a guest virtual address to the frame number that the
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:55:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMIVy-0004LN-6p; Thu, 21 Jan 2016 16:55: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 1aMIVw-0004Ky-TZ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:17 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	7E/E5-08977-47D01A65; Thu, 21 Jan 2016 16:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1453395314!11402529!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41508 invoked from network); 21 Jan 2016 16:55:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:55:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWY-00087u-8J
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIVu-0004Qq-57
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:14 +0000
Date: Thu, 21 Jan 2016 16:55:14 +0000
Message-Id: <E1aMIVu-0004Qq-57@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/VMX: prevent INVVPID failure
	due to non-canonical guest 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 99e0fb590fab567221d3eec26d275473e1b05781
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 13:54:12 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:54:12 2016 +0100

    x86/VMX: prevent INVVPID failure due to non-canonical guest address
    
    While INVLPG (and on SVM INVLPGA) don't fault on non-canonical
    addresses, INVVPID fails (in the "individual address" case) when passed
    such an address.
    
    Since such intercepted INVLPG are effectively no-ops anyway, don't fix
    this in vmx_invlpg_intercept(), but instead have paging_invlpg() never
    return true in such a case.
    
    This is CVE-2016-1571 / XSA-168.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: bf05e88ed7342a91cceba050b6c622accb809842
    master date: 2016-01-20 13:50:10 +0100
---
 xen/include/asm-x86/paging.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 483b2d7..6215f57 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -245,7 +245,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
  * or 0 if it's safe not to do so. */
 static inline int paging_invlpg(struct vcpu *v, unsigned long va)
 {
-    return paging_get_hostmode(v)->invlpg(v, va);
+    return is_canonical_address(va) && paging_get_hostmode(v)->invlpg(v, va);
 }
 
 /* Translate a guest virtual address to the frame number that the
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:55:29 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMIW9-0004O6-B6; Thu, 21 Jan 2016 16:55: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 1aMIW7-0004Nl-TM
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:28 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	60/E9-28221-F7D01A65; Thu, 21 Jan 2016 16:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1453395325!14741716!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58175 invoked from network); 21 Jan 2016 16:55:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:55:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWi-00088Z-PB
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIW4-0004RN-I8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:24 +0000
Date: Thu, 21 Jan 2016 16:55:24 +0000
Message-Id: <E1aMIW4-0004RN-I8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] VT-d: unhide messages needed for
	diagnosing firmware issues
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 208643f3b712e32ce2fdb8f01351946cf62238e1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 13:57:21 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:57:21 2016 +0100

    VT-d: unhide messages needed for diagnosing firmware issues
    
    Undue use of dprintk() lead to many messages useful in diagnosing
    issues in the field now being hidden in non-debug (i.e. production)
    builds. Re-surface them, namely when init-time only and/or already
    guarded by iommu_{verbose,debug} conditionals. Switch from using
    iommu_verbose to iommu_debug in a couple of runtime cases.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Feng Wu <feng.wu@intel.com>
    master commit: 009298d7baf6b8a9baed48121ff181e24abf6224
    master date: 2015-12-22 10:11:44 +0100
---
 xen/drivers/passthrough/vtd/dmar.c  |  121 ++++++++++++++++-------------------
 xen/drivers/passthrough/vtd/iommu.c |   74 ++++++++++-----------
 2 files changed, 90 insertions(+), 105 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 34ec4c7..aaa108c 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -298,7 +298,7 @@ static int __init scope_device_count(const void *start, const void *end)
         scope = start;
         if ( scope->length < MIN_SCOPE_LEN )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX, "Invalid device scope.\n");
+            printk(XENLOG_WARNING VTDPREFIX "Invalid device scope\n");
             return -EINVAL;
         }
 
@@ -360,18 +360,18 @@ static int __init acpi_parse_dev_scope(
             sub_bus = pci_conf_read8(seg, bus, path->dev, path->fn,
                                      PCI_SUBORDINATE_BUS);
             if ( iommu_verbose )
-                dprintk(VTDPREFIX,
-                        " bridge: %04x:%02x:%02x.%u start=%x sec=%x sub=%x\n",
-                        seg, bus, path->dev, path->fn,
-                        acpi_scope->bus, sec_bus, sub_bus);
+                printk(VTDPREFIX
+                       " bridge: %04x:%02x:%02x.%u start=%x sec=%x sub=%x\n",
+                       seg, bus, path->dev, path->fn,
+                       acpi_scope->bus, sec_bus, sub_bus);
 
             dmar_scope_add_buses(scope, sec_bus, sub_bus);
             break;
 
         case ACPI_DMAR_SCOPE_TYPE_HPET:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
-                        seg, bus, path->dev, path->fn);
+                printk(VTDPREFIX " MSI HPET: %04x:%02x:%02x.%u\n",
+                       seg, bus, path->dev, path->fn);
 
             if ( drhd )
             {
@@ -392,8 +392,8 @@ static int __init acpi_parse_dev_scope(
 
         case ACPI_DMAR_SCOPE_TYPE_ENDPOINT:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",
-                        seg, bus, path->dev, path->fn);
+                printk(VTDPREFIX " endpoint: %04x:%02x:%02x.%u\n",
+                       seg, bus, path->dev, path->fn);
 
             if ( drhd )
             {
@@ -406,8 +406,8 @@ static int __init acpi_parse_dev_scope(
 
         case ACPI_DMAR_SCOPE_TYPE_IOAPIC:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%u\n",
-                        seg, bus, path->dev, path->fn);
+                printk(VTDPREFIX " IOAPIC: %04x:%02x:%02x.%u\n",
+                       seg, bus, path->dev, path->fn);
 
             if ( drhd )
             {
@@ -449,9 +449,8 @@ static int __init acpi_dmar_check_length(
 {
     if ( h->length >= min_len )
         return 0;
-    dprintk(XENLOG_ERR VTDPREFIX,
-            "Invalid ACPI DMAR entry length: %#x\n",
-            h->length);
+    printk(XENLOG_ERR VTDPREFIX "Invalid ACPI DMAR entry length: %#x\n",
+           h->length);
     return -EINVAL;
 }
 
@@ -481,8 +480,7 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
     INIT_LIST_HEAD(&dmaru->ioapic_list);
     INIT_LIST_HEAD(&dmaru->hpet_list);
     if ( iommu_verbose )
-        dprintk(VTDPREFIX, "  dmaru->address = %"PRIx64"\n",
-                dmaru->address);
+        printk(VTDPREFIX "  dmaru->address = %"PRIx64"\n", dmaru->address);
 
     ret = iommu_alloc(dmaru);
     if ( ret )
@@ -496,12 +494,12 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
     if ( dmaru->include_all )
     {
         if ( iommu_verbose )
-            dprintk(VTDPREFIX, "  flags: INCLUDE_ALL\n");
+            printk(VTDPREFIX "  flags: INCLUDE_ALL\n");
         /* Only allow one INCLUDE_ALL */
         if ( drhd->segment == 0 && include_all )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                    "Only one INCLUDE_ALL device scope is allowed\n");
+            printk(XENLOG_WARNING VTDPREFIX
+                   "Only one INCLUDE_ALL device scope is allowed\n");
             ret = -EINVAL;
         }
         if ( drhd->segment == 0 )
@@ -538,9 +536,9 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
 
             if ( !pci_device_detect(drhd->segment, b, d, f) )
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                        " Non-existent device (%04x:%02x:%02x.%u) is reported"
-                        " in this DRHD's scope!\n", drhd->segment, b, d, f);
+                printk(XENLOG_WARNING VTDPREFIX
+                       " Non-existent device (%04x:%02x:%02x.%u) in this DRHD's scope!\n",
+                       drhd->segment, b, d, f);
                 invalid_cnt++;
             }
         }
@@ -550,9 +548,8 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
             if ( iommu_workaround_bios_bug &&
                  invalid_cnt == dmaru->scope.devices_cnt )
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                    "  Workaround BIOS bug: ignore the DRHD due to all "
-                    "devices under its scope are not PCI discoverable!\n");
+                printk(XENLOG_WARNING VTDPREFIX
+                       "  Workaround BIOS bug: ignoring DRHD (no devices in its scope are PCI discoverable)\n");
 
                 scope_devices_free(&dmaru->scope);
                 iommu_free(dmaru);
@@ -560,11 +557,10 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
             }
             else
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                    "  The DRHD is invalid due to there are devices under "
-                    "its scope are not PCI discoverable! Pls try option "
-                    "iommu=force or iommu=workaround_bios_bug if you "
-                    "really want VT-d\n");
+                printk(XENLOG_WARNING VTDPREFIX
+                       "  DRHD is invalid (some devices in its scope are not PCI discoverable)\n");
+                printk(XENLOG_WARNING VTDPREFIX
+                       "  Try \"iommu=force\" or \"iommu=workaround_bios_bug\" if you really want VT-d\n");
                 ret = -EINVAL;
             }
         }
@@ -613,10 +609,9 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
     if ( (!page_is_ram_type(paddr_to_pfn(base_addr), RAM_TYPE_RESERVED)) ||
          (!page_is_ram_type(paddr_to_pfn(end_addr), RAM_TYPE_RESERVED)) )
     {
-        dprintk(XENLOG_WARNING VTDPREFIX,
-                "  RMRR address range not in reserved memory "
-                "base = %"PRIx64" end = %"PRIx64"; "
-                "iommu_inclusive_mapping=1 parameter may be needed.\n",
+        printk(XENLOG_WARNING VTDPREFIX
+               "  RMRR address range %"PRIx64"..%"PRIx64" not in reserved memory;"
+               " need \"iommu_inclusive_mapping=1\"?\n",
                 base_addr, end_addr);
     }
 
@@ -653,11 +648,10 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
 
             if ( !pci_device_detect(rmrr->segment, b, d, f) )
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                        " Non-existent device (%04x:%02x:%02x.%u) is reported"
-                        " in RMRR (%"PRIx64", %"PRIx64")'s scope!\n",
-                        rmrr->segment, b, d, f,
-                        rmrru->base_address, rmrru->end_address);
+                printk(XENLOG_WARNING VTDPREFIX
+                       " Non-existent device (%04x:%02x:%02x.%u) reported in RMRR (%"PRIx64", %"PRIx64")'s scope!\n",
+                       rmrr->segment, b, d, f,
+                       rmrru->base_address, rmrru->end_address);
                 ignore = 1;
             }
             else
@@ -669,18 +663,17 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
 
         if ( ignore )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                "  Ignore the RMRR (%"PRIx64", %"PRIx64") due to "
-                "devices under its scope are not PCI discoverable!\n",
-                rmrru->base_address, rmrru->end_address);
+            printk(XENLOG_WARNING VTDPREFIX
+                   "  Ignore RMRR (%"PRIx64", %"PRIx64") (some devices in its scope are not PCI discoverable)\n",
+                   rmrru->base_address, rmrru->end_address);
             scope_devices_free(&rmrru->scope);
             xfree(rmrru);
         }
         else if ( base_addr > end_addr )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                "  The RMRR (%"PRIx64", %"PRIx64") is incorrect!\n",
-                rmrru->base_address, rmrru->end_address);
+            printk(XENLOG_WARNING VTDPREFIX
+                   "  RMRR (%"PRIx64", %"PRIx64") is incorrect\n",
+                   rmrru->base_address, rmrru->end_address);
             scope_devices_free(&rmrru->scope);
             xfree(rmrru);
             ret = -EFAULT;
@@ -688,10 +681,9 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
         else
         {
             if ( iommu_verbose )
-                dprintk(VTDPREFIX,
-                        "  RMRR region: base_addr %"PRIx64
-                        " end_address %"PRIx64"\n",
-                        rmrru->base_address, rmrru->end_address);
+                printk(VTDPREFIX
+                       "  RMRR region: base_addr %"PRIx64" end_address %"PRIx64"\n",
+                       rmrru->base_address, rmrru->end_address);
             acpi_register_rmrr_unit(rmrru);
         }
     }
@@ -719,8 +711,7 @@ acpi_parse_one_atsr(struct acpi_dmar_header *header)
     atsru->segment = atsr->segment;
     atsru->all_ports = atsr->flags & ACPI_DMAR_ALL_PORTS;
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
-                "  atsru->all_ports: %x\n", atsru->all_ports);
+        printk(VTDPREFIX "  atsru->all_ports: %x\n", atsru->all_ports);
     if ( !atsru->all_ports )
     {
         dev_scope_start = (void *)(atsr + 1);
@@ -731,12 +722,12 @@ acpi_parse_one_atsr(struct acpi_dmar_header *header)
     else
     {
         if ( iommu_verbose )
-            dprintk(VTDPREFIX, "  flags: ALL_PORTS\n");
+            printk(VTDPREFIX "  flags: ALL_PORTS\n");
         /* Only allow one ALL_PORTS */
         if ( atsr->segment == 0 && all_ports )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                    "Only one ALL_PORTS device scope is allowed\n");
+            printk(XENLOG_WARNING VTDPREFIX
+                   "Only one ALL_PORTS device scope is allowed\n");
             ret = -EINVAL;
         }
         if ( atsr->segment == 0 )
@@ -772,10 +763,9 @@ acpi_parse_one_rhsa(struct acpi_dmar_header *header)
     rhsau->proximity_domain = rhsa->proximity_domain;
     list_add_tail(&rhsau->list, &acpi_rhsa_units);
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
-                "  rhsau->address: %"PRIx64
-                " rhsau->proximity_domain: %"PRIx32"\n",
-                rhsau->address, rhsau->proximity_domain);
+        printk(VTDPREFIX
+               "  rhsau->address: %"PRIx64" rhsau->proximity_domain: %"PRIx32"\n",
+               rhsau->address, rhsau->proximity_domain);
 
     return ret;
 }
@@ -798,15 +788,14 @@ static int __init acpi_parse_dmar(struct acpi_table_header *table)
 
     if ( !dmar->width )
     {
-        dprintk(XENLOG_WARNING VTDPREFIX, "Zero: Invalid DMAR width\n");
+        printk(XENLOG_WARNING VTDPREFIX "Zero: Invalid DMAR width\n");
         ret = -EINVAL;
         goto out;
     }
 
     dmar_host_address_width = dmar->width + 1;
     if ( iommu_verbose )
-        dprintk(VTDPREFIX, "Host address width %d\n",
-                dmar_host_address_width);
+        printk(VTDPREFIX "Host address width %d\n", dmar_host_address_width);
 
     entry_header = (void *)(dmar + 1);
     while ( ((unsigned long)entry_header) <
@@ -820,22 +809,22 @@ static int __init acpi_parse_dmar(struct acpi_table_header *table)
         {
         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_DRHD:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_DRHD:\n");
             ret = acpi_parse_one_drhd(entry_header);
             break;
         case ACPI_DMAR_TYPE_RESERVED_MEMORY:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_RMRR:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_RMRR:\n");
             ret = acpi_parse_one_rmrr(entry_header);
             break;
         case ACPI_DMAR_TYPE_ATSR:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_ATSR:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_ATSR:\n");
             ret = acpi_parse_one_atsr(entry_header);
             break;
         case ACPI_DMAR_HARDWARE_AFFINITY:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_RHSA:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_RHSA:\n");
             ret = acpi_parse_one_rhsa(entry_header);
             break;
         default:
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 914b335..753f55a 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -713,20 +713,18 @@ static void iommu_enable_translation(struct acpi_drhd_unit *drhd)
     {
         if ( force_iommu )
             panic("BIOS did not enable IGD for VT properly, crash Xen for security purpose");
-        else
-        {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                    "BIOS did not enable IGD for VT properly.  Disabling IGD VT-d engine.\n");
-            return;
-        }
+
+        printk(XENLOG_WARNING VTDPREFIX
+               "BIOS did not enable IGD for VT properly.  Disabling IGD VT-d engine.\n");
+        return;
     }
 
     /* apply platform specific errata workarounds */
     vtd_ops_preamble_quirk(iommu);
 
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
-                "iommu_enable_translation: iommu->reg = %p\n", iommu->reg);
+        printk(VTDPREFIX "iommu_enable_translation: iommu->reg = %p\n",
+               iommu->reg);
     spin_lock_irqsave(&iommu->register_lock, flags);
     sts = dmar_readl(iommu->reg, DMAR_GSTS_REG);
     dmar_writel(iommu->reg, DMAR_GCMD_REG, sts | DMA_GCMD_TE);
@@ -1150,11 +1148,10 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
 
     if ( iommu_verbose )
     {
-        dprintk(VTDPREFIX,
-                "drhd->address = %"PRIx64" iommu->reg = %p\n",
-                drhd->address, iommu->reg);
-        dprintk(VTDPREFIX,
-                "cap = %"PRIx64" ecap = %"PRIx64"\n", iommu->cap, iommu->ecap);
+        printk(VTDPREFIX "drhd->address = %"PRIx64" iommu->reg = %p\n",
+               drhd->address, iommu->reg);
+        printk(VTDPREFIX "cap = %"PRIx64" ecap = %"PRIx64"\n",
+               iommu->cap, iommu->ecap);
     }
     if ( !(iommu->cap + 1) || !(iommu->ecap + 1) )
         return -ENODEV;
@@ -1163,7 +1160,7 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
          cap_num_fault_regs(iommu->cap) * PRIMARY_FAULT_REG_LEN >= PAGE_SIZE ||
          ecap_iotlb_offset(iommu->ecap) >= PAGE_SIZE )
     {
-        dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: unsupported\n");
+        printk(XENLOG_ERR VTDPREFIX "IOMMU: unsupported\n");
         print_iommu_regs(drhd);
         return -ENODEV;
     }
@@ -1175,8 +1172,7 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
             break;
     if ( agaw < 0 )
     {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                 "IOMMU: unsupported sagaw %lx\n", sagaw);
+        printk(XENLOG_ERR VTDPREFIX "IOMMU: unsupported sagaw %lx\n", sagaw);
         print_iommu_regs(drhd);
         return -ENODEV;
     }
@@ -1433,10 +1429,10 @@ static int domain_context_mapping(
     switch ( pdev->type )
     {
     case DEV_TYPE_PCI_HOST_BRIDGE:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:Hostbridge: skip %04x:%02x:%02x.%u map\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:Hostbridge: skip %04x:%02x:%02x.%u map\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         if ( !is_hardware_domain(domain) )
             return -EPERM;
         break;
@@ -1447,10 +1443,10 @@ static int domain_context_mapping(
         break;
 
     case DEV_TYPE_PCIe_ENDPOINT:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCIe: map %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCIe: map %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
@@ -1459,10 +1455,10 @@ static int domain_context_mapping(
         break;
 
     case DEV_TYPE_PCI:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCI: map %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCI: map %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
 
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
@@ -1572,10 +1568,10 @@ static int domain_context_unmap(
     switch ( pdev->type )
     {
     case DEV_TYPE_PCI_HOST_BRIDGE:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:Hostbridge: skip %04x:%02x:%02x.%u unmap\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:Hostbridge: skip %04x:%02x:%02x.%u unmap\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         if ( !is_hardware_domain(domain) )
             return -EPERM;
         goto out;
@@ -1586,10 +1582,10 @@ static int domain_context_unmap(
         goto out;
 
     case DEV_TYPE_PCIe_ENDPOINT:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCIe: unmap %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCIe: unmap %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_unmap_one(domain, iommu, bus, devfn);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
             disable_ats_device(seg, bus, devfn);
@@ -1597,9 +1593,9 @@ static int domain_context_unmap(
         break;
 
     case DEV_TYPE_PCI:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCI: unmap %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCI: unmap %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_unmap_one(domain, iommu, bus, devfn);
         if ( ret )
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:55:29 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMIW9-0004O6-B6; Thu, 21 Jan 2016 16:55: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 1aMIW7-0004Nl-TM
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:28 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	60/E9-28221-F7D01A65; Thu, 21 Jan 2016 16:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1453395325!14741716!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58175 invoked from network); 21 Jan 2016 16:55:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:55:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWi-00088Z-PB
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIW4-0004RN-I8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:24 +0000
Date: Thu, 21 Jan 2016 16:55:24 +0000
Message-Id: <E1aMIW4-0004RN-I8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] VT-d: unhide messages needed for
	diagnosing firmware issues
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 208643f3b712e32ce2fdb8f01351946cf62238e1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 13:57:21 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:57:21 2016 +0100

    VT-d: unhide messages needed for diagnosing firmware issues
    
    Undue use of dprintk() lead to many messages useful in diagnosing
    issues in the field now being hidden in non-debug (i.e. production)
    builds. Re-surface them, namely when init-time only and/or already
    guarded by iommu_{verbose,debug} conditionals. Switch from using
    iommu_verbose to iommu_debug in a couple of runtime cases.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Feng Wu <feng.wu@intel.com>
    master commit: 009298d7baf6b8a9baed48121ff181e24abf6224
    master date: 2015-12-22 10:11:44 +0100
---
 xen/drivers/passthrough/vtd/dmar.c  |  121 ++++++++++++++++-------------------
 xen/drivers/passthrough/vtd/iommu.c |   74 ++++++++++-----------
 2 files changed, 90 insertions(+), 105 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 34ec4c7..aaa108c 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -298,7 +298,7 @@ static int __init scope_device_count(const void *start, const void *end)
         scope = start;
         if ( scope->length < MIN_SCOPE_LEN )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX, "Invalid device scope.\n");
+            printk(XENLOG_WARNING VTDPREFIX "Invalid device scope\n");
             return -EINVAL;
         }
 
@@ -360,18 +360,18 @@ static int __init acpi_parse_dev_scope(
             sub_bus = pci_conf_read8(seg, bus, path->dev, path->fn,
                                      PCI_SUBORDINATE_BUS);
             if ( iommu_verbose )
-                dprintk(VTDPREFIX,
-                        " bridge: %04x:%02x:%02x.%u start=%x sec=%x sub=%x\n",
-                        seg, bus, path->dev, path->fn,
-                        acpi_scope->bus, sec_bus, sub_bus);
+                printk(VTDPREFIX
+                       " bridge: %04x:%02x:%02x.%u start=%x sec=%x sub=%x\n",
+                       seg, bus, path->dev, path->fn,
+                       acpi_scope->bus, sec_bus, sub_bus);
 
             dmar_scope_add_buses(scope, sec_bus, sub_bus);
             break;
 
         case ACPI_DMAR_SCOPE_TYPE_HPET:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
-                        seg, bus, path->dev, path->fn);
+                printk(VTDPREFIX " MSI HPET: %04x:%02x:%02x.%u\n",
+                       seg, bus, path->dev, path->fn);
 
             if ( drhd )
             {
@@ -392,8 +392,8 @@ static int __init acpi_parse_dev_scope(
 
         case ACPI_DMAR_SCOPE_TYPE_ENDPOINT:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",
-                        seg, bus, path->dev, path->fn);
+                printk(VTDPREFIX " endpoint: %04x:%02x:%02x.%u\n",
+                       seg, bus, path->dev, path->fn);
 
             if ( drhd )
             {
@@ -406,8 +406,8 @@ static int __init acpi_parse_dev_scope(
 
         case ACPI_DMAR_SCOPE_TYPE_IOAPIC:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%u\n",
-                        seg, bus, path->dev, path->fn);
+                printk(VTDPREFIX " IOAPIC: %04x:%02x:%02x.%u\n",
+                       seg, bus, path->dev, path->fn);
 
             if ( drhd )
             {
@@ -449,9 +449,8 @@ static int __init acpi_dmar_check_length(
 {
     if ( h->length >= min_len )
         return 0;
-    dprintk(XENLOG_ERR VTDPREFIX,
-            "Invalid ACPI DMAR entry length: %#x\n",
-            h->length);
+    printk(XENLOG_ERR VTDPREFIX "Invalid ACPI DMAR entry length: %#x\n",
+           h->length);
     return -EINVAL;
 }
 
@@ -481,8 +480,7 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
     INIT_LIST_HEAD(&dmaru->ioapic_list);
     INIT_LIST_HEAD(&dmaru->hpet_list);
     if ( iommu_verbose )
-        dprintk(VTDPREFIX, "  dmaru->address = %"PRIx64"\n",
-                dmaru->address);
+        printk(VTDPREFIX "  dmaru->address = %"PRIx64"\n", dmaru->address);
 
     ret = iommu_alloc(dmaru);
     if ( ret )
@@ -496,12 +494,12 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
     if ( dmaru->include_all )
     {
         if ( iommu_verbose )
-            dprintk(VTDPREFIX, "  flags: INCLUDE_ALL\n");
+            printk(VTDPREFIX "  flags: INCLUDE_ALL\n");
         /* Only allow one INCLUDE_ALL */
         if ( drhd->segment == 0 && include_all )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                    "Only one INCLUDE_ALL device scope is allowed\n");
+            printk(XENLOG_WARNING VTDPREFIX
+                   "Only one INCLUDE_ALL device scope is allowed\n");
             ret = -EINVAL;
         }
         if ( drhd->segment == 0 )
@@ -538,9 +536,9 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
 
             if ( !pci_device_detect(drhd->segment, b, d, f) )
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                        " Non-existent device (%04x:%02x:%02x.%u) is reported"
-                        " in this DRHD's scope!\n", drhd->segment, b, d, f);
+                printk(XENLOG_WARNING VTDPREFIX
+                       " Non-existent device (%04x:%02x:%02x.%u) in this DRHD's scope!\n",
+                       drhd->segment, b, d, f);
                 invalid_cnt++;
             }
         }
@@ -550,9 +548,8 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
             if ( iommu_workaround_bios_bug &&
                  invalid_cnt == dmaru->scope.devices_cnt )
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                    "  Workaround BIOS bug: ignore the DRHD due to all "
-                    "devices under its scope are not PCI discoverable!\n");
+                printk(XENLOG_WARNING VTDPREFIX
+                       "  Workaround BIOS bug: ignoring DRHD (no devices in its scope are PCI discoverable)\n");
 
                 scope_devices_free(&dmaru->scope);
                 iommu_free(dmaru);
@@ -560,11 +557,10 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header)
             }
             else
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                    "  The DRHD is invalid due to there are devices under "
-                    "its scope are not PCI discoverable! Pls try option "
-                    "iommu=force or iommu=workaround_bios_bug if you "
-                    "really want VT-d\n");
+                printk(XENLOG_WARNING VTDPREFIX
+                       "  DRHD is invalid (some devices in its scope are not PCI discoverable)\n");
+                printk(XENLOG_WARNING VTDPREFIX
+                       "  Try \"iommu=force\" or \"iommu=workaround_bios_bug\" if you really want VT-d\n");
                 ret = -EINVAL;
             }
         }
@@ -613,10 +609,9 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
     if ( (!page_is_ram_type(paddr_to_pfn(base_addr), RAM_TYPE_RESERVED)) ||
          (!page_is_ram_type(paddr_to_pfn(end_addr), RAM_TYPE_RESERVED)) )
     {
-        dprintk(XENLOG_WARNING VTDPREFIX,
-                "  RMRR address range not in reserved memory "
-                "base = %"PRIx64" end = %"PRIx64"; "
-                "iommu_inclusive_mapping=1 parameter may be needed.\n",
+        printk(XENLOG_WARNING VTDPREFIX
+               "  RMRR address range %"PRIx64"..%"PRIx64" not in reserved memory;"
+               " need \"iommu_inclusive_mapping=1\"?\n",
                 base_addr, end_addr);
     }
 
@@ -653,11 +648,10 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
 
             if ( !pci_device_detect(rmrr->segment, b, d, f) )
             {
-                dprintk(XENLOG_WARNING VTDPREFIX,
-                        " Non-existent device (%04x:%02x:%02x.%u) is reported"
-                        " in RMRR (%"PRIx64", %"PRIx64")'s scope!\n",
-                        rmrr->segment, b, d, f,
-                        rmrru->base_address, rmrru->end_address);
+                printk(XENLOG_WARNING VTDPREFIX
+                       " Non-existent device (%04x:%02x:%02x.%u) reported in RMRR (%"PRIx64", %"PRIx64")'s scope!\n",
+                       rmrr->segment, b, d, f,
+                       rmrru->base_address, rmrru->end_address);
                 ignore = 1;
             }
             else
@@ -669,18 +663,17 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
 
         if ( ignore )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                "  Ignore the RMRR (%"PRIx64", %"PRIx64") due to "
-                "devices under its scope are not PCI discoverable!\n",
-                rmrru->base_address, rmrru->end_address);
+            printk(XENLOG_WARNING VTDPREFIX
+                   "  Ignore RMRR (%"PRIx64", %"PRIx64") (some devices in its scope are not PCI discoverable)\n",
+                   rmrru->base_address, rmrru->end_address);
             scope_devices_free(&rmrru->scope);
             xfree(rmrru);
         }
         else if ( base_addr > end_addr )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                "  The RMRR (%"PRIx64", %"PRIx64") is incorrect!\n",
-                rmrru->base_address, rmrru->end_address);
+            printk(XENLOG_WARNING VTDPREFIX
+                   "  RMRR (%"PRIx64", %"PRIx64") is incorrect\n",
+                   rmrru->base_address, rmrru->end_address);
             scope_devices_free(&rmrru->scope);
             xfree(rmrru);
             ret = -EFAULT;
@@ -688,10 +681,9 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
         else
         {
             if ( iommu_verbose )
-                dprintk(VTDPREFIX,
-                        "  RMRR region: base_addr %"PRIx64
-                        " end_address %"PRIx64"\n",
-                        rmrru->base_address, rmrru->end_address);
+                printk(VTDPREFIX
+                       "  RMRR region: base_addr %"PRIx64" end_address %"PRIx64"\n",
+                       rmrru->base_address, rmrru->end_address);
             acpi_register_rmrr_unit(rmrru);
         }
     }
@@ -719,8 +711,7 @@ acpi_parse_one_atsr(struct acpi_dmar_header *header)
     atsru->segment = atsr->segment;
     atsru->all_ports = atsr->flags & ACPI_DMAR_ALL_PORTS;
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
-                "  atsru->all_ports: %x\n", atsru->all_ports);
+        printk(VTDPREFIX "  atsru->all_ports: %x\n", atsru->all_ports);
     if ( !atsru->all_ports )
     {
         dev_scope_start = (void *)(atsr + 1);
@@ -731,12 +722,12 @@ acpi_parse_one_atsr(struct acpi_dmar_header *header)
     else
     {
         if ( iommu_verbose )
-            dprintk(VTDPREFIX, "  flags: ALL_PORTS\n");
+            printk(VTDPREFIX "  flags: ALL_PORTS\n");
         /* Only allow one ALL_PORTS */
         if ( atsr->segment == 0 && all_ports )
         {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                    "Only one ALL_PORTS device scope is allowed\n");
+            printk(XENLOG_WARNING VTDPREFIX
+                   "Only one ALL_PORTS device scope is allowed\n");
             ret = -EINVAL;
         }
         if ( atsr->segment == 0 )
@@ -772,10 +763,9 @@ acpi_parse_one_rhsa(struct acpi_dmar_header *header)
     rhsau->proximity_domain = rhsa->proximity_domain;
     list_add_tail(&rhsau->list, &acpi_rhsa_units);
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
-                "  rhsau->address: %"PRIx64
-                " rhsau->proximity_domain: %"PRIx32"\n",
-                rhsau->address, rhsau->proximity_domain);
+        printk(VTDPREFIX
+               "  rhsau->address: %"PRIx64" rhsau->proximity_domain: %"PRIx32"\n",
+               rhsau->address, rhsau->proximity_domain);
 
     return ret;
 }
@@ -798,15 +788,14 @@ static int __init acpi_parse_dmar(struct acpi_table_header *table)
 
     if ( !dmar->width )
     {
-        dprintk(XENLOG_WARNING VTDPREFIX, "Zero: Invalid DMAR width\n");
+        printk(XENLOG_WARNING VTDPREFIX "Zero: Invalid DMAR width\n");
         ret = -EINVAL;
         goto out;
     }
 
     dmar_host_address_width = dmar->width + 1;
     if ( iommu_verbose )
-        dprintk(VTDPREFIX, "Host address width %d\n",
-                dmar_host_address_width);
+        printk(VTDPREFIX "Host address width %d\n", dmar_host_address_width);
 
     entry_header = (void *)(dmar + 1);
     while ( ((unsigned long)entry_header) <
@@ -820,22 +809,22 @@ static int __init acpi_parse_dmar(struct acpi_table_header *table)
         {
         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_DRHD:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_DRHD:\n");
             ret = acpi_parse_one_drhd(entry_header);
             break;
         case ACPI_DMAR_TYPE_RESERVED_MEMORY:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_RMRR:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_RMRR:\n");
             ret = acpi_parse_one_rmrr(entry_header);
             break;
         case ACPI_DMAR_TYPE_ATSR:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_ATSR:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_ATSR:\n");
             ret = acpi_parse_one_atsr(entry_header);
             break;
         case ACPI_DMAR_HARDWARE_AFFINITY:
             if ( iommu_verbose )
-                dprintk(VTDPREFIX, "found ACPI_DMAR_RHSA:\n");
+                printk(VTDPREFIX "found ACPI_DMAR_RHSA:\n");
             ret = acpi_parse_one_rhsa(entry_header);
             break;
         default:
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 914b335..753f55a 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -713,20 +713,18 @@ static void iommu_enable_translation(struct acpi_drhd_unit *drhd)
     {
         if ( force_iommu )
             panic("BIOS did not enable IGD for VT properly, crash Xen for security purpose");
-        else
-        {
-            dprintk(XENLOG_WARNING VTDPREFIX,
-                    "BIOS did not enable IGD for VT properly.  Disabling IGD VT-d engine.\n");
-            return;
-        }
+
+        printk(XENLOG_WARNING VTDPREFIX
+               "BIOS did not enable IGD for VT properly.  Disabling IGD VT-d engine.\n");
+        return;
     }
 
     /* apply platform specific errata workarounds */
     vtd_ops_preamble_quirk(iommu);
 
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
-                "iommu_enable_translation: iommu->reg = %p\n", iommu->reg);
+        printk(VTDPREFIX "iommu_enable_translation: iommu->reg = %p\n",
+               iommu->reg);
     spin_lock_irqsave(&iommu->register_lock, flags);
     sts = dmar_readl(iommu->reg, DMAR_GSTS_REG);
     dmar_writel(iommu->reg, DMAR_GCMD_REG, sts | DMA_GCMD_TE);
@@ -1150,11 +1148,10 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
 
     if ( iommu_verbose )
     {
-        dprintk(VTDPREFIX,
-                "drhd->address = %"PRIx64" iommu->reg = %p\n",
-                drhd->address, iommu->reg);
-        dprintk(VTDPREFIX,
-                "cap = %"PRIx64" ecap = %"PRIx64"\n", iommu->cap, iommu->ecap);
+        printk(VTDPREFIX "drhd->address = %"PRIx64" iommu->reg = %p\n",
+               drhd->address, iommu->reg);
+        printk(VTDPREFIX "cap = %"PRIx64" ecap = %"PRIx64"\n",
+               iommu->cap, iommu->ecap);
     }
     if ( !(iommu->cap + 1) || !(iommu->ecap + 1) )
         return -ENODEV;
@@ -1163,7 +1160,7 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
          cap_num_fault_regs(iommu->cap) * PRIMARY_FAULT_REG_LEN >= PAGE_SIZE ||
          ecap_iotlb_offset(iommu->ecap) >= PAGE_SIZE )
     {
-        dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: unsupported\n");
+        printk(XENLOG_ERR VTDPREFIX "IOMMU: unsupported\n");
         print_iommu_regs(drhd);
         return -ENODEV;
     }
@@ -1175,8 +1172,7 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
             break;
     if ( agaw < 0 )
     {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                 "IOMMU: unsupported sagaw %lx\n", sagaw);
+        printk(XENLOG_ERR VTDPREFIX "IOMMU: unsupported sagaw %lx\n", sagaw);
         print_iommu_regs(drhd);
         return -ENODEV;
     }
@@ -1433,10 +1429,10 @@ static int domain_context_mapping(
     switch ( pdev->type )
     {
     case DEV_TYPE_PCI_HOST_BRIDGE:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:Hostbridge: skip %04x:%02x:%02x.%u map\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:Hostbridge: skip %04x:%02x:%02x.%u map\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         if ( !is_hardware_domain(domain) )
             return -EPERM;
         break;
@@ -1447,10 +1443,10 @@ static int domain_context_mapping(
         break;
 
     case DEV_TYPE_PCIe_ENDPOINT:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCIe: map %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCIe: map %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
@@ -1459,10 +1455,10 @@ static int domain_context_mapping(
         break;
 
     case DEV_TYPE_PCI:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCI: map %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCI: map %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
 
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
@@ -1572,10 +1568,10 @@ static int domain_context_unmap(
     switch ( pdev->type )
     {
     case DEV_TYPE_PCI_HOST_BRIDGE:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:Hostbridge: skip %04x:%02x:%02x.%u unmap\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:Hostbridge: skip %04x:%02x:%02x.%u unmap\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         if ( !is_hardware_domain(domain) )
             return -EPERM;
         goto out;
@@ -1586,10 +1582,10 @@ static int domain_context_unmap(
         goto out;
 
     case DEV_TYPE_PCIe_ENDPOINT:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCIe: unmap %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus,
-                    PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCIe: unmap %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus,
+                   PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_unmap_one(domain, iommu, bus, devfn);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
             disable_ats_device(seg, bus, devfn);
@@ -1597,9 +1593,9 @@ static int domain_context_unmap(
         break;
 
     case DEV_TYPE_PCI:
-        if ( iommu_verbose )
-            dprintk(VTDPREFIX, "d%d:PCI: unmap %04x:%02x:%02x.%u\n",
-                    domain->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( iommu_debug )
+            printk(VTDPREFIX "d%d:PCI: unmap %04x:%02x:%02x.%u\n",
+                   domain->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_unmap_one(domain, iommu, bus, devfn);
         if ( ret )
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:55:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:55:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMIWI-0004Qe-JO; Thu, 21 Jan 2016 16:55:38 +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 1aMIWH-0004QC-E8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:37 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	C8/6D-13905-88D01A65; Thu, 21 Jan 2016 16:55:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1453395335!17294474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33232 invoked from network); 21 Jan 2016 16:55:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:55:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWt-00088m-19
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWF-0004SU-1M
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:35 +0000
Date: Thu, 21 Jan 2016 16:55:35 +0000
Message-Id: <E1aMIWF-0004SU-1M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] IOMMU: unhide messages useful for
	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 ef7e1565b794628409036fd35f4dad6d95266cef
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 13:57:43 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:57:43 2016 +0100

    IOMMU: unhide messages useful for diagnostics
    
    Undue use of dprintk() lead to many messages useful in diagnosing
    issues in the field now being hidden in non-debug (i.e. production)
    builds. Re-surface them.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 8e4d18e113c9d914a591c7bd8159c990122f50dc
    master date: 2015-12-22 10:12:14 +0100
---
 xen/drivers/passthrough/io.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c
index bda9374..4eba515 100644
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -422,10 +422,10 @@ int pt_irq_create_bind(
         spin_unlock(&d->event_lock);
 
         if ( iommu_verbose )
-            dprintk(XENLOG_G_INFO,
-                    "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);
+            printk(XENLOG_G_INFO
+                   "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;
     }
 
@@ -455,11 +455,11 @@ int pt_irq_destroy_bind(
             unsigned int device = pt_irq_bind->u.pci.device;
             unsigned int intx = pt_irq_bind->u.pci.intx;
 
-            dprintk(XENLOG_G_INFO,
-                    "d%d: unbind: m_gsi=%u g_gsi=%u dev=%02x:%02x.%u intx=%u\n",
-                    d->domain_id, machine_gsi, hvm_pci_intx_gsi(device, intx),
-                    pt_irq_bind->u.pci.bus,
-                    PCI_SLOT(device), PCI_FUNC(device), intx);
+            printk(XENLOG_G_INFO
+                   "d%d: unbind: m_gsi=%u g_gsi=%u dev=%02x:%02x.%u intx=%u\n",
+                   d->domain_id, machine_gsi, hvm_pci_intx_gsi(device, intx),
+                   pt_irq_bind->u.pci.bus,
+                   PCI_SLOT(device), PCI_FUNC(device), intx);
         }
         break;
     case PT_IRQ_TYPE_MSI:
@@ -555,10 +555,10 @@ int pt_irq_destroy_bind(
     {
         unsigned int device = pt_irq_bind->u.pci.device;
 
-        dprintk(XENLOG_G_INFO,
-                "d%d %s unmap: m_irq=%u dev=%02x:%02x.%u intx=%u\n",
-                d->domain_id, what, machine_gsi, pt_irq_bind->u.pci.bus,
-                PCI_SLOT(device), PCI_FUNC(device), pt_irq_bind->u.pci.intx);
+        printk(XENLOG_G_INFO
+               "d%d %s unmap: m_irq=%u dev=%02x:%02x.%u intx=%u\n",
+               d->domain_id, what, machine_gsi, pt_irq_bind->u.pci.bus,
+               PCI_SLOT(device), PCI_FUNC(device), pt_irq_bind->u.pci.intx);
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:55:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:55:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMIWI-0004Qe-JO; Thu, 21 Jan 2016 16:55:38 +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 1aMIWH-0004QC-E8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:37 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	C8/6D-13905-88D01A65; Thu, 21 Jan 2016 16:55:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1453395335!17294474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33232 invoked from network); 21 Jan 2016 16:55:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:55:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWt-00088m-19
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWF-0004SU-1M
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:35 +0000
Date: Thu, 21 Jan 2016 16:55:35 +0000
Message-Id: <E1aMIWF-0004SU-1M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] IOMMU: unhide messages useful for
	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 ef7e1565b794628409036fd35f4dad6d95266cef
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 13:57:43 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:57:43 2016 +0100

    IOMMU: unhide messages useful for diagnostics
    
    Undue use of dprintk() lead to many messages useful in diagnosing
    issues in the field now being hidden in non-debug (i.e. production)
    builds. Re-surface them.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 8e4d18e113c9d914a591c7bd8159c990122f50dc
    master date: 2015-12-22 10:12:14 +0100
---
 xen/drivers/passthrough/io.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c
index bda9374..4eba515 100644
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -422,10 +422,10 @@ int pt_irq_create_bind(
         spin_unlock(&d->event_lock);
 
         if ( iommu_verbose )
-            dprintk(XENLOG_G_INFO,
-                    "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);
+            printk(XENLOG_G_INFO
+                   "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;
     }
 
@@ -455,11 +455,11 @@ int pt_irq_destroy_bind(
             unsigned int device = pt_irq_bind->u.pci.device;
             unsigned int intx = pt_irq_bind->u.pci.intx;
 
-            dprintk(XENLOG_G_INFO,
-                    "d%d: unbind: m_gsi=%u g_gsi=%u dev=%02x:%02x.%u intx=%u\n",
-                    d->domain_id, machine_gsi, hvm_pci_intx_gsi(device, intx),
-                    pt_irq_bind->u.pci.bus,
-                    PCI_SLOT(device), PCI_FUNC(device), intx);
+            printk(XENLOG_G_INFO
+                   "d%d: unbind: m_gsi=%u g_gsi=%u dev=%02x:%02x.%u intx=%u\n",
+                   d->domain_id, machine_gsi, hvm_pci_intx_gsi(device, intx),
+                   pt_irq_bind->u.pci.bus,
+                   PCI_SLOT(device), PCI_FUNC(device), intx);
         }
         break;
     case PT_IRQ_TYPE_MSI:
@@ -555,10 +555,10 @@ int pt_irq_destroy_bind(
     {
         unsigned int device = pt_irq_bind->u.pci.device;
 
-        dprintk(XENLOG_G_INFO,
-                "d%d %s unmap: m_irq=%u dev=%02x:%02x.%u intx=%u\n",
-                d->domain_id, what, machine_gsi, pt_irq_bind->u.pci.bus,
-                PCI_SLOT(device), PCI_FUNC(device), pt_irq_bind->u.pci.intx);
+        printk(XENLOG_G_INFO
+               "d%d %s unmap: m_irq=%u dev=%02x:%02x.%u intx=%u\n",
+               d->domain_id, what, machine_gsi, pt_irq_bind->u.pci.bus,
+               PCI_SLOT(device), PCI_FUNC(device), pt_irq_bind->u.pci.intx);
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:55:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:55:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMIWT-0004Ti-NX; Thu, 21 Jan 2016 16:55: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 1aMIWR-0004TQ-VH
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:48 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	19/44-31122-39D01A65; Thu, 21 Jan 2016 16:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1453395345!11399510!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 883 invoked from network); 21 Jan 2016 16:55:46 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:55:46 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIX3-00088z-A4
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWP-0004Ss-Al
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:45 +0000
Date: Thu, 21 Jan 2016 16:55:45 +0000
Message-Id: <E1aMIWP-0004Ss-Al@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/vmx: Fix injection of #DB
	traps following XSA-156
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a929bee0e65296ee565251316dc53f1c6b79084a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 20 13:58:07 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:58:07 2016 +0100

    x86/vmx: Fix injection of #DB traps following XSA-156
    
    Most #DB exceptions are traps rather than faults, meaning that the instruction
    pointer in the exception frame points after the instruction rather than at it.
    
    However, VMX intercepts all have fault semantics, even when intercepting a
    trap.  Re-injecting an intercepted trap as a fault causes an infinite loop in
    the guest, by re-executing the same trapping instruction repeatedly.  This
    breaks debugging inside the guest.
    
    Introduce a helper which copies VM_EXIT_INTR_INTO to VM_ENTRY_INTR_INFO, and
    use it to mirror the intercepted interrupt back to the guest.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 0747bc8b4d85f3fc0ee1e58418418fa0229e8ff8
    master date: 2016-01-05 11:28:56 +0000
---
 xen/arch/x86/hvm/vmx/vmx.c |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index f78dc9d..404dcfe 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2800,6 +2800,33 @@ static int vmx_handle_eoi_write(void)
     return 0;
 }
 
+/*
+ * Propagate VM_EXIT_INTR_INFO to VM_ENTRY_INTR_INFO.  Used to mirror an
+ * intercepted exception back to the guest as if Xen hadn't intercepted it.
+ *
+ * It is the callers responsibility to ensure that this function is only used
+ * in the context of an appropriate vmexit.
+ */
+static void vmx_propagate_intr(void)
+{
+    unsigned long intr, tmp;
+
+    __vmread(VM_EXIT_INTR_INFO, &intr);
+
+    ASSERT(intr & INTR_INFO_VALID_MASK);
+
+    __vmwrite(VM_ENTRY_INTR_INFO, intr);
+
+    if ( intr & INTR_INFO_DELIVER_CODE_MASK )
+    {
+        __vmread(VM_EXIT_INTR_ERROR_CODE, &tmp);
+        __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, tmp);
+    }
+
+    __vmread(VM_EXIT_INSTRUCTION_LEN, &tmp);
+    __vmwrite(VM_ENTRY_INSTRUCTION_LEN, tmp);
+}
+
 static void vmx_idtv_reinject(unsigned long idtv_info)
 {
 
@@ -3048,7 +3075,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | DR_STATUS_RESERVED_ONE);
             if ( !v->domain->debugger_attached )
-                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+                vmx_propagate_intr();
             else
                 domain_pause_for_debugger();
             break;
@@ -3117,8 +3144,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             break;
         case TRAP_alignment_check:
             HVMTRACE_1D(TRAP, vector);
-            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
-            hvm_inject_hw_exception(vector, ecode);
+            vmx_propagate_intr();
             break;
         case TRAP_nmi:
             if ( MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK) !=
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:55:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:55:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMIWT-0004Ti-NX; Thu, 21 Jan 2016 16:55: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 1aMIWR-0004TQ-VH
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:48 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	19/44-31122-39D01A65; Thu, 21 Jan 2016 16:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1453395345!11399510!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 883 invoked from network); 21 Jan 2016 16:55:46 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:55:46 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIX3-00088z-A4
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWP-0004Ss-Al
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:45 +0000
Date: Thu, 21 Jan 2016 16:55:45 +0000
Message-Id: <E1aMIWP-0004Ss-Al@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/vmx: Fix injection of #DB
	traps following XSA-156
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a929bee0e65296ee565251316dc53f1c6b79084a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 20 13:58:07 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:58:07 2016 +0100

    x86/vmx: Fix injection of #DB traps following XSA-156
    
    Most #DB exceptions are traps rather than faults, meaning that the instruction
    pointer in the exception frame points after the instruction rather than at it.
    
    However, VMX intercepts all have fault semantics, even when intercepting a
    trap.  Re-injecting an intercepted trap as a fault causes an infinite loop in
    the guest, by re-executing the same trapping instruction repeatedly.  This
    breaks debugging inside the guest.
    
    Introduce a helper which copies VM_EXIT_INTR_INTO to VM_ENTRY_INTR_INFO, and
    use it to mirror the intercepted interrupt back to the guest.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 0747bc8b4d85f3fc0ee1e58418418fa0229e8ff8
    master date: 2016-01-05 11:28:56 +0000
---
 xen/arch/x86/hvm/vmx/vmx.c |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index f78dc9d..404dcfe 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2800,6 +2800,33 @@ static int vmx_handle_eoi_write(void)
     return 0;
 }
 
+/*
+ * Propagate VM_EXIT_INTR_INFO to VM_ENTRY_INTR_INFO.  Used to mirror an
+ * intercepted exception back to the guest as if Xen hadn't intercepted it.
+ *
+ * It is the callers responsibility to ensure that this function is only used
+ * in the context of an appropriate vmexit.
+ */
+static void vmx_propagate_intr(void)
+{
+    unsigned long intr, tmp;
+
+    __vmread(VM_EXIT_INTR_INFO, &intr);
+
+    ASSERT(intr & INTR_INFO_VALID_MASK);
+
+    __vmwrite(VM_ENTRY_INTR_INFO, intr);
+
+    if ( intr & INTR_INFO_DELIVER_CODE_MASK )
+    {
+        __vmread(VM_EXIT_INTR_ERROR_CODE, &tmp);
+        __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, tmp);
+    }
+
+    __vmread(VM_EXIT_INSTRUCTION_LEN, &tmp);
+    __vmwrite(VM_ENTRY_INSTRUCTION_LEN, tmp);
+}
+
 static void vmx_idtv_reinject(unsigned long idtv_info)
 {
 
@@ -3048,7 +3075,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | DR_STATUS_RESERVED_ONE);
             if ( !v->domain->debugger_attached )
-                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+                vmx_propagate_intr();
             else
                 domain_pause_for_debugger();
             break;
@@ -3117,8 +3144,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             break;
         case TRAP_alignment_check:
             HVMTRACE_1D(TRAP, vector);
-            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
-            hvm_inject_hw_exception(vector, ecode);
+            vmx_propagate_intr();
             break;
         case TRAP_nmi:
             if ( MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK) !=
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:55:59 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:55:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMIWd-0004Va-0n; Thu, 21 Jan 2016 16:55: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 1aMIWc-0004VG-4L
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:58 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	53/CF-15353-D9D01A65; Thu, 21 Jan 2016 16:55:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1453395355!17323827!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8359 invoked from network); 21 Jan 2016 16:55:56 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:55:56 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIXD-000897-JA
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWZ-0004TF-JN
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:55 +0000
Date: Thu, 21 Jan 2016 16:55:55 +0000
Message-Id: <E1aMIWZ-0004TF-JN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] docs: correct descriptions of
	gnttab_max_{, maptrack}_frames
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5929e25d98b59c64d7fd37fe4b885e2f1b0d717f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jan 20 13:59:02 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:59:02 2016 +0100

    docs: correct descriptions of gnttab_max_{, maptrack}_frames
    
    gnttab_max_frames incorrectly referred to numbers of grant tab
    operations and gnttab_max_maptrack_frames was confusingly worded.
    
    Add the default for gnttab_max_frames while here (it's currently the
    same on all arches since no arch uses the available arch override) and
    adjust the default for gnttab_max_maptrack_frames to match the normal
    form.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ef17887d848dae0ca46231b47bf30d3c1d4aa87d
    master date: 2016-01-19 16:24:44 +0000
---
 docs/misc/xen-command-line.markdown |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 7c936c1..b887d53 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -736,13 +736,18 @@ Specify the serial parameters for the GDB stub.
 ### gnttab\_max\_frames
 > `= <integer>`
 
-Specify the maximum number of frames per grant table operation.
+> Default: `32`
+
+Specify the maximum number of frames which any domain may use as part
+of its grant table.
 
 ### gnttab\_max\_maptrack\_frames
 > `= <integer>`
 
-Specify the maximum number of maptrack frames domain.
-The default value is 8 times **gnttab\_max\_frames**.
+> Default: `8 * gnttab_max_frames`
+
+Specify the maximum number of frames to use as part of a domains
+maptrack array.
 
 ### gnttab\_max\_nr\_frames
 > `= <integer>`
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:55:59 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:55:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMIWd-0004Va-0n; Thu, 21 Jan 2016 16:55: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 1aMIWc-0004VG-4L
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:58 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	53/CF-15353-D9D01A65; Thu, 21 Jan 2016 16:55:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1453395355!17323827!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8359 invoked from network); 21 Jan 2016 16:55:56 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:55:56 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIXD-000897-JA
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWZ-0004TF-JN
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:55:55 +0000
Date: Thu, 21 Jan 2016 16:55:55 +0000
Message-Id: <E1aMIWZ-0004TF-JN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] docs: correct descriptions of
	gnttab_max_{, maptrack}_frames
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5929e25d98b59c64d7fd37fe4b885e2f1b0d717f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jan 20 13:59:02 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:59:02 2016 +0100

    docs: correct descriptions of gnttab_max_{, maptrack}_frames
    
    gnttab_max_frames incorrectly referred to numbers of grant tab
    operations and gnttab_max_maptrack_frames was confusingly worded.
    
    Add the default for gnttab_max_frames while here (it's currently the
    same on all arches since no arch uses the available arch override) and
    adjust the default for gnttab_max_maptrack_frames to match the normal
    form.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ef17887d848dae0ca46231b47bf30d3c1d4aa87d
    master date: 2016-01-19 16:24:44 +0000
---
 docs/misc/xen-command-line.markdown |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 7c936c1..b887d53 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -736,13 +736,18 @@ Specify the serial parameters for the GDB stub.
 ### gnttab\_max\_frames
 > `= <integer>`
 
-Specify the maximum number of frames per grant table operation.
+> Default: `32`
+
+Specify the maximum number of frames which any domain may use as part
+of its grant table.
 
 ### gnttab\_max\_maptrack\_frames
 > `= <integer>`
 
-Specify the maximum number of maptrack frames domain.
-The default value is 8 times **gnttab\_max\_frames**.
+> Default: `8 * gnttab_max_frames`
+
+Specify the maximum number of frames to use as part of a domains
+maptrack array.
 
 ### gnttab\_max\_nr\_frames
 > `= <integer>`
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:56:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:56: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 1aMIWn-0004Ya-5H; Thu, 21 Jan 2016 16:56: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 1aMIWm-0004YG-Af
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:08 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	97/7B-12635-7AD01A65; Thu, 21 Jan 2016 16:56:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1453395366!17032800!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23995 invoked from network); 21 Jan 2016 16:56:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:56:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIXO-00089F-07
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWj-0004Tk-SU
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:06 +0000
Date: Thu, 21 Jan 2016 16:56:05 +0000
Message-Id: <E1aMIWj-0004Tk-SU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] VT-d: use proper error codes in
	iommu_enable_x2apic_IR()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1fd615aa0108490ffc558d27627f509183cbfdaf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:00:08 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:00:08 2016 +0100

    VT-d: use proper error codes in iommu_enable_x2apic_IR()
    
    ... allowing to suppress a confusing message combination: When
    ACPI_DMAR_X2APIC_OPT_OUT is set, so far we first logged a message
    that IR could not be enabled (hence not using x2APIC), followed by
    one indicating successful initialization of IR (if no other problems
    prevented that).
    
    Also adjust the return type of iommu_supports_eim() and fix some
    broken indentation in the function.
    
    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: 6851e979874ebc05d270ea94360c49d920d3eaf4
    master date: 2015-10-13 17:16:22 +0200
---
 xen/arch/x86/apic.c                    |   12 +++++++++++-
 xen/drivers/passthrough/vtd/intremap.c |   16 ++++++++--------
 xen/include/asm-x86/iommu.h            |    2 +-
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 2c9ae4e..44b1ac9 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -943,8 +943,18 @@ void __init x2apic_bsp_setup(void)
     mask_8259A();
     mask_IO_APIC_setup(ioapic_entries);
 
-    if ( iommu_enable_x2apic_IR() )
+    switch ( iommu_enable_x2apic_IR() )
     {
+    case 0:
+        break;
+    case -ENXIO: /* ACPI_DMAR_X2APIC_OPT_OUT set */
+        if ( !x2apic_enabled )
+        {
+            printk("Not enabling x2APIC (upon firmware request)\n");
+            goto restore_out;
+        }
+        /* fall through */
+    default:
         if ( x2apic_enabled )
             panic("Interrupt remapping could not be enabled while "
                   "x2APIC is already enabled by BIOS");
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 987bbe9..f9ba0ce 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -143,10 +143,10 @@ static void set_hpet_source_id(unsigned int id, struct iremap_entry *ire)
     set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_13_IGNORE_3, hpetid_to_bdf(id));
 }
 
-int iommu_supports_eim(void)
+bool_t iommu_supports_eim(void)
 {
     struct acpi_drhd_unit *drhd;
-    int apic;
+    unsigned int apic;
 
     if ( !iommu_qinval || !iommu_intremap || list_empty(&acpi_drhd_units) )
         return 0;
@@ -154,12 +154,12 @@ int iommu_supports_eim(void)
     /* We MUST have a DRHD unit for each IOAPIC. */
     for ( apic = 0; apic < nr_ioapics; apic++ )
         if ( !ioapic_to_drhd(IO_APIC_ID(apic)) )
-    {
+        {
             dprintk(XENLOG_WARNING VTDPREFIX,
                     "There is not a DRHD for IOAPIC %#x (id: %#x)!\n",
                     apic, IO_APIC_ID(apic));
             return 0;
-    }
+        }
 
     for_each_drhd_unit ( drhd )
         if ( !ecap_queued_inval(drhd->iommu->ecap) ||
@@ -833,10 +833,10 @@ int iommu_enable_x2apic_IR(void)
     struct iommu *iommu;
 
     if ( !iommu_supports_eim() )
-        return -1;
+        return -EOPNOTSUPP;
 
     if ( !platform_supports_x2apic() )
-        return -1;
+        return -ENXIO;
 
     for_each_drhd_unit ( drhd )
     {
@@ -861,7 +861,7 @@ int iommu_enable_x2apic_IR(void)
         {
             dprintk(XENLOG_INFO VTDPREFIX,
                     "Failed to enable Queued Invalidation!\n");
-            return -1;
+            return -EIO;
         }
     }
 
@@ -873,7 +873,7 @@ int iommu_enable_x2apic_IR(void)
         {
             dprintk(XENLOG_INFO VTDPREFIX,
                     "Failed to enable Interrupt Remapping!\n");
-            return -1;
+            return -EIO;
         }
     }
 
diff --git a/xen/include/asm-x86/iommu.h b/xen/include/asm-x86/iommu.h
index 29203d7..7e24b1a 100644
--- a/xen/include/asm-x86/iommu.h
+++ b/xen/include/asm-x86/iommu.h
@@ -27,7 +27,7 @@ int iommu_setup_hpet_msi(struct msi_desc *);
 /* While VT-d specific, this must get declared in a generic header. */
 int adjust_vtd_irq_affinities(void);
 void iommu_pte_flush(struct domain *d, u64 gfn, u64 *pte, int order, int present);
-int iommu_supports_eim(void);
+bool_t iommu_supports_eim(void);
 int iommu_enable_x2apic_IR(void);
 void iommu_disable_x2apic_IR(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 16:56:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 16:56: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 1aMIWn-0004Ya-5H; Thu, 21 Jan 2016 16:56: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 1aMIWm-0004YG-Af
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:08 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	97/7B-12635-7AD01A65; Thu, 21 Jan 2016 16:56:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1453395366!17032800!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23995 invoked from network); 21 Jan 2016 16:56:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 16:56:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIXO-00089F-07
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIWj-0004Tk-SU
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 16:56:06 +0000
Date: Thu, 21 Jan 2016 16:56:05 +0000
Message-Id: <E1aMIWj-0004Tk-SU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] VT-d: use proper error codes in
	iommu_enable_x2apic_IR()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1fd615aa0108490ffc558d27627f509183cbfdaf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:00:08 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:00:08 2016 +0100

    VT-d: use proper error codes in iommu_enable_x2apic_IR()
    
    ... allowing to suppress a confusing message combination: When
    ACPI_DMAR_X2APIC_OPT_OUT is set, so far we first logged a message
    that IR could not be enabled (hence not using x2APIC), followed by
    one indicating successful initialization of IR (if no other problems
    prevented that).
    
    Also adjust the return type of iommu_supports_eim() and fix some
    broken indentation in the function.
    
    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: 6851e979874ebc05d270ea94360c49d920d3eaf4
    master date: 2015-10-13 17:16:22 +0200
---
 xen/arch/x86/apic.c                    |   12 +++++++++++-
 xen/drivers/passthrough/vtd/intremap.c |   16 ++++++++--------
 xen/include/asm-x86/iommu.h            |    2 +-
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 2c9ae4e..44b1ac9 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -943,8 +943,18 @@ void __init x2apic_bsp_setup(void)
     mask_8259A();
     mask_IO_APIC_setup(ioapic_entries);
 
-    if ( iommu_enable_x2apic_IR() )
+    switch ( iommu_enable_x2apic_IR() )
     {
+    case 0:
+        break;
+    case -ENXIO: /* ACPI_DMAR_X2APIC_OPT_OUT set */
+        if ( !x2apic_enabled )
+        {
+            printk("Not enabling x2APIC (upon firmware request)\n");
+            goto restore_out;
+        }
+        /* fall through */
+    default:
         if ( x2apic_enabled )
             panic("Interrupt remapping could not be enabled while "
                   "x2APIC is already enabled by BIOS");
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 987bbe9..f9ba0ce 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -143,10 +143,10 @@ static void set_hpet_source_id(unsigned int id, struct iremap_entry *ire)
     set_ire_sid(ire, SVT_VERIFY_SID_SQ, SQ_13_IGNORE_3, hpetid_to_bdf(id));
 }
 
-int iommu_supports_eim(void)
+bool_t iommu_supports_eim(void)
 {
     struct acpi_drhd_unit *drhd;
-    int apic;
+    unsigned int apic;
 
     if ( !iommu_qinval || !iommu_intremap || list_empty(&acpi_drhd_units) )
         return 0;
@@ -154,12 +154,12 @@ int iommu_supports_eim(void)
     /* We MUST have a DRHD unit for each IOAPIC. */
     for ( apic = 0; apic < nr_ioapics; apic++ )
         if ( !ioapic_to_drhd(IO_APIC_ID(apic)) )
-    {
+        {
             dprintk(XENLOG_WARNING VTDPREFIX,
                     "There is not a DRHD for IOAPIC %#x (id: %#x)!\n",
                     apic, IO_APIC_ID(apic));
             return 0;
-    }
+        }
 
     for_each_drhd_unit ( drhd )
         if ( !ecap_queued_inval(drhd->iommu->ecap) ||
@@ -833,10 +833,10 @@ int iommu_enable_x2apic_IR(void)
     struct iommu *iommu;
 
     if ( !iommu_supports_eim() )
-        return -1;
+        return -EOPNOTSUPP;
 
     if ( !platform_supports_x2apic() )
-        return -1;
+        return -ENXIO;
 
     for_each_drhd_unit ( drhd )
     {
@@ -861,7 +861,7 @@ int iommu_enable_x2apic_IR(void)
         {
             dprintk(XENLOG_INFO VTDPREFIX,
                     "Failed to enable Queued Invalidation!\n");
-            return -1;
+            return -EIO;
         }
     }
 
@@ -873,7 +873,7 @@ int iommu_enable_x2apic_IR(void)
         {
             dprintk(XENLOG_INFO VTDPREFIX,
                     "Failed to enable Interrupt Remapping!\n");
-            return -1;
+            return -EIO;
         }
     }
 
diff --git a/xen/include/asm-x86/iommu.h b/xen/include/asm-x86/iommu.h
index 29203d7..7e24b1a 100644
--- a/xen/include/asm-x86/iommu.h
+++ b/xen/include/asm-x86/iommu.h
@@ -27,7 +27,7 @@ int iommu_setup_hpet_msi(struct msi_desc *);
 /* While VT-d specific, this must get declared in a generic header. */
 int adjust_vtd_irq_affinities(void);
 void iommu_pte_flush(struct domain *d, u64 gfn, u64 *pte, int order, int present);
-int iommu_supports_eim(void);
+bool_t iommu_supports_eim(void);
 int iommu_enable_x2apic_IR(void);
 void iommu_disable_x2apic_IR(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:00:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:00: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 1aMIae-0004gc-Kp; Thu, 21 Jan 2016 17:00: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 1aMIad-0004gX-Kg
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:07 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	1C/67-13487-69E01A65; Thu, 21 Jan 2016 17:00:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453395605!17102980!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10505 invoked from network); 21 Jan 2016 17:00:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:00:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbF-0008GQ-5L
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIab-0004mw-5j
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:05 +0000
Date: Thu, 21 Jan 2016 17:00:05 +0000
Message-Id: <E1aMIab-0004mw-5j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: convert bigmem to Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 165f36d5fa60ade72f691fbb81aad0a2cadaca37
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Tue Jan 12 11:27:49 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:27:49 2016 +0100

    x86: convert bigmem to Kconfig
    
    Convert the bigmem build option to Kconfig.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/arch/x86/Kconfig  |   11 +++++++++++
 xen/arch/x86/Rules.mk |    2 --
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 7d2ed96..d629767 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -25,6 +25,17 @@ config ARCH_DEFCONFIG
 
 menu "Architecture Features"
 
+config BIGMEM
+	bool "big memory support"
+	default n
+	---help---
+	  Allows Xen to support up to 123Tb of memory.
+
+	  This requires enlarging struct page_info as well as shrinking
+	  the always accessible direct mapped memory range.
+
+	  If unsure, say N.
+
 endmenu
 
 source "common/Kconfig"
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index b76a754..a108d24 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -23,7 +23,6 @@ $(call as-insn-check,CFLAGS,CC,".equ \"x\"$$(comma)1", \
                      '-D__OBJECT_LABEL__=$(subst $(BASEDIR)/,,$(CURDIR))/$$@')
 
 shadow-paging ?= y
-bigmem        ?= n
 
 CFLAGS += -mno-red-zone -mno-sse -fpic
 CFLAGS += -fno-asynchronous-unwind-tables
@@ -33,4 +32,3 @@ CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
 
 CFLAGS-$(shadow-paging) += -DCONFIG_SHADOW_PAGING
-CFLAGS-$(bigmem)        += -DCONFIG_BIGMEM
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:00:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:00: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 1aMIae-0004gc-Kp; Thu, 21 Jan 2016 17:00: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 1aMIad-0004gX-Kg
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:07 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	1C/67-13487-69E01A65; Thu, 21 Jan 2016 17:00:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453395605!17102980!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10505 invoked from network); 21 Jan 2016 17:00:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:00:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbF-0008GQ-5L
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIab-0004mw-5j
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:05 +0000
Date: Thu, 21 Jan 2016 17:00:05 +0000
Message-Id: <E1aMIab-0004mw-5j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: convert bigmem to Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 165f36d5fa60ade72f691fbb81aad0a2cadaca37
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Tue Jan 12 11:27:49 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:27:49 2016 +0100

    x86: convert bigmem to Kconfig
    
    Convert the bigmem build option to Kconfig.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/arch/x86/Kconfig  |   11 +++++++++++
 xen/arch/x86/Rules.mk |    2 --
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 7d2ed96..d629767 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -25,6 +25,17 @@ config ARCH_DEFCONFIG
 
 menu "Architecture Features"
 
+config BIGMEM
+	bool "big memory support"
+	default n
+	---help---
+	  Allows Xen to support up to 123Tb of memory.
+
+	  This requires enlarging struct page_info as well as shrinking
+	  the always accessible direct mapped memory range.
+
+	  If unsure, say N.
+
 endmenu
 
 source "common/Kconfig"
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index b76a754..a108d24 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -23,7 +23,6 @@ $(call as-insn-check,CFLAGS,CC,".equ \"x\"$$(comma)1", \
                      '-D__OBJECT_LABEL__=$(subst $(BASEDIR)/,,$(CURDIR))/$$@')
 
 shadow-paging ?= y
-bigmem        ?= n
 
 CFLAGS += -mno-red-zone -mno-sse -fpic
 CFLAGS += -fno-asynchronous-unwind-tables
@@ -33,4 +32,3 @@ CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
 
 CFLAGS-$(shadow-paging) += -DCONFIG_SHADOW_PAGING
-CFLAGS-$(bigmem)        += -DCONFIG_BIGMEM
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:00:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17: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 1aMIap-0004hT-Nx; Thu, 21 Jan 2016 17:00: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 1aMIao-0004hH-Dm
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:18 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	9A/A9-31122-1AE01A65; Thu, 21 Jan 2016 17:00:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1453395615!11396187!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38352 invoked from network); 21 Jan 2016 17:00:17 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:00:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbP-0008HJ-Fw
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIal-0004nL-Dp
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:15 +0000
Date: Thu, 21 Jan 2016 17:00:15 +0000
Message-Id: <E1aMIal-0004nL-Dp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: allow guest to use clflushopt
	and clwb
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3cb82a561382466208db50d41d6401e2cc4819dd
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Tue Jan 12 11:28:58 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:28:58 2016 +0100

    x86/hvm: allow guest to use clflushopt and clwb
    
    Pass CPU features CLFLUSHOPT and CLWB into HVM domain so that those two
    instructions can be used by guest.
    
    The specification of above two instructions can be found in
    https://software.intel.com/sites/default/files/managed/0d/53/319433-022.pdf
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com> for tools bits
---
 tools/libxc/xc_cpufeature.h |    3 ++-
 tools/libxc/xc_cpuid_x86.c  |    4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_cpufeature.h b/tools/libxc/xc_cpufeature.h
index c3ddc80..5288ac6 100644
--- a/tools/libxc/xc_cpufeature.h
+++ b/tools/libxc/xc_cpufeature.h
@@ -140,6 +140,7 @@
 #define X86_FEATURE_RDSEED      18 /* RDSEED instruction */
 #define X86_FEATURE_ADX         19 /* ADCX, ADOX instructions */
 #define X86_FEATURE_SMAP        20 /* Supervisor Mode Access Protection */
-
+#define X86_FEATURE_CLFLUSHOPT  23 /* CLFLUSHOPT instruction */
+#define X86_FEATURE_CLWB        24 /* CLWB instruction */
 
 #endif /* __LIBXC_CPUFEATURE_H */
diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index 8882c01..fecfd6c 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -426,7 +426,9 @@ static void xc_cpuid_hvm_policy(xc_interface *xch,
                         bitmaskof(X86_FEATURE_RDSEED)  |
                         bitmaskof(X86_FEATURE_ADX)  |
                         bitmaskof(X86_FEATURE_SMAP) |
-                        bitmaskof(X86_FEATURE_FSGSBASE));
+                        bitmaskof(X86_FEATURE_FSGSBASE) |
+                        bitmaskof(X86_FEATURE_CLWB) |
+                        bitmaskof(X86_FEATURE_CLFLUSHOPT));
         } else
             regs[1] = 0;
         regs[0] = regs[2] = regs[3] = 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 Jan 21 17:00:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17: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 1aMIap-0004hT-Nx; Thu, 21 Jan 2016 17:00: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 1aMIao-0004hH-Dm
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:18 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	9A/A9-31122-1AE01A65; Thu, 21 Jan 2016 17:00:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1453395615!11396187!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38352 invoked from network); 21 Jan 2016 17:00:17 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:00:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbP-0008HJ-Fw
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIal-0004nL-Dp
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:15 +0000
Date: Thu, 21 Jan 2016 17:00:15 +0000
Message-Id: <E1aMIal-0004nL-Dp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: allow guest to use clflushopt
	and clwb
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3cb82a561382466208db50d41d6401e2cc4819dd
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Tue Jan 12 11:28:58 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:28:58 2016 +0100

    x86/hvm: allow guest to use clflushopt and clwb
    
    Pass CPU features CLFLUSHOPT and CLWB into HVM domain so that those two
    instructions can be used by guest.
    
    The specification of above two instructions can be found in
    https://software.intel.com/sites/default/files/managed/0d/53/319433-022.pdf
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com> for tools bits
---
 tools/libxc/xc_cpufeature.h |    3 ++-
 tools/libxc/xc_cpuid_x86.c  |    4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_cpufeature.h b/tools/libxc/xc_cpufeature.h
index c3ddc80..5288ac6 100644
--- a/tools/libxc/xc_cpufeature.h
+++ b/tools/libxc/xc_cpufeature.h
@@ -140,6 +140,7 @@
 #define X86_FEATURE_RDSEED      18 /* RDSEED instruction */
 #define X86_FEATURE_ADX         19 /* ADCX, ADOX instructions */
 #define X86_FEATURE_SMAP        20 /* Supervisor Mode Access Protection */
-
+#define X86_FEATURE_CLFLUSHOPT  23 /* CLFLUSHOPT instruction */
+#define X86_FEATURE_CLWB        24 /* CLWB instruction */
 
 #endif /* __LIBXC_CPUFEATURE_H */
diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index 8882c01..fecfd6c 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -426,7 +426,9 @@ static void xc_cpuid_hvm_policy(xc_interface *xch,
                         bitmaskof(X86_FEATURE_RDSEED)  |
                         bitmaskof(X86_FEATURE_ADX)  |
                         bitmaskof(X86_FEATURE_SMAP) |
-                        bitmaskof(X86_FEATURE_FSGSBASE));
+                        bitmaskof(X86_FEATURE_FSGSBASE) |
+                        bitmaskof(X86_FEATURE_CLWB) |
+                        bitmaskof(X86_FEATURE_CLFLUSHOPT));
         } else
             regs[1] = 0;
         regs[0] = regs[2] = regs[3] = 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 Jan 21 17:00:35 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:00: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 1aMIb5-0004k1-Bi; Thu, 21 Jan 2016 17:00: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 1aMIb3-0004jf-N7
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:34 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	86/9E-31443-0BE01A65; Thu, 21 Jan 2016 17:00:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1453395631!17322083!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45909 invoked from network); 21 Jan 2016 17:00:32 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:00:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbe-0008Hu-V6
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIav-0004nu-UN
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:25 +0000
Date: Thu, 21 Jan 2016 17:00:25 +0000
Message-Id: <E1aMIav-0004nu-UN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: add support for pcommit
	instruction
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cfacce340608be5f94ce0c8f424487b63c3d5399
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Tue Jan 12 11:29:25 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:29:25 2016 +0100

    x86/hvm: add support for pcommit instruction
    
    Pass PCOMMIT CPU feature into HVM domain. Currently, we do not intercept
    pcommit instruction for L1 guest, and allow L1 to intercept pcommit
    instruction for L2 guest.
    
    The specification of pcommit instruction can be found in
    https://software.intel.com/sites/default/files/managed/0d/53/319433-022.pdf
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com> for tools bits
---
 tools/libxc/xc_cpufeature.h        |    1 +
 tools/libxc/xc_cpuid_x86.c         |    1 +
 xen/arch/x86/hvm/hvm.c             |   31 +++++++++++++++++++------------
 xen/arch/x86/hvm/vmx/vmcs.c        |    9 ++++++++-
 xen/arch/x86/hvm/vmx/vmx.c         |    1 +
 xen/arch/x86/hvm/vmx/vvmx.c        |    3 +++
 xen/include/asm-x86/cpufeature.h   |    1 +
 xen/include/asm-x86/hvm/vmx/vmcs.h |    4 +++-
 xen/include/asm-x86/hvm/vmx/vmx.h  |    1 +
 9 files changed, 38 insertions(+), 14 deletions(-)

diff --git a/tools/libxc/xc_cpufeature.h b/tools/libxc/xc_cpufeature.h
index 5288ac6..ee53679 100644
--- a/tools/libxc/xc_cpufeature.h
+++ b/tools/libxc/xc_cpufeature.h
@@ -140,6 +140,7 @@
 #define X86_FEATURE_RDSEED      18 /* RDSEED instruction */
 #define X86_FEATURE_ADX         19 /* ADCX, ADOX instructions */
 #define X86_FEATURE_SMAP        20 /* Supervisor Mode Access Protection */
+#define X86_FEATURE_PCOMMIT     22 /* PCOMMIT instruction */
 #define X86_FEATURE_CLFLUSHOPT  23 /* CLFLUSHOPT instruction */
 #define X86_FEATURE_CLWB        24 /* CLWB instruction */
 
diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index fecfd6c..c142595 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -427,6 +427,7 @@ static void xc_cpuid_hvm_policy(xc_interface *xch,
                         bitmaskof(X86_FEATURE_ADX)  |
                         bitmaskof(X86_FEATURE_SMAP) |
                         bitmaskof(X86_FEATURE_FSGSBASE) |
+                        bitmaskof(X86_FEATURE_PCOMMIT) |
                         bitmaskof(X86_FEATURE_CLWB) |
                         bitmaskof(X86_FEATURE_CLFLUSHOPT));
         } else
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 21470ec..787b7de 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4583,21 +4583,28 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
             *edx &= ~cpufeat_mask(X86_FEATURE_PSE36);
         break;
     case 0x7:
-        if ( (count == 0) && !cpu_has_smep )
-            *ebx &= ~cpufeat_mask(X86_FEATURE_SMEP);
+        if ( count == 0 )
+        {
+            if ( !cpu_has_smep )
+                *ebx &= ~cpufeat_mask(X86_FEATURE_SMEP);
+
+            if ( !cpu_has_smap )
+                *ebx &= ~cpufeat_mask(X86_FEATURE_SMAP);
 
-        if ( (count == 0) && !cpu_has_smap )
-            *ebx &= ~cpufeat_mask(X86_FEATURE_SMAP);
+            /* Don't expose MPX to hvm when VMX support is not available */
+            if ( !(vmx_vmexit_control & VM_EXIT_CLEAR_BNDCFGS) ||
+                 !(vmx_vmentry_control & VM_ENTRY_LOAD_BNDCFGS) )
+                *ebx &= ~cpufeat_mask(X86_FEATURE_MPX);
 
-        /* Don't expose MPX to hvm when VMX support is not available */
-        if ( (count == 0) &&
-             (!(vmx_vmexit_control & VM_EXIT_CLEAR_BNDCFGS) ||
-              !(vmx_vmentry_control & VM_ENTRY_LOAD_BNDCFGS)) )
-            *ebx &= ~cpufeat_mask(X86_FEATURE_MPX);
+            /* Don't expose INVPCID to non-hap hvm. */
+            if ( !hap_enabled(d) )
+                *ebx &= ~cpufeat_mask(X86_FEATURE_INVPCID);
+
+            /* Don't expose PCOMMIT to hvm when VMX support is not available */
+            if ( !cpu_has_vmx_pcommit )
+                *ebx &= ~cpufeat_mask(X86_FEATURE_PCOMMIT);
+        }
 
-        /* Don't expose INVPCID to non-hap hvm. */
-        if ( (count == 0) && !hap_enabled(d) )
-            *ebx &= ~cpufeat_mask(X86_FEATURE_INVPCID);
         break;
     case 0xb:
         /* Fix the x2APIC identifier. */
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index edd4c8d..5bc3c74 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -242,7 +242,8 @@ static int vmx_init_vmcs_config(void)
                SECONDARY_EXEC_ENABLE_INVPCID |
                SECONDARY_EXEC_ENABLE_VM_FUNCTIONS |
                SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS |
-               SECONDARY_EXEC_XSAVES);
+               SECONDARY_EXEC_XSAVES |
+               SECONDARY_EXEC_PCOMMIT);
         rdmsrl(MSR_IA32_VMX_MISC, _vmx_misc_cap);
         if ( _vmx_misc_cap & VMX_MISC_VMWRITE_ALL )
             opt |= SECONDARY_EXEC_ENABLE_VMCS_SHADOWING;
@@ -1075,6 +1076,12 @@ static int construct_vmcs(struct vcpu *v)
         __vmwrite(PLE_WINDOW, ple_window);
     }
 
+    /*
+     * We do not intercept pcommit for L1 guest and allow L1 hypervisor to
+     * intercept pcommit for L2 guest (see nvmx_n2_vmexit_handler()).
+     */
+    v->arch.hvm_vmx.secondary_exec_control &= ~SECONDARY_EXEC_PCOMMIT;
+
     if ( cpu_has_vmx_secondary_exec_control )
         __vmwrite(SECONDARY_VM_EXEC_CONTROL,
                   v->arch.hvm_vmx.secondary_exec_control);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 7917fb7..04dde83 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -3543,6 +3543,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
     case EXIT_REASON_ACCESS_LDTR_OR_TR:
     case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
     case EXIT_REASON_INVPCID:
+    case EXIT_REASON_PCOMMIT:
     /* fall through */
     default:
     exit_and_crash:
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index ea1052e..271ec70 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1950,6 +1950,8 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
                SECONDARY_EXEC_ENABLE_VPID |
                SECONDARY_EXEC_UNRESTRICTED_GUEST |
                SECONDARY_EXEC_ENABLE_EPT;
+        if ( cpu_has_vmx_pcommit )
+            data |= SECONDARY_EXEC_PCOMMIT;
         data = gen_vmx_msr(data, 0, host_data);
         break;
     case MSR_IA32_VMX_EXIT_CTLS:
@@ -2226,6 +2228,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
     case EXIT_REASON_VMXON:
     case EXIT_REASON_INVEPT:
     case EXIT_REASON_XSETBV:
+    case EXIT_REASON_PCOMMIT:
         /* inject to L1 */
         nvcpu->nv_vmexit_pending = 1;
         break;
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index ef96514..23f9fb2 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -162,6 +162,7 @@
 #define X86_FEATURE_RDSEED	(7*32+18) /* RDSEED instruction */
 #define X86_FEATURE_ADX		(7*32+19) /* ADCX, ADOX instructions */
 #define X86_FEATURE_SMAP	(7*32+20) /* Supervisor Mode Access Prevention */
+#define X86_FEATURE_PCOMMIT	(7*32+22) /* PCOMMIT instruction */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ecx), word 8 */
 #define X86_FEATURE_PKU	(8*32+ 3) /* Protection Keys for Userspace */
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index d1496b8..a5e7aee 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -236,6 +236,7 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_ENABLE_PML               0x00020000
 #define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000
 #define SECONDARY_EXEC_XSAVES                   0x00100000
+#define SECONDARY_EXEC_PCOMMIT                  0x00200000
 extern u32 vmx_secondary_exec_control;
 
 #define VMX_EPT_EXEC_ONLY_SUPPORTED                         0x00000001
@@ -303,7 +304,8 @@ extern u64 vmx_ept_vpid_cap;
     (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_PML)
 #define cpu_has_vmx_xsaves \
     (vmx_secondary_exec_control & SECONDARY_EXEC_XSAVES)
-
+#define cpu_has_vmx_pcommit \
+    (vmx_secondary_exec_control & SECONDARY_EXEC_PCOMMIT)
 #define VMCS_RID_TYPE_MASK              0x80000000
 
 /* GUEST_INTERRUPTIBILITY_INFO flags. */
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 1719965..14f3d32 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -213,6 +213,7 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
 #define EXIT_REASON_PML_FULL            62
 #define EXIT_REASON_XSAVES              63
 #define EXIT_REASON_XRSTORS             64
+#define EXIT_REASON_PCOMMIT             65
 
 /*
  * Interruption-information format
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:00:35 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:00: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 1aMIb5-0004k1-Bi; Thu, 21 Jan 2016 17:00: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 1aMIb3-0004jf-N7
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:34 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	86/9E-31443-0BE01A65; Thu, 21 Jan 2016 17:00:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1453395631!17322083!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45909 invoked from network); 21 Jan 2016 17:00:32 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:00:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbe-0008Hu-V6
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIav-0004nu-UN
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:25 +0000
Date: Thu, 21 Jan 2016 17:00:25 +0000
Message-Id: <E1aMIav-0004nu-UN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: add support for pcommit
	instruction
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cfacce340608be5f94ce0c8f424487b63c3d5399
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Tue Jan 12 11:29:25 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:29:25 2016 +0100

    x86/hvm: add support for pcommit instruction
    
    Pass PCOMMIT CPU feature into HVM domain. Currently, we do not intercept
    pcommit instruction for L1 guest, and allow L1 to intercept pcommit
    instruction for L2 guest.
    
    The specification of pcommit instruction can be found in
    https://software.intel.com/sites/default/files/managed/0d/53/319433-022.pdf
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com> for tools bits
---
 tools/libxc/xc_cpufeature.h        |    1 +
 tools/libxc/xc_cpuid_x86.c         |    1 +
 xen/arch/x86/hvm/hvm.c             |   31 +++++++++++++++++++------------
 xen/arch/x86/hvm/vmx/vmcs.c        |    9 ++++++++-
 xen/arch/x86/hvm/vmx/vmx.c         |    1 +
 xen/arch/x86/hvm/vmx/vvmx.c        |    3 +++
 xen/include/asm-x86/cpufeature.h   |    1 +
 xen/include/asm-x86/hvm/vmx/vmcs.h |    4 +++-
 xen/include/asm-x86/hvm/vmx/vmx.h  |    1 +
 9 files changed, 38 insertions(+), 14 deletions(-)

diff --git a/tools/libxc/xc_cpufeature.h b/tools/libxc/xc_cpufeature.h
index 5288ac6..ee53679 100644
--- a/tools/libxc/xc_cpufeature.h
+++ b/tools/libxc/xc_cpufeature.h
@@ -140,6 +140,7 @@
 #define X86_FEATURE_RDSEED      18 /* RDSEED instruction */
 #define X86_FEATURE_ADX         19 /* ADCX, ADOX instructions */
 #define X86_FEATURE_SMAP        20 /* Supervisor Mode Access Protection */
+#define X86_FEATURE_PCOMMIT     22 /* PCOMMIT instruction */
 #define X86_FEATURE_CLFLUSHOPT  23 /* CLFLUSHOPT instruction */
 #define X86_FEATURE_CLWB        24 /* CLWB instruction */
 
diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index fecfd6c..c142595 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -427,6 +427,7 @@ static void xc_cpuid_hvm_policy(xc_interface *xch,
                         bitmaskof(X86_FEATURE_ADX)  |
                         bitmaskof(X86_FEATURE_SMAP) |
                         bitmaskof(X86_FEATURE_FSGSBASE) |
+                        bitmaskof(X86_FEATURE_PCOMMIT) |
                         bitmaskof(X86_FEATURE_CLWB) |
                         bitmaskof(X86_FEATURE_CLFLUSHOPT));
         } else
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 21470ec..787b7de 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4583,21 +4583,28 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
             *edx &= ~cpufeat_mask(X86_FEATURE_PSE36);
         break;
     case 0x7:
-        if ( (count == 0) && !cpu_has_smep )
-            *ebx &= ~cpufeat_mask(X86_FEATURE_SMEP);
+        if ( count == 0 )
+        {
+            if ( !cpu_has_smep )
+                *ebx &= ~cpufeat_mask(X86_FEATURE_SMEP);
+
+            if ( !cpu_has_smap )
+                *ebx &= ~cpufeat_mask(X86_FEATURE_SMAP);
 
-        if ( (count == 0) && !cpu_has_smap )
-            *ebx &= ~cpufeat_mask(X86_FEATURE_SMAP);
+            /* Don't expose MPX to hvm when VMX support is not available */
+            if ( !(vmx_vmexit_control & VM_EXIT_CLEAR_BNDCFGS) ||
+                 !(vmx_vmentry_control & VM_ENTRY_LOAD_BNDCFGS) )
+                *ebx &= ~cpufeat_mask(X86_FEATURE_MPX);
 
-        /* Don't expose MPX to hvm when VMX support is not available */
-        if ( (count == 0) &&
-             (!(vmx_vmexit_control & VM_EXIT_CLEAR_BNDCFGS) ||
-              !(vmx_vmentry_control & VM_ENTRY_LOAD_BNDCFGS)) )
-            *ebx &= ~cpufeat_mask(X86_FEATURE_MPX);
+            /* Don't expose INVPCID to non-hap hvm. */
+            if ( !hap_enabled(d) )
+                *ebx &= ~cpufeat_mask(X86_FEATURE_INVPCID);
+
+            /* Don't expose PCOMMIT to hvm when VMX support is not available */
+            if ( !cpu_has_vmx_pcommit )
+                *ebx &= ~cpufeat_mask(X86_FEATURE_PCOMMIT);
+        }
 
-        /* Don't expose INVPCID to non-hap hvm. */
-        if ( (count == 0) && !hap_enabled(d) )
-            *ebx &= ~cpufeat_mask(X86_FEATURE_INVPCID);
         break;
     case 0xb:
         /* Fix the x2APIC identifier. */
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index edd4c8d..5bc3c74 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -242,7 +242,8 @@ static int vmx_init_vmcs_config(void)
                SECONDARY_EXEC_ENABLE_INVPCID |
                SECONDARY_EXEC_ENABLE_VM_FUNCTIONS |
                SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS |
-               SECONDARY_EXEC_XSAVES);
+               SECONDARY_EXEC_XSAVES |
+               SECONDARY_EXEC_PCOMMIT);
         rdmsrl(MSR_IA32_VMX_MISC, _vmx_misc_cap);
         if ( _vmx_misc_cap & VMX_MISC_VMWRITE_ALL )
             opt |= SECONDARY_EXEC_ENABLE_VMCS_SHADOWING;
@@ -1075,6 +1076,12 @@ static int construct_vmcs(struct vcpu *v)
         __vmwrite(PLE_WINDOW, ple_window);
     }
 
+    /*
+     * We do not intercept pcommit for L1 guest and allow L1 hypervisor to
+     * intercept pcommit for L2 guest (see nvmx_n2_vmexit_handler()).
+     */
+    v->arch.hvm_vmx.secondary_exec_control &= ~SECONDARY_EXEC_PCOMMIT;
+
     if ( cpu_has_vmx_secondary_exec_control )
         __vmwrite(SECONDARY_VM_EXEC_CONTROL,
                   v->arch.hvm_vmx.secondary_exec_control);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 7917fb7..04dde83 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -3543,6 +3543,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
     case EXIT_REASON_ACCESS_LDTR_OR_TR:
     case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
     case EXIT_REASON_INVPCID:
+    case EXIT_REASON_PCOMMIT:
     /* fall through */
     default:
     exit_and_crash:
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index ea1052e..271ec70 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1950,6 +1950,8 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
                SECONDARY_EXEC_ENABLE_VPID |
                SECONDARY_EXEC_UNRESTRICTED_GUEST |
                SECONDARY_EXEC_ENABLE_EPT;
+        if ( cpu_has_vmx_pcommit )
+            data |= SECONDARY_EXEC_PCOMMIT;
         data = gen_vmx_msr(data, 0, host_data);
         break;
     case MSR_IA32_VMX_EXIT_CTLS:
@@ -2226,6 +2228,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
     case EXIT_REASON_VMXON:
     case EXIT_REASON_INVEPT:
     case EXIT_REASON_XSETBV:
+    case EXIT_REASON_PCOMMIT:
         /* inject to L1 */
         nvcpu->nv_vmexit_pending = 1;
         break;
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index ef96514..23f9fb2 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -162,6 +162,7 @@
 #define X86_FEATURE_RDSEED	(7*32+18) /* RDSEED instruction */
 #define X86_FEATURE_ADX		(7*32+19) /* ADCX, ADOX instructions */
 #define X86_FEATURE_SMAP	(7*32+20) /* Supervisor Mode Access Prevention */
+#define X86_FEATURE_PCOMMIT	(7*32+22) /* PCOMMIT instruction */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ecx), word 8 */
 #define X86_FEATURE_PKU	(8*32+ 3) /* Protection Keys for Userspace */
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index d1496b8..a5e7aee 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -236,6 +236,7 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_ENABLE_PML               0x00020000
 #define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000
 #define SECONDARY_EXEC_XSAVES                   0x00100000
+#define SECONDARY_EXEC_PCOMMIT                  0x00200000
 extern u32 vmx_secondary_exec_control;
 
 #define VMX_EPT_EXEC_ONLY_SUPPORTED                         0x00000001
@@ -303,7 +304,8 @@ extern u64 vmx_ept_vpid_cap;
     (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_PML)
 #define cpu_has_vmx_xsaves \
     (vmx_secondary_exec_control & SECONDARY_EXEC_XSAVES)
-
+#define cpu_has_vmx_pcommit \
+    (vmx_secondary_exec_control & SECONDARY_EXEC_PCOMMIT)
 #define VMCS_RID_TYPE_MASK              0x80000000
 
 /* GUEST_INTERRUPTIBILITY_INFO flags. */
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 1719965..14f3d32 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -213,6 +213,7 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
 #define EXIT_REASON_PML_FULL            62
 #define EXIT_REASON_XSAVES              63
 #define EXIT_REASON_XRSTORS             64
+#define EXIT_REASON_PCOMMIT             65
 
 /*
  * Interruption-information format
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:00:47 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:00: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 1aMIbH-0004tW-OF; Thu, 21 Jan 2016 17:00: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 1aMIbG-0004s4-F3
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:46 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	A0/5C-08977-DBE01A65; Thu, 21 Jan 2016 17:00:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1453395641!11394069!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62781 invoked from network); 21 Jan 2016 17:00:42 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:00:42 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbp-0008I7-Fk
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbB-0004p0-Dl
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:41 +0000
Date: Thu, 21 Jan 2016 17:00:41 +0000
Message-Id: <E1aMIbB-0004p0-Dl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] add xenstore domain flag to hypervisor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5513bd0b4675e2fa2ff4e9a06885f16727901805
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Jan 12 11:29:55 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:29:55 2016 +0100

    add xenstore domain flag to hypervisor
    
    In order to be able to have full support of a xenstore domain in Xen
    add a "Xenstore-domain" flag to the hypervisor. This flag must be
    specified at domain creation time and is returned by
    XEN_DOMCTL_getdomaininfo.
    
    It will allow the domain to retrieve domain information by issuing the
    XEN_DOMCTL_getdomaininfo itself in order to be able to check for
    domains having been destroyed. At the same time this flag will inhibit
    the domain to be migrated, as this wouldn't be a very wise thing to do.
    
    In case of a later support of a rebootable Dom0 this flag will allow to
    recognize a xenstore domain already being present to connect to.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citirx.com>
---
 xen/common/domain.c         |    6 ++++++
 xen/common/domctl.c         |   14 +++++++++-----
 xen/include/public/domctl.h |    6 ++++++
 xen/include/xen/sched.h     |    5 +++++
 xen/include/xsm/dummy.h     |    6 ++++++
 xen/include/xsm/xsm.h       |    1 +
 6 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 1017efb..2979c1b 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -318,6 +318,12 @@ struct domain *domain_create(domid_t domid, unsigned int domcr_flags,
         hardware_domain = d;
     }
 
+    if ( domcr_flags & DOMCRF_xs_domain )
+    {
+        d->is_xenstore = 1;
+        d->disable_migrate = 1;
+    }
+
     rangeset_domain_initialise(d);
     init_status |= INIT_rangeset;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 1fab587..dc1ea06 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -183,10 +183,11 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
     info->cpu_time = cpu_time;
 
     info->flags = (info->nr_online_vcpus ? flags : 0) |
-        ((d->is_dying == DOMDYING_dead) ? XEN_DOMINF_dying    : 0) |
-        (d->is_shut_down                ? XEN_DOMINF_shutdown : 0) |
-        (d->controller_pause_count > 0  ? XEN_DOMINF_paused   : 0) |
-        (d->debugger_attached           ? XEN_DOMINF_debugged : 0) |
+        ((d->is_dying == DOMDYING_dead) ? XEN_DOMINF_dying     : 0) |
+        (d->is_shut_down                ? XEN_DOMINF_shutdown  : 0) |
+        (d->controller_pause_count > 0  ? XEN_DOMINF_paused    : 0) |
+        (d->debugger_attached           ? XEN_DOMINF_debugged  : 0) |
+        (d->is_xenstore                 ? XEN_DOMINF_xs_domain : 0) |
         d->shutdown_code << XEN_DOMINF_shutdownshift;
 
     switch ( d->guest_type )
@@ -551,7 +552,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
                | XEN_DOMCTL_CDF_pvh_guest
                | XEN_DOMCTL_CDF_hap
                | XEN_DOMCTL_CDF_s3_integrity
-               | XEN_DOMCTL_CDF_oos_off)) )
+               | XEN_DOMCTL_CDF_oos_off
+               | XEN_DOMCTL_CDF_xs_domain)) )
             break;
 
         dom = op->domain;
@@ -593,6 +595,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             domcr_flags |= DOMCRF_s3_integrity;
         if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_oos_off )
             domcr_flags |= DOMCRF_oos_off;
+        if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_xs_domain )
+            domcr_flags |= DOMCRF_xs_domain;
 
         d = domain_create(dom, domcr_flags, op->u.createdomain.ssidref,
                           &op->u.createdomain.config);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 7a56b3f..2d8076c 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -63,6 +63,9 @@ struct xen_domctl_createdomain {
  /* Is this a PVH guest (as opposed to an HVM or PV guest)? */
 #define _XEN_DOMCTL_CDF_pvh_guest     4
 #define XEN_DOMCTL_CDF_pvh_guest      (1U<<_XEN_DOMCTL_CDF_pvh_guest)
+ /* Is this a xenstore domain? */
+#define _XEN_DOMCTL_CDF_xs_domain     5
+#define XEN_DOMCTL_CDF_xs_domain      (1U<<_XEN_DOMCTL_CDF_xs_domain)
     uint32_t flags;
     struct xen_arch_domainconfig config;
 };
@@ -97,6 +100,9 @@ struct xen_domctl_getdomaininfo {
 /* domain is PVH */
 #define _XEN_DOMINF_pvh_guest 7
 #define XEN_DOMINF_pvh_guest  (1U<<_XEN_DOMINF_pvh_guest)
+/* domain is a xenstore domain */
+#define _XEN_DOMINF_xs_domain 8
+#define XEN_DOMINF_xs_domain  (1U<<_XEN_DOMINF_xs_domain)
  /* XEN_DOMINF_shutdown guest-supplied code.  */
 #define XEN_DOMINF_shutdownmask 255
 #define XEN_DOMINF_shutdownshift 16
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index fc61fc3..c9a4fc0 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -374,6 +374,8 @@ struct domain
     bool_t           auto_node_affinity;
     /* Is this guest fully privileged (aka dom0)? */
     bool_t           is_privileged;
+    /* Is this a xenstore domain (not dom0)? */
+    bool_t           is_xenstore;
     /* Domain's VCPUs are pinned 1:1 to physical CPUs? */
     bool_t           is_pinned;
     /* Non-migratable and non-restoreable? */
@@ -533,6 +535,9 @@ struct domain *domain_create(domid_t domid, unsigned int domcr_flags,
  /* DOMCRF_pvh: Create PV domain in HVM container. */
 #define _DOMCRF_pvh             5
 #define DOMCRF_pvh              (1U<<_DOMCRF_pvh)
+ /* DOMCRF_xs_domain: xenstore domain */
+#define _DOMCRF_xs_domain       6
+#define DOMCRF_xs_domain        (1U<<_DOMCRF_xs_domain)
 
 /*
  * rcu_lock_domain_by_id() is more efficient than get_domain_by_id().
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 81fba40..9803ff4 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -71,6 +71,10 @@ static always_inline int xsm_default_action(
         if ( src->is_privileged )
             return 0;
         return -EPERM;
+    case XSM_XS_PRIV:
+        if ( src->is_xenstore || src->is_privileged )
+            return 0;
+        return -EPERM;
     default:
         LINKER_BUG_ON(1);
         return -EPERM;
@@ -123,6 +127,8 @@ static XSM_INLINE int xsm_domctl(XSM_DEFAULT_ARG struct domain *d, int cmd)
     case XEN_DOMCTL_bind_pt_irq:
     case XEN_DOMCTL_unbind_pt_irq:
         return xsm_default_action(XSM_DM_PRIV, current->domain, d);
+    case XEN_DOMCTL_getdomaininfo:
+        return xsm_default_action(XSM_XS_PRIV, current->domain, d);
     default:
         return xsm_default_action(XSM_PRIV, current->domain, d);
     }
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 3fc3824..150f94a 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -35,6 +35,7 @@ enum xsm_default {
     XSM_DM_PRIV,  /* Device model can perform on its target domain */
     XSM_TARGET,   /* Can perform on self or your target domain */
     XSM_PRIV,     /* Privileged - normally restricted to dom0 */
+    XSM_XS_PRIV,  /* Xenstore domain - can do some privileged operations */
     XSM_OTHER     /* Something more complex */
 };
 typedef enum xsm_default xsm_default_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 Jan 21 17:00:47 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:00: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 1aMIbH-0004tW-OF; Thu, 21 Jan 2016 17:00: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 1aMIbG-0004s4-F3
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:46 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	A0/5C-08977-DBE01A65; Thu, 21 Jan 2016 17:00:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1453395641!11394069!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62781 invoked from network); 21 Jan 2016 17:00:42 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:00:42 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbp-0008I7-Fk
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbB-0004p0-Dl
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:41 +0000
Date: Thu, 21 Jan 2016 17:00:41 +0000
Message-Id: <E1aMIbB-0004p0-Dl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] add xenstore domain flag to hypervisor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5513bd0b4675e2fa2ff4e9a06885f16727901805
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Jan 12 11:29:55 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:29:55 2016 +0100

    add xenstore domain flag to hypervisor
    
    In order to be able to have full support of a xenstore domain in Xen
    add a "Xenstore-domain" flag to the hypervisor. This flag must be
    specified at domain creation time and is returned by
    XEN_DOMCTL_getdomaininfo.
    
    It will allow the domain to retrieve domain information by issuing the
    XEN_DOMCTL_getdomaininfo itself in order to be able to check for
    domains having been destroyed. At the same time this flag will inhibit
    the domain to be migrated, as this wouldn't be a very wise thing to do.
    
    In case of a later support of a rebootable Dom0 this flag will allow to
    recognize a xenstore domain already being present to connect to.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citirx.com>
---
 xen/common/domain.c         |    6 ++++++
 xen/common/domctl.c         |   14 +++++++++-----
 xen/include/public/domctl.h |    6 ++++++
 xen/include/xen/sched.h     |    5 +++++
 xen/include/xsm/dummy.h     |    6 ++++++
 xen/include/xsm/xsm.h       |    1 +
 6 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 1017efb..2979c1b 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -318,6 +318,12 @@ struct domain *domain_create(domid_t domid, unsigned int domcr_flags,
         hardware_domain = d;
     }
 
+    if ( domcr_flags & DOMCRF_xs_domain )
+    {
+        d->is_xenstore = 1;
+        d->disable_migrate = 1;
+    }
+
     rangeset_domain_initialise(d);
     init_status |= INIT_rangeset;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 1fab587..dc1ea06 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -183,10 +183,11 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
     info->cpu_time = cpu_time;
 
     info->flags = (info->nr_online_vcpus ? flags : 0) |
-        ((d->is_dying == DOMDYING_dead) ? XEN_DOMINF_dying    : 0) |
-        (d->is_shut_down                ? XEN_DOMINF_shutdown : 0) |
-        (d->controller_pause_count > 0  ? XEN_DOMINF_paused   : 0) |
-        (d->debugger_attached           ? XEN_DOMINF_debugged : 0) |
+        ((d->is_dying == DOMDYING_dead) ? XEN_DOMINF_dying     : 0) |
+        (d->is_shut_down                ? XEN_DOMINF_shutdown  : 0) |
+        (d->controller_pause_count > 0  ? XEN_DOMINF_paused    : 0) |
+        (d->debugger_attached           ? XEN_DOMINF_debugged  : 0) |
+        (d->is_xenstore                 ? XEN_DOMINF_xs_domain : 0) |
         d->shutdown_code << XEN_DOMINF_shutdownshift;
 
     switch ( d->guest_type )
@@ -551,7 +552,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
                | XEN_DOMCTL_CDF_pvh_guest
                | XEN_DOMCTL_CDF_hap
                | XEN_DOMCTL_CDF_s3_integrity
-               | XEN_DOMCTL_CDF_oos_off)) )
+               | XEN_DOMCTL_CDF_oos_off
+               | XEN_DOMCTL_CDF_xs_domain)) )
             break;
 
         dom = op->domain;
@@ -593,6 +595,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
             domcr_flags |= DOMCRF_s3_integrity;
         if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_oos_off )
             domcr_flags |= DOMCRF_oos_off;
+        if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_xs_domain )
+            domcr_flags |= DOMCRF_xs_domain;
 
         d = domain_create(dom, domcr_flags, op->u.createdomain.ssidref,
                           &op->u.createdomain.config);
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 7a56b3f..2d8076c 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -63,6 +63,9 @@ struct xen_domctl_createdomain {
  /* Is this a PVH guest (as opposed to an HVM or PV guest)? */
 #define _XEN_DOMCTL_CDF_pvh_guest     4
 #define XEN_DOMCTL_CDF_pvh_guest      (1U<<_XEN_DOMCTL_CDF_pvh_guest)
+ /* Is this a xenstore domain? */
+#define _XEN_DOMCTL_CDF_xs_domain     5
+#define XEN_DOMCTL_CDF_xs_domain      (1U<<_XEN_DOMCTL_CDF_xs_domain)
     uint32_t flags;
     struct xen_arch_domainconfig config;
 };
@@ -97,6 +100,9 @@ struct xen_domctl_getdomaininfo {
 /* domain is PVH */
 #define _XEN_DOMINF_pvh_guest 7
 #define XEN_DOMINF_pvh_guest  (1U<<_XEN_DOMINF_pvh_guest)
+/* domain is a xenstore domain */
+#define _XEN_DOMINF_xs_domain 8
+#define XEN_DOMINF_xs_domain  (1U<<_XEN_DOMINF_xs_domain)
  /* XEN_DOMINF_shutdown guest-supplied code.  */
 #define XEN_DOMINF_shutdownmask 255
 #define XEN_DOMINF_shutdownshift 16
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index fc61fc3..c9a4fc0 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -374,6 +374,8 @@ struct domain
     bool_t           auto_node_affinity;
     /* Is this guest fully privileged (aka dom0)? */
     bool_t           is_privileged;
+    /* Is this a xenstore domain (not dom0)? */
+    bool_t           is_xenstore;
     /* Domain's VCPUs are pinned 1:1 to physical CPUs? */
     bool_t           is_pinned;
     /* Non-migratable and non-restoreable? */
@@ -533,6 +535,9 @@ struct domain *domain_create(domid_t domid, unsigned int domcr_flags,
  /* DOMCRF_pvh: Create PV domain in HVM container. */
 #define _DOMCRF_pvh             5
 #define DOMCRF_pvh              (1U<<_DOMCRF_pvh)
+ /* DOMCRF_xs_domain: xenstore domain */
+#define _DOMCRF_xs_domain       6
+#define DOMCRF_xs_domain        (1U<<_DOMCRF_xs_domain)
 
 /*
  * rcu_lock_domain_by_id() is more efficient than get_domain_by_id().
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 81fba40..9803ff4 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -71,6 +71,10 @@ static always_inline int xsm_default_action(
         if ( src->is_privileged )
             return 0;
         return -EPERM;
+    case XSM_XS_PRIV:
+        if ( src->is_xenstore || src->is_privileged )
+            return 0;
+        return -EPERM;
     default:
         LINKER_BUG_ON(1);
         return -EPERM;
@@ -123,6 +127,8 @@ static XSM_INLINE int xsm_domctl(XSM_DEFAULT_ARG struct domain *d, int cmd)
     case XEN_DOMCTL_bind_pt_irq:
     case XEN_DOMCTL_unbind_pt_irq:
         return xsm_default_action(XSM_DM_PRIV, current->domain, d);
+    case XEN_DOMCTL_getdomaininfo:
+        return xsm_default_action(XSM_XS_PRIV, current->domain, d);
     default:
         return xsm_default_action(XSM_PRIV, current->domain, d);
     }
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 3fc3824..150f94a 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -35,6 +35,7 @@ enum xsm_default {
     XSM_DM_PRIV,  /* Device model can perform on its target domain */
     XSM_TARGET,   /* Can perform on self or your target domain */
     XSM_PRIV,     /* Privileged - normally restricted to dom0 */
+    XSM_XS_PRIV,  /* Xenstore domain - can do some privileged operations */
     XSM_OTHER     /* Something more complex */
 };
 typedef enum xsm_default xsm_default_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 Jan 21 17:00:55 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:00: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 1aMIbP-0004wS-Sc; Thu, 21 Jan 2016 17:00: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 1aMIbO-0004w4-Ld
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:54 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	0C/8C-08977-6CE01A65; Thu, 21 Jan 2016 17:00:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1453395652!11523486!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62292 invoked from network); 21 Jan 2016 17:00:53 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:00:53 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbz-0008IF-Ug
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbL-0004pS-Pu
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:51 +0000
Date: Thu, 21 Jan 2016 17:00:51 +0000
Message-Id: <E1aMIbL-0004pS-Pu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: implement ipc and arch
	filter flags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e3cce1799df2f957dfa00f84a5315cbf896490fe
Author:     Brendan Gregg <bgregg@netflix.com>
AuthorDate: Tue Jan 12 11:33:16 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:33:16 2016 +0100

    x86/VPMU: implement ipc and arch filter flags
    
    This introduces a way to have a restricted VPMU, by specifying one of two
    predefined groups of PMCs to make available. For secure environments, this
    allows the VPMU to be used without needing to enable all PMCs.
    
    Signed-off-by: Brendan Gregg <bgregg@netflix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 docs/misc/xen-command-line.markdown |   15 +++++++++-
 xen/arch/x86/cpu/vpmu.c             |   55 +++++++++++++++++++++++++++-------
 xen/arch/x86/cpu/vpmu_intel.c       |   45 ++++++++++++++++++++++++++++
 xen/include/asm-x86/msr-index.h     |    1 +
 xen/include/public/pmu.h            |   14 +++++++-
 5 files changed, 115 insertions(+), 15 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 467dc8f..5ed0730 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1476,7 +1476,7 @@ Use Virtual Processor ID support if available.  This prevents the need for TLB
 flushes on VM entry and exit, increasing performance.
 
 ### vpmu
-> `= ( bts )`
+> `= ( <boolean> | { bts | ipc | arch [, ...] } )`
 
 > Default: `off`
 
@@ -1492,6 +1492,19 @@ wrong behaviour (see handle\_pmc\_quirk()).
 If 'vpmu=bts' is specified the virtualisation of the Branch Trace Store (BTS)
 feature is switched on on Intel processors supporting this feature.
 
+vpmu=ipc enables performance monitoring, but restricts the counters to the
+most minimum set possible: instructions, cycles, and reference cycles. These
+can be used to calculate instructions per cycle (IPC).
+
+vpmu=arch enables performance monitoring, but restricts the counters to the
+pre-defined architectural events only. These are exposed by cpuid, and listed
+in the Pre-Defined Architectural Performance Events table from the Intel 64
+and IA-32 Architectures Software Developer's Manual, Volume 3B, System
+Programming Guide, Part 2.
+
+If a boolean is not used, combinations of flags are allowed, comma separated.
+For example, vpmu=arch,bts.
+
 Note that if **watchdog** option is also specified vpmu will be turned off.
 
 *Warning:*
diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 4856e98..237b5ff 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -43,34 +43,59 @@ CHECK_pmu_data;
 CHECK_pmu_params;
 
 /*
- * "vpmu" :     vpmu generally enabled
- * "vpmu=off" : vpmu generally disabled
- * "vpmu=bts" : vpmu enabled and Intel BTS feature switched on.
+ * "vpmu" :     vpmu generally enabled (all counters)
+ * "vpmu=off"  : vpmu generally disabled
+ * "vpmu=bts"  : vpmu enabled and Intel BTS feature switched on.
+ * "vpmu=ipc"  : vpmu enabled for IPC counters only (most restrictive)
+ * "vpmu=arch" : vpmu enabled for predef arch counters only (restrictive)
+ * flag combinations are allowed, eg, "vpmu=ipc,bts".
  */
 static unsigned int __read_mostly opt_vpmu_enabled;
 unsigned int __read_mostly vpmu_mode = XENPMU_MODE_OFF;
 unsigned int __read_mostly vpmu_features = 0;
-static void parse_vpmu_param(char *s);
-custom_param("vpmu", parse_vpmu_param);
+static void parse_vpmu_params(char *s);
+custom_param("vpmu", parse_vpmu_params);
 
 static DEFINE_SPINLOCK(vpmu_lock);
 static unsigned vpmu_count;
 
 static DEFINE_PER_CPU(struct vcpu *, last_vcpu);
 
-static void __init parse_vpmu_param(char *s)
+static int parse_vpmu_param(char *s, unsigned int len)
 {
+    if ( !*s || !len )
+        return 0;
+    if ( !strncmp(s, "bts", len) )
+        vpmu_features |= XENPMU_FEATURE_INTEL_BTS;
+    else if ( !strncmp(s, "ipc", len) )
+        vpmu_features |= XENPMU_FEATURE_IPC_ONLY;
+    else if ( !strncmp(s, "arch", len) )
+        vpmu_features |= XENPMU_FEATURE_ARCH_ONLY;
+    else
+        return 1;
+    return 0;
+}
+
+static void __init parse_vpmu_params(char *s)
+{
+    char *sep, *p = s;
+
     switch ( parse_bool(s) )
     {
     case 0:
         break;
     default:
-        if ( !strcmp(s, "bts") )
-            vpmu_features |= XENPMU_FEATURE_INTEL_BTS;
-        else if ( *s )
+        for ( ; ; )
         {
-            printk("VPMU: unknown flag: %s - vpmu disabled!\n", s);
-            break;
+            sep = strchr(p, ',');
+            if ( sep == NULL )
+                sep = strchr(p, 0);
+            if ( parse_vpmu_param(p, sep - p) )
+                goto error;
+            if ( !*sep )
+                /* reached end of flags */
+                break;
+            p = sep + 1;
         }
         /* fall through */
     case 1:
@@ -79,6 +104,10 @@ static void __init parse_vpmu_param(char *s)
         opt_vpmu_enabled = 1;
         break;
     }
+    return;
+
+ error:
+    printk("VPMU: unknown flags: %s - vpmu disabled!\n", s);
 }
 
 void vpmu_lvtpc_update(uint32_t val)
@@ -708,7 +737,9 @@ long do_xenpmu_op(unsigned int op, XEN_GUEST_HANDLE_PARAM(xen_pmu_params_t) arg)
         break;
 
     case XENPMU_feature_set:
-        if ( pmu_params.val & ~XENPMU_FEATURE_INTEL_BTS )
+        if ( pmu_params.val & ~(XENPMU_FEATURE_INTEL_BTS |
+                                XENPMU_FEATURE_IPC_ONLY |
+                                XENPMU_FEATURE_ARCH_ONLY))
             return -EINVAL;
 
         spin_lock(&vpmu_lock);
diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index a179717..50b5831 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -605,11 +605,16 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
                  "MSR_PERF_GLOBAL_STATUS(0x38E)!\n");
         return -EINVAL;
     case MSR_IA32_PEBS_ENABLE:
+        if ( vpmu_features & (XENPMU_FEATURE_IPC_ONLY |
+                              XENPMU_FEATURE_ARCH_ONLY) )
+            return -EINVAL;
         if ( msr_content )
             /* PEBS is reported as unavailable in MSR_IA32_MISC_ENABLE */
             return -EINVAL;
         return 0;
     case MSR_IA32_DS_AREA:
+        if ( !(vpmu_features & XENPMU_FEATURE_INTEL_BTS) )
+            return -EINVAL;
         if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
         {
             if ( !(has_hvm_container_vcpu(v)
@@ -658,12 +663,52 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         tmp = msr - MSR_P6_EVNTSEL(0);
         if ( tmp >= 0 && tmp < arch_pmc_cnt )
         {
+            bool_t blocked = 0;
+            uint64_t umaskevent = msr_content & MSR_IA32_CMT_EVTSEL_UE_MASK;
             struct xen_pmu_cntr_pair *xen_pmu_cntr_pair =
                 vpmu_reg_pointer(core2_vpmu_cxt, arch_counters);
 
             if ( msr_content & ARCH_CTRL_MASK )
                 return -EINVAL;
 
+            /* PMC filters */
+            if ( vpmu_features & (XENPMU_FEATURE_IPC_ONLY |
+                                  XENPMU_FEATURE_ARCH_ONLY) )
+            {
+                blocked = 1;
+                switch ( umaskevent )
+                {
+                /*
+                 * See the Pre-Defined Architectural Performance Events table
+                 * from the Intel 64 and IA-32 Architectures Software
+                 * Developer's Manual, Volume 3B, System Programming Guide,
+                 * Part 2.
+                 */
+                case 0x003c:	/* UnHalted Core Cycles */
+                case 0x013c:	/* UnHalted Reference Cycles */
+                case 0x00c0:	/* Instructions Retired */
+                    blocked = 0;
+                    break;
+                }
+            }
+
+            if ( vpmu_features & XENPMU_FEATURE_ARCH_ONLY )
+            {
+                /* Additional counters beyond IPC only; blocked already set. */
+                switch ( umaskevent )
+                {
+                case 0x4f2e:	/* Last Level Cache References */
+                case 0x412e:	/* Last Level Cache Misses */
+                case 0x00c4:	/* Branch Instructions Retired */
+                case 0x00c5:	/* All Branch Mispredict Retired */
+                    blocked = 0;
+                    break;
+               }
+            }
+
+            if ( blocked )
+                return -EINVAL;
+
             if ( has_hvm_container_vcpu(v) )
                 vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL,
                                    &core2_vpmu_cxt->global_ctrl);
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 2b97861..84da631 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -329,6 +329,7 @@
 
 /* Platform Shared Resource MSRs */
 #define MSR_IA32_CMT_EVTSEL		0x00000c8d
+#define MSR_IA32_CMT_EVTSEL_UE_MASK	0x0000ffff
 #define MSR_IA32_CMT_CTR		0x00000c8e
 #define MSR_IA32_PSR_ASSOC		0x00000c8f
 #define MSR_IA32_PSR_L3_QOS_CFG	0x00000c81
diff --git a/xen/include/public/pmu.h b/xen/include/public/pmu.h
index 7753df0..0e1312c 100644
--- a/xen/include/public/pmu.h
+++ b/xen/include/public/pmu.h
@@ -84,9 +84,19 @@ DEFINE_XEN_GUEST_HANDLE(xen_pmu_params_t);
 
 /*
  * PMU features:
- * - XENPMU_FEATURE_INTEL_BTS: Intel BTS support (ignored on AMD)
+ * - XENPMU_FEATURE_INTEL_BTS:  Intel BTS support (ignored on AMD)
+ * - XENPMU_FEATURE_IPC_ONLY:   Restrict PMCs to the most minimum set possible.
+ *                              Instructions, cycles, and ref cycles. Can be
+ *                              used to calculate instructions-per-cycle (IPC)
+ *                              (ignored on AMD).
+ * - XENPMU_FEATURE_ARCH_ONLY:  Restrict PMCs to the Intel Pre-Defined
+ *                              Architectural Performance Events exposed by
+ *                              cpuid and listed in the Intel developer's manual
+ *                              (ignored on AMD).
  */
-#define XENPMU_FEATURE_INTEL_BTS  1
+#define XENPMU_FEATURE_INTEL_BTS  (1<<0)
+#define XENPMU_FEATURE_IPC_ONLY   (1<<1)
+#define XENPMU_FEATURE_ARCH_ONLY  (1<<2)
 
 /*
  * Shared PMU data between hypervisor and PV(H) domains.
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:00:55 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:00: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 1aMIbP-0004wS-Sc; Thu, 21 Jan 2016 17:00: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 1aMIbO-0004w4-Ld
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:54 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	0C/8C-08977-6CE01A65; Thu, 21 Jan 2016 17:00:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1453395652!11523486!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62292 invoked from network); 21 Jan 2016 17:00:53 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:00:53 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbz-0008IF-Ug
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbL-0004pS-Pu
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:00:51 +0000
Date: Thu, 21 Jan 2016 17:00:51 +0000
Message-Id: <E1aMIbL-0004pS-Pu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: implement ipc and arch
	filter flags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e3cce1799df2f957dfa00f84a5315cbf896490fe
Author:     Brendan Gregg <bgregg@netflix.com>
AuthorDate: Tue Jan 12 11:33:16 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:33:16 2016 +0100

    x86/VPMU: implement ipc and arch filter flags
    
    This introduces a way to have a restricted VPMU, by specifying one of two
    predefined groups of PMCs to make available. For secure environments, this
    allows the VPMU to be used without needing to enable all PMCs.
    
    Signed-off-by: Brendan Gregg <bgregg@netflix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 docs/misc/xen-command-line.markdown |   15 +++++++++-
 xen/arch/x86/cpu/vpmu.c             |   55 +++++++++++++++++++++++++++-------
 xen/arch/x86/cpu/vpmu_intel.c       |   45 ++++++++++++++++++++++++++++
 xen/include/asm-x86/msr-index.h     |    1 +
 xen/include/public/pmu.h            |   14 +++++++-
 5 files changed, 115 insertions(+), 15 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 467dc8f..5ed0730 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1476,7 +1476,7 @@ Use Virtual Processor ID support if available.  This prevents the need for TLB
 flushes on VM entry and exit, increasing performance.
 
 ### vpmu
-> `= ( bts )`
+> `= ( <boolean> | { bts | ipc | arch [, ...] } )`
 
 > Default: `off`
 
@@ -1492,6 +1492,19 @@ wrong behaviour (see handle\_pmc\_quirk()).
 If 'vpmu=bts' is specified the virtualisation of the Branch Trace Store (BTS)
 feature is switched on on Intel processors supporting this feature.
 
+vpmu=ipc enables performance monitoring, but restricts the counters to the
+most minimum set possible: instructions, cycles, and reference cycles. These
+can be used to calculate instructions per cycle (IPC).
+
+vpmu=arch enables performance monitoring, but restricts the counters to the
+pre-defined architectural events only. These are exposed by cpuid, and listed
+in the Pre-Defined Architectural Performance Events table from the Intel 64
+and IA-32 Architectures Software Developer's Manual, Volume 3B, System
+Programming Guide, Part 2.
+
+If a boolean is not used, combinations of flags are allowed, comma separated.
+For example, vpmu=arch,bts.
+
 Note that if **watchdog** option is also specified vpmu will be turned off.
 
 *Warning:*
diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 4856e98..237b5ff 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -43,34 +43,59 @@ CHECK_pmu_data;
 CHECK_pmu_params;
 
 /*
- * "vpmu" :     vpmu generally enabled
- * "vpmu=off" : vpmu generally disabled
- * "vpmu=bts" : vpmu enabled and Intel BTS feature switched on.
+ * "vpmu" :     vpmu generally enabled (all counters)
+ * "vpmu=off"  : vpmu generally disabled
+ * "vpmu=bts"  : vpmu enabled and Intel BTS feature switched on.
+ * "vpmu=ipc"  : vpmu enabled for IPC counters only (most restrictive)
+ * "vpmu=arch" : vpmu enabled for predef arch counters only (restrictive)
+ * flag combinations are allowed, eg, "vpmu=ipc,bts".
  */
 static unsigned int __read_mostly opt_vpmu_enabled;
 unsigned int __read_mostly vpmu_mode = XENPMU_MODE_OFF;
 unsigned int __read_mostly vpmu_features = 0;
-static void parse_vpmu_param(char *s);
-custom_param("vpmu", parse_vpmu_param);
+static void parse_vpmu_params(char *s);
+custom_param("vpmu", parse_vpmu_params);
 
 static DEFINE_SPINLOCK(vpmu_lock);
 static unsigned vpmu_count;
 
 static DEFINE_PER_CPU(struct vcpu *, last_vcpu);
 
-static void __init parse_vpmu_param(char *s)
+static int parse_vpmu_param(char *s, unsigned int len)
 {
+    if ( !*s || !len )
+        return 0;
+    if ( !strncmp(s, "bts", len) )
+        vpmu_features |= XENPMU_FEATURE_INTEL_BTS;
+    else if ( !strncmp(s, "ipc", len) )
+        vpmu_features |= XENPMU_FEATURE_IPC_ONLY;
+    else if ( !strncmp(s, "arch", len) )
+        vpmu_features |= XENPMU_FEATURE_ARCH_ONLY;
+    else
+        return 1;
+    return 0;
+}
+
+static void __init parse_vpmu_params(char *s)
+{
+    char *sep, *p = s;
+
     switch ( parse_bool(s) )
     {
     case 0:
         break;
     default:
-        if ( !strcmp(s, "bts") )
-            vpmu_features |= XENPMU_FEATURE_INTEL_BTS;
-        else if ( *s )
+        for ( ; ; )
         {
-            printk("VPMU: unknown flag: %s - vpmu disabled!\n", s);
-            break;
+            sep = strchr(p, ',');
+            if ( sep == NULL )
+                sep = strchr(p, 0);
+            if ( parse_vpmu_param(p, sep - p) )
+                goto error;
+            if ( !*sep )
+                /* reached end of flags */
+                break;
+            p = sep + 1;
         }
         /* fall through */
     case 1:
@@ -79,6 +104,10 @@ static void __init parse_vpmu_param(char *s)
         opt_vpmu_enabled = 1;
         break;
     }
+    return;
+
+ error:
+    printk("VPMU: unknown flags: %s - vpmu disabled!\n", s);
 }
 
 void vpmu_lvtpc_update(uint32_t val)
@@ -708,7 +737,9 @@ long do_xenpmu_op(unsigned int op, XEN_GUEST_HANDLE_PARAM(xen_pmu_params_t) arg)
         break;
 
     case XENPMU_feature_set:
-        if ( pmu_params.val & ~XENPMU_FEATURE_INTEL_BTS )
+        if ( pmu_params.val & ~(XENPMU_FEATURE_INTEL_BTS |
+                                XENPMU_FEATURE_IPC_ONLY |
+                                XENPMU_FEATURE_ARCH_ONLY))
             return -EINVAL;
 
         spin_lock(&vpmu_lock);
diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index a179717..50b5831 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -605,11 +605,16 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
                  "MSR_PERF_GLOBAL_STATUS(0x38E)!\n");
         return -EINVAL;
     case MSR_IA32_PEBS_ENABLE:
+        if ( vpmu_features & (XENPMU_FEATURE_IPC_ONLY |
+                              XENPMU_FEATURE_ARCH_ONLY) )
+            return -EINVAL;
         if ( msr_content )
             /* PEBS is reported as unavailable in MSR_IA32_MISC_ENABLE */
             return -EINVAL;
         return 0;
     case MSR_IA32_DS_AREA:
+        if ( !(vpmu_features & XENPMU_FEATURE_INTEL_BTS) )
+            return -EINVAL;
         if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
         {
             if ( !(has_hvm_container_vcpu(v)
@@ -658,12 +663,52 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         tmp = msr - MSR_P6_EVNTSEL(0);
         if ( tmp >= 0 && tmp < arch_pmc_cnt )
         {
+            bool_t blocked = 0;
+            uint64_t umaskevent = msr_content & MSR_IA32_CMT_EVTSEL_UE_MASK;
             struct xen_pmu_cntr_pair *xen_pmu_cntr_pair =
                 vpmu_reg_pointer(core2_vpmu_cxt, arch_counters);
 
             if ( msr_content & ARCH_CTRL_MASK )
                 return -EINVAL;
 
+            /* PMC filters */
+            if ( vpmu_features & (XENPMU_FEATURE_IPC_ONLY |
+                                  XENPMU_FEATURE_ARCH_ONLY) )
+            {
+                blocked = 1;
+                switch ( umaskevent )
+                {
+                /*
+                 * See the Pre-Defined Architectural Performance Events table
+                 * from the Intel 64 and IA-32 Architectures Software
+                 * Developer's Manual, Volume 3B, System Programming Guide,
+                 * Part 2.
+                 */
+                case 0x003c:	/* UnHalted Core Cycles */
+                case 0x013c:	/* UnHalted Reference Cycles */
+                case 0x00c0:	/* Instructions Retired */
+                    blocked = 0;
+                    break;
+                }
+            }
+
+            if ( vpmu_features & XENPMU_FEATURE_ARCH_ONLY )
+            {
+                /* Additional counters beyond IPC only; blocked already set. */
+                switch ( umaskevent )
+                {
+                case 0x4f2e:	/* Last Level Cache References */
+                case 0x412e:	/* Last Level Cache Misses */
+                case 0x00c4:	/* Branch Instructions Retired */
+                case 0x00c5:	/* All Branch Mispredict Retired */
+                    blocked = 0;
+                    break;
+               }
+            }
+
+            if ( blocked )
+                return -EINVAL;
+
             if ( has_hvm_container_vcpu(v) )
                 vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL,
                                    &core2_vpmu_cxt->global_ctrl);
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 2b97861..84da631 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -329,6 +329,7 @@
 
 /* Platform Shared Resource MSRs */
 #define MSR_IA32_CMT_EVTSEL		0x00000c8d
+#define MSR_IA32_CMT_EVTSEL_UE_MASK	0x0000ffff
 #define MSR_IA32_CMT_CTR		0x00000c8e
 #define MSR_IA32_PSR_ASSOC		0x00000c8f
 #define MSR_IA32_PSR_L3_QOS_CFG	0x00000c81
diff --git a/xen/include/public/pmu.h b/xen/include/public/pmu.h
index 7753df0..0e1312c 100644
--- a/xen/include/public/pmu.h
+++ b/xen/include/public/pmu.h
@@ -84,9 +84,19 @@ DEFINE_XEN_GUEST_HANDLE(xen_pmu_params_t);
 
 /*
  * PMU features:
- * - XENPMU_FEATURE_INTEL_BTS: Intel BTS support (ignored on AMD)
+ * - XENPMU_FEATURE_INTEL_BTS:  Intel BTS support (ignored on AMD)
+ * - XENPMU_FEATURE_IPC_ONLY:   Restrict PMCs to the most minimum set possible.
+ *                              Instructions, cycles, and ref cycles. Can be
+ *                              used to calculate instructions-per-cycle (IPC)
+ *                              (ignored on AMD).
+ * - XENPMU_FEATURE_ARCH_ONLY:  Restrict PMCs to the Intel Pre-Defined
+ *                              Architectural Performance Events exposed by
+ *                              cpuid and listed in the Intel developer's manual
+ *                              (ignored on AMD).
  */
-#define XENPMU_FEATURE_INTEL_BTS  1
+#define XENPMU_FEATURE_INTEL_BTS  (1<<0)
+#define XENPMU_FEATURE_IPC_ONLY   (1<<1)
+#define XENPMU_FEATURE_ARCH_ONLY  (1<<2)
 
 /*
  * Shared PMU data between hypervisor and PV(H) domains.
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:01:06 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:01: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 1aMIba-0004yI-1Y; Thu, 21 Jan 2016 17:01:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbZ-0004y2-59
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:05 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	1B/39-18633-0DE01A65; Thu, 21 Jan 2016 17:01:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1453395663!17352199!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8209 invoked from network); 21 Jan 2016 17:01:03 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:01:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcA-0008IV-OH
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbW-0004py-9I
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:02 +0000
Date: Thu, 21 Jan 2016 17:01:02 +0000
Message-Id: <E1aMIbW-0004py-9I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: save generated xen .config
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 361b4f9f0f0d4adc19df428e224a7b8fa62cd392
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Tue Jan 12 11:33:55 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:33:55 2016 +0100

    build: save generated xen .config
    
    Since we now support changing Xen options with Kconfig, we should save
    the configuration that was used to build up Xen. This will save it in
    /usr/lib/debug alongside xen-syms and call it xen-$(FULLVERSION).config
    
    Suggested-by: Ian Campbell <ian.campbell@citrix.com>
    Requested-by: Jan Beulich <jbeulich@suse.com> # the directory
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 9023863..d30d251 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -58,6 +58,7 @@ _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX)
 	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z)
 	[ -d "$(D)$(DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(DEBUG_DIR)
 	$(INSTALL_DATA) $(TARGET)-syms $(D)$(DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION)
+	$(INSTALL_DATA) $(KCONFIG_CONFIG) $(D)$(DEBUG_DIR)/$(T)-$(XEN_FULLVERSION).config
 	if [ -r $(TARGET).efi -a -n '$(EFI_DIR)' ]; then \
 		[ -d $(D)$(EFI_DIR) ] || $(INSTALL_DIR) $(D)$(EFI_DIR); \
 		$(INSTALL_DATA) $(TARGET).efi $(D)$(EFI_DIR)/$(T)-$(XEN_FULLVERSION).efi; \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:01:06 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:01: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 1aMIba-0004yI-1Y; Thu, 21 Jan 2016 17:01:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbZ-0004y2-59
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:05 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	1B/39-18633-0DE01A65; Thu, 21 Jan 2016 17:01:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1453395663!17352199!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8209 invoked from network); 21 Jan 2016 17:01:03 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:01:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcA-0008IV-OH
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbW-0004py-9I
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:02 +0000
Date: Thu, 21 Jan 2016 17:01:02 +0000
Message-Id: <E1aMIbW-0004py-9I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: save generated xen .config
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 361b4f9f0f0d4adc19df428e224a7b8fa62cd392
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Tue Jan 12 11:33:55 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:33:55 2016 +0100

    build: save generated xen .config
    
    Since we now support changing Xen options with Kconfig, we should save
    the configuration that was used to build up Xen. This will save it in
    /usr/lib/debug alongside xen-syms and call it xen-$(FULLVERSION).config
    
    Suggested-by: Ian Campbell <ian.campbell@citrix.com>
    Requested-by: Jan Beulich <jbeulich@suse.com> # the directory
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 9023863..d30d251 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -58,6 +58,7 @@ _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX)
 	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z)
 	[ -d "$(D)$(DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(DEBUG_DIR)
 	$(INSTALL_DATA) $(TARGET)-syms $(D)$(DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION)
+	$(INSTALL_DATA) $(KCONFIG_CONFIG) $(D)$(DEBUG_DIR)/$(T)-$(XEN_FULLVERSION).config
 	if [ -r $(TARGET).efi -a -n '$(EFI_DIR)' ]; then \
 		[ -d $(D)$(EFI_DIR) ] || $(INSTALL_DIR) $(D)$(EFI_DIR); \
 		$(INSTALL_DATA) $(TARGET).efi $(D)$(EFI_DIR)/$(T)-$(XEN_FULLVERSION).efi; \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:01:17 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:01: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 1aMIbl-0005Dh-6H; Thu, 21 Jan 2016 17:01:17 +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 1aMIbj-0005BH-Tc
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:16 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	09/8B-13487-BDE01A65; Thu, 21 Jan 2016 17:01:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1453395673!17352256!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9505 invoked from network); 21 Jan 2016 17:01:14 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:01:14 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcL-0008J9-BJ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbh-0004qb-7g
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:13 +0000
Date: Thu, 21 Jan 2016 17:01:13 +0000
Message-Id: <E1aMIbh-0004qb-7g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] convert FLASK_ENABLE to Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 529298fdf9097f8e637f754c9b29bd58a8a714e9
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Tue Jan 12 11:36:33 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:38:17 2016 +0100

    convert FLASK_ENABLE to Kconfig
    
    Converts the Config.mk option of FLASK_ENABLE into a Kconfig option for
    the hypervisor called CONFIG_FLASK. This commit knowingly breaks the
    dependent relationship on XSM_ENABLE which is addressed when XSM_ENABLE
    is converted to Kconfig.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 Config.mk                |    1 -
 INSTALL                  |    6 +++++-
 docs/misc/xsm-flask.txt  |    5 +++--
 xen/Rules.mk             |    1 -
 xen/common/Kconfig       |   11 +++++++++++
 xen/include/Makefile     |    2 +-
 xen/include/xen/config.h |    2 +-
 xen/include/xen/sched.h  |    2 +-
 xen/xsm/Makefile         |    2 +-
 9 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/Config.mk b/Config.mk
index a3be5ed..1315918 100644
--- a/Config.mk
+++ b/Config.mk
@@ -214,7 +214,6 @@ EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
 # Enable XSM security module (by default, Flask).
 XSM_ENABLE ?= n
-FLASK_ENABLE ?= $(XSM_ENABLE)
 
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
diff --git a/INSTALL b/INSTALL
index b7e426c..c51447b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -278,7 +278,11 @@ PYTHON_PREFIX_ARG=
 The hypervisor may be build with XSM support, which can be changed with
 the following variables.
 XSM_ENABLE=y
-FLASK_ENABLE=y
+
+The hypervisor may be build with Flask support, which can be changed
+by running:
+make -C xen menuconfig
+and enabling Flask in the 'Common Features' menu.
 
 Do a build for coverage.
 coverage=y
diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index 7249f40..f2f0fd4 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -172,8 +172,9 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE and
-FLASK_ENABLE to "y"; this change requires a make clean and rebuild.
+framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
+"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
+Features'; this change requires a make clean and rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
diff --git a/xen/Rules.mk b/xen/Rules.mk
index f7ddc69..9e4e6ff 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -53,7 +53,6 @@ CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
-CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 046e257..3419816 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -8,6 +8,17 @@ config COMPAT
 	  HVM and PV guests. HVMLoader makes 32-bit hypercalls irrespective
 	  of the destination runmode of the guest.
 
+config FLASK
+	bool "FLux Advanced Security Kernel support"
+	default n
+	---help---
+	  Enables the FLASK (FLux Advanced Security Kernel) support which
+	  provides a mandatory access control framework by which security
+	  enforcement, isolation, and auditing can be achieved with fine
+	  granular control via a security policy.
+
+	  If unsure, say N.
+
 # Select HAS_DEVICE_TREE if device tree is supported
 config HAS_DEVICE_TREE
 	bool
diff --git a/xen/include/Makefile b/xen/include/Makefile
index 94ba3d8..9c8188b 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -28,7 +28,7 @@ headers-$(CONFIG_X86)     += compat/arch-x86/xen.h
 headers-$(CONFIG_X86)     += compat/arch-x86/xen-$(compat-arch-y).h
 headers-$(CONFIG_X86)     += compat/hvm/hvm_vcpu.h
 headers-y                 += compat/arch-$(compat-arch-y).h compat/pmu.h compat/xlat.h
-headers-$(FLASK_ENABLE)   += compat/xsm/flask_op.h
+headers-$(CONFIG_FLASK)   += compat/xsm/flask_op.h
 
 cppflags-y                := -include public/xen-compat.h
 cppflags-$(CONFIG_X86)    += -m32
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index 7595599..bba015a 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -86,7 +86,7 @@
 #define mk_unsigned_long(x) x
 #endif /* !__ASSEMBLY__ */
 
-#ifdef FLASK_ENABLE
+#ifdef CONFIG_FLASK
 #define XSM_MAGIC 0xf97cff8c
 /* Maintain statistics on the access vector cache */
 #define FLASK_AVC_STATS 1
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index c9a4fc0..8fc26ce 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -119,7 +119,7 @@ struct evtchn
          */
         void *generic;
 #endif
-#ifdef FLASK_ENABLE
+#ifdef CONFIG_FLASK
         /*
          * Inlining the contents of the structure for FLASK avoids unneeded
          * allocations, and on 64-bit platforms with only FLASK enabled,
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index 16c13b5..d29e71c 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -4,4 +4,4 @@ obj-y += xsm_policy.o
 obj-y += dummy.o
 endif
 
-subdir-$(FLASK_ENABLE) += flask
+subdir-$(CONFIG_FLASK) += flask
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:01:17 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:01: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 1aMIbl-0005Dh-6H; Thu, 21 Jan 2016 17:01:17 +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 1aMIbj-0005BH-Tc
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:16 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	09/8B-13487-BDE01A65; Thu, 21 Jan 2016 17:01:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1453395673!17352256!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9505 invoked from network); 21 Jan 2016 17:01:14 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:01:14 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcL-0008J9-BJ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbh-0004qb-7g
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:13 +0000
Date: Thu, 21 Jan 2016 17:01:13 +0000
Message-Id: <E1aMIbh-0004qb-7g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] convert FLASK_ENABLE to Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 529298fdf9097f8e637f754c9b29bd58a8a714e9
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Tue Jan 12 11:36:33 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:38:17 2016 +0100

    convert FLASK_ENABLE to Kconfig
    
    Converts the Config.mk option of FLASK_ENABLE into a Kconfig option for
    the hypervisor called CONFIG_FLASK. This commit knowingly breaks the
    dependent relationship on XSM_ENABLE which is addressed when XSM_ENABLE
    is converted to Kconfig.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 Config.mk                |    1 -
 INSTALL                  |    6 +++++-
 docs/misc/xsm-flask.txt  |    5 +++--
 xen/Rules.mk             |    1 -
 xen/common/Kconfig       |   11 +++++++++++
 xen/include/Makefile     |    2 +-
 xen/include/xen/config.h |    2 +-
 xen/include/xen/sched.h  |    2 +-
 xen/xsm/Makefile         |    2 +-
 9 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/Config.mk b/Config.mk
index a3be5ed..1315918 100644
--- a/Config.mk
+++ b/Config.mk
@@ -214,7 +214,6 @@ EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
 # Enable XSM security module (by default, Flask).
 XSM_ENABLE ?= n
-FLASK_ENABLE ?= $(XSM_ENABLE)
 
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
diff --git a/INSTALL b/INSTALL
index b7e426c..c51447b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -278,7 +278,11 @@ PYTHON_PREFIX_ARG=
 The hypervisor may be build with XSM support, which can be changed with
 the following variables.
 XSM_ENABLE=y
-FLASK_ENABLE=y
+
+The hypervisor may be build with Flask support, which can be changed
+by running:
+make -C xen menuconfig
+and enabling Flask in the 'Common Features' menu.
 
 Do a build for coverage.
 coverage=y
diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index 7249f40..f2f0fd4 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -172,8 +172,9 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE and
-FLASK_ENABLE to "y"; this change requires a make clean and rebuild.
+framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
+"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
+Features'; this change requires a make clean and rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
diff --git a/xen/Rules.mk b/xen/Rules.mk
index f7ddc69..9e4e6ff 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -53,7 +53,6 @@ CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
-CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 046e257..3419816 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -8,6 +8,17 @@ config COMPAT
 	  HVM and PV guests. HVMLoader makes 32-bit hypercalls irrespective
 	  of the destination runmode of the guest.
 
+config FLASK
+	bool "FLux Advanced Security Kernel support"
+	default n
+	---help---
+	  Enables the FLASK (FLux Advanced Security Kernel) support which
+	  provides a mandatory access control framework by which security
+	  enforcement, isolation, and auditing can be achieved with fine
+	  granular control via a security policy.
+
+	  If unsure, say N.
+
 # Select HAS_DEVICE_TREE if device tree is supported
 config HAS_DEVICE_TREE
 	bool
diff --git a/xen/include/Makefile b/xen/include/Makefile
index 94ba3d8..9c8188b 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -28,7 +28,7 @@ headers-$(CONFIG_X86)     += compat/arch-x86/xen.h
 headers-$(CONFIG_X86)     += compat/arch-x86/xen-$(compat-arch-y).h
 headers-$(CONFIG_X86)     += compat/hvm/hvm_vcpu.h
 headers-y                 += compat/arch-$(compat-arch-y).h compat/pmu.h compat/xlat.h
-headers-$(FLASK_ENABLE)   += compat/xsm/flask_op.h
+headers-$(CONFIG_FLASK)   += compat/xsm/flask_op.h
 
 cppflags-y                := -include public/xen-compat.h
 cppflags-$(CONFIG_X86)    += -m32
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index 7595599..bba015a 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -86,7 +86,7 @@
 #define mk_unsigned_long(x) x
 #endif /* !__ASSEMBLY__ */
 
-#ifdef FLASK_ENABLE
+#ifdef CONFIG_FLASK
 #define XSM_MAGIC 0xf97cff8c
 /* Maintain statistics on the access vector cache */
 #define FLASK_AVC_STATS 1
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index c9a4fc0..8fc26ce 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -119,7 +119,7 @@ struct evtchn
          */
         void *generic;
 #endif
-#ifdef FLASK_ENABLE
+#ifdef CONFIG_FLASK
         /*
          * Inlining the contents of the structure for FLASK avoids unneeded
          * allocations, and on 64-bit platforms with only FLASK enabled,
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index 16c13b5..d29e71c 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -4,4 +4,4 @@ obj-y += xsm_policy.o
 obj-y += dummy.o
 endif
 
-subdir-$(FLASK_ENABLE) += flask
+subdir-$(CONFIG_FLASK) += flask
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:01:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:01: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 1aMIbw-0005Wl-DU; Thu, 21 Jan 2016 17:01: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 1aMIbu-0005Qy-Nc
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:26 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	94/0D-09708-6EE01A65; Thu, 21 Jan 2016 17:01:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1453395684!11378411!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3227 invoked from network); 21 Jan 2016 17:01:25 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:01:25 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcV-0008Jo-PS
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbr-0004r2-L8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:23 +0000
Date: Thu, 21 Jan 2016 17:01:23 +0000
Message-Id: <E1aMIbr-0004r2-L8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] convert XSM_ENABLE to Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 20c8f1a8a5fd61cb6f0ba6f3c3b3d567b1765116
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Tue Jan 12 11:39:47 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:39:47 2016 +0100

    convert XSM_ENABLE to Kconfig
    
    Converts the existing XSM_ENABLE flag from Config.mk to CONFIG_XSM
    within Kconfig. This also re-adds the dependency of CONFIG_FLASK on
    CONFIG_XSM.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 Config.mk                    |    3 ---
 INSTALL                      |    8 ++------
 docs/misc/xsm-flask.txt      |    6 +++---
 xen/Rules.mk                 |    1 -
 xen/common/Kconfig           |   37 ++++++++++++++++++++++++++++++++++++-
 xen/include/asm-x86/config.h |    4 ----
 xen/include/xen/sched.h      |    2 +-
 xen/include/xsm/dummy.h      |   10 +++++-----
 xen/include/xsm/xsm.h        |    6 +++---
 xen/xsm/Makefile             |    6 ++----
 xen/xsm/xsm_core.c           |    2 +-
 11 files changed, 53 insertions(+), 32 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1315918..62f8209 100644
--- a/Config.mk
+++ b/Config.mk
@@ -212,9 +212,6 @@ APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
-# Enable XSM security module (by default, Flask).
-XSM_ENABLE ?= n
-
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
 # the internet.  The original download URL is preserved as a comment
diff --git a/INSTALL b/INSTALL
index c51447b..3d2e86a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -275,14 +275,10 @@ Building the python tools may fail unless certain options are passed to
 setup.py. Config.mk contains additional info how to use this variable.
 PYTHON_PREFIX_ARG=
 
-The hypervisor may be build with XSM support, which can be changed with
-the following variables.
-XSM_ENABLE=y
-
-The hypervisor may be build with Flask support, which can be changed
+he hypervisor may be build with XSM/Flask support, which can be changed
 by running:
 make -C xen menuconfig
-and enabling Flask in the 'Common Features' menu.
+and enabling XSM/Flask in the 'Common Features' menu.
 
 Do a build for coverage.
 coverage=y
diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index f2f0fd4..fb2fe9f 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -172,9 +172,9 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
-"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
-Features'; this change requires a make clean and rebuild.
+framework is disabled. Running 'make -C xen menuconfig' and enabling XSM
+and FLASK inside 'Common Features'; this change requires a make clean and
+rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 9e4e6ff..8bd1098 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -52,7 +52,6 @@ CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
 CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
-CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 3419816..eadfc3b 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -10,7 +10,8 @@ config COMPAT
 
 config FLASK
 	bool "FLux Advanced Security Kernel support"
-	default n
+	default y
+	depends on XSM
 	---help---
 	  Enables the FLASK (FLux Advanced Security Kernel) support which
 	  provides a mandatory access control framework by which security
@@ -62,4 +63,38 @@ config KEXEC
 
 	  If unsure, say Y.
 
+# Allows "late" initialization of the hardware domain
+config LATE_HWDOM
+	bool "dedicated hardware domain"
+	default n
+	depends on XSM && X86
+	---help---
+	  Allows the creation of a dedicated hardware domain distinct from
+	  domain 0 that manages devices without needing access to other
+	  privileged functionality such as the ability to manage domains.
+	  This requires that the actual domain 0 be a stub domain that
+	  constructs the actual hardware domain instead of initializing the
+	  hardware itself.  Because the hardware domain needs access to
+	  hypercalls not available to unprivileged guests, an XSM policy
+	  is required to properly define the privilege of these domains.
+
+	  This feature does nothing if the "hardware_dom" boot parameter is
+	  not present.  If this feature is being used for security, it should
+	  be combined with an IOMMU in strict mode.
+
+	  If unsure, say N.
+
+# Enable/Disable XSM support
+config XSM
+	bool "Xen Security Modules support"
+	default n
+	---help---
+	  Enables the security framework known as Xen Security Modules which
+	  allows administrators fine-grained control over a Xen domain and
+	  its capabilities by defining permissible interactions between domains,
+	  the hypervisor itself, and related resources such as memory and
+	  devices.
+
+	  If unsure, say N.
+
 endmenu
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index f25d92e..3305a75 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -52,10 +52,6 @@
 
 #define CONFIG_MULTIBOOT 1
 
-#ifdef XSM_ENABLE
-#define CONFIG_LATE_HWDOM 1
-#endif
-
 #define HZ 100
 
 #define OPT_CONSOLE_STR "vga"
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 8fc26ce..82b6dd1 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -110,7 +110,7 @@ struct evtchn
     u8 priority;
     u8 last_priority;
     u16 last_vcpu_id;
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
     union {
 #ifdef XSM_NEED_GENERIC_EVTCHN_SSID
         /*
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 9803ff4..1d13826 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -27,9 +27,9 @@
 /* DO NOT implement this function; it is supposed to trigger link errors */
 void __xsm_action_mismatch_detected(void);
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
-/* In XSM_ENABLE builds, this header file is included from xsm/dummy.c, and
+/* In CONFIG_XSM builds, this header file is included from xsm/dummy.c, and
  * contains static (not inline) functions compiled to the dummy XSM module.
  * There is no xsm_default_t argument available, so the value from the assertion
  * is used to initialize the variable.
@@ -39,9 +39,9 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID void
 #define XSM_ASSERT_ACTION(def) xsm_default_t action = def; (void)action
 
-#else /* XSM_ENABLE */
+#else /* CONFIG_XSM */
 
-/* In !XSM_ENABLE builds, this header file is included from xsm/xsm.h, and
+/* In !CONFIG_XSM builds, this header file is included from xsm/xsm.h, and
  * contains inline functions for each XSM hook. These functions also perform
  * compile-time checks on the xsm_default_t argument to ensure that the behavior
  * of the dummy XSM module is the same as the behavior with XSM disabled.
@@ -51,7 +51,7 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID xsm_default_t action
 #define XSM_ASSERT_ACTION(def) LINKER_BUG_ON(def != action)
 
-#endif /* XSM_ENABLE */
+#endif /* CONFIG_XSM */
 
 static always_inline int xsm_default_action(
     xsm_default_t action, struct domain *src, struct domain *target)
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 150f94a..3afed70 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -195,7 +195,7 @@ struct xsm_operations {
 #endif
 };
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
 extern struct xsm_operations *xsm_ops;
 
@@ -753,7 +753,7 @@ extern int unregister_xsm(struct xsm_operations *ops);
 extern struct xsm_operations dummy_xsm_ops;
 extern void xsm_fixup_ops(struct xsm_operations *ops);
 
-#else /* XSM_ENABLE */
+#else /* CONFIG_XSM */
 
 #include <xsm/dummy.h>
 
@@ -773,6 +773,6 @@ static inline int xsm_dt_init(void)
 }
 #endif
 
-#endif /* XSM_ENABLE */
+#endif /* CONFIG_XSM */
 
 #endif /* __XSM_H */
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index d29e71c..3252c46 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -1,7 +1,5 @@
 obj-y += xsm_core.o
-ifeq ($(XSM_ENABLE),y)
-obj-y += xsm_policy.o
-obj-y += dummy.o
-endif
+obj-$(CONFIG_XSM) += xsm_policy.o
+obj-$(CONFIG_XSM) += dummy.o
 
 subdir-$(CONFIG_FLASK) += flask
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index 2a74496..5e432de 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -17,7 +17,7 @@
 #include <xen/hypercall.h>
 #include <xsm/xsm.h>
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
 #define XSM_FRAMEWORK_VERSION    "1.0.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 Jan 21 17:01:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:01: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 1aMIbw-0005Wl-DU; Thu, 21 Jan 2016 17:01: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 1aMIbu-0005Qy-Nc
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:26 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	94/0D-09708-6EE01A65; Thu, 21 Jan 2016 17:01:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1453395684!11378411!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3227 invoked from network); 21 Jan 2016 17:01:25 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:01:25 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcV-0008Jo-PS
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIbr-0004r2-L8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:23 +0000
Date: Thu, 21 Jan 2016 17:01:23 +0000
Message-Id: <E1aMIbr-0004r2-L8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] convert XSM_ENABLE to Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 20c8f1a8a5fd61cb6f0ba6f3c3b3d567b1765116
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Tue Jan 12 11:39:47 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 12 11:39:47 2016 +0100

    convert XSM_ENABLE to Kconfig
    
    Converts the existing XSM_ENABLE flag from Config.mk to CONFIG_XSM
    within Kconfig. This also re-adds the dependency of CONFIG_FLASK on
    CONFIG_XSM.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 Config.mk                    |    3 ---
 INSTALL                      |    8 ++------
 docs/misc/xsm-flask.txt      |    6 +++---
 xen/Rules.mk                 |    1 -
 xen/common/Kconfig           |   37 ++++++++++++++++++++++++++++++++++++-
 xen/include/asm-x86/config.h |    4 ----
 xen/include/xen/sched.h      |    2 +-
 xen/include/xsm/dummy.h      |   10 +++++-----
 xen/include/xsm/xsm.h        |    6 +++---
 xen/xsm/Makefile             |    6 ++----
 xen/xsm/xsm_core.c           |    2 +-
 11 files changed, 53 insertions(+), 32 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1315918..62f8209 100644
--- a/Config.mk
+++ b/Config.mk
@@ -212,9 +212,6 @@ APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
-# Enable XSM security module (by default, Flask).
-XSM_ENABLE ?= n
-
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
 # the internet.  The original download URL is preserved as a comment
diff --git a/INSTALL b/INSTALL
index c51447b..3d2e86a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -275,14 +275,10 @@ Building the python tools may fail unless certain options are passed to
 setup.py. Config.mk contains additional info how to use this variable.
 PYTHON_PREFIX_ARG=
 
-The hypervisor may be build with XSM support, which can be changed with
-the following variables.
-XSM_ENABLE=y
-
-The hypervisor may be build with Flask support, which can be changed
+he hypervisor may be build with XSM/Flask support, which can be changed
 by running:
 make -C xen menuconfig
-and enabling Flask in the 'Common Features' menu.
+and enabling XSM/Flask in the 'Common Features' menu.
 
 Do a build for coverage.
 coverage=y
diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index f2f0fd4..fb2fe9f 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -172,9 +172,9 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
-"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
-Features'; this change requires a make clean and rebuild.
+framework is disabled. Running 'make -C xen menuconfig' and enabling XSM
+and FLASK inside 'Common Features'; this change requires a make clean and
+rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 9e4e6ff..8bd1098 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -52,7 +52,6 @@ CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
 CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
-CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 3419816..eadfc3b 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -10,7 +10,8 @@ config COMPAT
 
 config FLASK
 	bool "FLux Advanced Security Kernel support"
-	default n
+	default y
+	depends on XSM
 	---help---
 	  Enables the FLASK (FLux Advanced Security Kernel) support which
 	  provides a mandatory access control framework by which security
@@ -62,4 +63,38 @@ config KEXEC
 
 	  If unsure, say Y.
 
+# Allows "late" initialization of the hardware domain
+config LATE_HWDOM
+	bool "dedicated hardware domain"
+	default n
+	depends on XSM && X86
+	---help---
+	  Allows the creation of a dedicated hardware domain distinct from
+	  domain 0 that manages devices without needing access to other
+	  privileged functionality such as the ability to manage domains.
+	  This requires that the actual domain 0 be a stub domain that
+	  constructs the actual hardware domain instead of initializing the
+	  hardware itself.  Because the hardware domain needs access to
+	  hypercalls not available to unprivileged guests, an XSM policy
+	  is required to properly define the privilege of these domains.
+
+	  This feature does nothing if the "hardware_dom" boot parameter is
+	  not present.  If this feature is being used for security, it should
+	  be combined with an IOMMU in strict mode.
+
+	  If unsure, say N.
+
+# Enable/Disable XSM support
+config XSM
+	bool "Xen Security Modules support"
+	default n
+	---help---
+	  Enables the security framework known as Xen Security Modules which
+	  allows administrators fine-grained control over a Xen domain and
+	  its capabilities by defining permissible interactions between domains,
+	  the hypervisor itself, and related resources such as memory and
+	  devices.
+
+	  If unsure, say N.
+
 endmenu
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index f25d92e..3305a75 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -52,10 +52,6 @@
 
 #define CONFIG_MULTIBOOT 1
 
-#ifdef XSM_ENABLE
-#define CONFIG_LATE_HWDOM 1
-#endif
-
 #define HZ 100
 
 #define OPT_CONSOLE_STR "vga"
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 8fc26ce..82b6dd1 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -110,7 +110,7 @@ struct evtchn
     u8 priority;
     u8 last_priority;
     u16 last_vcpu_id;
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
     union {
 #ifdef XSM_NEED_GENERIC_EVTCHN_SSID
         /*
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 9803ff4..1d13826 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -27,9 +27,9 @@
 /* DO NOT implement this function; it is supposed to trigger link errors */
 void __xsm_action_mismatch_detected(void);
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
-/* In XSM_ENABLE builds, this header file is included from xsm/dummy.c, and
+/* In CONFIG_XSM builds, this header file is included from xsm/dummy.c, and
  * contains static (not inline) functions compiled to the dummy XSM module.
  * There is no xsm_default_t argument available, so the value from the assertion
  * is used to initialize the variable.
@@ -39,9 +39,9 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID void
 #define XSM_ASSERT_ACTION(def) xsm_default_t action = def; (void)action
 
-#else /* XSM_ENABLE */
+#else /* CONFIG_XSM */
 
-/* In !XSM_ENABLE builds, this header file is included from xsm/xsm.h, and
+/* In !CONFIG_XSM builds, this header file is included from xsm/xsm.h, and
  * contains inline functions for each XSM hook. These functions also perform
  * compile-time checks on the xsm_default_t argument to ensure that the behavior
  * of the dummy XSM module is the same as the behavior with XSM disabled.
@@ -51,7 +51,7 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID xsm_default_t action
 #define XSM_ASSERT_ACTION(def) LINKER_BUG_ON(def != action)
 
-#endif /* XSM_ENABLE */
+#endif /* CONFIG_XSM */
 
 static always_inline int xsm_default_action(
     xsm_default_t action, struct domain *src, struct domain *target)
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 150f94a..3afed70 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -195,7 +195,7 @@ struct xsm_operations {
 #endif
 };
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
 extern struct xsm_operations *xsm_ops;
 
@@ -753,7 +753,7 @@ extern int unregister_xsm(struct xsm_operations *ops);
 extern struct xsm_operations dummy_xsm_ops;
 extern void xsm_fixup_ops(struct xsm_operations *ops);
 
-#else /* XSM_ENABLE */
+#else /* CONFIG_XSM */
 
 #include <xsm/dummy.h>
 
@@ -773,6 +773,6 @@ static inline int xsm_dt_init(void)
 }
 #endif
 
-#endif /* XSM_ENABLE */
+#endif /* CONFIG_XSM */
 
 #endif /* __XSM_H */
diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile
index d29e71c..3252c46 100644
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -1,7 +1,5 @@
 obj-y += xsm_core.o
-ifeq ($(XSM_ENABLE),y)
-obj-y += xsm_policy.o
-obj-y += dummy.o
-endif
+obj-$(CONFIG_XSM) += xsm_policy.o
+obj-$(CONFIG_XSM) += dummy.o
 
 subdir-$(CONFIG_FLASK) += flask
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index 2a74496..5e432de 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -17,7 +17,7 @@
 #include <xen/hypercall.h>
 #include <xsm/xsm.h>
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
 #define XSM_FRAMEWORK_VERSION    "1.0.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 Jan 21 17:01:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:01: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 1aMIc6-0005Ze-HH; Thu, 21 Jan 2016 17:01:38 +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 1aMIc4-0005ZE-TL
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:37 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	D5/ED-06010-0FE01A65; Thu, 21 Jan 2016 17:01:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1453395694!1506381!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34053 invoked from network); 21 Jan 2016 17:01:35 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:01:35 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcg-0008K1-8j
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIc2-0004rV-5t
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:34 +0000
Date: Thu, 21 Jan 2016 17:01:34 +0000
Message-Id: <E1aMIc2-0004rV-5t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86emul: support clzero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 892d196360d65dfa87f5fd7210cd5bca927aa455
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 14 10:32:35 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:32:35 2016 +0100

    x86emul: support clzero
    
    ... in anticipation of this possibly going to get used by guests for
    basic thinks like memset() or clearing or pages.
    
    Since the emulation doesn't use clzero itself, checking the guest's
    CPUID for the feature to be exposed is (intentionally) being avoided
    here. All that's required is sensible guest side data for the clflush
    line size.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/test_x86_emulator.c |   35 ++++++++++++++++++++++
 xen/arch/x86/x86_emulate/x86_emulate.c       |   40 ++++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 0 deletions(-)

diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c
index 1b78bf7..86e298f 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -82,6 +82,12 @@ static int cpuid(
     return X86EMUL_OKAY;
 }
 
+#define cache_line_size() ({ \
+    unsigned int eax = 1, ebx, ecx = 0, edx; \
+    cpuid(&eax, &ebx, &ecx, &edx, NULL); \
+    edx & (1U << 19) ? (ebx >> 5) & 0x7f8 : 0; \
+})
+
 #define cpu_has_mmx ({ \
     unsigned int eax = 1, ecx = 0, edx; \
     cpuid(&eax, &ecx, &ecx, &edx, NULL); \
@@ -873,6 +879,35 @@ int main(int argc, char **argv)
 #undef set_insn
 #undef check_eip
 
+    j = cache_line_size();
+    snprintf(instr, (char *)res + MMAP_SZ - instr,
+             "Testing clzero (%u-byte line)...", j);
+    printf("%-40s", instr);
+    if ( j >= sizeof(*res) && j <= MMAP_SZ / 4 )
+    {
+        instr[0] = 0x0f; instr[1] = 0x01; instr[2] = 0xfc;
+        regs.eflags = 0x200;
+        regs.eip    = (unsigned long)&instr[0];
+        regs.eax    = (unsigned long)res + MMAP_SZ / 2 + j - 1;
+        memset((void *)res + MMAP_SZ / 4, ~0, 3 * MMAP_SZ / 4);
+        rc = x86_emulate(&ctxt, &emulops);
+        if ( (rc != X86EMUL_OKAY) ||
+             (regs.eax != (unsigned long)res + MMAP_SZ / 2 + j - 1) ||
+             (regs.eflags != 0x200) ||
+             (regs.eip != (unsigned long)&instr[3]) ||
+             (res[MMAP_SZ / 2 / sizeof(*res) - 1] != ~0U) ||
+             (res[(MMAP_SZ / 2 + j) / sizeof(*res)] != ~0U) )
+            goto fail;
+        for ( i = 0; i < j; i += sizeof(*res) )
+            if ( res[(MMAP_SZ / 2 + i) / sizeof(*res)] )
+                break;
+        if ( i < j )
+            goto fail;
+        printf("okay\n");
+    }
+    else
+        printf("skipped\n");
+
     for ( j = 1; j <= 2; j++ )
     {
 #if defined(__i386__)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 56aef3e..c3672e7 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1069,6 +1069,7 @@ static bool_t vcpu_has(
     return rc == X86EMUL_OKAY;
 }
 
+#define vcpu_has_clflush() vcpu_has(       1, EDX, 19, ctxt, ops)
 #define vcpu_has_lzcnt() vcpu_has(0x80000001, ECX,  5, ctxt, ops)
 #define vcpu_has_bmi1()  vcpu_has(0x00000007, EBX,  3, ctxt, ops)
 
@@ -3851,6 +3852,45 @@ x86_emulate(
             if ( (rc = ops->vmfunc(ctxt) != X86EMUL_OKAY) )
                 goto done;
             goto no_writeback;
+	case 0xfc: /* clzero */ {
+            unsigned int eax = 1, ebx = 0, dummy = 0;
+            unsigned long zero = 0;
+
+            base = ad_bytes == 8 ? _regs.eax :
+                   ad_bytes == 4 ? (uint32_t)_regs.eax : (uint16_t)_regs.eax;
+            limit = 0;
+            if ( vcpu_has_clflush() &&
+                 ops->cpuid(&eax, &ebx, &dummy, &dummy, ctxt) == X86EMUL_OKAY )
+                limit = ((ebx >> 8) & 0xff) * 8;
+            generate_exception_if(limit < sizeof(long) ||
+                                  (limit & (limit - 1)), EXC_UD, -1);
+            base &= ~(limit - 1);
+            if ( override_seg == -1 )
+                override_seg = x86_seg_ds;
+            if ( ops->rep_stos )
+            {
+                unsigned long nr_reps = limit / sizeof(zero);
+
+                rc = ops->rep_stos(&zero, override_seg, base, sizeof(zero),
+                                   &nr_reps, ctxt);
+                if ( rc == X86EMUL_OKAY )
+                {
+                    base += nr_reps * sizeof(zero);
+                    limit -= nr_reps * sizeof(zero);
+                }
+                else if ( rc != X86EMUL_UNHANDLEABLE )
+                    goto done;
+            }
+            while ( limit )
+            {
+                rc = ops->write(override_seg, base, &zero, sizeof(zero), ctxt);
+                if ( rc != X86EMUL_OKAY )
+                    goto done;
+                base += sizeof(zero);
+                limit -= sizeof(zero);
+            }
+            goto no_writeback;
+        }
         }
 
         switch ( modrm_reg & 7 )
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:01:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:01: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 1aMIc6-0005Ze-HH; Thu, 21 Jan 2016 17:01:38 +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 1aMIc4-0005ZE-TL
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:37 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	D5/ED-06010-0FE01A65; Thu, 21 Jan 2016 17:01:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1453395694!1506381!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34053 invoked from network); 21 Jan 2016 17:01:35 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:01:35 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcg-0008K1-8j
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIc2-0004rV-5t
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:34 +0000
Date: Thu, 21 Jan 2016 17:01:34 +0000
Message-Id: <E1aMIc2-0004rV-5t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86emul: support clzero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 892d196360d65dfa87f5fd7210cd5bca927aa455
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 14 10:32:35 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:32:35 2016 +0100

    x86emul: support clzero
    
    ... in anticipation of this possibly going to get used by guests for
    basic thinks like memset() or clearing or pages.
    
    Since the emulation doesn't use clzero itself, checking the guest's
    CPUID for the feature to be exposed is (intentionally) being avoided
    here. All that's required is sensible guest side data for the clflush
    line size.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/test_x86_emulator.c |   35 ++++++++++++++++++++++
 xen/arch/x86/x86_emulate/x86_emulate.c       |   40 ++++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 0 deletions(-)

diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c
index 1b78bf7..86e298f 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -82,6 +82,12 @@ static int cpuid(
     return X86EMUL_OKAY;
 }
 
+#define cache_line_size() ({ \
+    unsigned int eax = 1, ebx, ecx = 0, edx; \
+    cpuid(&eax, &ebx, &ecx, &edx, NULL); \
+    edx & (1U << 19) ? (ebx >> 5) & 0x7f8 : 0; \
+})
+
 #define cpu_has_mmx ({ \
     unsigned int eax = 1, ecx = 0, edx; \
     cpuid(&eax, &ecx, &ecx, &edx, NULL); \
@@ -873,6 +879,35 @@ int main(int argc, char **argv)
 #undef set_insn
 #undef check_eip
 
+    j = cache_line_size();
+    snprintf(instr, (char *)res + MMAP_SZ - instr,
+             "Testing clzero (%u-byte line)...", j);
+    printf("%-40s", instr);
+    if ( j >= sizeof(*res) && j <= MMAP_SZ / 4 )
+    {
+        instr[0] = 0x0f; instr[1] = 0x01; instr[2] = 0xfc;
+        regs.eflags = 0x200;
+        regs.eip    = (unsigned long)&instr[0];
+        regs.eax    = (unsigned long)res + MMAP_SZ / 2 + j - 1;
+        memset((void *)res + MMAP_SZ / 4, ~0, 3 * MMAP_SZ / 4);
+        rc = x86_emulate(&ctxt, &emulops);
+        if ( (rc != X86EMUL_OKAY) ||
+             (regs.eax != (unsigned long)res + MMAP_SZ / 2 + j - 1) ||
+             (regs.eflags != 0x200) ||
+             (regs.eip != (unsigned long)&instr[3]) ||
+             (res[MMAP_SZ / 2 / sizeof(*res) - 1] != ~0U) ||
+             (res[(MMAP_SZ / 2 + j) / sizeof(*res)] != ~0U) )
+            goto fail;
+        for ( i = 0; i < j; i += sizeof(*res) )
+            if ( res[(MMAP_SZ / 2 + i) / sizeof(*res)] )
+                break;
+        if ( i < j )
+            goto fail;
+        printf("okay\n");
+    }
+    else
+        printf("skipped\n");
+
     for ( j = 1; j <= 2; j++ )
     {
 #if defined(__i386__)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 56aef3e..c3672e7 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1069,6 +1069,7 @@ static bool_t vcpu_has(
     return rc == X86EMUL_OKAY;
 }
 
+#define vcpu_has_clflush() vcpu_has(       1, EDX, 19, ctxt, ops)
 #define vcpu_has_lzcnt() vcpu_has(0x80000001, ECX,  5, ctxt, ops)
 #define vcpu_has_bmi1()  vcpu_has(0x00000007, EBX,  3, ctxt, ops)
 
@@ -3851,6 +3852,45 @@ x86_emulate(
             if ( (rc = ops->vmfunc(ctxt) != X86EMUL_OKAY) )
                 goto done;
             goto no_writeback;
+	case 0xfc: /* clzero */ {
+            unsigned int eax = 1, ebx = 0, dummy = 0;
+            unsigned long zero = 0;
+
+            base = ad_bytes == 8 ? _regs.eax :
+                   ad_bytes == 4 ? (uint32_t)_regs.eax : (uint16_t)_regs.eax;
+            limit = 0;
+            if ( vcpu_has_clflush() &&
+                 ops->cpuid(&eax, &ebx, &dummy, &dummy, ctxt) == X86EMUL_OKAY )
+                limit = ((ebx >> 8) & 0xff) * 8;
+            generate_exception_if(limit < sizeof(long) ||
+                                  (limit & (limit - 1)), EXC_UD, -1);
+            base &= ~(limit - 1);
+            if ( override_seg == -1 )
+                override_seg = x86_seg_ds;
+            if ( ops->rep_stos )
+            {
+                unsigned long nr_reps = limit / sizeof(zero);
+
+                rc = ops->rep_stos(&zero, override_seg, base, sizeof(zero),
+                                   &nr_reps, ctxt);
+                if ( rc == X86EMUL_OKAY )
+                {
+                    base += nr_reps * sizeof(zero);
+                    limit -= nr_reps * sizeof(zero);
+                }
+                else if ( rc != X86EMUL_UNHANDLEABLE )
+                    goto done;
+            }
+            while ( limit )
+            {
+                rc = ops->write(override_seg, base, &zero, sizeof(zero), ctxt);
+                if ( rc != X86EMUL_OKAY )
+                    goto done;
+                base += sizeof(zero);
+                limit -= sizeof(zero);
+            }
+            goto no_writeback;
+        }
         }
 
         switch ( modrm_reg & 7 )
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:01:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:01: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 1aMIcG-0005c4-NE; Thu, 21 Jan 2016 17:01:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcF-0005bi-FQ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:47 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	8D/24-28228-AFE01A65; Thu, 21 Jan 2016 17:01:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1453395704!18516588!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34032 invoked from network); 21 Jan 2016 17:01:45 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:01:45 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcq-0008K9-HV
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcC-0004sc-HO
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:44 +0000
Date: Thu, 21 Jan 2016 17:01:44 +0000
Message-Id: <E1aMIcC-0004sc-HO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: prune error labels in
	do_hvm_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ed6452a091daa711890f0c0f84adb12e9fa54fa3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 14 10:33:39 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:33:39 2016 +0100

    x86/HVM: prune error labels in do_hvm_op()
    
    I've got repeatedly annoyed by the bad naming: Make them slightly
    better recognizable (and less likely to get mixed up), except in cases
    where they can be eliminated altogether.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   78 ++++++++++++++++++++++--------------------------
 1 files changed, 36 insertions(+), 42 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 787b7de..4d517a5 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -6523,29 +6523,29 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto param_fail2;
+            goto tdv_fail;
 
         if ( a.nr > GB(1) >> PAGE_SHIFT )
-            goto param_fail2;
+            goto tdv_fail;
 
         rc = xsm_hvm_control(XSM_DM_PRIV, d, op);
         if ( rc )
-            goto param_fail2;
+            goto tdv_fail;
 
         rc = -ESRCH;
         if ( d->is_dying )
-            goto param_fail2;
+            goto tdv_fail;
 
         rc = -EINVAL;
         if ( d->vcpu == NULL || d->vcpu[0] == NULL )
-            goto param_fail2;
+            goto tdv_fail;
 
         if ( shadow_mode_enabled(d) )
             rc = shadow_track_dirty_vram(d, a.first_pfn, a.nr, a.dirty_bitmap);
         else
             rc = hap_track_dirty_vram(d, a.first_pfn, a.nr, a.dirty_bitmap);
 
-    param_fail2:
+    tdv_fail:
         rcu_unlock_domain(d);
         break;
     }
@@ -6564,21 +6564,21 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto param_fail3;
+            goto modmem_fail;
 
         rc = xsm_hvm_control(XSM_DM_PRIV, d, op);
         if ( rc )
-            goto param_fail3;
+            goto modmem_fail;
 
         rc = -EINVAL;
         if ( a.nr < start_iter ||
              ((a.first_pfn + a.nr - 1) < a.first_pfn) ||
              ((a.first_pfn + a.nr - 1) > domain_get_maximum_gpfn(d)) )
-            goto param_fail3;
+            goto modmem_fail;
 
         rc = 0;
         if ( !paging_mode_log_dirty(d) )
-            goto param_fail3;
+            goto modmem_fail;
 
         while ( a.nr > start_iter )
         {
@@ -6604,7 +6604,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
             }
         }
 
-    param_fail3:
+    modmem_fail:
         rcu_unlock_domain(d);
         break;
     }
@@ -6623,11 +6623,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
             return -ESRCH;
 
         rc = xsm_hvm_param(XSM_TARGET, d, op);
-        if ( rc )
-            goto param_fail_getmemtype;
-
-        rc = -EINVAL;
-        if ( is_hvm_domain(d) )
+        if ( unlikely(rc) )
+            /* nothing */;
+        else if ( likely(is_hvm_domain(d)) )
         {
             /* Use get_gfn query as we are interested in the current 
              * type, not in allocating or unsharing. That'll happen 
@@ -6647,10 +6645,12 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
                 a.mem_type =  HVMMEM_ram_rw;
             else
                 a.mem_type =  HVMMEM_mmio_dm;
-            rc = __copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
+            if ( __copy_to_guest(arg, &a, 1) )
+                rc = -EFAULT;
         }
+        else
+            rc = -EINVAL;
 
-    param_fail_getmemtype:
         rcu_unlock_domain(d);
         break;
     }
@@ -6677,20 +6677,20 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto param_fail4;
+            goto setmemtype_fail;
 
         rc = xsm_hvm_control(XSM_DM_PRIV, d, op);
         if ( rc )
-            goto param_fail4;
+            goto setmemtype_fail;
 
         rc = -EINVAL;
         if ( a.nr < start_iter ||
              ((a.first_pfn + a.nr - 1) < a.first_pfn) ||
              ((a.first_pfn + a.nr - 1) > domain_get_maximum_gpfn(d)) )
-            goto param_fail4;
+            goto setmemtype_fail;
             
         if ( a.hvmmem_type >= ARRAY_SIZE(memtype) )
-            goto param_fail4;
+            goto setmemtype_fail;
 
         while ( a.nr > start_iter )
         {
@@ -6703,39 +6703,39 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
                 put_gfn(d, pfn);
                 p2m_mem_paging_populate(d, pfn);
                 rc = -EAGAIN;
-                goto param_fail4;
+                goto setmemtype_fail;
             }
             if ( p2m_is_shared(t) )
             {
                 put_gfn(d, pfn);
                 rc = -EAGAIN;
-                goto param_fail4;
+                goto setmemtype_fail;
             }
             if ( !p2m_is_ram(t) &&
                  (!p2m_is_hole(t) || a.hvmmem_type != HVMMEM_mmio_dm) &&
                  (t != p2m_mmio_write_dm || a.hvmmem_type != HVMMEM_ram_rw) )
             {
                 put_gfn(d, pfn);
-                goto param_fail4;
+                goto setmemtype_fail;
             }
 
             rc = p2m_change_type_one(d, pfn, t, memtype[a.hvmmem_type]);
             put_gfn(d, pfn);
             if ( rc )
-                goto param_fail4;
+                goto setmemtype_fail;
 
             /* Check for continuation if it's not the last interation */
             if ( a.nr > ++start_iter && !(start_iter & HVMOP_op_mask) &&
                  hypercall_preempt_check() )
             {
                 rc = -ERESTART;
-                goto param_fail4;
+                goto setmemtype_fail;
             }
         }
 
         rc = 0;
 
-    param_fail4:
+    setmemtype_fail:
         rcu_unlock_domain(d);
         break;
     }
@@ -6753,17 +6753,11 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
             return -ESRCH;
 
         rc = -EINVAL;
-        if ( !is_hvm_domain(d) || !paging_mode_shadow(d) )
-            goto param_fail7;
-
-        rc = xsm_hvm_param(XSM_TARGET, d, op);
-        if ( rc )
-            goto param_fail7;
-
-        rc = 0;
-        pagetable_dying(d, a.gpa);
+        if ( is_hvm_domain(d) && paging_mode_shadow(d) )
+            rc = xsm_hvm_param(XSM_TARGET, d, op);
+        if ( !rc )
+            pagetable_dying(d, a.gpa);
 
-    param_fail7:
         rcu_unlock_domain(d);
         break;
     }
@@ -6808,15 +6802,15 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto param_fail8;
+            goto injtrap_fail;
 
         rc = xsm_hvm_control(XSM_DM_PRIV, d, op);
         if ( rc )
-            goto param_fail8;
+            goto injtrap_fail;
 
         rc = -ENOENT;
         if ( tr.vcpuid >= d->max_vcpus || (v = d->vcpu[tr.vcpuid]) == NULL )
-            goto param_fail8;
+            goto injtrap_fail;
         
         if ( v->arch.hvm_vcpu.inject_trap.vector != -1 )
             rc = -EBUSY;
@@ -6830,7 +6824,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
             rc = 0;
         }
 
-    param_fail8:
+    injtrap_fail:
         rcu_unlock_domain(d);
         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 Jan 21 17:01:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:01: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 1aMIcG-0005c4-NE; Thu, 21 Jan 2016 17:01:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcF-0005bi-FQ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:47 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	8D/24-28228-AFE01A65; Thu, 21 Jan 2016 17:01:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1453395704!18516588!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34032 invoked from network); 21 Jan 2016 17:01:45 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:01:45 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcq-0008K9-HV
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcC-0004sc-HO
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:44 +0000
Date: Thu, 21 Jan 2016 17:01:44 +0000
Message-Id: <E1aMIcC-0004sc-HO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: prune error labels in
	do_hvm_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ed6452a091daa711890f0c0f84adb12e9fa54fa3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 14 10:33:39 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:33:39 2016 +0100

    x86/HVM: prune error labels in do_hvm_op()
    
    I've got repeatedly annoyed by the bad naming: Make them slightly
    better recognizable (and less likely to get mixed up), except in cases
    where they can be eliminated altogether.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   78 ++++++++++++++++++++++--------------------------
 1 files changed, 36 insertions(+), 42 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 787b7de..4d517a5 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -6523,29 +6523,29 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto param_fail2;
+            goto tdv_fail;
 
         if ( a.nr > GB(1) >> PAGE_SHIFT )
-            goto param_fail2;
+            goto tdv_fail;
 
         rc = xsm_hvm_control(XSM_DM_PRIV, d, op);
         if ( rc )
-            goto param_fail2;
+            goto tdv_fail;
 
         rc = -ESRCH;
         if ( d->is_dying )
-            goto param_fail2;
+            goto tdv_fail;
 
         rc = -EINVAL;
         if ( d->vcpu == NULL || d->vcpu[0] == NULL )
-            goto param_fail2;
+            goto tdv_fail;
 
         if ( shadow_mode_enabled(d) )
             rc = shadow_track_dirty_vram(d, a.first_pfn, a.nr, a.dirty_bitmap);
         else
             rc = hap_track_dirty_vram(d, a.first_pfn, a.nr, a.dirty_bitmap);
 
-    param_fail2:
+    tdv_fail:
         rcu_unlock_domain(d);
         break;
     }
@@ -6564,21 +6564,21 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto param_fail3;
+            goto modmem_fail;
 
         rc = xsm_hvm_control(XSM_DM_PRIV, d, op);
         if ( rc )
-            goto param_fail3;
+            goto modmem_fail;
 
         rc = -EINVAL;
         if ( a.nr < start_iter ||
              ((a.first_pfn + a.nr - 1) < a.first_pfn) ||
              ((a.first_pfn + a.nr - 1) > domain_get_maximum_gpfn(d)) )
-            goto param_fail3;
+            goto modmem_fail;
 
         rc = 0;
         if ( !paging_mode_log_dirty(d) )
-            goto param_fail3;
+            goto modmem_fail;
 
         while ( a.nr > start_iter )
         {
@@ -6604,7 +6604,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
             }
         }
 
-    param_fail3:
+    modmem_fail:
         rcu_unlock_domain(d);
         break;
     }
@@ -6623,11 +6623,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
             return -ESRCH;
 
         rc = xsm_hvm_param(XSM_TARGET, d, op);
-        if ( rc )
-            goto param_fail_getmemtype;
-
-        rc = -EINVAL;
-        if ( is_hvm_domain(d) )
+        if ( unlikely(rc) )
+            /* nothing */;
+        else if ( likely(is_hvm_domain(d)) )
         {
             /* Use get_gfn query as we are interested in the current 
              * type, not in allocating or unsharing. That'll happen 
@@ -6647,10 +6645,12 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
                 a.mem_type =  HVMMEM_ram_rw;
             else
                 a.mem_type =  HVMMEM_mmio_dm;
-            rc = __copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
+            if ( __copy_to_guest(arg, &a, 1) )
+                rc = -EFAULT;
         }
+        else
+            rc = -EINVAL;
 
-    param_fail_getmemtype:
         rcu_unlock_domain(d);
         break;
     }
@@ -6677,20 +6677,20 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto param_fail4;
+            goto setmemtype_fail;
 
         rc = xsm_hvm_control(XSM_DM_PRIV, d, op);
         if ( rc )
-            goto param_fail4;
+            goto setmemtype_fail;
 
         rc = -EINVAL;
         if ( a.nr < start_iter ||
              ((a.first_pfn + a.nr - 1) < a.first_pfn) ||
              ((a.first_pfn + a.nr - 1) > domain_get_maximum_gpfn(d)) )
-            goto param_fail4;
+            goto setmemtype_fail;
             
         if ( a.hvmmem_type >= ARRAY_SIZE(memtype) )
-            goto param_fail4;
+            goto setmemtype_fail;
 
         while ( a.nr > start_iter )
         {
@@ -6703,39 +6703,39 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
                 put_gfn(d, pfn);
                 p2m_mem_paging_populate(d, pfn);
                 rc = -EAGAIN;
-                goto param_fail4;
+                goto setmemtype_fail;
             }
             if ( p2m_is_shared(t) )
             {
                 put_gfn(d, pfn);
                 rc = -EAGAIN;
-                goto param_fail4;
+                goto setmemtype_fail;
             }
             if ( !p2m_is_ram(t) &&
                  (!p2m_is_hole(t) || a.hvmmem_type != HVMMEM_mmio_dm) &&
                  (t != p2m_mmio_write_dm || a.hvmmem_type != HVMMEM_ram_rw) )
             {
                 put_gfn(d, pfn);
-                goto param_fail4;
+                goto setmemtype_fail;
             }
 
             rc = p2m_change_type_one(d, pfn, t, memtype[a.hvmmem_type]);
             put_gfn(d, pfn);
             if ( rc )
-                goto param_fail4;
+                goto setmemtype_fail;
 
             /* Check for continuation if it's not the last interation */
             if ( a.nr > ++start_iter && !(start_iter & HVMOP_op_mask) &&
                  hypercall_preempt_check() )
             {
                 rc = -ERESTART;
-                goto param_fail4;
+                goto setmemtype_fail;
             }
         }
 
         rc = 0;
 
-    param_fail4:
+    setmemtype_fail:
         rcu_unlock_domain(d);
         break;
     }
@@ -6753,17 +6753,11 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
             return -ESRCH;
 
         rc = -EINVAL;
-        if ( !is_hvm_domain(d) || !paging_mode_shadow(d) )
-            goto param_fail7;
-
-        rc = xsm_hvm_param(XSM_TARGET, d, op);
-        if ( rc )
-            goto param_fail7;
-
-        rc = 0;
-        pagetable_dying(d, a.gpa);
+        if ( is_hvm_domain(d) && paging_mode_shadow(d) )
+            rc = xsm_hvm_param(XSM_TARGET, d, op);
+        if ( !rc )
+            pagetable_dying(d, a.gpa);
 
-    param_fail7:
         rcu_unlock_domain(d);
         break;
     }
@@ -6808,15 +6802,15 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto param_fail8;
+            goto injtrap_fail;
 
         rc = xsm_hvm_control(XSM_DM_PRIV, d, op);
         if ( rc )
-            goto param_fail8;
+            goto injtrap_fail;
 
         rc = -ENOENT;
         if ( tr.vcpuid >= d->max_vcpus || (v = d->vcpu[tr.vcpuid]) == NULL )
-            goto param_fail8;
+            goto injtrap_fail;
         
         if ( v->arch.hvm_vcpu.inject_trap.vector != -1 )
             rc = -EBUSY;
@@ -6830,7 +6824,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
             rc = 0;
         }
 
-    param_fail8:
+    injtrap_fail:
         rcu_unlock_domain(d);
         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 Jan 21 17:01:58 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:01: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 1aMIcQ-0005dn-S2; Thu, 21 Jan 2016 17:01: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 1aMIcP-0005dU-Gz
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:57 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	33/2E-08977-40F01A65; Thu, 21 Jan 2016 17:01:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1453395715!11523720!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3657 invoked from network); 21 Jan 2016 17:01:56 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:01:56 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMId0-0008KH-R0
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcM-0004sz-Re
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:54 +0000
Date: Thu, 21 Jan 2016 17:01:54 +0000
Message-Id: <E1aMIcM-0004sz-Re@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: introduce CONFIG_NR_CPUS in
	Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6da11a5ac28215eff9faa78ca26e13c2be1d5eaa
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Thu Jan 14 10:34:27 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:35:04 2016 +0100

    build: introduce CONFIG_NR_CPUS in Kconfig
    
    Introduce an option where the user can modifiy the maximum number of
    supported physical CPUs.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/arch/Kconfig     |    8 ++++++++
 xen/arch/arm/Kconfig |    2 ++
 xen/arch/x86/Kconfig |    2 ++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig
new file mode 100644
index 0000000..cf0acb7
--- /dev/null
+++ b/xen/arch/Kconfig
@@ -0,0 +1,8 @@
+
+config NR_CPUS
+	int "Maximum number of physical CPUs"
+	range 1 4095
+	default "256" if X86
+	default "128" if ARM
+	---help---
+	  Specifies the maximum number of physical CPUs which Xen will support.
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 2cab17b..60e923c 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -31,6 +31,8 @@ config ARCH_DEFCONFIG
 
 menu "Architecture Features"
 
+source "arch/Kconfig"
+
 # Select HAS_GICV3 if GICv3 is supported
 config HAS_GICV3
 	bool
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index d629767..4781b34 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -25,6 +25,8 @@ config ARCH_DEFCONFIG
 
 menu "Architecture Features"
 
+source "arch/Kconfig"
+
 config BIGMEM
 	bool "big memory support"
 	default 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 Jan 21 17:01:58 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:01: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 1aMIcQ-0005dn-S2; Thu, 21 Jan 2016 17:01: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 1aMIcP-0005dU-Gz
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:57 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	33/2E-08977-40F01A65; Thu, 21 Jan 2016 17:01:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1453395715!11523720!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3657 invoked from network); 21 Jan 2016 17:01:56 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:01:56 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMId0-0008KH-R0
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcM-0004sz-Re
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:01:54 +0000
Date: Thu, 21 Jan 2016 17:01:54 +0000
Message-Id: <E1aMIcM-0004sz-Re@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: introduce CONFIG_NR_CPUS in
	Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6da11a5ac28215eff9faa78ca26e13c2be1d5eaa
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Thu Jan 14 10:34:27 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:35:04 2016 +0100

    build: introduce CONFIG_NR_CPUS in Kconfig
    
    Introduce an option where the user can modifiy the maximum number of
    supported physical CPUs.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/arch/Kconfig     |    8 ++++++++
 xen/arch/arm/Kconfig |    2 ++
 xen/arch/x86/Kconfig |    2 ++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig
new file mode 100644
index 0000000..cf0acb7
--- /dev/null
+++ b/xen/arch/Kconfig
@@ -0,0 +1,8 @@
+
+config NR_CPUS
+	int "Maximum number of physical CPUs"
+	range 1 4095
+	default "256" if X86
+	default "128" if ARM
+	---help---
+	  Specifies the maximum number of physical CPUs which Xen will support.
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 2cab17b..60e923c 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -31,6 +31,8 @@ config ARCH_DEFCONFIG
 
 menu "Architecture Features"
 
+source "arch/Kconfig"
+
 # Select HAS_GICV3 if GICv3 is supported
 config HAS_GICV3
 	bool
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index d629767..4781b34 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -25,6 +25,8 @@ config ARCH_DEFCONFIG
 
 menu "Architecture Features"
 
+source "arch/Kconfig"
+
 config BIGMEM
 	bool "big memory support"
 	default 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 Jan 21 17:02:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:02: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 1aMIcb-0005fu-2p; Thu, 21 Jan 2016 17:02: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 1aMIcZ-0005fg-Nw
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:07 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	80/23-02940-E0F01A65; Thu, 21 Jan 2016 17:02:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1453395725!17339894!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64027 invoked from network); 21 Jan 2016 17:02:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:02:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdB-0008KS-75
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcX-0004tY-3i
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:05 +0000
Date: Thu, 21 Jan 2016 17:02:05 +0000
Message-Id: <E1aMIcX-0004tY-3i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: convert NR_CPUS to Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit af3eb9bf2f979631795750ee5924bdd5a88ded95
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Thu Jan 14 10:36:40 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:36:40 2016 +0100

    build: convert NR_CPUS to Kconfig
    
    Use CONFIG_NR_CPUS from Kconfig as NR_CPUS instead of the previous
    MAX_PHYS_CPUS variable from make. Remove the creation of MAX_PHYS_CPUS
    as well.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/Rules.mk                 |    3 ---
 xen/include/asm-arm/config.h |    6 ------
 xen/include/asm-x86/config.h |    6 ------
 xen/include/xen/config.h     |    3 +++
 4 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 8bd1098..f29491e 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -59,9 +59,6 @@ CFLAGS-$(perfc_arrays)  += -DPERF_ARRAYS
 CFLAGS-$(lock_profile)  += -DLOCK_PROFILE
 CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
 
-ifneq ($(max_phys_cpus),)
-CFLAGS-y                += -DMAX_PHYS_CPUS=$(max_phys_cpus)
-endif
 ifneq ($(max_phys_irqs),)
 CFLAGS-y                += -DMAX_PHYS_IRQS=$(max_phys_irqs)
 endif
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 1520b41..bd832df 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -45,12 +45,6 @@
 
 #define OPT_CONSOLE_STR "dtuart"
 
-#ifdef MAX_PHYS_CPUS
-#define NR_CPUS MAX_PHYS_CPUS
-#else
-#define NR_CPUS 128
-#endif
-
 #ifdef CONFIG_ARM_64
 #define MAX_VIRT_CPUS 128
 #else
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index 3305a75..d97877d 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -56,12 +56,6 @@
 
 #define OPT_CONSOLE_STR "vga"
 
-#ifdef MAX_PHYS_CPUS
-#define NR_CPUS MAX_PHYS_CPUS
-#else
-#define NR_CPUS 256
-#endif
-
 /* Linkage for x86 */
 #define __ALIGN .align 16,0x90
 #define __ALIGN_STR ".align 16,0x90"
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index bba015a..d780121 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -92,4 +92,7 @@
 #define FLASK_AVC_STATS 1
 #endif
 
+/* allow existing code to work with Kconfig variable */
+#define NR_CPUS CONFIG_NR_CPUS
+
 #endif /* __XEN_CONFIG_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 Jan 21 17:02:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:02: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 1aMIcb-0005fu-2p; Thu, 21 Jan 2016 17:02: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 1aMIcZ-0005fg-Nw
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:07 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	80/23-02940-E0F01A65; Thu, 21 Jan 2016 17:02:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1453395725!17339894!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64027 invoked from network); 21 Jan 2016 17:02:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:02:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdB-0008KS-75
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcX-0004tY-3i
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:05 +0000
Date: Thu, 21 Jan 2016 17:02:05 +0000
Message-Id: <E1aMIcX-0004tY-3i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: convert NR_CPUS to Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit af3eb9bf2f979631795750ee5924bdd5a88ded95
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Thu Jan 14 10:36:40 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:36:40 2016 +0100

    build: convert NR_CPUS to Kconfig
    
    Use CONFIG_NR_CPUS from Kconfig as NR_CPUS instead of the previous
    MAX_PHYS_CPUS variable from make. Remove the creation of MAX_PHYS_CPUS
    as well.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/Rules.mk                 |    3 ---
 xen/include/asm-arm/config.h |    6 ------
 xen/include/asm-x86/config.h |    6 ------
 xen/include/xen/config.h     |    3 +++
 4 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 8bd1098..f29491e 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -59,9 +59,6 @@ CFLAGS-$(perfc_arrays)  += -DPERF_ARRAYS
 CFLAGS-$(lock_profile)  += -DLOCK_PROFILE
 CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
 
-ifneq ($(max_phys_cpus),)
-CFLAGS-y                += -DMAX_PHYS_CPUS=$(max_phys_cpus)
-endif
 ifneq ($(max_phys_irqs),)
 CFLAGS-y                += -DMAX_PHYS_IRQS=$(max_phys_irqs)
 endif
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 1520b41..bd832df 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -45,12 +45,6 @@
 
 #define OPT_CONSOLE_STR "dtuart"
 
-#ifdef MAX_PHYS_CPUS
-#define NR_CPUS MAX_PHYS_CPUS
-#else
-#define NR_CPUS 128
-#endif
-
 #ifdef CONFIG_ARM_64
 #define MAX_VIRT_CPUS 128
 #else
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index 3305a75..d97877d 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -56,12 +56,6 @@
 
 #define OPT_CONSOLE_STR "vga"
 
-#ifdef MAX_PHYS_CPUS
-#define NR_CPUS MAX_PHYS_CPUS
-#else
-#define NR_CPUS 256
-#endif
-
 /* Linkage for x86 */
 #define __ALIGN .align 16,0x90
 #define __ALIGN_STR ".align 16,0x90"
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index bba015a..d780121 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -92,4 +92,7 @@
 #define FLASK_AVC_STATS 1
 #endif
 
+/* allow existing code to work with Kconfig variable */
+#define NR_CPUS CONFIG_NR_CPUS
+
 #endif /* __XEN_CONFIG_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 Jan 21 17:02:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:02: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 1aMIcm-0005l6-3c; Thu, 21 Jan 2016 17:02: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 1aMIck-0005ip-3C
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:18 +0000
Content-Length: 6755
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	DE/78-07165-91F01A65; Thu, 21 Jan 2016 17:02:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1453395735!18429998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 358 invoked from network); 21 Jan 2016 17:02:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:02:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdL-0008LL-JD
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIch-0004u1-Gx
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:15 +0000
Date: Thu, 21 Jan 2016 17:02:15 +0000
Message-Id: <E1aMIch-0004u1-Gx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: introduce a flags field in
	the CPU save record
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============6494752954348126016=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6494752954348126016==
Content-Length: 6465
Content-Transfer-Encoding: quoted-printable

commit a3b6844d3b7ac8445669337c222b0cff2cf90484
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Thu Jan 14 10:37:53 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:37:53 2016 +0100

    x86/hvm: introduce a flags field in the CPU save record
    
    Introduce a new flags field and use bit 0 to signal if the FPU has been
    initialised or not. Previously Xen always wrongly assumed the FPU was
    initialised on restore.
    
    While modifying the FPU restore part of hvm_load_cpu_ctxt remove the
    memcpy branching, since v->arch.fpu_ctxt will always point to the right
    area for hosts with XSAVE or without it.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c                 |   42 +++++++++++++++++++++----------
 xen/include/public/arch-x86/hvm/save.h |   27 +++++++++++++++-----
 2 files changed, 48 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 4d517a5..922754a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1797,9 +1797,15 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         ctxt.ldtr_arbytes =3D seg.attr.bytes;
 
         if ( v->fpu_initialised )
+        {
             memcpy(ctxt.fpu_regs, v->arch.fpu_ctxt, sizeof(ctxt.fpu_regs));
-        else 
-            memset(ctxt.fpu_regs, 0, sizeof(ctxt.fpu_regs));
+            ctxt.flags =3D XEN_X86_FPU_INITIALISED;
+        }
+        else
+        {
+             memset(ctxt.fpu_regs, 0, sizeof(ctxt.fpu_regs));
+             ctxt.flags =3D 0;
+        }
 
         ctxt.rax =3D v->arch.user_regs.eax;
         ctxt.rbx =3D v->arch.user_regs.ebx;
@@ -1981,7 +1987,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( hvm_load_entry(CPU, h, &ctxt) !=3D 0 ) 
+    if ( hvm_load_entry_zeroextend(CPU, h, &ctxt) !=3D 0 )
         return -EINVAL;
 
     /* Sanity check some control registers. */
@@ -2009,6 +2015,13 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
+    if ( (ctxt.flags & ~XEN_X86_FPU_INITIALISED) !=3D 0 )
+    {
+        gprintk(XENLOG_ERR, "bad flags value in CPU context: %#x\n",
+                ctxt.flags);
+        return -EINVAL;
+    }
+
     /* Older Xen versions used to save the segment arbytes directly 
      * from the VMCS on Intel hosts.  Detect this and rearrange them
      * into the struct segment_register format. */
@@ -2087,19 +2100,21 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     seg.attr.bytes =3D ctxt.ldtr_arbytes;
     hvm_set_segment_register(v, x86_seg_ldtr, &seg);
 
-    /* In case xsave-absent save file is restored on a xsave-capable host */
-    if ( cpu_has_xsave && !xsave_enabled(v) )
+    v->fpu_initialised =3D !!(ctxt.flags & XEN_X86_FPU_INITIALISED);
+    if ( v->fpu_initialised )
     {
-        struct xsave_struct *xsave_area =3D v->arch.xsave_area;
+        memcpy(v->arch.fpu_ctxt, ctxt.fpu_regs, sizeof(ctxt.fpu_regs));
+        /* In case xsave-absent save file is restored on a xsave-capable host */
+        if ( cpu_has_xsave && !xsave_enabled(v) )
+        {
+            struct xsave_struct *xsave_area =3D v->arch.xsave_area;
 
-        memcpy(v->arch.xsave_area, ctxt.fpu_regs, sizeof(ctxt.fpu_regs));
-        xsave_area->xsave_hdr.xstate_bv =3D XSTATE_FP_SSE;
-        if ( cpu_has_xsaves || cpu_has_xsavec )
-            xsave_area->xsave_hdr.xcomp_bv =3D XSTATE_FP_SSE |
-                                             XSTATE_COMPACTION_ENABLED;
+            xsave_area->xsave_hdr.xstate_bv =3D XSTATE_FP_SSE;
+            if ( cpu_has_xsaves || cpu_has_xsavec )
+                xsave_area->xsave_hdr.xcomp_bv =3D XSTATE_FP_SSE |
+                                                 XSTATE_COMPACTION_ENABLED;
+        }
     }
-    else
-        memcpy(v->arch.fpu_ctxt, ctxt.fpu_regs, sizeof(ctxt.fpu_regs));
 
     v->arch.user_regs.eax =3D ctxt.rax;
     v->arch.user_regs.ebx =3D ctxt.rbx;
@@ -2127,7 +2142,6 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     v->arch.debugreg[7] =3D ctxt.dr7;
 
     v->arch.vgc_flags =3D VGCF_online;
-    v->fpu_initialised =3D 1;
 
     /* Auxiliary processors should be woken immediately. */
     v->is_initialised =3D 1;
diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h
index 29d513c..b6b1bf8 100644
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -47,7 +47,9 @@ DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header);
 /*
  * Processor
  *
- * Compat: Pre-3.4 didn't have msr_tsc_aux
+ * Compat:
+ *     - Pre-3.4 didn't have msr_tsc_aux
+ *     - Pre-4.7 didn't have fpu_initialised
  */
 
 struct hvm_hw_cpu {
@@ -157,6 +159,10 @@ struct hvm_hw_cpu {
     };
     /* error code for pending event */
     uint32_t error_code;
+
+#define _XEN_X86_FPU_INITIALISED        0
+#define XEN_X86_FPU_INITIALISED         (1U<<_XEN_X86_FPU_INITIALISED)
+    uint32_t flags;
 };
 
 struct hvm_hw_cpu_compat {
@@ -275,12 +281,19 @@ static inline int _hvm_hw_fix_cpu(void *h, uint32_t size) {
         struct hvm_hw_cpu_compat cmp;
     } *ucpu =3D (union hvm_hw_cpu_union *)h;
 
-    /* If we copy from the end backwards, we should
-     * be able to do the modification in-place */
-    ucpu->nat.error_code =3D ucpu->cmp.error_code;
-    ucpu->nat.pending_event =3D ucpu->cmp.pending_event;
-    ucpu->nat.tsc =3D ucpu->cmp.tsc;
-    ucpu->nat.msr_tsc_aux =3D 0;
+    if ( size =3D=3D sizeof(struct hvm_hw_cpu_compat) )
+    {
+        /*
+         * If we copy from the end backwards, we should
+         * be able to do the modification in-place.
+         */
+        ucpu->nat.error_code =3D ucpu->cmp.error_code;
+        ucpu->nat.pending_event =3D ucpu->cmp.pending_event;
+        ucpu->nat.tsc =3D ucpu->cmp.tsc;
+        ucpu->nat.msr_tsc_aux =3D 0;
+    }
+    /* Mimic the old behaviour by unconditionally setting fpu_initialised. */
+    ucpu->nat.flags =3D XEN_X86_FPU_INITIALISED;
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:02:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:02: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 1aMIcm-0005l6-3c; Thu, 21 Jan 2016 17:02: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 1aMIck-0005ip-3C
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:18 +0000
Content-Length: 6755
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	DE/78-07165-91F01A65; Thu, 21 Jan 2016 17:02:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1453395735!18429998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 358 invoked from network); 21 Jan 2016 17:02:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:02:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdL-0008LL-JD
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIch-0004u1-Gx
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:15 +0000
Date: Thu, 21 Jan 2016 17:02:15 +0000
Message-Id: <E1aMIch-0004u1-Gx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: introduce a flags field in
	the CPU save record
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============6494752954348126016=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6494752954348126016==
Content-Length: 6465
Content-Transfer-Encoding: quoted-printable

commit a3b6844d3b7ac8445669337c222b0cff2cf90484
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Thu Jan 14 10:37:53 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:37:53 2016 +0100

    x86/hvm: introduce a flags field in the CPU save record
    
    Introduce a new flags field and use bit 0 to signal if the FPU has been
    initialised or not. Previously Xen always wrongly assumed the FPU was
    initialised on restore.
    
    While modifying the FPU restore part of hvm_load_cpu_ctxt remove the
    memcpy branching, since v->arch.fpu_ctxt will always point to the right
    area for hosts with XSAVE or without it.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c                 |   42 +++++++++++++++++++++----------
 xen/include/public/arch-x86/hvm/save.h |   27 +++++++++++++++-----
 2 files changed, 48 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 4d517a5..922754a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1797,9 +1797,15 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         ctxt.ldtr_arbytes =3D seg.attr.bytes;
 
         if ( v->fpu_initialised )
+        {
             memcpy(ctxt.fpu_regs, v->arch.fpu_ctxt, sizeof(ctxt.fpu_regs));
-        else 
-            memset(ctxt.fpu_regs, 0, sizeof(ctxt.fpu_regs));
+            ctxt.flags =3D XEN_X86_FPU_INITIALISED;
+        }
+        else
+        {
+             memset(ctxt.fpu_regs, 0, sizeof(ctxt.fpu_regs));
+             ctxt.flags =3D 0;
+        }
 
         ctxt.rax =3D v->arch.user_regs.eax;
         ctxt.rbx =3D v->arch.user_regs.ebx;
@@ -1981,7 +1987,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( hvm_load_entry(CPU, h, &ctxt) !=3D 0 ) 
+    if ( hvm_load_entry_zeroextend(CPU, h, &ctxt) !=3D 0 )
         return -EINVAL;
 
     /* Sanity check some control registers. */
@@ -2009,6 +2015,13 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
+    if ( (ctxt.flags & ~XEN_X86_FPU_INITIALISED) !=3D 0 )
+    {
+        gprintk(XENLOG_ERR, "bad flags value in CPU context: %#x\n",
+                ctxt.flags);
+        return -EINVAL;
+    }
+
     /* Older Xen versions used to save the segment arbytes directly 
      * from the VMCS on Intel hosts.  Detect this and rearrange them
      * into the struct segment_register format. */
@@ -2087,19 +2100,21 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     seg.attr.bytes =3D ctxt.ldtr_arbytes;
     hvm_set_segment_register(v, x86_seg_ldtr, &seg);
 
-    /* In case xsave-absent save file is restored on a xsave-capable host */
-    if ( cpu_has_xsave && !xsave_enabled(v) )
+    v->fpu_initialised =3D !!(ctxt.flags & XEN_X86_FPU_INITIALISED);
+    if ( v->fpu_initialised )
     {
-        struct xsave_struct *xsave_area =3D v->arch.xsave_area;
+        memcpy(v->arch.fpu_ctxt, ctxt.fpu_regs, sizeof(ctxt.fpu_regs));
+        /* In case xsave-absent save file is restored on a xsave-capable host */
+        if ( cpu_has_xsave && !xsave_enabled(v) )
+        {
+            struct xsave_struct *xsave_area =3D v->arch.xsave_area;
 
-        memcpy(v->arch.xsave_area, ctxt.fpu_regs, sizeof(ctxt.fpu_regs));
-        xsave_area->xsave_hdr.xstate_bv =3D XSTATE_FP_SSE;
-        if ( cpu_has_xsaves || cpu_has_xsavec )
-            xsave_area->xsave_hdr.xcomp_bv =3D XSTATE_FP_SSE |
-                                             XSTATE_COMPACTION_ENABLED;
+            xsave_area->xsave_hdr.xstate_bv =3D XSTATE_FP_SSE;
+            if ( cpu_has_xsaves || cpu_has_xsavec )
+                xsave_area->xsave_hdr.xcomp_bv =3D XSTATE_FP_SSE |
+                                                 XSTATE_COMPACTION_ENABLED;
+        }
     }
-    else
-        memcpy(v->arch.fpu_ctxt, ctxt.fpu_regs, sizeof(ctxt.fpu_regs));
 
     v->arch.user_regs.eax =3D ctxt.rax;
     v->arch.user_regs.ebx =3D ctxt.rbx;
@@ -2127,7 +2142,6 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     v->arch.debugreg[7] =3D ctxt.dr7;
 
     v->arch.vgc_flags =3D VGCF_online;
-    v->fpu_initialised =3D 1;
 
     /* Auxiliary processors should be woken immediately. */
     v->is_initialised =3D 1;
diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h
index 29d513c..b6b1bf8 100644
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -47,7 +47,9 @@ DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header);
 /*
  * Processor
  *
- * Compat: Pre-3.4 didn't have msr_tsc_aux
+ * Compat:
+ *     - Pre-3.4 didn't have msr_tsc_aux
+ *     - Pre-4.7 didn't have fpu_initialised
  */
 
 struct hvm_hw_cpu {
@@ -157,6 +159,10 @@ struct hvm_hw_cpu {
     };
     /* error code for pending event */
     uint32_t error_code;
+
+#define _XEN_X86_FPU_INITIALISED        0
+#define XEN_X86_FPU_INITIALISED         (1U<<_XEN_X86_FPU_INITIALISED)
+    uint32_t flags;
 };
 
 struct hvm_hw_cpu_compat {
@@ -275,12 +281,19 @@ static inline int _hvm_hw_fix_cpu(void *h, uint32_t size) {
         struct hvm_hw_cpu_compat cmp;
     } *ucpu =3D (union hvm_hw_cpu_union *)h;
 
-    /* If we copy from the end backwards, we should
-     * be able to do the modification in-place */
-    ucpu->nat.error_code =3D ucpu->cmp.error_code;
-    ucpu->nat.pending_event =3D ucpu->cmp.pending_event;
-    ucpu->nat.tsc =3D ucpu->cmp.tsc;
-    ucpu->nat.msr_tsc_aux =3D 0;
+    if ( size =3D=3D sizeof(struct hvm_hw_cpu_compat) )
+    {
+        /*
+         * If we copy from the end backwards, we should
+         * be able to do the modification in-place.
+         */
+        ucpu->nat.error_code =3D ucpu->cmp.error_code;
+        ucpu->nat.pending_event =3D ucpu->cmp.pending_event;
+        ucpu->nat.tsc =3D ucpu->cmp.tsc;
+        ucpu->nat.msr_tsc_aux =3D 0;
+    }
+    /* Mimic the old behaviour by unconditionally setting fpu_initialised. */
+    ucpu->nat.flags =3D XEN_X86_FPU_INITIALISED;
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:02:30 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:02: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 1aMIcw-0005qk-8Z; Thu, 21 Jan 2016 17:02: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 1aMIcu-0005pO-IC
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:28 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	93/9D-08347-32F01A65; Thu, 21 Jan 2016 17:02:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1453395746!18467767!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8158 invoked from network); 21 Jan 2016 17:02:27 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:02:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdV-0008Lz-WE
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcr-0004uu-W2
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:26 +0000
Date: Thu, 21 Jan 2016 17:02:25 +0000
Message-Id: <E1aMIcr-0004uu-W2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsave: simplify xcomp_bv
	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 83ae0bb2260c71e8dcec538dd477f7253aaef327
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 14 10:42:53 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:42:53 2016 +0100

    x86/xsave: simplify xcomp_bv initialization
    
    This simplifies a number of pointless conditionals: Bits 0 and 1 of
    xcomp_bv don't matter anyway, and as long as none of bits 2..62 are
    set, setting bit 63 is pointless too unless XSAVES is in use.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c  |    5 ++---
 xen/arch/x86/hvm/hvm.c |   10 ++++------
 xen/arch/x86/i387.c    |    2 +-
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 159d960..e70c125 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -922,9 +922,8 @@ int arch_set_info_guest(
         if ( v->arch.xsave_area )
         {
             v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
-            if ( cpu_has_xsaves || cpu_has_xsavec )
-                v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP_SSE |
-                                                         XSTATE_COMPACTION_ENABLED;
+            v->arch.xsave_area->xsave_hdr.xcomp_bv =
+                cpu_has_xsaves ? XSTATE_COMPACTION_ENABLED : 0;
         }
     }
     else if ( v->arch.xsave_area )
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 922754a..a99edc2 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2110,9 +2110,8 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
             struct xsave_struct *xsave_area = v->arch.xsave_area;
 
             xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
-            if ( cpu_has_xsaves || cpu_has_xsavec )
-                xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP_SSE |
-                                                 XSTATE_COMPACTION_ENABLED;
+            xsave_area->xsave_hdr.xcomp_bv =
+                cpu_has_xsaves ? XSTATE_COMPACTION_ENABLED : 0;
         }
     }
 
@@ -5476,9 +5475,8 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip)
     if ( v->arch.xsave_area )
     {
         v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP;
-        if ( cpu_has_xsaves || cpu_has_xsavec )
-            v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP |
-                                                     XSTATE_COMPACTION_ENABLED;
+        v->arch.xsave_area->xsave_hdr.xcomp_bv =
+            cpu_has_xsaves ? XSTATE_COMPACTION_ENABLED : 0;
     }
 
     v->arch.vgc_flags = VGCF_online;
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 9c29211..331a401 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -272,7 +272,7 @@ int vcpu_init_fpu(struct vcpu *v)
     if ( v->arch.xsave_area )
     {
         v->arch.fpu_ctxt = &v->arch.xsave_area->fpu_sse;
-        if ( cpu_has_xsaves || cpu_has_xsavec )
+        if ( cpu_has_xsaves )
             v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_COMPACTION_ENABLED;
     }
     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 Jan 21 17:02:30 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:02: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 1aMIcw-0005qk-8Z; Thu, 21 Jan 2016 17:02: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 1aMIcu-0005pO-IC
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:28 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	93/9D-08347-32F01A65; Thu, 21 Jan 2016 17:02:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1453395746!18467767!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8158 invoked from network); 21 Jan 2016 17:02:27 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:02:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdV-0008Lz-WE
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIcr-0004uu-W2
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:26 +0000
Date: Thu, 21 Jan 2016 17:02:25 +0000
Message-Id: <E1aMIcr-0004uu-W2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsave: simplify xcomp_bv
	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 83ae0bb2260c71e8dcec538dd477f7253aaef327
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 14 10:42:53 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:42:53 2016 +0100

    x86/xsave: simplify xcomp_bv initialization
    
    This simplifies a number of pointless conditionals: Bits 0 and 1 of
    xcomp_bv don't matter anyway, and as long as none of bits 2..62 are
    set, setting bit 63 is pointless too unless XSAVES is in use.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c  |    5 ++---
 xen/arch/x86/hvm/hvm.c |   10 ++++------
 xen/arch/x86/i387.c    |    2 +-
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 159d960..e70c125 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -922,9 +922,8 @@ int arch_set_info_guest(
         if ( v->arch.xsave_area )
         {
             v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
-            if ( cpu_has_xsaves || cpu_has_xsavec )
-                v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP_SSE |
-                                                         XSTATE_COMPACTION_ENABLED;
+            v->arch.xsave_area->xsave_hdr.xcomp_bv =
+                cpu_has_xsaves ? XSTATE_COMPACTION_ENABLED : 0;
         }
     }
     else if ( v->arch.xsave_area )
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 922754a..a99edc2 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2110,9 +2110,8 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
             struct xsave_struct *xsave_area = v->arch.xsave_area;
 
             xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
-            if ( cpu_has_xsaves || cpu_has_xsavec )
-                xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP_SSE |
-                                                 XSTATE_COMPACTION_ENABLED;
+            xsave_area->xsave_hdr.xcomp_bv =
+                cpu_has_xsaves ? XSTATE_COMPACTION_ENABLED : 0;
         }
     }
 
@@ -5476,9 +5475,8 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip)
     if ( v->arch.xsave_area )
     {
         v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP;
-        if ( cpu_has_xsaves || cpu_has_xsavec )
-            v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP |
-                                                     XSTATE_COMPACTION_ENABLED;
+        v->arch.xsave_area->xsave_hdr.xcomp_bv =
+            cpu_has_xsaves ? XSTATE_COMPACTION_ENABLED : 0;
     }
 
     v->arch.vgc_flags = VGCF_online;
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 9c29211..331a401 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -272,7 +272,7 @@ int vcpu_init_fpu(struct vcpu *v)
     if ( v->arch.xsave_area )
     {
         v->arch.fpu_ctxt = &v->arch.xsave_area->fpu_sse;
-        if ( cpu_has_xsaves || cpu_has_xsavec )
+        if ( cpu_has_xsaves )
             v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_COMPACTION_ENABLED;
     }
     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 Jan 21 17:02:40 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:02: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 1aMId6-00061Y-Ik; Thu, 21 Jan 2016 17:02: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 1aMId4-0005yW-V5
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:39 +0000
Content-Length: 3255
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	63/8A-07651-E2F01A65; Thu, 21 Jan 2016 17:02:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1453395756!17271882!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 63293 invoked from network); 21 Jan 2016 17:02:37 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:02:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdg-0008MC-CW
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMId2-0004vv-9t
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:36 +0000
Date: Thu, 21 Jan 2016 17:02:36 +0000
Message-Id: <E1aMId2-0004vv-9t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "libxc: create an initial FPU
	state for 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="===============0798679534644386055=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0798679534644386055==
Content-Length: 2887
Content-Transfer-Encoding: quoted-printable

commit d23da94b123a0d9326408c376e5735697bd2d96a
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Thu Jan 14 10:43:36 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:43:36 2016 +0100

    Revert "libxc: create an initial FPU state for HVM guests"
    
    This reverts commit d64dbbcc7c9934a46126c59d78536235908377ad:
    
    Xen always set the FPU as initialized when loading a HVM context, so libxc
    has to provide a valid FPU context when setting the CPU registers.
    
    This was a stop-gap measure in order to unblock OSSTest Windows 7 failures
    while a proper fix for the HVM CPU save/restore is being worked on.
    
    This can now be reverted because a proper fix is in place and we can signal
    in the save record whether the FPU is initialized or not.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_x86.c |   38 --------------------------------------
 1 files changed, 0 insertions(+), 38 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index b8d2904..b650762 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -987,27 +987,6 @@ static int vcpu_hvm(struct xc_dom_image *dom)
         struct hvm_save_descriptor end_d;
         HVM_SAVE_TYPE(END) end;
     } bsp_ctx;
-    /*
-     * The layout of the fpu context structure is the same for
-     * both 32 and 64 bits.
-     */
-    struct {
-        uint16_t fcw;
-        uint16_t fsw;
-        uint8_t ftw;
-        uint8_t rsvd1;
-        uint16_t fop;
-        union {
-            uint64_t addr;
-            struct {
-                uint32_t offs;
-                uint16_t sel;
-                uint16_t rsvd;
-            };
-        } fip, fdp;
-        uint32_t mxcsr;
-        uint32_t mxcsr_mask;
-    } *fpu_ctxt;
     uint8_t *full_ctx =3D NULL;
     int rc;
 
@@ -1075,23 +1054,6 @@ static int vcpu_hvm(struct xc_dom_image *dom)
     /* Set the control registers. */
     bsp_ctx.cpu.cr0 =3D X86_CR0_PE | X86_CR0_ET;
 
-    /*
-     * XXX: Set initial FPU state.
-     *
-     * This should be removed once Xen is able to know if the
-     * FPU state saved is valid or not, now Xen always sets
-     * fpu_initialised to true regardless of the FPU state.
-     *
-     * The code below mimics the FPU sate after executing
-     * fninit
-     * ldmxcsr 0x1f80
-     */
-    fpu_ctxt =3D (typeof(fpu_ctxt))bsp_ctx.cpu.fpu_regs;
-
-    fpu_ctxt->fcw =3D 0x37f;
-    fpu_ctxt->ftw =3D 0xff;
-    fpu_ctxt->mxcsr =3D 0x1f80;
-
     /* Set the IP. */
     bsp_ctx.cpu.rip =3D dom->parms.phys_entry;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:02:40 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:02: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 1aMId6-00061Y-Ik; Thu, 21 Jan 2016 17:02: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 1aMId4-0005yW-V5
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:39 +0000
Content-Length: 3255
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	63/8A-07651-E2F01A65; Thu, 21 Jan 2016 17:02:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1453395756!17271882!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 63293 invoked from network); 21 Jan 2016 17:02:37 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:02:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdg-0008MC-CW
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMId2-0004vv-9t
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:36 +0000
Date: Thu, 21 Jan 2016 17:02:36 +0000
Message-Id: <E1aMId2-0004vv-9t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "libxc: create an initial FPU
	state for 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="===============0798679534644386055=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0798679534644386055==
Content-Length: 2887
Content-Transfer-Encoding: quoted-printable

commit d23da94b123a0d9326408c376e5735697bd2d96a
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Thu Jan 14 10:43:36 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:43:36 2016 +0100

    Revert "libxc: create an initial FPU state for HVM guests"
    
    This reverts commit d64dbbcc7c9934a46126c59d78536235908377ad:
    
    Xen always set the FPU as initialized when loading a HVM context, so libxc
    has to provide a valid FPU context when setting the CPU registers.
    
    This was a stop-gap measure in order to unblock OSSTest Windows 7 failures
    while a proper fix for the HVM CPU save/restore is being worked on.
    
    This can now be reverted because a proper fix is in place and we can signal
    in the save record whether the FPU is initialized or not.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_x86.c |   38 --------------------------------------
 1 files changed, 0 insertions(+), 38 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index b8d2904..b650762 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -987,27 +987,6 @@ static int vcpu_hvm(struct xc_dom_image *dom)
         struct hvm_save_descriptor end_d;
         HVM_SAVE_TYPE(END) end;
     } bsp_ctx;
-    /*
-     * The layout of the fpu context structure is the same for
-     * both 32 and 64 bits.
-     */
-    struct {
-        uint16_t fcw;
-        uint16_t fsw;
-        uint8_t ftw;
-        uint8_t rsvd1;
-        uint16_t fop;
-        union {
-            uint64_t addr;
-            struct {
-                uint32_t offs;
-                uint16_t sel;
-                uint16_t rsvd;
-            };
-        } fip, fdp;
-        uint32_t mxcsr;
-        uint32_t mxcsr_mask;
-    } *fpu_ctxt;
     uint8_t *full_ctx =3D NULL;
     int rc;
 
@@ -1075,23 +1054,6 @@ static int vcpu_hvm(struct xc_dom_image *dom)
     /* Set the control registers. */
     bsp_ctx.cpu.cr0 =3D X86_CR0_PE | X86_CR0_ET;
 
-    /*
-     * XXX: Set initial FPU state.
-     *
-     * This should be removed once Xen is able to know if the
-     * FPU state saved is valid or not, now Xen always sets
-     * fpu_initialised to true regardless of the FPU state.
-     *
-     * The code below mimics the FPU sate after executing
-     * fninit
-     * ldmxcsr 0x1f80
-     */
-    fpu_ctxt =3D (typeof(fpu_ctxt))bsp_ctx.cpu.fpu_regs;
-
-    fpu_ctxt->fcw =3D 0x37f;
-    fpu_ctxt->ftw =3D 0xff;
-    fpu_ctxt->mxcsr =3D 0x1f80;
-
     /* Set the IP. */
     bsp_ctx.cpu.rip =3D dom->parms.phys_entry;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:02:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:02: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 1aMIdF-0006BI-OM; Thu, 21 Jan 2016 17:02: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 1aMIdE-00069r-Jk
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:48 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	22/4F-08977-83F01A65; Thu, 21 Jan 2016 17:02:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1453395766!11392550!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1082 invoked from network); 21 Jan 2016 17:02:47 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:02:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdq-0008MO-K1
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdC-0004wW-Kj
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:46 +0000
Date: Thu, 21 Jan 2016 17:02:46 +0000
Message-Id: <E1aMIdC-0004wW-Kj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: remove .config when making
	distclean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5e00bbc2629114148e61282beb15e510e339b7ba
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 14 10:44:04 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:44:04 2016 +0100

    build: remove .config when making distclean
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index d30d251..3699b20 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -109,7 +109,7 @@ _clean: delete-unfresh-files
 
 .PHONY: _distclean
 _distclean: clean
-	rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out GTAGS GPATH GRTAGS GSYMS
+	rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out GTAGS GPATH GRTAGS GSYMS .config
 
 $(TARGET).gz: $(TARGET)
 	gzip -f -9 < $< > $@.new
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:02:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:02: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 1aMIdF-0006BI-OM; Thu, 21 Jan 2016 17:02: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 1aMIdE-00069r-Jk
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:48 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	22/4F-08977-83F01A65; Thu, 21 Jan 2016 17:02:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1453395766!11392550!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1082 invoked from network); 21 Jan 2016 17:02:47 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:02:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdq-0008MO-K1
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdC-0004wW-Kj
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:46 +0000
Date: Thu, 21 Jan 2016 17:02:46 +0000
Message-Id: <E1aMIdC-0004wW-Kj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: remove .config when making
	distclean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5e00bbc2629114148e61282beb15e510e339b7ba
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 14 10:44:04 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:44:04 2016 +0100

    build: remove .config when making distclean
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index d30d251..3699b20 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -109,7 +109,7 @@ _clean: delete-unfresh-files
 
 .PHONY: _distclean
 _distclean: clean
-	rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out GTAGS GPATH GRTAGS GSYMS
+	rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out GTAGS GPATH GRTAGS GSYMS .config
 
 $(TARGET).gz: $(TARGET)
 	gzip -f -9 < $< > $@.new
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:03:00 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:03: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 1aMIdQ-0006Kj-Ts; Thu, 21 Jan 2016 17:03: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 1aMIdP-0006JP-BB
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:59 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	EE/81-08479-24F01A65; Thu, 21 Jan 2016 17:02:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1453395777!17036237!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 63577 invoked from network); 21 Jan 2016 17:02:57 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:02:57 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIe0-0008MW-Sg
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdM-0004x1-TY
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:56 +0000
Date: Thu, 21 Jan 2016 17:02:56 +0000
Message-Id: <E1aMIdM-0004x1-TY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vm_event: add altp2m info to HVM
	events as well
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7167222b15dc661ff0b44cc93d558f6bb4ff6492
Author:     Tamas K Lengyel <tamas@tklengyel.com>
AuthorDate: Thu Jan 14 10:49:50 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:49:50 2016 +0100

    vm_event: add altp2m info to HVM events as well
    
    Add altp2m information to HVM events as well when altp2m is active.
    
    Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
    Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/event.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/event.c b/xen/arch/x86/hvm/event.c
index 73c8f14..a3d4892 100644
--- a/xen/arch/x86/hvm/event.c
+++ b/xen/arch/x86/hvm/event.c
@@ -22,6 +22,7 @@
 #include <xen/paging.h>
 #include <asm/hvm/event.h>
 #include <asm/monitor.h>
+#include <asm/altp2m.h>
 #include <public/vm_event.h>
 
 static void hvm_event_fill_regs(vm_event_request_t *req)
@@ -83,6 +84,12 @@ static int hvm_event_traps(uint8_t sync, vm_event_request_t *req)
         vm_event_vcpu_pause(curr);
     }
 
+    if ( altp2m_active(currd) )
+    {
+        req->flags |= VM_EVENT_FLAG_ALTERNATE_P2M;
+        req->altp2m_idx = vcpu_altp2m(curr).p2midx;
+    }
+
     hvm_event_fill_regs(req);
     vm_event_put_request(currd, &currd->vm_event->monitor, req);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:03:00 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:03: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 1aMIdQ-0006Kj-Ts; Thu, 21 Jan 2016 17:03: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 1aMIdP-0006JP-BB
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:59 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	EE/81-08479-24F01A65; Thu, 21 Jan 2016 17:02:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1453395777!17036237!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 63577 invoked from network); 21 Jan 2016 17:02:57 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:02:57 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIe0-0008MW-Sg
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdM-0004x1-TY
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:02:56 +0000
Date: Thu, 21 Jan 2016 17:02:56 +0000
Message-Id: <E1aMIdM-0004x1-TY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vm_event: add altp2m info to HVM
	events as well
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7167222b15dc661ff0b44cc93d558f6bb4ff6492
Author:     Tamas K Lengyel <tamas@tklengyel.com>
AuthorDate: Thu Jan 14 10:49:50 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 14 10:49:50 2016 +0100

    vm_event: add altp2m info to HVM events as well
    
    Add altp2m information to HVM events as well when altp2m is active.
    
    Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
    Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/event.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/event.c b/xen/arch/x86/hvm/event.c
index 73c8f14..a3d4892 100644
--- a/xen/arch/x86/hvm/event.c
+++ b/xen/arch/x86/hvm/event.c
@@ -22,6 +22,7 @@
 #include <xen/paging.h>
 #include <asm/hvm/event.h>
 #include <asm/monitor.h>
+#include <asm/altp2m.h>
 #include <public/vm_event.h>
 
 static void hvm_event_fill_regs(vm_event_request_t *req)
@@ -83,6 +84,12 @@ static int hvm_event_traps(uint8_t sync, vm_event_request_t *req)
         vm_event_vcpu_pause(curr);
     }
 
+    if ( altp2m_active(currd) )
+    {
+        req->flags |= VM_EVENT_FLAG_ALTERNATE_P2M;
+        req->altp2m_idx = vcpu_altp2m(curr).p2midx;
+    }
+
     hvm_event_fill_regs(req);
     vm_event_put_request(currd, &currd->vm_event->monitor, req);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:03:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:03: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 1aMIda-0006Rn-VS; Thu, 21 Jan 2016 17:03: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 1aMIdZ-0006Qc-JE
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:09 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	9E/11-13487-C4F01A65; Thu, 21 Jan 2016 17:03:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1453395787!17098091!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52032 invoked from network); 21 Jan 2016 17:03:08 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:03:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeB-0008Mj-5O
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdX-0004xa-5O
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:07 +0000
Date: Thu, 21 Jan 2016 17:03:07 +0000
Message-Id: <E1aMIdX-0004xa-5O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: fix python install with
	"xentoollog"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7d3c16b4e966c3591d822e1ceb4431b63a723660
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Jan 12 22:16:11 2016 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 10:10:24 2016 +0000

    tools: fix python install with "xentoollog"
    
    commit 5d3dc8671521ea4a4f753e77d3e7fb3a3a6f5f80
    "tools: Refactor "xentoollog" into its own library"
    with older python versions (2.6.4) will fail to
    the build if attempted to be done twice (which
    happens due to pygrub dependencies).
    
    make -C python DESTDIR=/tmp
    make -C python DESTDIR=/tmp
    
    The second one will fail with:
    error: -Wl, -rpath-link=../../tools/libs/toollog: No such file or directory
    
    even though the directory is there (with the libs).
    
    Andrew pointed out that the linker additions should be in
    the "extra_link_args" rather than "depends".
    
    And true enough - with that modification it builds.
    
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Ian Jackson <ian.jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Suggested-by: Andrew Cooper <andrew.cooper3@citirx.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- typo in commit message ]
---
 tools/python/setup.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/python/setup.py b/tools/python/setup.py
index 9771cc4..604b314 100644
--- a/tools/python/setup.py
+++ b/tools/python/setup.py
@@ -17,7 +17,8 @@ xc = Extension("xc",
                include_dirs       = [ PATH_XEN, PATH_LIBXENTOOLLOG + "/include", PATH_LIBXC + "/include", "xen/lowlevel/xc" ],
                library_dirs       = [ PATH_LIBXC ],
                libraries          = [ "xenctrl", "xenguest" ],
-               depends            = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so",  "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ],
+               depends            = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so" ],
+               extra_link_args    = [ "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ],
                sources            = [ "xen/lowlevel/xc/xc.c" ])
 
 xs = Extension("xs",
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:03:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:03: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 1aMIda-0006Rn-VS; Thu, 21 Jan 2016 17:03: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 1aMIdZ-0006Qc-JE
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:09 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	9E/11-13487-C4F01A65; Thu, 21 Jan 2016 17:03:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1453395787!17098091!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52032 invoked from network); 21 Jan 2016 17:03:08 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:03:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeB-0008Mj-5O
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdX-0004xa-5O
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:07 +0000
Date: Thu, 21 Jan 2016 17:03:07 +0000
Message-Id: <E1aMIdX-0004xa-5O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: fix python install with
	"xentoollog"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7d3c16b4e966c3591d822e1ceb4431b63a723660
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Jan 12 22:16:11 2016 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 10:10:24 2016 +0000

    tools: fix python install with "xentoollog"
    
    commit 5d3dc8671521ea4a4f753e77d3e7fb3a3a6f5f80
    "tools: Refactor "xentoollog" into its own library"
    with older python versions (2.6.4) will fail to
    the build if attempted to be done twice (which
    happens due to pygrub dependencies).
    
    make -C python DESTDIR=/tmp
    make -C python DESTDIR=/tmp
    
    The second one will fail with:
    error: -Wl, -rpath-link=../../tools/libs/toollog: No such file or directory
    
    even though the directory is there (with the libs).
    
    Andrew pointed out that the linker additions should be in
    the "extra_link_args" rather than "depends".
    
    And true enough - with that modification it builds.
    
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Ian Jackson <ian.jackson@eu.citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Suggested-by: Andrew Cooper <andrew.cooper3@citirx.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- typo in commit message ]
---
 tools/python/setup.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/python/setup.py b/tools/python/setup.py
index 9771cc4..604b314 100644
--- a/tools/python/setup.py
+++ b/tools/python/setup.py
@@ -17,7 +17,8 @@ xc = Extension("xc",
                include_dirs       = [ PATH_XEN, PATH_LIBXENTOOLLOG + "/include", PATH_LIBXC + "/include", "xen/lowlevel/xc" ],
                library_dirs       = [ PATH_LIBXC ],
                libraries          = [ "xenctrl", "xenguest" ],
-               depends            = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so",  "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ],
+               depends            = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so" ],
+               extra_link_args    = [ "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ],
                sources            = [ "xen/lowlevel/xc/xc.c" ])
 
 xs = Extension("xs",
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:03:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:03: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 1aMIdk-0006Z1-NB; Thu, 21 Jan 2016 17:03: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 1aMIdj-0006Y6-Nx
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:19 +0000
Content-Length: 1863
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	CC/D6-28228-75F01A65; Thu, 21 Jan 2016 17:03:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1453395797!17577222!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7423 invoked from network); 21 Jan 2016 17:03:18 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:03:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeL-0008NZ-ED
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdh-0004y4-EF
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:17 +0000
Date: Thu, 21 Jan 2016 17:03:17 +0000
Message-Id: <E1aMIdh-0004y4-EF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix _SC_GETPW_R_SIZE_MAX usage
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4905728831597200416=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4905728831597200416==
Content-Length: 1449
Content-Transfer-Encoding: quoted-printable

commit 2155a0ec7d693a05553e515ce1a1d3783fdc8e53
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Jan 14 16:06:50 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 10:32:24 2016 +0000

    libxl: fix _SC_GETPW_R_SIZE_MAX usage
    
    If sysconf(_SC_GETPW_R_SIZE_MAX) fails for any reason just use an initial
    buffer size of 2048. This is not a critical failure, and the code that
    makes use of this buffer is able to expand it later if required.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dm.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 0aaefd9..a088d71 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -730,9 +730,10 @@ static int libxl__dm_runas_helper(libxl__gc *gc, const char *username)
 
     buf_size =3D sysconf(_SC_GETPW_R_SIZE_MAX);
     if (buf_size < 0) {
-        LOGE(ERROR, "sysconf(_SC_GETPW_R_SIZE_MAX) returned error %ld",
-                buf_size);
-        return ERROR_FAIL;
+        buf_size =3D 2048;
+        LOG(DEBUG,
+"sysconf(_SC_GETPW_R_SIZE_MAX) failed, setting the initial buffer size to %ld",
+            buf_size);
     }
 
     while (1) {
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:03:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:03: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 1aMIdk-0006Z1-NB; Thu, 21 Jan 2016 17:03: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 1aMIdj-0006Y6-Nx
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:19 +0000
Content-Length: 1863
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	CC/D6-28228-75F01A65; Thu, 21 Jan 2016 17:03:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1453395797!17577222!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7423 invoked from network); 21 Jan 2016 17:03:18 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:03:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeL-0008NZ-ED
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdh-0004y4-EF
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:17 +0000
Date: Thu, 21 Jan 2016 17:03:17 +0000
Message-Id: <E1aMIdh-0004y4-EF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix _SC_GETPW_R_SIZE_MAX usage
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4905728831597200416=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4905728831597200416==
Content-Length: 1449
Content-Transfer-Encoding: quoted-printable

commit 2155a0ec7d693a05553e515ce1a1d3783fdc8e53
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Jan 14 16:06:50 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 10:32:24 2016 +0000

    libxl: fix _SC_GETPW_R_SIZE_MAX usage
    
    If sysconf(_SC_GETPW_R_SIZE_MAX) fails for any reason just use an initial
    buffer size of 2048. This is not a critical failure, and the code that
    makes use of this buffer is able to expand it later if required.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dm.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 0aaefd9..a088d71 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -730,9 +730,10 @@ static int libxl__dm_runas_helper(libxl__gc *gc, const char *username)
 
     buf_size =3D sysconf(_SC_GETPW_R_SIZE_MAX);
     if (buf_size < 0) {
-        LOGE(ERROR, "sysconf(_SC_GETPW_R_SIZE_MAX) returned error %ld",
-                buf_size);
-        return ERROR_FAIL;
+        buf_size =3D 2048;
+        LOG(DEBUG,
+"sysconf(_SC_GETPW_R_SIZE_MAX) failed, setting the initial buffer size to %ld",
+            buf_size);
     }
 
     while (1) {
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:03:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:03: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 1aMIdv-0006hb-Rv; Thu, 21 Jan 2016 17:03: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 1aMIdu-0006gF-55
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:30 +0000
Content-Length: 1607
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	1E/CD-13475-16F01A65; Thu, 21 Jan 2016 17:03:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1453395808!17577267!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9211 invoked from network); 21 Jan 2016 17:03:28 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:03:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeV-0008OE-MM
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdr-0004yT-Mc
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:27 +0000
Date: Thu, 21 Jan 2016 17:03:27 +0000
Message-Id: <E1aMIdr-0004yT-Mc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] SEABIOS_UPSTREAM_REVISION 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: multipart/mixed; boundary="===============2224243117689990866=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2224243117689990866==
Content-Length: 1190
Content-Transfer-Encoding: quoted-printable

commit 2f3b2f4aa242759826bbc61513ea06b2d124c9a7
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 10:34:21 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 10:35:06 2016 +0000

    SEABIOS_UPSTREAM_REVISION Update
    
    Track the upstream 1.9-stable branch.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 62f8209..d654af8 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_REVISION =3F=3D d25773c8afa2f4dbbb466116daeb60159ddd22bd
 # Thu Dec 3 11:23:25 2015 +0000
 # mini-os: Include libxentoollog with libxc
 
-SEABIOS_UPSTREAM_REVISION =3F=3D rel-1.9.0
-# Tue Nov 17 09:18:44 2015 -0500
-# docs: Note v1.9.0 release
+SEABIOS_UPSTREAM_REVISION =3F=3D 3403ac4313812752be6e6aac35239ca6888a8cab
+# Mon Dec 28 13:50:41 2015 +0100
+# build: fix typo in buildversion.py
 
 ETHERBOOT_NICS =3F=3D rtl8139 8086100e
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:03:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:03: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 1aMIdv-0006hb-Rv; Thu, 21 Jan 2016 17:03: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 1aMIdu-0006gF-55
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:30 +0000
Content-Length: 1607
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	1E/CD-13475-16F01A65; Thu, 21 Jan 2016 17:03:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1453395808!17577267!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9211 invoked from network); 21 Jan 2016 17:03:28 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:03:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeV-0008OE-MM
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIdr-0004yT-Mc
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:27 +0000
Date: Thu, 21 Jan 2016 17:03:27 +0000
Message-Id: <E1aMIdr-0004yT-Mc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] SEABIOS_UPSTREAM_REVISION 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: multipart/mixed; boundary="===============2224243117689990866=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2224243117689990866==
Content-Length: 1190
Content-Transfer-Encoding: quoted-printable

commit 2f3b2f4aa242759826bbc61513ea06b2d124c9a7
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 10:34:21 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 10:35:06 2016 +0000

    SEABIOS_UPSTREAM_REVISION Update
    
    Track the upstream 1.9-stable branch.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 62f8209..d654af8 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_REVISION =3F=3D d25773c8afa2f4dbbb466116daeb60159ddd22bd
 # Thu Dec 3 11:23:25 2015 +0000
 # mini-os: Include libxentoollog with libxc
 
-SEABIOS_UPSTREAM_REVISION =3F=3D rel-1.9.0
-# Tue Nov 17 09:18:44 2015 -0500
-# docs: Note v1.9.0 release
+SEABIOS_UPSTREAM_REVISION =3F=3D 3403ac4313812752be6e6aac35239ca6888a8cab
+# Mon Dec 28 13:50:41 2015 +0100
+# build: fix typo in buildversion.py
 
 ETHERBOOT_NICS =3F=3D rtl8139 8086100e
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:03:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:03: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 1aMIe6-0006nI-2A; Thu, 21 Jan 2016 17:03: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 1aMIe4-0006m2-DG
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:40 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	48/9A-07165-B6F01A65; Thu, 21 Jan 2016 17:03:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1453395818!18531088!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 65212 invoked from network); 21 Jan 2016 17:03:39 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:03:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIef-0008OT-W0
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIe1-0004zb-Uz
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:38 +0000
Date: Thu, 21 Jan 2016 17:03:37 +0000
Message-Id: <E1aMIe1-0004zb-Uz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] gitignore: update stubdom entries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c3564743e942ee322ebbee9fa28e22093256bbe
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jan 14 16:17:57 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 11:00:41 2016 +0000

    gitignore: update stubdom entries
    
    Add stubdom/libs-* to gitignore, then sort stubdom/* entries
    alphabetically.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/.gitignore b/.gitignore
index e0df903..02b2100 100644
--- a/.gitignore
+++ b/.gitignore
@@ -50,32 +50,33 @@ extras/mini-os*
 install/*
 stubdom/autom4te.cache/
 stubdom/binutils-*
+stubdom/config.cache
 stubdom/config.log
 stubdom/config.status
-stubdom/config.cache
 stubdom/cross-root-*
 stubdom/gcc-*
+stubdom/gmp-*
+stubdom/grub-*
 stubdom/include
 stubdom/ioemu
-stubdom/xenstore
-stubdom/libxentoollog-*
+stubdom/ioemu/
+stubdom/libs-*
 stubdom/libxc-*
+stubdom/libxentoollog-*
 stubdom/lwip-*
+stubdom/lwip/
 stubdom/mini-os-*
 stubdom/mk-headers-*
 stubdom/newlib-1.*
 stubdom/newlib-x86*
-stubdom/pciutils-*
-stubdom/zlib-*
-stubdom/grub-*
 stubdom/ocaml-*
+stubdom/pciutils-*
 stubdom/polarssl-*
-stubdom/gmp-*
-stubdom/tpm_emulator-*
-stubdom/lwip/
-stubdom/ioemu/
 stubdom/stubdompath.sh
+stubdom/tpm_emulator-*
 stubdom/vtpm/vtpm_manager.h
+stubdom/xenstore
+stubdom/zlib-*
 tools/*/build/lib*/*.py
 tools/autom4te.cache/
 tools/config.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 Jan 21 17:03:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:03: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 1aMIe6-0006nI-2A; Thu, 21 Jan 2016 17:03: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 1aMIe4-0006m2-DG
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:40 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	48/9A-07165-B6F01A65; Thu, 21 Jan 2016 17:03:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1453395818!18531088!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 65212 invoked from network); 21 Jan 2016 17:03:39 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:03:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIef-0008OT-W0
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIe1-0004zb-Uz
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:38 +0000
Date: Thu, 21 Jan 2016 17:03:37 +0000
Message-Id: <E1aMIe1-0004zb-Uz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] gitignore: update stubdom entries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c3564743e942ee322ebbee9fa28e22093256bbe
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Jan 14 16:17:57 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 11:00:41 2016 +0000

    gitignore: update stubdom entries
    
    Add stubdom/libs-* to gitignore, then sort stubdom/* entries
    alphabetically.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/.gitignore b/.gitignore
index e0df903..02b2100 100644
--- a/.gitignore
+++ b/.gitignore
@@ -50,32 +50,33 @@ extras/mini-os*
 install/*
 stubdom/autom4te.cache/
 stubdom/binutils-*
+stubdom/config.cache
 stubdom/config.log
 stubdom/config.status
-stubdom/config.cache
 stubdom/cross-root-*
 stubdom/gcc-*
+stubdom/gmp-*
+stubdom/grub-*
 stubdom/include
 stubdom/ioemu
-stubdom/xenstore
-stubdom/libxentoollog-*
+stubdom/ioemu/
+stubdom/libs-*
 stubdom/libxc-*
+stubdom/libxentoollog-*
 stubdom/lwip-*
+stubdom/lwip/
 stubdom/mini-os-*
 stubdom/mk-headers-*
 stubdom/newlib-1.*
 stubdom/newlib-x86*
-stubdom/pciutils-*
-stubdom/zlib-*
-stubdom/grub-*
 stubdom/ocaml-*
+stubdom/pciutils-*
 stubdom/polarssl-*
-stubdom/gmp-*
-stubdom/tpm_emulator-*
-stubdom/lwip/
-stubdom/ioemu/
 stubdom/stubdompath.sh
+stubdom/tpm_emulator-*
 stubdom/vtpm/vtpm_manager.h
+stubdom/xenstore
+stubdom/zlib-*
 tools/*/build/lib*/*.py
 tools/autom4te.cache/
 tools/config.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 Jan 21 17:03:52 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:03: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 1aMIeG-0006ua-7W; Thu, 21 Jan 2016 17:03:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeE-0006tJ-JH
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:50 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	36/6D-07651-57F01A65; Thu, 21 Jan 2016 17:03:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1453395828!1506925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51657 invoked from network); 21 Jan 2016 17:03:49 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:03:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeq-0008Ob-7d
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeC-000501-8r
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:48 +0000
Date: Thu, 21 Jan 2016 17:03:48 +0000
Message-Id: <E1aMIeC-000501-8r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: remove the xl list limit of
	1024 domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ff1301576ecc573c738ffe065ac779c349a36244
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 4 15:55:51 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 15:35:26 2016 +0000

    libxl: remove the xl list limit of 1024 domains
    
    xl list is currently limited to 1024 domains. Remove the limit.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 9207621..86b08d9 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -649,31 +649,30 @@ static void xcinfo2xlinfo(libxl_ctx *ctx,
 
 libxl_dominfo * libxl_list_domain(libxl_ctx *ctx, int *nb_domain_out)
 {
-    libxl_dominfo *ptr;
+    libxl_dominfo *ptr = NULL;
     int i, ret;
     xc_domaininfo_t info[1024];
-    int size = 1024;
+    int size = 0;
+    uint32_t domid = 0;
     GC_INIT(ctx);
 
-    ptr = calloc(size, sizeof(libxl_dominfo));
-    if (!ptr) {
-        LOGE(ERROR, "allocating domain info");
-        GC_FREE;
-        return NULL;
+    while ((ret = xc_domain_getinfolist(ctx->xch, domid, 1024, info)) > 0) {
+        ptr = libxl__realloc(NOGC, ptr, (size + ret) * sizeof(libxl_dominfo));
+        for (i = 0; i < ret; i++) {
+            xcinfo2xlinfo(ctx, &info[i], &ptr[size + i]);
+        }
+        domid = info[ret - 1].domain + 1;
+        size += ret;
     }
 
-    ret = xc_domain_getinfolist(ctx->xch, 0, 1024, info);
-    if (ret<0) {
+    if (ret < 0) {
         LOGE(ERROR, "getting domain info list");
         free(ptr);
         GC_FREE;
         return NULL;
     }
 
-    for (i = 0; i < ret; i++) {
-        xcinfo2xlinfo(ctx, &info[i], &ptr[i]);
-    }
-    *nb_domain_out = ret;
+    *nb_domain_out = size;
     GC_FREE;
     return ptr;
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:03:52 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:03: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 1aMIeG-0006ua-7W; Thu, 21 Jan 2016 17:03:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeE-0006tJ-JH
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:50 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	36/6D-07651-57F01A65; Thu, 21 Jan 2016 17:03:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1453395828!1506925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51657 invoked from network); 21 Jan 2016 17:03:49 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:03:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeq-0008Ob-7d
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeC-000501-8r
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:48 +0000
Date: Thu, 21 Jan 2016 17:03:48 +0000
Message-Id: <E1aMIeC-000501-8r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: remove the xl list limit of
	1024 domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ff1301576ecc573c738ffe065ac779c349a36244
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 4 15:55:51 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 15:35:26 2016 +0000

    libxl: remove the xl list limit of 1024 domains
    
    xl list is currently limited to 1024 domains. Remove the limit.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 9207621..86b08d9 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -649,31 +649,30 @@ static void xcinfo2xlinfo(libxl_ctx *ctx,
 
 libxl_dominfo * libxl_list_domain(libxl_ctx *ctx, int *nb_domain_out)
 {
-    libxl_dominfo *ptr;
+    libxl_dominfo *ptr = NULL;
     int i, ret;
     xc_domaininfo_t info[1024];
-    int size = 1024;
+    int size = 0;
+    uint32_t domid = 0;
     GC_INIT(ctx);
 
-    ptr = calloc(size, sizeof(libxl_dominfo));
-    if (!ptr) {
-        LOGE(ERROR, "allocating domain info");
-        GC_FREE;
-        return NULL;
+    while ((ret = xc_domain_getinfolist(ctx->xch, domid, 1024, info)) > 0) {
+        ptr = libxl__realloc(NOGC, ptr, (size + ret) * sizeof(libxl_dominfo));
+        for (i = 0; i < ret; i++) {
+            xcinfo2xlinfo(ctx, &info[i], &ptr[size + i]);
+        }
+        domid = info[ret - 1].domain + 1;
+        size += ret;
     }
 
-    ret = xc_domain_getinfolist(ctx->xch, 0, 1024, info);
-    if (ret<0) {
+    if (ret < 0) {
         LOGE(ERROR, "getting domain info list");
         free(ptr);
         GC_FREE;
         return NULL;
     }
 
-    for (i = 0; i < ret; i++) {
-        xcinfo2xlinfo(ctx, &info[i], &ptr[i]);
-    }
-    *nb_domain_out = ret;
+    *nb_domain_out = size;
     GC_FREE;
     return ptr;
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:04:01 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:04: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 1aMIeP-00070u-C3; Thu, 21 Jan 2016 17:04:01 +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 1aMIeO-00070H-O3
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:00 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	BA/D0-08977-08F01A65; Thu, 21 Jan 2016 17:04:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1453395838!11390302!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6069 invoked from network); 21 Jan 2016 17:03:59 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:03:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIf0-0008Ok-KI
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeM-00050O-Hr
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:58 +0000
Date: Thu, 21 Jan 2016 17:03:58 +0000
Message-Id: <E1aMIeM-00050O-Hr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: base libxl_list_vm() on
	libxl_list_domain()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b4637669c4758d1e8c65eb5bec711ff2cf183641
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 4 15:55:52 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 15:35:26 2016 +0000

    libxl: base libxl_list_vm() on libxl_list_domain()
    
    libxl_list_vm() is calling xc_domain_getinfolist() today with a limit
    of 1024 domains. To avoid open coding a loop around
    xc_domain_getinfolist() to avoid the 1024 domain limit just use
    libxl_list_domain() instead.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 86b08d9..abb2845 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -799,32 +799,31 @@ out:
 libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out)
 {
     GC_INIT(ctx);
+    libxl_dominfo *info;
     libxl_vminfo *ptr = NULL;
-    int idx, i, ret;
-    xc_domaininfo_t info[1024];
+    int idx, i, n_doms;
 
-    ret = xc_domain_getinfolist(ctx->xch, 1, ARRAY_SIZE(info), info);
-    if (ret < 0) {
-        LOGE(ERROR, "getting domain info list");
+    info = libxl_list_domain(ctx, &n_doms);
+    if (!info)
         goto out;
-    }
 
     /*
      * Always make sure to allocate at least one element; if we don't and we
      * request zero, libxl__calloc (might) think its internal call to calloc
      * has failed (if it returns null), if so it would kill our process.
      */
-    ptr = libxl__calloc(NOGC, ret ? ret : 1, sizeof(libxl_vminfo));
+    ptr = libxl__calloc(NOGC, n_doms ? n_doms : 1, sizeof(libxl_vminfo));
 
-    for (idx = i = 0; i < ret; i++) {
-        if (libxl_is_stubdom(ctx, info[i].domain, NULL))
+    for (idx = i = 0; i < n_doms; i++) {
+        if (libxl_is_stubdom(ctx, info[i].domid, NULL))
             continue;
-        memcpy(&(ptr[idx].uuid), info[i].handle, sizeof(xen_domain_handle_t));
-        ptr[idx].domid = info[i].domain;
+        ptr[idx].uuid = info[i].uuid;
+        ptr[idx].domid = info[i].domid;
 
         idx++;
     }
     *nb_vm_out = idx;
+    libxl_dominfo_list_free(info, n_doms);
 
 out:
     GC_FREE;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:04:01 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:04: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 1aMIeP-00070u-C3; Thu, 21 Jan 2016 17:04:01 +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 1aMIeO-00070H-O3
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:00 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	BA/D0-08977-08F01A65; Thu, 21 Jan 2016 17:04:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1453395838!11390302!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6069 invoked from network); 21 Jan 2016 17:03:59 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:03:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIf0-0008Ok-KI
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeM-00050O-Hr
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:03:58 +0000
Date: Thu, 21 Jan 2016 17:03:58 +0000
Message-Id: <E1aMIeM-00050O-Hr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: base libxl_list_vm() on
	libxl_list_domain()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b4637669c4758d1e8c65eb5bec711ff2cf183641
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 4 15:55:52 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 15:35:26 2016 +0000

    libxl: base libxl_list_vm() on libxl_list_domain()
    
    libxl_list_vm() is calling xc_domain_getinfolist() today with a limit
    of 1024 domains. To avoid open coding a loop around
    xc_domain_getinfolist() to avoid the 1024 domain limit just use
    libxl_list_domain() instead.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 86b08d9..abb2845 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -799,32 +799,31 @@ out:
 libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out)
 {
     GC_INIT(ctx);
+    libxl_dominfo *info;
     libxl_vminfo *ptr = NULL;
-    int idx, i, ret;
-    xc_domaininfo_t info[1024];
+    int idx, i, n_doms;
 
-    ret = xc_domain_getinfolist(ctx->xch, 1, ARRAY_SIZE(info), info);
-    if (ret < 0) {
-        LOGE(ERROR, "getting domain info list");
+    info = libxl_list_domain(ctx, &n_doms);
+    if (!info)
         goto out;
-    }
 
     /*
      * Always make sure to allocate at least one element; if we don't and we
      * request zero, libxl__calloc (might) think its internal call to calloc
      * has failed (if it returns null), if so it would kill our process.
      */
-    ptr = libxl__calloc(NOGC, ret ? ret : 1, sizeof(libxl_vminfo));
+    ptr = libxl__calloc(NOGC, n_doms ? n_doms : 1, sizeof(libxl_vminfo));
 
-    for (idx = i = 0; i < ret; i++) {
-        if (libxl_is_stubdom(ctx, info[i].domain, NULL))
+    for (idx = i = 0; i < n_doms; i++) {
+        if (libxl_is_stubdom(ctx, info[i].domid, NULL))
             continue;
-        memcpy(&(ptr[idx].uuid), info[i].handle, sizeof(xen_domain_handle_t));
-        ptr[idx].domid = info[i].domain;
+        ptr[idx].uuid = info[i].uuid;
+        ptr[idx].domid = info[i].domid;
 
         idx++;
     }
     *nb_vm_out = idx;
+    libxl_dominfo_list_free(info, n_doms);
 
 out:
     GC_FREE;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:04:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:04: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 1aMIeZ-00077B-Ft; Thu, 21 Jan 2016 17:04: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 1aMIeZ-00076g-1z
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:11 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	FA/0F-31122-A8F01A65; Thu, 21 Jan 2016 17:04:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1453395849!11379004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26061 invoked from network); 21 Jan 2016 17:04:09 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:04:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfA-0008Os-Ue
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeW-000512-UT
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:08 +0000
Date: Thu, 21 Jan 2016 17:04:08 +0000
Message-Id: <E1aMIeW-000512-UT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add r1p12 to the list of
	supported Cadence UARTs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 67f7afd26f7a61c31f6b3c3112828a3996434e17
Author:     Edgar E. Iglesias <edgar.iglesias@xilinx.com>
AuthorDate: Thu Jan 14 19:44:07 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 15:36:22 2016 +0000

    xen/arm: Add r1p12 to the list of supported Cadence UARTs
    
    Add r1p12 to the list of supported Cadence UARTs. Xen only
    uses the subset of features available in r1p8, so we don't
    need to differentiate between r1p8 and r1p12 yet.
    
    Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/cadence-uart.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/char/cadence-uart.c b/xen/drivers/char/cadence-uart.c
index 933672f..7f90f8d 100644
--- a/xen/drivers/char/cadence-uart.c
+++ b/xen/drivers/char/cadence-uart.c
@@ -206,6 +206,7 @@ static int __init cuart_init(struct dt_device_node *dev, const void *data)
 static const struct dt_device_match cuart_dt_match[] __initconst =
 {
     DT_MATCH_COMPATIBLE("cdns,uart-r1p8"),
+    DT_MATCH_COMPATIBLE("cdns,uart-r1p12"),
     { /* sentinel */ },
 };
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:04:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:04: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 1aMIeZ-00077B-Ft; Thu, 21 Jan 2016 17:04: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 1aMIeZ-00076g-1z
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:11 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	FA/0F-31122-A8F01A65; Thu, 21 Jan 2016 17:04:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1453395849!11379004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26061 invoked from network); 21 Jan 2016 17:04:09 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:04:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfA-0008Os-Ue
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeW-000512-UT
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:08 +0000
Date: Thu, 21 Jan 2016 17:04:08 +0000
Message-Id: <E1aMIeW-000512-UT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add r1p12 to the list of
	supported Cadence UARTs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 67f7afd26f7a61c31f6b3c3112828a3996434e17
Author:     Edgar E. Iglesias <edgar.iglesias@xilinx.com>
AuthorDate: Thu Jan 14 19:44:07 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 15:36:22 2016 +0000

    xen/arm: Add r1p12 to the list of supported Cadence UARTs
    
    Add r1p12 to the list of supported Cadence UARTs. Xen only
    uses the subset of features available in r1p8, so we don't
    need to differentiate between r1p8 and r1p12 yet.
    
    Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/cadence-uart.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/char/cadence-uart.c b/xen/drivers/char/cadence-uart.c
index 933672f..7f90f8d 100644
--- a/xen/drivers/char/cadence-uart.c
+++ b/xen/drivers/char/cadence-uart.c
@@ -206,6 +206,7 @@ static int __init cuart_init(struct dt_device_node *dev, const void *data)
 static const struct dt_device_match cuart_dt_match[] __initconst =
 {
     DT_MATCH_COMPATIBLE("cdns,uart-r1p8"),
+    DT_MATCH_COMPATIBLE("cdns,uart-r1p12"),
     { /* sentinel */ },
 };
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:04:22 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:04: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 1aMIek-0007Ea-Kg; Thu, 21 Jan 2016 17:04:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIej-0007Dt-G4
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:21 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	23/48-22089-49F01A65; Thu, 21 Jan 2016 17:04:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453395859!17104207!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48277 invoked from network); 21 Jan 2016 17:04:20 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:04:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfL-0008Pk-7Q
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeh-00051n-6y
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:19 +0000
Date: Thu, 21 Jan 2016 17:04:19 +0000
Message-Id: <E1aMIeh-00051n-6y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: Add
	xen/drivers/char/cadence-uart.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 58cd994c6b1187754d6178d3e1c9c9419d532ec9
Author:     Edgar E. Iglesias <edgar.iglesias@xilinx.com>
AuthorDate: Fri Jan 15 13:14:18 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 15:37:29 2016 +0000

    MAINTAINERS: Add xen/drivers/char/cadence-uart.c
    
    Add xen/drivers/char/cadence-uart.c to the ARM section.
    
    Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 09fe823..0e8af01 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -133,6 +133,7 @@ S:	Supported
 L:	xen-devel@lists.xen.org
 F:	xen/arch/arm/
 F:	xen/include/asm-arm/
+F:	xen/drivers/char/cadence-uart.c
 F:	xen/drivers/char/dt-uart.c
 F:	xen/drivers/char/exynos4210-uart.c
 F:	xen/drivers/char/omap-uart.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 Jan 21 17:04:22 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:04: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 1aMIek-0007Ea-Kg; Thu, 21 Jan 2016 17:04:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIej-0007Dt-G4
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:21 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	23/48-22089-49F01A65; Thu, 21 Jan 2016 17:04:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453395859!17104207!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48277 invoked from network); 21 Jan 2016 17:04:20 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:04:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfL-0008Pk-7Q
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIeh-00051n-6y
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:19 +0000
Date: Thu, 21 Jan 2016 17:04:19 +0000
Message-Id: <E1aMIeh-00051n-6y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: Add
	xen/drivers/char/cadence-uart.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 58cd994c6b1187754d6178d3e1c9c9419d532ec9
Author:     Edgar E. Iglesias <edgar.iglesias@xilinx.com>
AuthorDate: Fri Jan 15 13:14:18 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 15:37:29 2016 +0000

    MAINTAINERS: Add xen/drivers/char/cadence-uart.c
    
    Add xen/drivers/char/cadence-uart.c to the ARM section.
    
    Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 09fe823..0e8af01 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -133,6 +133,7 @@ S:	Supported
 L:	xen-devel@lists.xen.org
 F:	xen/arch/arm/
 F:	xen/include/asm-arm/
+F:	xen/drivers/char/cadence-uart.c
 F:	xen/drivers/char/dt-uart.c
 F:	xen/drivers/char/exynos4210-uart.c
 F:	xen/drivers/char/omap-uart.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 Jan 21 17:04:33 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:04: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 1aMIeu-0007KX-Sm; Thu, 21 Jan 2016 17:04:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIet-0007Jm-VB
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:32 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	A1/FA-21901-F9F01A65; Thu, 21 Jan 2016 17:04:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1453395869!17090680!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26691 invoked from network); 21 Jan 2016 17:04:30 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:04:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfV-0008QM-Ka
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIer-00052F-JQ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:29 +0000
Date: Thu, 21 Jan 2016 17:04:29 +0000
Message-Id: <E1aMIer-00052F-JQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: create 'drivers',
	'feature' and 'attr' xenstore 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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7a1d1becf020f1fa511692bd97d50402588ef28d
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Fri Jan 15 10:00:10 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 15:38:06 2016 +0000

    libxl: create 'drivers', 'feature' and 'attr' xenstore paths
    
    My recent patch series 'docs: Document xenstore paths' included 3
    patches documenting new xenstore paths to allow PV drivers/agents in
    guests to advertise version information, significant features and
    attributes (such as assigned IP addresses).
    
    This patch adds the necessary code to libxl to create these paths in
    xenstore when a domain is created.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_create.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 261816a..e491d83 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -628,6 +628,15 @@ retry_transaction:
     libxl__xs_mknod(gc, t,
                     GCSPRINTF("%s/data", dom_path),
                     rwperm, ARRAY_SIZE(rwperm));
+    libxl__xs_mknod(gc, t,
+                    GCSPRINTF("%s/drivers", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
+    libxl__xs_mknod(gc, t,
+                    GCSPRINTF("%s/feature", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
+    libxl__xs_mknod(gc, t,
+                    GCSPRINTF("%s/attr", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
 
     if (libxl_defbool_val(info->driver_domain)) {
         /*
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:04:33 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:04: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 1aMIeu-0007KX-Sm; Thu, 21 Jan 2016 17:04:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIet-0007Jm-VB
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:32 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	A1/FA-21901-F9F01A65; Thu, 21 Jan 2016 17:04:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1453395869!17090680!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26691 invoked from network); 21 Jan 2016 17:04:30 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:04:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfV-0008QM-Ka
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIer-00052F-JQ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:29 +0000
Date: Thu, 21 Jan 2016 17:04:29 +0000
Message-Id: <E1aMIer-00052F-JQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: create 'drivers',
	'feature' and 'attr' xenstore 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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7a1d1becf020f1fa511692bd97d50402588ef28d
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Fri Jan 15 10:00:10 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 15 15:38:06 2016 +0000

    libxl: create 'drivers', 'feature' and 'attr' xenstore paths
    
    My recent patch series 'docs: Document xenstore paths' included 3
    patches documenting new xenstore paths to allow PV drivers/agents in
    guests to advertise version information, significant features and
    attributes (such as assigned IP addresses).
    
    This patch adds the necessary code to libxl to create these paths in
    xenstore when a domain is created.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_create.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 261816a..e491d83 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -628,6 +628,15 @@ retry_transaction:
     libxl__xs_mknod(gc, t,
                     GCSPRINTF("%s/data", dom_path),
                     rwperm, ARRAY_SIZE(rwperm));
+    libxl__xs_mknod(gc, t,
+                    GCSPRINTF("%s/drivers", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
+    libxl__xs_mknod(gc, t,
+                    GCSPRINTF("%s/feature", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
+    libxl__xs_mknod(gc, t,
+                    GCSPRINTF("%s/attr", dom_path),
+                    rwperm, ARRAY_SIZE(rwperm));
 
     if (libxl_defbool_val(info->driver_domain)) {
         /*
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:04:44 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:04: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 1aMIf6-0007QE-21; Thu, 21 Jan 2016 17:04: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 1aMIf4-0007PX-Uk
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:43 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	36/AF-31122-AAF01A65; Thu, 21 Jan 2016 17:04:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1453395880!11390428!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28300 invoked from network); 21 Jan 2016 17:04:41 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:04:41 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIff-0008Qm-W5
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIf1-00053C-VN
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:40 +0000
Date: Thu, 21 Jan 2016 17:04:39 +0000
Message-Id: <E1aMIf1-00053C-VN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: move installed copy of
	xen/.config file to /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 3b911d948eb791a00ef6ac80356521979e1900e7
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 18 11:19:27 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 11:45:45 2016 +0000

    xen: move installed copy of xen/.config file to /boot
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 3699b20..2b34898 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -58,7 +58,7 @@ _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX)
 	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z)
 	[ -d "$(D)$(DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(DEBUG_DIR)
 	$(INSTALL_DATA) $(TARGET)-syms $(D)$(DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION)
-	$(INSTALL_DATA) $(KCONFIG_CONFIG) $(D)$(DEBUG_DIR)/$(T)-$(XEN_FULLVERSION).config
+	$(INSTALL_DATA) $(KCONFIG_CONFIG) $(D)$(BOOT_DIR)/$(T)-$(XEN_FULLVERSION).config
 	if [ -r $(TARGET).efi -a -n '$(EFI_DIR)' ]; then \
 		[ -d $(D)$(EFI_DIR) ] || $(INSTALL_DIR) $(D)$(EFI_DIR); \
 		$(INSTALL_DATA) $(TARGET).efi $(D)$(EFI_DIR)/$(T)-$(XEN_FULLVERSION).efi; \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:04:44 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:04: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 1aMIf6-0007QE-21; Thu, 21 Jan 2016 17:04: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 1aMIf4-0007PX-Uk
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:43 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	36/AF-31122-AAF01A65; Thu, 21 Jan 2016 17:04:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1453395880!11390428!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28300 invoked from network); 21 Jan 2016 17:04:41 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:04:41 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIff-0008Qm-W5
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIf1-00053C-VN
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:40 +0000
Date: Thu, 21 Jan 2016 17:04:39 +0000
Message-Id: <E1aMIf1-00053C-VN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: move installed copy of
	xen/.config file to /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 3b911d948eb791a00ef6ac80356521979e1900e7
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 18 11:19:27 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 11:45:45 2016 +0000

    xen: move installed copy of xen/.config file to /boot
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 3699b20..2b34898 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -58,7 +58,7 @@ _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX)
 	ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z)
 	[ -d "$(D)$(DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(DEBUG_DIR)
 	$(INSTALL_DATA) $(TARGET)-syms $(D)$(DEBUG_DIR)/$(T)-syms-$(XEN_FULLVERSION)
-	$(INSTALL_DATA) $(KCONFIG_CONFIG) $(D)$(DEBUG_DIR)/$(T)-$(XEN_FULLVERSION).config
+	$(INSTALL_DATA) $(KCONFIG_CONFIG) $(D)$(BOOT_DIR)/$(T)-$(XEN_FULLVERSION).config
 	if [ -r $(TARGET).efi -a -n '$(EFI_DIR)' ]; then \
 		[ -d $(D)$(EFI_DIR) ] || $(INSTALL_DIR) $(D)$(EFI_DIR); \
 		$(INSTALL_DATA) $(TARGET).efi $(D)$(EFI_DIR)/$(T)-$(XEN_FULLVERSION).efi; \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:04:54 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:04: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 1aMIfG-0007WR-7H; Thu, 21 Jan 2016 17:04: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 1aMIfE-0007VK-Kq
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:52 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	EF/1D-07165-4BF01A65; Thu, 21 Jan 2016 17:04:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1453395890!18559861!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6499 invoked from network); 21 Jan 2016 17:04:51 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:04:51 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfq-0008R5-9G
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfC-00053Y-9K
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:50 +0000
Date: Thu, 21 Jan 2016 17:04:50 +0000
Message-Id: <E1aMIfC-00053Y-9K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: make FLASK utils build
	unconditional
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a942a6f4ca64c023bec072f1d8d4e1d637815eb1
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Fri Jan 15 11:39:40 2016 -0600
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 11:46:50 2016 +0000

    tools: make FLASK utils build unconditional
    
    The flask utilities only have dependencies on libxc so there's no
    downside to always building it. Distros and projects based on Xen can
    put these in a different package to not install them for all users.
    Prior to this change FLASK_ENABLE needed to be set at the top level to
    build the utilities and the tools/configure script would build the FLASK
    policy by default, but only if the utilities were built.
    
    This change makes item 3 from
    http://lists.xenproject.org/archives/html/xen-devel/2016-01/msg01796.html
    a happen by default.
    
    CC: Ian Jackson <ian.jackson@eu.citrix.com>
    CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 9f74ac7..3f9289b 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -5,7 +5,7 @@ SUBDIRS-y :=
 SUBDIRS-y += include
 SUBDIRS-y += libs
 SUBDIRS-y += libxc
-SUBDIRS-$(FLASK_ENABLE) += flask
+SUBDIRS-y += flask
 SUBDIRS-y += xenstore
 SUBDIRS-y += misc
 SUBDIRS-y += examples
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:04:54 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:04: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 1aMIfG-0007WR-7H; Thu, 21 Jan 2016 17:04: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 1aMIfE-0007VK-Kq
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:52 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	EF/1D-07165-4BF01A65; Thu, 21 Jan 2016 17:04:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1453395890!18559861!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6499 invoked from network); 21 Jan 2016 17:04:51 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:04:51 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfq-0008R5-9G
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfC-00053Y-9K
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:04:50 +0000
Date: Thu, 21 Jan 2016 17:04:50 +0000
Message-Id: <E1aMIfC-00053Y-9K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: make FLASK utils build
	unconditional
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a942a6f4ca64c023bec072f1d8d4e1d637815eb1
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Fri Jan 15 11:39:40 2016 -0600
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 11:46:50 2016 +0000

    tools: make FLASK utils build unconditional
    
    The flask utilities only have dependencies on libxc so there's no
    downside to always building it. Distros and projects based on Xen can
    put these in a different package to not install them for all users.
    Prior to this change FLASK_ENABLE needed to be set at the top level to
    build the utilities and the tools/configure script would build the FLASK
    policy by default, but only if the utilities were built.
    
    This change makes item 3 from
    http://lists.xenproject.org/archives/html/xen-devel/2016-01/msg01796.html
    a happen by default.
    
    CC: Ian Jackson <ian.jackson@eu.citrix.com>
    CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 9f74ac7..3f9289b 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -5,7 +5,7 @@ SUBDIRS-y :=
 SUBDIRS-y += include
 SUBDIRS-y += libs
 SUBDIRS-y += libxc
-SUBDIRS-$(FLASK_ENABLE) += flask
+SUBDIRS-y += flask
 SUBDIRS-y += xenstore
 SUBDIRS-y += misc
 SUBDIRS-y += examples
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:05:04 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:05: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 1aMIfQ-0007ap-BM; Thu, 21 Jan 2016 17:05: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 1aMIfO-0007a6-Vd
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:03 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	F2/0A-28228-EBF01A65; Thu, 21 Jan 2016 17:05:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1453395900!17577647!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 43774 invoked from network); 21 Jan 2016 17:05:01 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:05:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIg0-0008RW-K7
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfM-000540-Jr
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:00 +0000
Date: Thu, 21 Jan 2016 17:05:00 +0000
Message-Id: <E1aMIfM-000540-Jr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Kconfig: fix environment variable
	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 a16ab49bce737d03e98967a34b93280db19201d0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 18 14:51:06 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:51:06 2016 +0100

    Kconfig: fix environment variable handling
    
    With xen/Makefile including include/config/auto.conf.cmd, environment
    variables checked in the latter must be available at the time of
    inclusion of that file, and hence must be populated in xen/Makefile
    rather than by passing to or inside xen/tools/kconfig/Makefile.kconfig.
    Otherwise incremental re-builds will always be full re-builds, which is
    not only annoying but actively problematic when building as non-root
    and only running "install-xen" as root.
    
    Also take the opportunity and remove stray $(Q) uses.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/Makefile                       |   11 +++++++----
 xen/tools/kconfig/Makefile.kconfig |    4 ----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 2b34898..e3449d1 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -20,6 +20,9 @@ MAKEFLAGS += -rR
 
 EFI_MOUNTPOINT ?= $(BOOT_DIR)/efi
 
+ARCH=$(XEN_TARGET_ARCH)
+SRCARCH=$(shell echo $(ARCH) | sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
+
 # Don't break if the build process wasn't called from the top level
 # we need XEN_TARGET_ARCH to generate the proper config
 include $(XEN_ROOT)/Config.mk
@@ -101,7 +104,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig clean
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) clean
 	find . \( -name "*.o" -o -name ".*.d" \) -exec rm -f {} \;
 	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
 	rm -f include/asm-*/asm-offsets.h
@@ -236,14 +239,14 @@ kconfig := silentoldconfig oldconfig config menuconfig defconfig \
 	nconfig xconfig gconfig savedefconfig listnewconfig olddefconfig
 .PHONY: $(kconfig)
 $(kconfig):
-	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(XEN_TARGET_ARCH) $@
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) $@
 
 include/config/%.conf: include/config/auto.conf.cmd $(KCONFIG_CONFIG)
-	$(Q)$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(XEN_TARGET_ARCH) silentoldconfig
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) silentoldconfig
 
 # Allow people to just run `make` as before and not force them to configure
 $(KCONFIG_CONFIG):
-	$(Q)$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(XEN_TARGET_ARCH) defconfig
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) defconfig
 
 # Break the dependency chain for the first run
 include/config/auto.conf.cmd: ;
diff --git a/xen/tools/kconfig/Makefile.kconfig b/xen/tools/kconfig/Makefile.kconfig
index 574ce1d..815f306 100644
--- a/xen/tools/kconfig/Makefile.kconfig
+++ b/xen/tools/kconfig/Makefile.kconfig
@@ -44,10 +44,6 @@ PHONY += FORCE
 
 FORCE:
 
-SRCARCH = $(shell echo $(ARCH) | \
-	sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
-export SRCARCH
-
 # include the original Makefile and Makefile.host from Linux
 include $(src)/Makefile
 include $(src)/Makefile.host
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:05:04 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:05: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 1aMIfQ-0007ap-BM; Thu, 21 Jan 2016 17:05: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 1aMIfO-0007a6-Vd
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:03 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	F2/0A-28228-EBF01A65; Thu, 21 Jan 2016 17:05:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1453395900!17577647!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 43774 invoked from network); 21 Jan 2016 17:05:01 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:05:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIg0-0008RW-K7
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfM-000540-Jr
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:00 +0000
Date: Thu, 21 Jan 2016 17:05:00 +0000
Message-Id: <E1aMIfM-000540-Jr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Kconfig: fix environment variable
	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 a16ab49bce737d03e98967a34b93280db19201d0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jan 18 14:51:06 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:51:06 2016 +0100

    Kconfig: fix environment variable handling
    
    With xen/Makefile including include/config/auto.conf.cmd, environment
    variables checked in the latter must be available at the time of
    inclusion of that file, and hence must be populated in xen/Makefile
    rather than by passing to or inside xen/tools/kconfig/Makefile.kconfig.
    Otherwise incremental re-builds will always be full re-builds, which is
    not only annoying but actively problematic when building as non-root
    and only running "install-xen" as root.
    
    Also take the opportunity and remove stray $(Q) uses.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/Makefile                       |   11 +++++++----
 xen/tools/kconfig/Makefile.kconfig |    4 ----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 2b34898..e3449d1 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -20,6 +20,9 @@ MAKEFLAGS += -rR
 
 EFI_MOUNTPOINT ?= $(BOOT_DIR)/efi
 
+ARCH=$(XEN_TARGET_ARCH)
+SRCARCH=$(shell echo $(ARCH) | sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
+
 # Don't break if the build process wasn't called from the top level
 # we need XEN_TARGET_ARCH to generate the proper config
 include $(XEN_ROOT)/Config.mk
@@ -101,7 +104,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig clean
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) clean
 	find . \( -name "*.o" -o -name ".*.d" \) -exec rm -f {} \;
 	rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
 	rm -f include/asm-*/asm-offsets.h
@@ -236,14 +239,14 @@ kconfig := silentoldconfig oldconfig config menuconfig defconfig \
 	nconfig xconfig gconfig savedefconfig listnewconfig olddefconfig
 .PHONY: $(kconfig)
 $(kconfig):
-	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(XEN_TARGET_ARCH) $@
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) $@
 
 include/config/%.conf: include/config/auto.conf.cmd $(KCONFIG_CONFIG)
-	$(Q)$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(XEN_TARGET_ARCH) silentoldconfig
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) silentoldconfig
 
 # Allow people to just run `make` as before and not force them to configure
 $(KCONFIG_CONFIG):
-	$(Q)$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(XEN_TARGET_ARCH) defconfig
+	$(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) defconfig
 
 # Break the dependency chain for the first run
 include/config/auto.conf.cmd: ;
diff --git a/xen/tools/kconfig/Makefile.kconfig b/xen/tools/kconfig/Makefile.kconfig
index 574ce1d..815f306 100644
--- a/xen/tools/kconfig/Makefile.kconfig
+++ b/xen/tools/kconfig/Makefile.kconfig
@@ -44,10 +44,6 @@ PHONY += FORCE
 
 FORCE:
 
-SRCARCH = $(shell echo $(ARCH) | \
-	sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
-export SRCARCH
-
 # include the original Makefile and Makefile.host from Linux
 include $(src)/Makefile
 include $(src)/Makefile.host
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:05:15 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:05: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 1aMIfa-0007ds-En; Thu, 21 Jan 2016 17:05: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 1aMIfZ-0007dK-8f
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:13 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	38/18-30270-8CF01A65; Thu, 21 Jan 2016 17:05:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1453395911!17296822!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57387 invoked from network); 21 Jan 2016 17:05:11 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:05:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgA-0008SE-SG
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfW-00054g-Rk
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:10 +0000
Date: Thu, 21 Jan 2016 17:05:10 +0000
Message-Id: <E1aMIfW-00054g-Rk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] spinlock: use mnemonics for recursive
	spinlock sentinel 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 21b151e6bb8f66475bf49d360aceb31172afed22
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 18 14:51:57 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:51:57 2016 +0100

    spinlock: use mnemonics for recursive spinlock sentinel values
    
    No resulting change.  The compiled binary is identical.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/spinlock.c      |    8 ++++----
 xen/include/xen/spinlock.h |    6 ++++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 7f89694..7b0cf6c 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -246,7 +246,7 @@ int _spin_trylock_recursive(spinlock_t *lock)
     unsigned int cpu = smp_processor_id();
 
     /* Don't allow overflow of recurse_cpu field. */
-    BUILD_BUG_ON(NR_CPUS > 0xfffu);
+    BUILD_BUG_ON(NR_CPUS > SPINLOCK_NO_CPU);
 
     check_lock(&lock->debug);
 
@@ -258,7 +258,7 @@ int _spin_trylock_recursive(spinlock_t *lock)
     }
 
     /* We support only fairly shallow recursion, else the counter overflows. */
-    ASSERT(lock->recurse_cnt < 0xfu);
+    ASSERT(lock->recurse_cnt < SPINLOCK_MAX_RECURSE);
     lock->recurse_cnt++;
 
     return 1;
@@ -275,7 +275,7 @@ void _spin_lock_recursive(spinlock_t *lock)
     }
 
     /* We support only fairly shallow recursion, else the counter overflows. */
-    ASSERT(lock->recurse_cnt < 0xfu);
+    ASSERT(lock->recurse_cnt < SPINLOCK_MAX_RECURSE);
     lock->recurse_cnt++;
 }
 
@@ -283,7 +283,7 @@ void _spin_unlock_recursive(spinlock_t *lock)
 {
     if ( likely(--lock->recurse_cnt == 0) )
     {
-        lock->recurse_cpu = 0xfffu;
+        lock->recurse_cpu = SPINLOCK_NO_CPU;
         spin_unlock(lock);
     }
 }
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index fb0438e..9555c53 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -80,7 +80,7 @@ struct lock_profile_qhead {
     static struct lock_profile *__lock_profile_##name                         \
     __used_section(".lockprofile.data") =                                     \
     &__lock_profile_data_##name
-#define _SPIN_LOCK_UNLOCKED(x) { { 0 }, 0xfffu, 0, _LOCK_DEBUG, x }
+#define _SPIN_LOCK_UNLOCKED(x) { { 0 }, SPINLOCK_NO_CPU, 0, _LOCK_DEBUG, x }
 #define SPIN_LOCK_UNLOCKED _SPIN_LOCK_UNLOCKED(NULL)
 #define DEFINE_SPINLOCK(l)                                                    \
     spinlock_t l = _SPIN_LOCK_UNLOCKED(NULL);                                 \
@@ -116,7 +116,7 @@ extern void spinlock_profile_reset(unsigned char key);
 
 struct lock_profile_qhead { };
 
-#define SPIN_LOCK_UNLOCKED { { 0 }, 0xfffu, 0, _LOCK_DEBUG }
+#define SPIN_LOCK_UNLOCKED { { 0 }, SPINLOCK_NO_CPU, 0, _LOCK_DEBUG }
 #define DEFINE_SPINLOCK(l) spinlock_t l = SPIN_LOCK_UNLOCKED
 
 #define spin_lock_init_prof(s, l) spin_lock_init(&((s)->l))
@@ -138,7 +138,9 @@ typedef union {
 typedef struct spinlock {
     spinlock_tickets_t tickets;
     u16 recurse_cpu:12;
+#define SPINLOCK_NO_CPU 0xfffu
     u16 recurse_cnt:4;
+#define SPINLOCK_MAX_RECURSE 0xfu
     struct lock_debug debug;
 #ifdef LOCK_PROFILE
     struct lock_profile *profile;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:05:15 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:05: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 1aMIfa-0007ds-En; Thu, 21 Jan 2016 17:05: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 1aMIfZ-0007dK-8f
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:13 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	38/18-30270-8CF01A65; Thu, 21 Jan 2016 17:05:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1453395911!17296822!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57387 invoked from network); 21 Jan 2016 17:05:11 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:05:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgA-0008SE-SG
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfW-00054g-Rk
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:10 +0000
Date: Thu, 21 Jan 2016 17:05:10 +0000
Message-Id: <E1aMIfW-00054g-Rk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] spinlock: use mnemonics for recursive
	spinlock sentinel 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 21b151e6bb8f66475bf49d360aceb31172afed22
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 18 14:51:57 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:51:57 2016 +0100

    spinlock: use mnemonics for recursive spinlock sentinel values
    
    No resulting change.  The compiled binary is identical.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/spinlock.c      |    8 ++++----
 xen/include/xen/spinlock.h |    6 ++++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 7f89694..7b0cf6c 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -246,7 +246,7 @@ int _spin_trylock_recursive(spinlock_t *lock)
     unsigned int cpu = smp_processor_id();
 
     /* Don't allow overflow of recurse_cpu field. */
-    BUILD_BUG_ON(NR_CPUS > 0xfffu);
+    BUILD_BUG_ON(NR_CPUS > SPINLOCK_NO_CPU);
 
     check_lock(&lock->debug);
 
@@ -258,7 +258,7 @@ int _spin_trylock_recursive(spinlock_t *lock)
     }
 
     /* We support only fairly shallow recursion, else the counter overflows. */
-    ASSERT(lock->recurse_cnt < 0xfu);
+    ASSERT(lock->recurse_cnt < SPINLOCK_MAX_RECURSE);
     lock->recurse_cnt++;
 
     return 1;
@@ -275,7 +275,7 @@ void _spin_lock_recursive(spinlock_t *lock)
     }
 
     /* We support only fairly shallow recursion, else the counter overflows. */
-    ASSERT(lock->recurse_cnt < 0xfu);
+    ASSERT(lock->recurse_cnt < SPINLOCK_MAX_RECURSE);
     lock->recurse_cnt++;
 }
 
@@ -283,7 +283,7 @@ void _spin_unlock_recursive(spinlock_t *lock)
 {
     if ( likely(--lock->recurse_cnt == 0) )
     {
-        lock->recurse_cpu = 0xfffu;
+        lock->recurse_cpu = SPINLOCK_NO_CPU;
         spin_unlock(lock);
     }
 }
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index fb0438e..9555c53 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -80,7 +80,7 @@ struct lock_profile_qhead {
     static struct lock_profile *__lock_profile_##name                         \
     __used_section(".lockprofile.data") =                                     \
     &__lock_profile_data_##name
-#define _SPIN_LOCK_UNLOCKED(x) { { 0 }, 0xfffu, 0, _LOCK_DEBUG, x }
+#define _SPIN_LOCK_UNLOCKED(x) { { 0 }, SPINLOCK_NO_CPU, 0, _LOCK_DEBUG, x }
 #define SPIN_LOCK_UNLOCKED _SPIN_LOCK_UNLOCKED(NULL)
 #define DEFINE_SPINLOCK(l)                                                    \
     spinlock_t l = _SPIN_LOCK_UNLOCKED(NULL);                                 \
@@ -116,7 +116,7 @@ extern void spinlock_profile_reset(unsigned char key);
 
 struct lock_profile_qhead { };
 
-#define SPIN_LOCK_UNLOCKED { { 0 }, 0xfffu, 0, _LOCK_DEBUG }
+#define SPIN_LOCK_UNLOCKED { { 0 }, SPINLOCK_NO_CPU, 0, _LOCK_DEBUG }
 #define DEFINE_SPINLOCK(l) spinlock_t l = SPIN_LOCK_UNLOCKED
 
 #define spin_lock_init_prof(s, l) spin_lock_init(&((s)->l))
@@ -138,7 +138,9 @@ typedef union {
 typedef struct spinlock {
     spinlock_tickets_t tickets;
     u16 recurse_cpu:12;
+#define SPINLOCK_NO_CPU 0xfffu
     u16 recurse_cnt:4;
+#define SPINLOCK_MAX_RECURSE 0xfu
     struct lock_debug debug;
 #ifdef LOCK_PROFILE
     struct lock_profile *profile;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:05:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:05: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 1aMIfk-0007hn-3E; Thu, 21 Jan 2016 17:05: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 1aMIfj-0007hO-Bd
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:23 +0000
Content-Length: 1972
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	0C/02-09708-2DF01A65; Thu, 21 Jan 2016 17:05:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1453395921!11397261!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6407 invoked from network); 21 Jan 2016 17:05:22 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:05:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgL-0008SS-85
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfh-00055K-6R
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:21 +0000
Date: Thu, 21 Jan 2016 17:05:21 +0000
Message-Id: <E1aMIfh-00055K-6R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: don't set the BSP as
	initialised in hvm_vcpu_initialise
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============0349088776586846819=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0349088776586846819==
Content-Length: 1559
Content-Transfer-Encoding: quoted-printable

commit 9761bfb9b7582ef50202f3b4e04d658713422c0d
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Mon Jan 18 14:52:31 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:52:31 2016 +0100

    x86/hvm: don't set the BSP as initialised in hvm_vcpu_initialise
    
    The BSP will be marked as initialised after hvm_load_cpu_ctxt has loaded the
    initial state, which is called from the toolstack during domain creation.
    
    Previous to my HVMlite series HVM guests were started without setting any
    explicit CPU state (in fact we placed that horrible jmp at 0x0, because the
    IP was by default set to 0x0). This is no longer true, and now HVM guests
    require that a proper CPU context is loaded before starting. This change
    helps enforce this policy.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a99edc2..f646c1e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2487,10 +2487,6 @@ int hvm_vcpu_initialise(struct vcpu *v)
  
         /* Init guest TSC to start from zero. */
         hvm_set_guest_tsc(v, 0);
-
-        /* Can start up without SIPI-SIPI or setvcpucontext domctl. */
-        v->is_initialised =3D 1;
-        clear_bit(_VPF_down, &v->pause_flags);
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:05:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:05: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 1aMIfk-0007hn-3E; Thu, 21 Jan 2016 17:05: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 1aMIfj-0007hO-Bd
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:23 +0000
Content-Length: 1972
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	0C/02-09708-2DF01A65; Thu, 21 Jan 2016 17:05:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1453395921!11397261!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6407 invoked from network); 21 Jan 2016 17:05:22 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:05:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgL-0008SS-85
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfh-00055K-6R
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:21 +0000
Date: Thu, 21 Jan 2016 17:05:21 +0000
Message-Id: <E1aMIfh-00055K-6R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: don't set the BSP as
	initialised in hvm_vcpu_initialise
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============0349088776586846819=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0349088776586846819==
Content-Length: 1559
Content-Transfer-Encoding: quoted-printable

commit 9761bfb9b7582ef50202f3b4e04d658713422c0d
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Mon Jan 18 14:52:31 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:52:31 2016 +0100

    x86/hvm: don't set the BSP as initialised in hvm_vcpu_initialise
    
    The BSP will be marked as initialised after hvm_load_cpu_ctxt has loaded the
    initial state, which is called from the toolstack during domain creation.
    
    Previous to my HVMlite series HVM guests were started without setting any
    explicit CPU state (in fact we placed that horrible jmp at 0x0, because the
    IP was by default set to 0x0). This is no longer true, and now HVM guests
    require that a proper CPU context is loaded before starting. This change
    helps enforce this policy.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a99edc2..f646c1e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2487,10 +2487,6 @@ int hvm_vcpu_initialise(struct vcpu *v)
  
         /* Init guest TSC to start from zero. */
         hvm_set_guest_tsc(v, 0);
-
-        /* Can start up without SIPI-SIPI or setvcpucontext domctl. */
-        v->is_initialised =3D 1;
-        clear_bit(_VPF_down, &v->pause_flags);
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:05:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:05: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 1aMIfy-0007nZ-7Y; Thu, 21 Jan 2016 17:05: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 1aMIfx-0007n4-BY
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:37 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	9D/0B-28228-0EF01A65; Thu, 21 Jan 2016 17:05:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1453395931!17577819!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49844 invoked from network); 21 Jan 2016 17:05:32 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:05:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgV-0008T7-Hn
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfr-00055q-HA
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:31 +0000
Date: Thu, 21 Jan 2016 17:05:31 +0000
Message-Id: <E1aMIfr-00055q-HA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: env var to enable expert config
	options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9fe8d627e0612529dd2733b9c2328815cfa90f3b
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Mon Jan 18 14:53:02 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:53:02 2016 +0100

    build: env var to enable expert config options
    
    Add an additional environment variable, defaulting to disabled,
    that enables the CONFIG_EXPERT configuration option. The purpose
    of the CONFIG_EXPERT configuration option is to make non-standard
    Kconfig options visible during the configuration process. The
    CONFIG_EXPERT option is not, itself, visible during the Kconfig
    configuration process, so typical users will never see it nor
    any of the non-standard configuration options.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/Kconfig  |    4 ++++
 xen/Makefile |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/Kconfig b/xen/Kconfig
index ffe3f45..fa8b27c 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -22,3 +22,7 @@ config DEFCONFIG_LIST
 	string
 	option defconfig_list
 	default "$ARCH_DEFCONFIG"
+
+config EXPERT
+	string
+	option env="XEN_CONFIG_EXPERT"
diff --git a/xen/Makefile b/xen/Makefile
index e3449d1..8b530c2 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -11,6 +11,7 @@ export XEN_DOMAIN	?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) |
 export XEN_BUILD_DATE	?= $(shell LC_ALL=C date)
 export XEN_BUILD_TIME	?= $(shell LC_ALL=C date +%T)
 export XEN_BUILD_HOST	?= $(shell hostname)
+export XEN_CONFIG_EXPERT ?= n
 
 export BASEDIR := $(CURDIR)
 export XEN_ROOT := $(BASEDIR)/..
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:05:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:05: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 1aMIfy-0007nZ-7Y; Thu, 21 Jan 2016 17:05: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 1aMIfx-0007n4-BY
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:37 +0000
Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id
	9D/0B-28228-0EF01A65; Thu, 21 Jan 2016 17:05:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1453395931!17577819!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49844 invoked from network); 21 Jan 2016 17:05:32 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:05:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgV-0008T7-Hn
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIfr-00055q-HA
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:31 +0000
Date: Thu, 21 Jan 2016 17:05:31 +0000
Message-Id: <E1aMIfr-00055q-HA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: env var to enable expert config
	options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9fe8d627e0612529dd2733b9c2328815cfa90f3b
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Mon Jan 18 14:53:02 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:53:02 2016 +0100

    build: env var to enable expert config options
    
    Add an additional environment variable, defaulting to disabled,
    that enables the CONFIG_EXPERT configuration option. The purpose
    of the CONFIG_EXPERT configuration option is to make non-standard
    Kconfig options visible during the configuration process. The
    CONFIG_EXPERT option is not, itself, visible during the Kconfig
    configuration process, so typical users will never see it nor
    any of the non-standard configuration options.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/Kconfig  |    4 ++++
 xen/Makefile |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/Kconfig b/xen/Kconfig
index ffe3f45..fa8b27c 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -22,3 +22,7 @@ config DEFCONFIG_LIST
 	string
 	option defconfig_list
 	default "$ARCH_DEFCONFIG"
+
+config EXPERT
+	string
+	option env="XEN_CONFIG_EXPERT"
diff --git a/xen/Makefile b/xen/Makefile
index e3449d1..8b530c2 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -11,6 +11,7 @@ export XEN_DOMAIN	?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) |
 export XEN_BUILD_DATE	?= $(shell LC_ALL=C date)
 export XEN_BUILD_TIME	?= $(shell LC_ALL=C date +%T)
 export XEN_BUILD_HOST	?= $(shell hostname)
+export XEN_CONFIG_EXPERT ?= n
 
 export BASEDIR := $(CURDIR)
 export XEN_ROOT := $(BASEDIR)/..
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:05:45 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:05: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 1aMIg5-0007r6-In; Thu, 21 Jan 2016 17:05:45 +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 1aMIg4-0007qP-Di
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:44 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	A9/29-09570-7EF01A65; Thu, 21 Jan 2016 17:05:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1453395942!17356823!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48066 invoked from network); 21 Jan 2016 17:05:43 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:05:43 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgf-0008TU-Rm
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIg1-000577-Rt
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:41 +0000
Date: Thu, 21 Jan 2016 17:05:41 +0000
Message-Id: <E1aMIg1-000577-Rt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPI: check acpi_disabled in
	acpi_table_parse() and acpi_table_parse_entries()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 865d791263eb55c470979b2a22c4ff0568a920a3
Author:     Len Brown <len.brown@intel.com>
AuthorDate: Mon Jan 18 14:53:41 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:53:41 2016 +0100

    ACPI: check acpi_disabled in acpi_table_parse() and acpi_table_parse_entries()
    
    Allow consumers of the acpi_table_parse()/acpi_table_parse_entries() API
    to gracefully handle the acpi_disabled=1 case via return value
    rather than checking the global flag themselves.
    
    Signed-off-by: Feng Tang <feng.tang@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>
    [Linux commit e5b8fc6ac158f65598f58dba2c0d52ba3b412f52]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 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 60c4ab1..39f1223 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -210,6 +210,9 @@ acpi_table_parse_entries(char *id,
 	unsigned int count = 0;
 	unsigned long table_end;
 
+	if (acpi_disabled)
+		return -ENODEV;
+
 	if (!handler)
 		return -EINVAL;
 
@@ -279,6 +282,9 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
 {
 	struct acpi_table_header *table = NULL;
 
+	if (acpi_disabled)
+		return -ENODEV;
+
 	if (!handler)
 		return -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 Jan 21 17:05:45 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:05: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 1aMIg5-0007r6-In; Thu, 21 Jan 2016 17:05:45 +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 1aMIg4-0007qP-Di
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:44 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	A9/29-09570-7EF01A65; Thu, 21 Jan 2016 17:05:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1453395942!17356823!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48066 invoked from network); 21 Jan 2016 17:05:43 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:05:43 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgf-0008TU-Rm
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIg1-000577-Rt
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:41 +0000
Date: Thu, 21 Jan 2016 17:05:41 +0000
Message-Id: <E1aMIg1-000577-Rt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPI: check acpi_disabled in
	acpi_table_parse() and acpi_table_parse_entries()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 865d791263eb55c470979b2a22c4ff0568a920a3
Author:     Len Brown <len.brown@intel.com>
AuthorDate: Mon Jan 18 14:53:41 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:53:41 2016 +0100

    ACPI: check acpi_disabled in acpi_table_parse() and acpi_table_parse_entries()
    
    Allow consumers of the acpi_table_parse()/acpi_table_parse_entries() API
    to gracefully handle the acpi_disabled=1 case via return value
    rather than checking the global flag themselves.
    
    Signed-off-by: Feng Tang <feng.tang@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>
    [Linux commit e5b8fc6ac158f65598f58dba2c0d52ba3b412f52]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 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 60c4ab1..39f1223 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -210,6 +210,9 @@ acpi_table_parse_entries(char *id,
 	unsigned int count = 0;
 	unsigned long table_end;
 
+	if (acpi_disabled)
+		return -ENODEV;
+
 	if (!handler)
 		return -EINVAL;
 
@@ -279,6 +282,9 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
 {
 	struct acpi_table_header *table = NULL;
 
+	if (acpi_disabled)
+		return -ENODEV;
+
 	if (!handler)
 		return -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 Jan 21 17:06:04 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:06: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 1aMIgO-0007wm-OL; Thu, 21 Jan 2016 17:06: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 1aMIgM-0007vY-M5
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:02 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	F7/21-31122-6FF01A65; Thu, 21 Jan 2016 17:05:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1453395957!11426614!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24853 invoked from network); 21 Jan 2016 17:05:58 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:05:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgv-0008Tf-72
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgC-00057d-6o
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:52 +0000
Date: Thu, 21 Jan 2016 17:05:52 +0000
Message-Id: <E1aMIgC-00057d-6o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPI / table: add new function to get
	table entries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9403c732cbc9ba49b82ed280adc6ae4850ff8a69
Author:     Ashwin Chaugule <ashwin.chaugule@linaro.org>
AuthorDate: Mon Jan 18 14:54:08 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:54:08 2016 +0100

    ACPI / table: add new function to get table entries
    
    The acpi_table_parse() function has a callback that
    passes a pointer to a table_header. Add a new function
    which takes this pointer and parses its entries. This
    eliminates the need to re-traverse all the tables for
    each call. e.g. as in acpi_table_parse_madt() which is
    normally called after acpi_table_parse().
    
    Acked-by: Grant Likely <grant.likely@linaro.org>
    Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org>
    Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
    Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit f08bb472bff3c0397fb7d6f47bc5cec41dad76e3]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/drivers/acpi/tables.c |   50 ++++++++++++++++++++++++++++++++++----------
 xen/include/xen/acpi.h    |    4 +++
 2 files changed, 42 insertions(+), 12 deletions(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index 39f1223..4e590de 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -199,27 +199,23 @@ void __init acpi_table_print_madt_entry(struct acpi_subtable_header *header)
 
 
 int __init
-acpi_table_parse_entries(char *id,
-			     unsigned long table_size,
-			     int entry_id,
-			     acpi_table_entry_handler handler,
-			     unsigned int max_entries)
+acpi_parse_entries(char *id, unsigned long table_size,
+		   acpi_table_entry_handler handler,
+		   struct acpi_table_header *table_header,
+		   int entry_id, unsigned int max_entries)
 {
-	struct acpi_table_header *table_header = NULL;
 	struct acpi_subtable_header *entry;
-	unsigned int count = 0;
+	int count = 0;
 	unsigned long table_end;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	if (!handler)
+	if (!id || !handler)
 		return -EINVAL;
 
-	if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
-		acpi_get_table(id, acpi_apic_instance, &table_header);
-	else
-		acpi_get_table(id, 0, &table_header);
+	if (!table_size)
+		return -EINVAL;
 
 	if (!table_header) {
 		printk(KERN_WARNING PREFIX "%4.4s not present\n", id);
@@ -252,6 +248,7 @@ acpi_table_parse_entries(char *id,
 		entry = (struct acpi_subtable_header *)
 		    ((unsigned long)entry + entry->length);
 	}
+
 	if (max_entries && count > max_entries) {
 		printk(KERN_WARNING PREFIX "[%4.4s:%#x] ignored %i entries of "
 		       "%i found\n", id, entry_id, count - max_entries, count);
@@ -261,6 +258,35 @@ acpi_table_parse_entries(char *id,
 }
 
 int __init
+acpi_table_parse_entries(char *id,
+			 unsigned long table_size,
+			 int entry_id,
+			 acpi_table_entry_handler handler,
+			 unsigned int max_entries)
+{
+	struct acpi_table_header *table_header = NULL;
+	u32 instance = 0;
+
+	if (acpi_disabled)
+		return -ENODEV;
+
+	if (!id || !handler)
+		return -EINVAL;
+
+	if (!strncmp(id, ACPI_SIG_MADT, 4))
+		instance = acpi_apic_instance;
+
+	acpi_get_table(id, instance, &table_header);
+	if (!table_header) {
+		printk(KERN_WARNING PREFIX "%4.4s not present\n", id);
+		return -ENODEV;
+	}
+
+	return acpi_parse_entries(id, table_size, handler, table_header,
+				  entry_id, max_entries);
+}
+
+int __init
 acpi_table_parse_madt(enum acpi_madt_type id,
 		      acpi_table_entry_handler handler, unsigned int max_entries)
 {
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index 0f1077d..65e53a6 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -64,6 +64,10 @@ void acpi_hest_init(void);
 
 int acpi_table_init (void);
 int acpi_table_parse(char *id, acpi_table_handler handler);
+int acpi_parse_entries(char *id, unsigned long table_size,
+		       acpi_table_entry_handler handler,
+		       struct acpi_table_header *table_header,
+		       int entry_id, unsigned int max_entries);
 int acpi_table_parse_entries(char *id, unsigned long table_size,
 	int entry_id, acpi_table_entry_handler handler, unsigned int max_entries);
 int acpi_table_parse_madt(enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries);
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:06:04 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:06: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 1aMIgO-0007wm-OL; Thu, 21 Jan 2016 17:06: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 1aMIgM-0007vY-M5
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:02 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	F7/21-31122-6FF01A65; Thu, 21 Jan 2016 17:05:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1453395957!11426614!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24853 invoked from network); 21 Jan 2016 17:05:58 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:05:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgv-0008Tf-72
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgC-00057d-6o
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:05:52 +0000
Date: Thu, 21 Jan 2016 17:05:52 +0000
Message-Id: <E1aMIgC-00057d-6o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPI / table: add new function to get
	table entries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9403c732cbc9ba49b82ed280adc6ae4850ff8a69
Author:     Ashwin Chaugule <ashwin.chaugule@linaro.org>
AuthorDate: Mon Jan 18 14:54:08 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:54:08 2016 +0100

    ACPI / table: add new function to get table entries
    
    The acpi_table_parse() function has a callback that
    passes a pointer to a table_header. Add a new function
    which takes this pointer and parses its entries. This
    eliminates the need to re-traverse all the tables for
    each call. e.g. as in acpi_table_parse_madt() which is
    normally called after acpi_table_parse().
    
    Acked-by: Grant Likely <grant.likely@linaro.org>
    Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org>
    Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
    Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit f08bb472bff3c0397fb7d6f47bc5cec41dad76e3]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/drivers/acpi/tables.c |   50 ++++++++++++++++++++++++++++++++++----------
 xen/include/xen/acpi.h    |    4 +++
 2 files changed, 42 insertions(+), 12 deletions(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index 39f1223..4e590de 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -199,27 +199,23 @@ void __init acpi_table_print_madt_entry(struct acpi_subtable_header *header)
 
 
 int __init
-acpi_table_parse_entries(char *id,
-			     unsigned long table_size,
-			     int entry_id,
-			     acpi_table_entry_handler handler,
-			     unsigned int max_entries)
+acpi_parse_entries(char *id, unsigned long table_size,
+		   acpi_table_entry_handler handler,
+		   struct acpi_table_header *table_header,
+		   int entry_id, unsigned int max_entries)
 {
-	struct acpi_table_header *table_header = NULL;
 	struct acpi_subtable_header *entry;
-	unsigned int count = 0;
+	int count = 0;
 	unsigned long table_end;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	if (!handler)
+	if (!id || !handler)
 		return -EINVAL;
 
-	if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
-		acpi_get_table(id, acpi_apic_instance, &table_header);
-	else
-		acpi_get_table(id, 0, &table_header);
+	if (!table_size)
+		return -EINVAL;
 
 	if (!table_header) {
 		printk(KERN_WARNING PREFIX "%4.4s not present\n", id);
@@ -252,6 +248,7 @@ acpi_table_parse_entries(char *id,
 		entry = (struct acpi_subtable_header *)
 		    ((unsigned long)entry + entry->length);
 	}
+
 	if (max_entries && count > max_entries) {
 		printk(KERN_WARNING PREFIX "[%4.4s:%#x] ignored %i entries of "
 		       "%i found\n", id, entry_id, count - max_entries, count);
@@ -261,6 +258,35 @@ acpi_table_parse_entries(char *id,
 }
 
 int __init
+acpi_table_parse_entries(char *id,
+			 unsigned long table_size,
+			 int entry_id,
+			 acpi_table_entry_handler handler,
+			 unsigned int max_entries)
+{
+	struct acpi_table_header *table_header = NULL;
+	u32 instance = 0;
+
+	if (acpi_disabled)
+		return -ENODEV;
+
+	if (!id || !handler)
+		return -EINVAL;
+
+	if (!strncmp(id, ACPI_SIG_MADT, 4))
+		instance = acpi_apic_instance;
+
+	acpi_get_table(id, instance, &table_header);
+	if (!table_header) {
+		printk(KERN_WARNING PREFIX "%4.4s not present\n", id);
+		return -ENODEV;
+	}
+
+	return acpi_parse_entries(id, table_size, handler, table_header,
+				  entry_id, max_entries);
+}
+
+int __init
 acpi_table_parse_madt(enum acpi_madt_type id,
 		      acpi_table_entry_handler handler, unsigned int max_entries)
 {
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index 0f1077d..65e53a6 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -64,6 +64,10 @@ void acpi_hest_init(void);
 
 int acpi_table_init (void);
 int acpi_table_parse(char *id, acpi_table_handler handler);
+int acpi_parse_entries(char *id, unsigned long table_size,
+		       acpi_table_entry_handler handler,
+		       struct acpi_table_header *table_header,
+		       int entry_id, unsigned int max_entries);
 int acpi_table_parse_entries(char *id, unsigned long table_size,
 	int entry_id, acpi_table_entry_handler handler, unsigned int max_entries);
 int acpi_table_parse_madt(enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries);
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:06:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:06: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 1aMIgV-0007zN-W1; Thu, 21 Jan 2016 17:06: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 1aMIgU-0007yq-3q
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:10 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	AC/24-08347-10011A65; Thu, 21 Jan 2016 17:06:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1453395967!18531847!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3881 invoked from network); 21 Jan 2016 17:06:08 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:06:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIh5-0008Ts-Ki
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgR-00058T-IE
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:07 +0000
Date: Thu, 21 Jan 2016 17:06:07 +0000
Message-Id: <E1aMIgR-00058T-IE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] acpi/pmstat: build for x86 only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0fc47845fa66597a4dab195820a0a3c829c196fa
Author:     Parth Dixit <parth.dixit@linaro.org>
AuthorDate: Mon Jan 18 14:55:23 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:55:23 2016 +0100

    acpi/pmstat: build for x86 only
    
    Pmstat is currently not supported for ARM in Xen. Configure and build
    pmstat for x86 architecture only.
    
    Signed-off-by: Parth Dixit <parth.dixit@linaro.org>
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/sysctl.c       |    2 +-
 xen/drivers/acpi/Makefile |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index a3007b8..1624024 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -171,7 +171,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         op->u.availheap.avail_bytes <<= PAGE_SHIFT;
         break;
 
-#ifdef CONFIG_HAS_ACPI
+#if defined (CONFIG_HAS_ACPI) && defined (CONFIG_HAS_CPUFREQ)
     case XEN_SYSCTL_get_pmstat:
         ret = do_get_pm_info(&op->u.get_pmstat);
         break;
diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile
index d8a4299..fb6dfc3 100644
--- a/xen/drivers/acpi/Makefile
+++ b/xen/drivers/acpi/Makefile
@@ -5,7 +5,7 @@ subdir-$(CONFIG_X86) += apei
 obj-bin-y += tables.init.o
 obj-$(HAS_NUMA) += numa.o
 obj-y += osl.o
-obj-y += pmstat.o
+obj-$(CONFIG_HAS_CPUFREQ) += pmstat.o
 
 obj-$(CONFIG_X86) += hwregs.o
 obj-$(CONFIG_X86) += reboot.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 Thu Jan 21 17:06:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:06: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 1aMIgV-0007zN-W1; Thu, 21 Jan 2016 17:06: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 1aMIgU-0007yq-3q
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:10 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	AC/24-08347-10011A65; Thu, 21 Jan 2016 17:06:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1453395967!18531847!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3881 invoked from network); 21 Jan 2016 17:06:08 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:06:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIh5-0008Ts-Ki
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgR-00058T-IE
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:07 +0000
Date: Thu, 21 Jan 2016 17:06:07 +0000
Message-Id: <E1aMIgR-00058T-IE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] acpi/pmstat: build for x86 only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0fc47845fa66597a4dab195820a0a3c829c196fa
Author:     Parth Dixit <parth.dixit@linaro.org>
AuthorDate: Mon Jan 18 14:55:23 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jan 18 14:55:23 2016 +0100

    acpi/pmstat: build for x86 only
    
    Pmstat is currently not supported for ARM in Xen. Configure and build
    pmstat for x86 architecture only.
    
    Signed-off-by: Parth Dixit <parth.dixit@linaro.org>
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/sysctl.c       |    2 +-
 xen/drivers/acpi/Makefile |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index a3007b8..1624024 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -171,7 +171,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
         op->u.availheap.avail_bytes <<= PAGE_SHIFT;
         break;
 
-#ifdef CONFIG_HAS_ACPI
+#if defined (CONFIG_HAS_ACPI) && defined (CONFIG_HAS_CPUFREQ)
     case XEN_SYSCTL_get_pmstat:
         ret = do_get_pm_info(&op->u.get_pmstat);
         break;
diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile
index d8a4299..fb6dfc3 100644
--- a/xen/drivers/acpi/Makefile
+++ b/xen/drivers/acpi/Makefile
@@ -5,7 +5,7 @@ subdir-$(CONFIG_X86) += apei
 obj-bin-y += tables.init.o
 obj-$(HAS_NUMA) += numa.o
 obj-y += osl.o
-obj-y += pmstat.o
+obj-$(CONFIG_HAS_CPUFREQ) += pmstat.o
 
 obj-$(CONFIG_X86) += hwregs.o
 obj-$(CONFIG_X86) += reboot.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 Thu Jan 21 17:06:22 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:06: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 1aMIgg-00082g-3L; Thu, 21 Jan 2016 17:06:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIge-00081N-BJ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:20 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	E8/99-13487-B0011A65; Thu, 21 Jan 2016 17:06:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1453395978!17373271!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7622 invoked from network); 21 Jan 2016 17:06:19 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:06:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhG-0008Uj-1Q
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgb-000594-VV
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:18 +0000
Date: Thu, 21 Jan 2016 17:06:17 +0000
Message-Id: <E1aMIgb-000594-VV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: support new xenstore domain
	flag in libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b84357cdafb2d3cfbe2a646c4069fef5959b93e6
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:51 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:19 2016 +0000

    libxc: support new xenstore domain flag in libxc
    
    Support the xenstore domain flag for obtaining domain info.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/include/xenctrl.h |    2 +-
 tools/libxc/xc_domain.c       |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 01a6dda..079cad0 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -456,7 +456,7 @@ typedef struct xc_dominfo {
     uint32_t      ssidref;
     unsigned int  dying:1, crashed:1, shutdown:1,
                   paused:1, blocked:1, running:1,
-                  hvm:1, debugged:1, pvh:1;
+                  hvm:1, debugged:1, pvh:1, xenstore:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown==1 */
     unsigned long nr_pages; /* current number, not maximum */
     unsigned long nr_outstanding_pages;
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 96506d5..99e0d48 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -374,6 +374,7 @@ int xc_domain_getinfo(xc_interface *xch,
         info->hvm      = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_hvm_guest);
         info->debugged = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_debugged);
         info->pvh      = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_pvh_guest);
+        info->xenstore = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_xs_domain);
 
         info->shutdown_reason =
             (domctl.u.getdomaininfo.flags>>XEN_DOMINF_shutdownshift) &
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:06:22 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:06: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 1aMIgg-00082g-3L; Thu, 21 Jan 2016 17:06:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIge-00081N-BJ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:20 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	E8/99-13487-B0011A65; Thu, 21 Jan 2016 17:06:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1453395978!17373271!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7622 invoked from network); 21 Jan 2016 17:06:19 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:06:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhG-0008Uj-1Q
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgb-000594-VV
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:18 +0000
Date: Thu, 21 Jan 2016 17:06:17 +0000
Message-Id: <E1aMIgb-000594-VV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: support new xenstore domain
	flag in libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b84357cdafb2d3cfbe2a646c4069fef5959b93e6
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:51 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:19 2016 +0000

    libxc: support new xenstore domain flag in libxc
    
    Support the xenstore domain flag for obtaining domain info.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/include/xenctrl.h |    2 +-
 tools/libxc/xc_domain.c       |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 01a6dda..079cad0 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -456,7 +456,7 @@ typedef struct xc_dominfo {
     uint32_t      ssidref;
     unsigned int  dying:1, crashed:1, shutdown:1,
                   paused:1, blocked:1, running:1,
-                  hvm:1, debugged:1, pvh:1;
+                  hvm:1, debugged:1, pvh:1, xenstore:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown==1 */
     unsigned long nr_pages; /* current number, not maximum */
     unsigned long nr_outstanding_pages;
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 96506d5..99e0d48 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -374,6 +374,7 @@ int xc_domain_getinfo(xc_interface *xch,
         info->hvm      = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_hvm_guest);
         info->debugged = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_debugged);
         info->pvh      = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_pvh_guest);
+        info->xenstore = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_xs_domain);
 
         info->shutdown_reason =
             (domctl.u.getdomaininfo.flags>>XEN_DOMINF_shutdownshift) &
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:06:32 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:06: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 1aMIgq-00085U-A0; Thu, 21 Jan 2016 17:06:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgo-000851-Pu
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:30 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	AA/C6-18633-61011A65; Thu, 21 Jan 2016 17:06:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1453395988!17052889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9838 invoked from network); 21 Jan 2016 17:06:29 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:06:29 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhQ-0008VK-CO
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgm-00059U-Bx
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:28 +0000
Date: Thu, 21 Jan 2016 17:06:28 +0000
Message-Id: <E1aMIgm-00059U-Bx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: provide a flag in dominfo to
	avoid stopping 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 15a66f1119938c92752589c79eff9ded2c95128a
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:52 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:19 2016 +0000

    libxl: provide a flag in dominfo to avoid stopping it
    
    Add a "never_stop" flag to dominfo as indicator for the toolstack that
    this domain is to be kept running. For now it is being set for xenstore
    domain, but there might be other domains in the future.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c         |   11 ++++++-----
 tools/libxl/libxl.h         |    9 +++++++++
 tools/libxl/libxl_types.idl |    1 +
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index abb2845..a8718b0 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -623,11 +623,12 @@ static void xcinfo2xlinfo(libxl_ctx *ctx,
                                    &xlinfo->ssid_label, &size) < 0)
         xlinfo->ssid_label = NULL;
 
-    xlinfo->dying    = !!(xcinfo->flags&XEN_DOMINF_dying);
-    xlinfo->shutdown = !!(xcinfo->flags&XEN_DOMINF_shutdown);
-    xlinfo->paused   = !!(xcinfo->flags&XEN_DOMINF_paused);
-    xlinfo->blocked  = !!(xcinfo->flags&XEN_DOMINF_blocked);
-    xlinfo->running  = !!(xcinfo->flags&XEN_DOMINF_running);
+    xlinfo->dying      = !!(xcinfo->flags&XEN_DOMINF_dying);
+    xlinfo->shutdown   = !!(xcinfo->flags&XEN_DOMINF_shutdown);
+    xlinfo->paused     = !!(xcinfo->flags&XEN_DOMINF_paused);
+    xlinfo->blocked    = !!(xcinfo->flags&XEN_DOMINF_blocked);
+    xlinfo->running    = !!(xcinfo->flags&XEN_DOMINF_running);
+    xlinfo->never_stop = !!(xcinfo->flags&XEN_DOMINF_xs_domain);
 
     if (xlinfo->shutdown)
         xlinfo->shutdown_reason = (xcinfo->flags>>XEN_DOMINF_shutdownshift) & XEN_DOMINF_shutdownmask;
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 05606a7..7114491 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -560,6 +560,15 @@ typedef struct libxl__ctx libxl_ctx;
 #define LIBXL_HAVE_DOMINFO_OUTSTANDING_MEMKB 1
 
 /*
+ * LIBXL_HAVE_DOMINFO_NEVER_STOP
+ *
+ * If this is defined, libxl_dominfo will contain a flag called never_stop
+ * indicating that the specific domain should never be stopped by the
+ * toolstack.
+ */
+#define LIBXL_HAVE_DOMINFO_NEVER_STOP 1
+
+/*
  * LIBXL_HAVE_QXL
  *
  * If defined, then the libxl_vga_interface_type will contain another value:
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 9658356..9ad7eba 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -295,6 +295,7 @@ libxl_dominfo = Struct("dominfo",[
     ("paused",      bool),
     ("shutdown",    bool),
     ("dying",       bool),
+    ("never_stop",  bool),
 
     # Valid iff ->shutdown is true.
     #
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:06:32 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:06: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 1aMIgq-00085U-A0; Thu, 21 Jan 2016 17:06:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgo-000851-Pu
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:30 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	AA/C6-18633-61011A65; Thu, 21 Jan 2016 17:06:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1453395988!17052889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9838 invoked from network); 21 Jan 2016 17:06:29 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:06:29 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhQ-0008VK-CO
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgm-00059U-Bx
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:28 +0000
Date: Thu, 21 Jan 2016 17:06:28 +0000
Message-Id: <E1aMIgm-00059U-Bx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: provide a flag in dominfo to
	avoid stopping 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 15a66f1119938c92752589c79eff9ded2c95128a
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:52 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:19 2016 +0000

    libxl: provide a flag in dominfo to avoid stopping it
    
    Add a "never_stop" flag to dominfo as indicator for the toolstack that
    this domain is to be kept running. For now it is being set for xenstore
    domain, but there might be other domains in the future.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c         |   11 ++++++-----
 tools/libxl/libxl.h         |    9 +++++++++
 tools/libxl/libxl_types.idl |    1 +
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index abb2845..a8718b0 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -623,11 +623,12 @@ static void xcinfo2xlinfo(libxl_ctx *ctx,
                                    &xlinfo->ssid_label, &size) < 0)
         xlinfo->ssid_label = NULL;
 
-    xlinfo->dying    = !!(xcinfo->flags&XEN_DOMINF_dying);
-    xlinfo->shutdown = !!(xcinfo->flags&XEN_DOMINF_shutdown);
-    xlinfo->paused   = !!(xcinfo->flags&XEN_DOMINF_paused);
-    xlinfo->blocked  = !!(xcinfo->flags&XEN_DOMINF_blocked);
-    xlinfo->running  = !!(xcinfo->flags&XEN_DOMINF_running);
+    xlinfo->dying      = !!(xcinfo->flags&XEN_DOMINF_dying);
+    xlinfo->shutdown   = !!(xcinfo->flags&XEN_DOMINF_shutdown);
+    xlinfo->paused     = !!(xcinfo->flags&XEN_DOMINF_paused);
+    xlinfo->blocked    = !!(xcinfo->flags&XEN_DOMINF_blocked);
+    xlinfo->running    = !!(xcinfo->flags&XEN_DOMINF_running);
+    xlinfo->never_stop = !!(xcinfo->flags&XEN_DOMINF_xs_domain);
 
     if (xlinfo->shutdown)
         xlinfo->shutdown_reason = (xcinfo->flags>>XEN_DOMINF_shutdownshift) & XEN_DOMINF_shutdownmask;
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 05606a7..7114491 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -560,6 +560,15 @@ typedef struct libxl__ctx libxl_ctx;
 #define LIBXL_HAVE_DOMINFO_OUTSTANDING_MEMKB 1
 
 /*
+ * LIBXL_HAVE_DOMINFO_NEVER_STOP
+ *
+ * If this is defined, libxl_dominfo will contain a flag called never_stop
+ * indicating that the specific domain should never be stopped by the
+ * toolstack.
+ */
+#define LIBXL_HAVE_DOMINFO_NEVER_STOP 1
+
+/*
  * LIBXL_HAVE_QXL
  *
  * If defined, then the libxl_vga_interface_type will contain another value:
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 9658356..9ad7eba 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -295,6 +295,7 @@ libxl_dominfo = Struct("dominfo",[
     ("paused",      bool),
     ("shutdown",    bool),
     ("dying",       bool),
+    ("never_stop",  bool),
 
     # Valid iff ->shutdown is true.
     #
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:06:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:06: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 1aMIh0-00087U-I7; Thu, 21 Jan 2016 17:06: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 1aMIgz-00087C-DE
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:41 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	28/37-18633-02011A65; Thu, 21 Jan 2016 17:06:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1453395999!17373347!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9822 invoked from network); 21 Jan 2016 17:06:39 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:06:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIha-0008VS-Sk
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgw-0005AV-Oz
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:38 +0000
Date: Thu, 21 Jan 2016 17:06:38 +0000
Message-Id: <E1aMIgw-0005AV-Oz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: move init-xenstore-domain to
	tools/helpers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 89bf86d1eb4a4f899c3c3ece758991f9bd361448
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:53 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:19 2016 +0000

    xenstore: move init-xenstore-domain to tools/helpers
    
    The program init-xenstore-domain to start a xenstore domain instead
    of the xenstored daemon is built, but not installed. Change that.
    
    Move the program to a new tools subdirectory "helpers" to be able to
    use libxl in a later patch. Otherwise a dependency loop will be
    created.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore                            |    2 +-
 tools/Makefile                        |    1 +
 tools/helpers/Makefile                |   34 +++++++++
 tools/helpers/init-xenstore-domain.c  |  119 +++++++++++++++++++++++++++++++++
 tools/xenstore/Makefile               |    9 ---
 tools/xenstore/init-xenstore-domain.c |  119 ---------------------------------
 6 files changed, 155 insertions(+), 129 deletions(-)

diff --git a/.gitignore b/.gitignore
index 02b2100..01d3305 100644
--- a/.gitignore
+++ b/.gitignore
@@ -133,6 +133,7 @@ tools/flask/utils/flask-loadpolicy
 tools/flask/utils/flask-setenforce
 tools/flask/utils/flask-set-bool
 tools/flask/utils/flask-label-pci
+tools/helpers/init-xenstore-domain
 tools/hotplug/common/hotplugpath.sh
 tools/hotplug/FreeBSD/rc.d/xencommons
 tools/hotplug/FreeBSD/rc.d/xendriverdomain
@@ -201,7 +202,6 @@ tools/xenmon/xenbaked
 tools/xenpaging/xenpaging
 tools/xenpmd/xenpmd
 tools/xenstat/xentop/xentop
-tools/xenstore/init-xenstore-domain
 tools/xenstore/xenstore
 tools/xenstore/xenstore-chmod
 tools/xenstore/xenstore-exists
diff --git a/tools/Makefile b/tools/Makefile
index 3f9289b..ccd0ae7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -30,6 +30,7 @@ endif
 
 SUBDIRS-y += xenpmd
 SUBDIRS-y += libxl
+SUBDIRS-y += helpers
 SUBDIRS-$(CONFIG_X86) += xenpaging
 SUBDIRS-$(CONFIG_X86) += debugger/gdbsx
 SUBDIRS-$(CONFIG_X86) += debugger/kdd
diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
new file mode 100644
index 0000000..52347fd
--- /dev/null
+++ b/tools/helpers/Makefile
@@ -0,0 +1,34 @@
+#
+# tools/helpers/Makefile
+#
+
+XEN_ROOT = $(CURDIR)/../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+ifeq ($(CONFIG_Linux),y)
+PROGS += init-xenstore-domain
+endif
+
+INIT_XENSTORE_DOMAIN_OBJS = init-xenstore-domain.o
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenguest)
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenstore)
+
+.PHONY: all
+all: $(PROGS)
+
+init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
+	$(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: all
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+ifeq ($(CONFIG_Linux),y)
+	$(INSTALL_PROG) init-xenstore-domain $(DESTDIR)$(LIBEXEC_BIN)
+endif
+
+.PHONY: clean
+clean:
+	$(RM) -f *.o $(PROGS) $(DEPS)
+
+distclean: clean
diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
new file mode 100644
index 0000000..297afe5
--- /dev/null
+++ b/tools/helpers/init-xenstore-domain.c
@@ -0,0 +1,119 @@
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <xenctrl.h>
+#include <xc_dom.h>
+#include <xenstore.h>
+#include <xen/sys/xenbus_dev.h>
+
+static uint32_t domid = -1;
+
+static int build(xc_interface *xch, int argc, char** argv)
+{
+	char cmdline[512];
+	uint32_t ssid;
+	xen_domain_handle_t handle = { 0 };
+	int rv, xs_fd;
+	struct xc_dom_image *dom = NULL;
+	int maxmem = atoi(argv[2]);
+	int limit_kb = (maxmem + 1)*1024;
+
+	xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
+	if (xs_fd == -1) return -1;
+
+	rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
+	if (rv) goto err;
+	rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
+	if (rv) goto err;
+	rv = xc_domain_max_vcpus(xch, domid, 1);
+	if (rv) goto err;
+	rv = xc_domain_setmaxmem(xch, domid, limit_kb);
+	if (rv) goto err;
+	rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
+	if (rv) goto err;
+
+	rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
+	if (rv < 0) goto err;
+	snprintf(cmdline, 512, "--event %d --internal-db", rv);
+
+	dom = xc_dom_allocate(xch, cmdline, NULL);
+	rv = xc_dom_kernel_file(dom, argv[1]);
+	if (rv) goto err;
+
+	if (argc > 4) {
+		rv = xc_dom_ramdisk_file(dom, argv[4]);
+		if (rv) goto err;
+	}
+
+	rv = xc_dom_boot_xen_init(dom, xch, domid);
+	if (rv) goto err;
+	rv = xc_dom_parse_image(dom);
+	if (rv) goto err;
+	rv = xc_dom_mem_init(dom, maxmem);
+	if (rv) goto err;
+	rv = xc_dom_boot_mem_init(dom);
+	if (rv) goto err;
+	rv = xc_dom_build_image(dom);
+	if (rv) goto err;
+	rv = xc_dom_boot_image(dom);
+	if (rv) goto err;
+
+	xc_dom_release(dom);
+	dom = NULL;
+
+	rv = xc_domain_set_virq_handler(xch, domid, VIRQ_DOM_EXC);
+	if (rv) goto err;
+	rv = xc_domain_unpause(xch, domid);
+	if (rv) goto err;
+
+	return 0;
+
+err:
+	if (dom)
+		xc_dom_release(dom);
+	close(xs_fd);
+	return rv;
+}
+
+int main(int argc, char** argv)
+{
+	xc_interface *xch;
+	struct xs_handle *xsh;
+	char buf[16];
+	int rv, fd;
+
+	if (argc < 4 || argc > 5) {
+		printf("Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n", argv[0]);
+		return 2;
+	}
+
+	xch = xc_interface_open(NULL, NULL, 0);
+	if (!xch) return 1;
+
+	rv = build(xch, argc, argv);
+
+	xc_interface_close(xch);
+
+	if (rv) return 1;
+
+	xsh = xs_open(0);
+	rv = snprintf(buf, 16, "%d", domid);
+	xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
+	xs_daemon_close(xsh);
+
+	fd = creat("/var/run/xenstored.pid", 0666);
+	if (fd < 0)
+		return 3;
+	rv = snprintf(buf, 16, "domid:%d\n", domid);
+	rv = write(fd, buf, rv);
+	close(fd);
+	if (rv < 0)
+		return 3;
+
+	return 0;
+}
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 1b4a494..404d4cb 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -46,10 +46,6 @@ ifeq ($(XENSTORE_XENSTORED),y)
 ALL_TARGETS += xs_tdb_dump xenstored
 endif
 
-ifeq ($(CONFIG_Linux),y)
-ALL_TARGETS += init-xenstore-domain
-endif
-
 ifdef CONFIG_STUBDOM
 CFLAGS += -DNO_SOCKETS=1
 endif
@@ -72,11 +68,6 @@ xenstored_probes.o: xenstored_solaris.o
 CFLAGS += -DHAVE_DTRACE=1
 endif
 
-init-xenstore-domain.o: CFLAGS += $(CFLAGS_libxenguest)
-
-init-xenstore-domain: init-xenstore-domain.o $(LIBXENSTORE)
-	$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) -o $@ $(APPEND_LDFLAGS)
-
 xenstored: $(XENSTORED_OBJS)
 	$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
 
diff --git a/tools/xenstore/init-xenstore-domain.c b/tools/xenstore/init-xenstore-domain.c
deleted file mode 100644
index 297afe5..0000000
--- a/tools/xenstore/init-xenstore-domain.c
+++ /dev/null
@@ -1,119 +0,0 @@
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <xenctrl.h>
-#include <xc_dom.h>
-#include <xenstore.h>
-#include <xen/sys/xenbus_dev.h>
-
-static uint32_t domid = -1;
-
-static int build(xc_interface *xch, int argc, char** argv)
-{
-	char cmdline[512];
-	uint32_t ssid;
-	xen_domain_handle_t handle = { 0 };
-	int rv, xs_fd;
-	struct xc_dom_image *dom = NULL;
-	int maxmem = atoi(argv[2]);
-	int limit_kb = (maxmem + 1)*1024;
-
-	xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
-	if (xs_fd == -1) return -1;
-
-	rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
-	if (rv) goto err;
-	rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
-	if (rv) goto err;
-	rv = xc_domain_max_vcpus(xch, domid, 1);
-	if (rv) goto err;
-	rv = xc_domain_setmaxmem(xch, domid, limit_kb);
-	if (rv) goto err;
-	rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
-	if (rv) goto err;
-
-	rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
-	if (rv < 0) goto err;
-	snprintf(cmdline, 512, "--event %d --internal-db", rv);
-
-	dom = xc_dom_allocate(xch, cmdline, NULL);
-	rv = xc_dom_kernel_file(dom, argv[1]);
-	if (rv) goto err;
-
-	if (argc > 4) {
-		rv = xc_dom_ramdisk_file(dom, argv[4]);
-		if (rv) goto err;
-	}
-
-	rv = xc_dom_boot_xen_init(dom, xch, domid);
-	if (rv) goto err;
-	rv = xc_dom_parse_image(dom);
-	if (rv) goto err;
-	rv = xc_dom_mem_init(dom, maxmem);
-	if (rv) goto err;
-	rv = xc_dom_boot_mem_init(dom);
-	if (rv) goto err;
-	rv = xc_dom_build_image(dom);
-	if (rv) goto err;
-	rv = xc_dom_boot_image(dom);
-	if (rv) goto err;
-
-	xc_dom_release(dom);
-	dom = NULL;
-
-	rv = xc_domain_set_virq_handler(xch, domid, VIRQ_DOM_EXC);
-	if (rv) goto err;
-	rv = xc_domain_unpause(xch, domid);
-	if (rv) goto err;
-
-	return 0;
-
-err:
-	if (dom)
-		xc_dom_release(dom);
-	close(xs_fd);
-	return rv;
-}
-
-int main(int argc, char** argv)
-{
-	xc_interface *xch;
-	struct xs_handle *xsh;
-	char buf[16];
-	int rv, fd;
-
-	if (argc < 4 || argc > 5) {
-		printf("Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n", argv[0]);
-		return 2;
-	}
-
-	xch = xc_interface_open(NULL, NULL, 0);
-	if (!xch) return 1;
-
-	rv = build(xch, argc, argv);
-
-	xc_interface_close(xch);
-
-	if (rv) return 1;
-
-	xsh = xs_open(0);
-	rv = snprintf(buf, 16, "%d", domid);
-	xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
-	xs_daemon_close(xsh);
-
-	fd = creat("/var/run/xenstored.pid", 0666);
-	if (fd < 0)
-		return 3;
-	rv = snprintf(buf, 16, "domid:%d\n", domid);
-	rv = write(fd, buf, rv);
-	close(fd);
-	if (rv < 0)
-		return 3;
-
-	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 Jan 21 17:06:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:06: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 1aMIh0-00087U-I7; Thu, 21 Jan 2016 17:06: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 1aMIgz-00087C-DE
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:41 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	28/37-18633-02011A65; Thu, 21 Jan 2016 17:06:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1453395999!17373347!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9822 invoked from network); 21 Jan 2016 17:06:39 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:06:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIha-0008VS-Sk
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIgw-0005AV-Oz
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:38 +0000
Date: Thu, 21 Jan 2016 17:06:38 +0000
Message-Id: <E1aMIgw-0005AV-Oz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: move init-xenstore-domain to
	tools/helpers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 89bf86d1eb4a4f899c3c3ece758991f9bd361448
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:53 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:19 2016 +0000

    xenstore: move init-xenstore-domain to tools/helpers
    
    The program init-xenstore-domain to start a xenstore domain instead
    of the xenstored daemon is built, but not installed. Change that.
    
    Move the program to a new tools subdirectory "helpers" to be able to
    use libxl in a later patch. Otherwise a dependency loop will be
    created.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore                            |    2 +-
 tools/Makefile                        |    1 +
 tools/helpers/Makefile                |   34 +++++++++
 tools/helpers/init-xenstore-domain.c  |  119 +++++++++++++++++++++++++++++++++
 tools/xenstore/Makefile               |    9 ---
 tools/xenstore/init-xenstore-domain.c |  119 ---------------------------------
 6 files changed, 155 insertions(+), 129 deletions(-)

diff --git a/.gitignore b/.gitignore
index 02b2100..01d3305 100644
--- a/.gitignore
+++ b/.gitignore
@@ -133,6 +133,7 @@ tools/flask/utils/flask-loadpolicy
 tools/flask/utils/flask-setenforce
 tools/flask/utils/flask-set-bool
 tools/flask/utils/flask-label-pci
+tools/helpers/init-xenstore-domain
 tools/hotplug/common/hotplugpath.sh
 tools/hotplug/FreeBSD/rc.d/xencommons
 tools/hotplug/FreeBSD/rc.d/xendriverdomain
@@ -201,7 +202,6 @@ tools/xenmon/xenbaked
 tools/xenpaging/xenpaging
 tools/xenpmd/xenpmd
 tools/xenstat/xentop/xentop
-tools/xenstore/init-xenstore-domain
 tools/xenstore/xenstore
 tools/xenstore/xenstore-chmod
 tools/xenstore/xenstore-exists
diff --git a/tools/Makefile b/tools/Makefile
index 3f9289b..ccd0ae7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -30,6 +30,7 @@ endif
 
 SUBDIRS-y += xenpmd
 SUBDIRS-y += libxl
+SUBDIRS-y += helpers
 SUBDIRS-$(CONFIG_X86) += xenpaging
 SUBDIRS-$(CONFIG_X86) += debugger/gdbsx
 SUBDIRS-$(CONFIG_X86) += debugger/kdd
diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
new file mode 100644
index 0000000..52347fd
--- /dev/null
+++ b/tools/helpers/Makefile
@@ -0,0 +1,34 @@
+#
+# tools/helpers/Makefile
+#
+
+XEN_ROOT = $(CURDIR)/../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+ifeq ($(CONFIG_Linux),y)
+PROGS += init-xenstore-domain
+endif
+
+INIT_XENSTORE_DOMAIN_OBJS = init-xenstore-domain.o
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenguest)
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenstore)
+
+.PHONY: all
+all: $(PROGS)
+
+init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
+	$(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: all
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+ifeq ($(CONFIG_Linux),y)
+	$(INSTALL_PROG) init-xenstore-domain $(DESTDIR)$(LIBEXEC_BIN)
+endif
+
+.PHONY: clean
+clean:
+	$(RM) -f *.o $(PROGS) $(DEPS)
+
+distclean: clean
diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
new file mode 100644
index 0000000..297afe5
--- /dev/null
+++ b/tools/helpers/init-xenstore-domain.c
@@ -0,0 +1,119 @@
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <xenctrl.h>
+#include <xc_dom.h>
+#include <xenstore.h>
+#include <xen/sys/xenbus_dev.h>
+
+static uint32_t domid = -1;
+
+static int build(xc_interface *xch, int argc, char** argv)
+{
+	char cmdline[512];
+	uint32_t ssid;
+	xen_domain_handle_t handle = { 0 };
+	int rv, xs_fd;
+	struct xc_dom_image *dom = NULL;
+	int maxmem = atoi(argv[2]);
+	int limit_kb = (maxmem + 1)*1024;
+
+	xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
+	if (xs_fd == -1) return -1;
+
+	rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
+	if (rv) goto err;
+	rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
+	if (rv) goto err;
+	rv = xc_domain_max_vcpus(xch, domid, 1);
+	if (rv) goto err;
+	rv = xc_domain_setmaxmem(xch, domid, limit_kb);
+	if (rv) goto err;
+	rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
+	if (rv) goto err;
+
+	rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
+	if (rv < 0) goto err;
+	snprintf(cmdline, 512, "--event %d --internal-db", rv);
+
+	dom = xc_dom_allocate(xch, cmdline, NULL);
+	rv = xc_dom_kernel_file(dom, argv[1]);
+	if (rv) goto err;
+
+	if (argc > 4) {
+		rv = xc_dom_ramdisk_file(dom, argv[4]);
+		if (rv) goto err;
+	}
+
+	rv = xc_dom_boot_xen_init(dom, xch, domid);
+	if (rv) goto err;
+	rv = xc_dom_parse_image(dom);
+	if (rv) goto err;
+	rv = xc_dom_mem_init(dom, maxmem);
+	if (rv) goto err;
+	rv = xc_dom_boot_mem_init(dom);
+	if (rv) goto err;
+	rv = xc_dom_build_image(dom);
+	if (rv) goto err;
+	rv = xc_dom_boot_image(dom);
+	if (rv) goto err;
+
+	xc_dom_release(dom);
+	dom = NULL;
+
+	rv = xc_domain_set_virq_handler(xch, domid, VIRQ_DOM_EXC);
+	if (rv) goto err;
+	rv = xc_domain_unpause(xch, domid);
+	if (rv) goto err;
+
+	return 0;
+
+err:
+	if (dom)
+		xc_dom_release(dom);
+	close(xs_fd);
+	return rv;
+}
+
+int main(int argc, char** argv)
+{
+	xc_interface *xch;
+	struct xs_handle *xsh;
+	char buf[16];
+	int rv, fd;
+
+	if (argc < 4 || argc > 5) {
+		printf("Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n", argv[0]);
+		return 2;
+	}
+
+	xch = xc_interface_open(NULL, NULL, 0);
+	if (!xch) return 1;
+
+	rv = build(xch, argc, argv);
+
+	xc_interface_close(xch);
+
+	if (rv) return 1;
+
+	xsh = xs_open(0);
+	rv = snprintf(buf, 16, "%d", domid);
+	xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
+	xs_daemon_close(xsh);
+
+	fd = creat("/var/run/xenstored.pid", 0666);
+	if (fd < 0)
+		return 3;
+	rv = snprintf(buf, 16, "domid:%d\n", domid);
+	rv = write(fd, buf, rv);
+	close(fd);
+	if (rv < 0)
+		return 3;
+
+	return 0;
+}
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 1b4a494..404d4cb 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -46,10 +46,6 @@ ifeq ($(XENSTORE_XENSTORED),y)
 ALL_TARGETS += xs_tdb_dump xenstored
 endif
 
-ifeq ($(CONFIG_Linux),y)
-ALL_TARGETS += init-xenstore-domain
-endif
-
 ifdef CONFIG_STUBDOM
 CFLAGS += -DNO_SOCKETS=1
 endif
@@ -72,11 +68,6 @@ xenstored_probes.o: xenstored_solaris.o
 CFLAGS += -DHAVE_DTRACE=1
 endif
 
-init-xenstore-domain.o: CFLAGS += $(CFLAGS_libxenguest)
-
-init-xenstore-domain: init-xenstore-domain.o $(LIBXENSTORE)
-	$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) -o $@ $(APPEND_LDFLAGS)
-
 xenstored: $(XENSTORED_OBJS)
 	$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
 
diff --git a/tools/xenstore/init-xenstore-domain.c b/tools/xenstore/init-xenstore-domain.c
deleted file mode 100644
index 297afe5..0000000
--- a/tools/xenstore/init-xenstore-domain.c
+++ /dev/null
@@ -1,119 +0,0 @@
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <xenctrl.h>
-#include <xc_dom.h>
-#include <xenstore.h>
-#include <xen/sys/xenbus_dev.h>
-
-static uint32_t domid = -1;
-
-static int build(xc_interface *xch, int argc, char** argv)
-{
-	char cmdline[512];
-	uint32_t ssid;
-	xen_domain_handle_t handle = { 0 };
-	int rv, xs_fd;
-	struct xc_dom_image *dom = NULL;
-	int maxmem = atoi(argv[2]);
-	int limit_kb = (maxmem + 1)*1024;
-
-	xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
-	if (xs_fd == -1) return -1;
-
-	rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
-	if (rv) goto err;
-	rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
-	if (rv) goto err;
-	rv = xc_domain_max_vcpus(xch, domid, 1);
-	if (rv) goto err;
-	rv = xc_domain_setmaxmem(xch, domid, limit_kb);
-	if (rv) goto err;
-	rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
-	if (rv) goto err;
-
-	rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
-	if (rv < 0) goto err;
-	snprintf(cmdline, 512, "--event %d --internal-db", rv);
-
-	dom = xc_dom_allocate(xch, cmdline, NULL);
-	rv = xc_dom_kernel_file(dom, argv[1]);
-	if (rv) goto err;
-
-	if (argc > 4) {
-		rv = xc_dom_ramdisk_file(dom, argv[4]);
-		if (rv) goto err;
-	}
-
-	rv = xc_dom_boot_xen_init(dom, xch, domid);
-	if (rv) goto err;
-	rv = xc_dom_parse_image(dom);
-	if (rv) goto err;
-	rv = xc_dom_mem_init(dom, maxmem);
-	if (rv) goto err;
-	rv = xc_dom_boot_mem_init(dom);
-	if (rv) goto err;
-	rv = xc_dom_build_image(dom);
-	if (rv) goto err;
-	rv = xc_dom_boot_image(dom);
-	if (rv) goto err;
-
-	xc_dom_release(dom);
-	dom = NULL;
-
-	rv = xc_domain_set_virq_handler(xch, domid, VIRQ_DOM_EXC);
-	if (rv) goto err;
-	rv = xc_domain_unpause(xch, domid);
-	if (rv) goto err;
-
-	return 0;
-
-err:
-	if (dom)
-		xc_dom_release(dom);
-	close(xs_fd);
-	return rv;
-}
-
-int main(int argc, char** argv)
-{
-	xc_interface *xch;
-	struct xs_handle *xsh;
-	char buf[16];
-	int rv, fd;
-
-	if (argc < 4 || argc > 5) {
-		printf("Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n", argv[0]);
-		return 2;
-	}
-
-	xch = xc_interface_open(NULL, NULL, 0);
-	if (!xch) return 1;
-
-	rv = build(xch, argc, argv);
-
-	xc_interface_close(xch);
-
-	if (rv) return 1;
-
-	xsh = xs_open(0);
-	rv = snprintf(buf, 16, "%d", domid);
-	xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
-	xs_daemon_close(xsh);
-
-	fd = creat("/var/run/xenstored.pid", 0666);
-	if (fd < 0)
-		return 3;
-	rv = snprintf(buf, 16, "domid:%d\n", domid);
-	rv = write(fd, buf, rv);
-	close(fd);
-	if (rv < 0)
-		return 3;
-
-	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 Jan 21 17:06:52 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:06: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 1aMIhA-0008AL-Pw; Thu, 21 Jan 2016 17:06:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIh9-00089y-Rq
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:52 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	3C/16-02745-B2011A65; Thu, 21 Jan 2016 17:06:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1453396009!17340971!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 53880 invoked from network); 21 Jan 2016 17:06:50 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:06:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhl-0008Vf-8w
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIh7-0005B2-8X
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:49 +0000
Date: Thu, 21 Jan 2016 17:06:49 +0000
Message-Id: <E1aMIh7-0005B2-8X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: adjust coding style of
	init-xenstore-domain.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 b69191172116fe092cc5d7bc5a77cb5f1d823888
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:54 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:20 2016 +0000

    xenstore: adjust coding style of init-xenstore-domain.c
    
    Adjust the coding style of init-xenstore-domain.c to the general Xen
    coding style.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/helpers/init-xenstore-domain.c |  221 +++++++++++++++++++---------------
 1 files changed, 126 insertions(+), 95 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 297afe5..9c47af1 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -15,105 +15,136 @@ static uint32_t domid = -1;
 
 static int build(xc_interface *xch, int argc, char** argv)
 {
-	char cmdline[512];
-	uint32_t ssid;
-	xen_domain_handle_t handle = { 0 };
-	int rv, xs_fd;
-	struct xc_dom_image *dom = NULL;
-	int maxmem = atoi(argv[2]);
-	int limit_kb = (maxmem + 1)*1024;
-
-	xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
-	if (xs_fd == -1) return -1;
-
-	rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
-	if (rv) goto err;
-	rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
-	if (rv) goto err;
-	rv = xc_domain_max_vcpus(xch, domid, 1);
-	if (rv) goto err;
-	rv = xc_domain_setmaxmem(xch, domid, limit_kb);
-	if (rv) goto err;
-	rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
-	if (rv) goto err;
-
-	rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
-	if (rv < 0) goto err;
-	snprintf(cmdline, 512, "--event %d --internal-db", rv);
-
-	dom = xc_dom_allocate(xch, cmdline, NULL);
-	rv = xc_dom_kernel_file(dom, argv[1]);
-	if (rv) goto err;
-
-	if (argc > 4) {
-		rv = xc_dom_ramdisk_file(dom, argv[4]);
-		if (rv) goto err;
-	}
-
-	rv = xc_dom_boot_xen_init(dom, xch, domid);
-	if (rv) goto err;
-	rv = xc_dom_parse_image(dom);
-	if (rv) goto err;
-	rv = xc_dom_mem_init(dom, maxmem);
-	if (rv) goto err;
-	rv = xc_dom_boot_mem_init(dom);
-	if (rv) goto err;
-	rv = xc_dom_build_image(dom);
-	if (rv) goto err;
-	rv = xc_dom_boot_image(dom);
-	if (rv) goto err;
-
-	xc_dom_release(dom);
-	dom = NULL;
-
-	rv = xc_domain_set_virq_handler(xch, domid, VIRQ_DOM_EXC);
-	if (rv) goto err;
-	rv = xc_domain_unpause(xch, domid);
-	if (rv) goto err;
-
-	return 0;
+    char cmdline[512];
+    uint32_t ssid;
+    xen_domain_handle_t handle = { 0 };
+    int rv, xs_fd;
+    struct xc_dom_image *dom = NULL;
+    int maxmem = atoi(argv[2]);
+    int limit_kb = (maxmem + 1) * 1024;
+
+    xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
+    if ( xs_fd == -1 )
+        return -1;
+
+    rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
+    if ( rv )
+        goto err;
+    rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
+    if ( rv )
+        goto err;
+    rv = xc_domain_max_vcpus(xch, domid, 1);
+    if ( rv )
+        goto err;
+    rv = xc_domain_setmaxmem(xch, domid, limit_kb);
+    if ( rv )
+        goto err;
+    rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
+    if ( rv )
+        goto err;
+
+    rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
+    if ( rv < 0 )
+        goto err;
+    snprintf(cmdline, 512, "--event %d --internal-db", rv);
+
+    dom = xc_dom_allocate(xch, cmdline, NULL);
+    rv = xc_dom_kernel_file(dom, argv[1]);
+    if ( rv )
+        goto err;
+
+    if ( argc > 4 )
+    {
+        rv = xc_dom_ramdisk_file(dom, argv[4]);
+        if ( rv )
+            goto err;
+    }
+
+    rv = xc_dom_boot_xen_init(dom, xch, domid);
+    if ( rv )
+        goto err;
+    rv = xc_dom_parse_image(dom);
+    if ( rv )
+        goto err;
+    rv = xc_dom_mem_init(dom, maxmem);
+    if ( rv )
+        goto err;
+    rv = xc_dom_boot_mem_init(dom);
+    if ( rv )
+        goto err;
+    rv = xc_dom_build_image(dom);
+    if ( rv )
+        goto err;
+    rv = xc_dom_boot_image(dom);
+    if ( rv )
+        goto err;
+
+    xc_dom_release(dom);
+    dom = NULL;
+
+    rv = xc_domain_set_virq_handler(xch, domid, VIRQ_DOM_EXC);
+    if ( rv )
+        goto err;
+    rv = xc_domain_unpause(xch, domid);
+    if ( rv )
+        goto err;
+
+    return 0;
 
 err:
-	if (dom)
-		xc_dom_release(dom);
-	close(xs_fd);
-	return rv;
+    if ( dom )
+        xc_dom_release(dom);
+    close(xs_fd);
+    return rv;
 }
 
 int main(int argc, char** argv)
 {
-	xc_interface *xch;
-	struct xs_handle *xsh;
-	char buf[16];
-	int rv, fd;
-
-	if (argc < 4 || argc > 5) {
-		printf("Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n", argv[0]);
-		return 2;
-	}
-
-	xch = xc_interface_open(NULL, NULL, 0);
-	if (!xch) return 1;
-
-	rv = build(xch, argc, argv);
-
-	xc_interface_close(xch);
-
-	if (rv) return 1;
-
-	xsh = xs_open(0);
-	rv = snprintf(buf, 16, "%d", domid);
-	xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
-	xs_daemon_close(xsh);
-
-	fd = creat("/var/run/xenstored.pid", 0666);
-	if (fd < 0)
-		return 3;
-	rv = snprintf(buf, 16, "domid:%d\n", domid);
-	rv = write(fd, buf, rv);
-	close(fd);
-	if (rv < 0)
-		return 3;
-
-	return 0;
+    xc_interface *xch;
+    struct xs_handle *xsh;
+    char buf[16];
+    int rv, fd;
+
+    if ( argc < 4 || argc > 5 )
+    {
+        printf("Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n",
+               argv[0]);
+        return 2;
+    }
+
+    xch = xc_interface_open(NULL, NULL, 0);
+    if ( !xch )
+        return 1;
+
+    rv = build(xch, argc, argv);
+
+    xc_interface_close(xch);
+
+    if ( rv )
+        return 1;
+
+    xsh = xs_open(0);
+    rv = snprintf(buf, 16, "%d", domid);
+    xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
+    xs_daemon_close(xsh);
+
+    fd = creat("/var/run/xenstored.pid", 0666);
+    if ( fd < 0 )
+        return 3;
+    rv = snprintf(buf, 16, "domid:%d\n", domid);
+    rv = write(fd, buf, rv);
+    close(fd);
+    if ( rv < 0 )
+        return 3;
+
+    return 0;
 }
+
+/*
+ * 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 Jan 21 17:06:52 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:06: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 1aMIhA-0008AL-Pw; Thu, 21 Jan 2016 17:06:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIh9-00089y-Rq
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:52 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	3C/16-02745-B2011A65; Thu, 21 Jan 2016 17:06:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1453396009!17340971!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 53880 invoked from network); 21 Jan 2016 17:06:50 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:06:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhl-0008Vf-8w
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIh7-0005B2-8X
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:49 +0000
Date: Thu, 21 Jan 2016 17:06:49 +0000
Message-Id: <E1aMIh7-0005B2-8X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: adjust coding style of
	init-xenstore-domain.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 b69191172116fe092cc5d7bc5a77cb5f1d823888
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:54 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:20 2016 +0000

    xenstore: adjust coding style of init-xenstore-domain.c
    
    Adjust the coding style of init-xenstore-domain.c to the general Xen
    coding style.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/helpers/init-xenstore-domain.c |  221 +++++++++++++++++++---------------
 1 files changed, 126 insertions(+), 95 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 297afe5..9c47af1 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -15,105 +15,136 @@ static uint32_t domid = -1;
 
 static int build(xc_interface *xch, int argc, char** argv)
 {
-	char cmdline[512];
-	uint32_t ssid;
-	xen_domain_handle_t handle = { 0 };
-	int rv, xs_fd;
-	struct xc_dom_image *dom = NULL;
-	int maxmem = atoi(argv[2]);
-	int limit_kb = (maxmem + 1)*1024;
-
-	xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
-	if (xs_fd == -1) return -1;
-
-	rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
-	if (rv) goto err;
-	rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
-	if (rv) goto err;
-	rv = xc_domain_max_vcpus(xch, domid, 1);
-	if (rv) goto err;
-	rv = xc_domain_setmaxmem(xch, domid, limit_kb);
-	if (rv) goto err;
-	rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
-	if (rv) goto err;
-
-	rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
-	if (rv < 0) goto err;
-	snprintf(cmdline, 512, "--event %d --internal-db", rv);
-
-	dom = xc_dom_allocate(xch, cmdline, NULL);
-	rv = xc_dom_kernel_file(dom, argv[1]);
-	if (rv) goto err;
-
-	if (argc > 4) {
-		rv = xc_dom_ramdisk_file(dom, argv[4]);
-		if (rv) goto err;
-	}
-
-	rv = xc_dom_boot_xen_init(dom, xch, domid);
-	if (rv) goto err;
-	rv = xc_dom_parse_image(dom);
-	if (rv) goto err;
-	rv = xc_dom_mem_init(dom, maxmem);
-	if (rv) goto err;
-	rv = xc_dom_boot_mem_init(dom);
-	if (rv) goto err;
-	rv = xc_dom_build_image(dom);
-	if (rv) goto err;
-	rv = xc_dom_boot_image(dom);
-	if (rv) goto err;
-
-	xc_dom_release(dom);
-	dom = NULL;
-
-	rv = xc_domain_set_virq_handler(xch, domid, VIRQ_DOM_EXC);
-	if (rv) goto err;
-	rv = xc_domain_unpause(xch, domid);
-	if (rv) goto err;
-
-	return 0;
+    char cmdline[512];
+    uint32_t ssid;
+    xen_domain_handle_t handle = { 0 };
+    int rv, xs_fd;
+    struct xc_dom_image *dom = NULL;
+    int maxmem = atoi(argv[2]);
+    int limit_kb = (maxmem + 1) * 1024;
+
+    xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
+    if ( xs_fd == -1 )
+        return -1;
+
+    rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
+    if ( rv )
+        goto err;
+    rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
+    if ( rv )
+        goto err;
+    rv = xc_domain_max_vcpus(xch, domid, 1);
+    if ( rv )
+        goto err;
+    rv = xc_domain_setmaxmem(xch, domid, limit_kb);
+    if ( rv )
+        goto err;
+    rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
+    if ( rv )
+        goto err;
+
+    rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
+    if ( rv < 0 )
+        goto err;
+    snprintf(cmdline, 512, "--event %d --internal-db", rv);
+
+    dom = xc_dom_allocate(xch, cmdline, NULL);
+    rv = xc_dom_kernel_file(dom, argv[1]);
+    if ( rv )
+        goto err;
+
+    if ( argc > 4 )
+    {
+        rv = xc_dom_ramdisk_file(dom, argv[4]);
+        if ( rv )
+            goto err;
+    }
+
+    rv = xc_dom_boot_xen_init(dom, xch, domid);
+    if ( rv )
+        goto err;
+    rv = xc_dom_parse_image(dom);
+    if ( rv )
+        goto err;
+    rv = xc_dom_mem_init(dom, maxmem);
+    if ( rv )
+        goto err;
+    rv = xc_dom_boot_mem_init(dom);
+    if ( rv )
+        goto err;
+    rv = xc_dom_build_image(dom);
+    if ( rv )
+        goto err;
+    rv = xc_dom_boot_image(dom);
+    if ( rv )
+        goto err;
+
+    xc_dom_release(dom);
+    dom = NULL;
+
+    rv = xc_domain_set_virq_handler(xch, domid, VIRQ_DOM_EXC);
+    if ( rv )
+        goto err;
+    rv = xc_domain_unpause(xch, domid);
+    if ( rv )
+        goto err;
+
+    return 0;
 
 err:
-	if (dom)
-		xc_dom_release(dom);
-	close(xs_fd);
-	return rv;
+    if ( dom )
+        xc_dom_release(dom);
+    close(xs_fd);
+    return rv;
 }
 
 int main(int argc, char** argv)
 {
-	xc_interface *xch;
-	struct xs_handle *xsh;
-	char buf[16];
-	int rv, fd;
-
-	if (argc < 4 || argc > 5) {
-		printf("Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n", argv[0]);
-		return 2;
-	}
-
-	xch = xc_interface_open(NULL, NULL, 0);
-	if (!xch) return 1;
-
-	rv = build(xch, argc, argv);
-
-	xc_interface_close(xch);
-
-	if (rv) return 1;
-
-	xsh = xs_open(0);
-	rv = snprintf(buf, 16, "%d", domid);
-	xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
-	xs_daemon_close(xsh);
-
-	fd = creat("/var/run/xenstored.pid", 0666);
-	if (fd < 0)
-		return 3;
-	rv = snprintf(buf, 16, "domid:%d\n", domid);
-	rv = write(fd, buf, rv);
-	close(fd);
-	if (rv < 0)
-		return 3;
-
-	return 0;
+    xc_interface *xch;
+    struct xs_handle *xsh;
+    char buf[16];
+    int rv, fd;
+
+    if ( argc < 4 || argc > 5 )
+    {
+        printf("Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n",
+               argv[0]);
+        return 2;
+    }
+
+    xch = xc_interface_open(NULL, NULL, 0);
+    if ( !xch )
+        return 1;
+
+    rv = build(xch, argc, argv);
+
+    xc_interface_close(xch);
+
+    if ( rv )
+        return 1;
+
+    xsh = xs_open(0);
+    rv = snprintf(buf, 16, "%d", domid);
+    xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
+    xs_daemon_close(xsh);
+
+    fd = creat("/var/run/xenstored.pid", 0666);
+    if ( fd < 0 )
+        return 3;
+    rv = snprintf(buf, 16, "domid:%d\n", domid);
+    rv = write(fd, buf, rv);
+    close(fd);
+    if ( rv < 0 )
+        return 3;
+
+    return 0;
 }
+
+/*
+ * 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 Jan 21 17:07:03 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:07: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 1aMIhL-0008Cg-UP; Thu, 21 Jan 2016 17:07: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 1aMIhK-0008CG-D7
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:02 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	E2/52-23366-53011A65; Thu, 21 Jan 2016 17:07:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1453396019!18456434!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18662 invoked from network); 21 Jan 2016 17:07:00 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:07:00 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhv-0008Vn-I6
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhH-0005BV-HM
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:59 +0000
Date: Thu, 21 Jan 2016 17:06:59 +0000
Message-Id: <E1aMIhH-0005BV-HM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: move xen-init-dom0 to
	tools/helpers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 175f00bcedee5901213fe2e348a3e41edb641146
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:55 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:20 2016 +0000

    libxl: move xen-init-dom0 to tools/helpers
    
    Move xen-init-dom0 from tools/libxl to tools/helpers, as it is just a
    helper program.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore                    |    2 +-
 tools/helpers/Makefile        |   10 ++++
 tools/helpers/xen-init-dom0.c |  120 +++++++++++++++++++++++++++++++++++++++++
 tools/libxl/Makefile          |   14 +----
 tools/libxl/xen-init-dom0.c   |  120 -----------------------------------------
 5 files changed, 134 insertions(+), 132 deletions(-)

diff --git a/.gitignore b/.gitignore
index 01d3305..141c2be 100644
--- a/.gitignore
+++ b/.gitignore
@@ -134,6 +134,7 @@ tools/flask/utils/flask-setenforce
 tools/flask/utils/flask-set-bool
 tools/flask/utils/flask-label-pci
 tools/helpers/init-xenstore-domain
+tools/helpers/xen-init-dom0
 tools/hotplug/common/hotplugpath.sh
 tools/hotplug/FreeBSD/rc.d/xencommons
 tools/hotplug/FreeBSD/rc.d/xendriverdomain
@@ -301,7 +302,6 @@ tools/libxl/*.pyc
 tools/libxl/libxl-save-helper
 tools/libxl/test_timedereg
 tools/libxl/test_fdderegrace
-tools/libxl/xen-init-dom0
 tools/blktap2/control/tap-ctl
 tools/firmware/etherboot/eb-roms.h
 tools/firmware/etherboot/gpxe-git-snapshot.tar.gz
diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index 52347fd..826e0ed 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -5,10 +5,16 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
+PROGS += xen-init-dom0
 ifeq ($(CONFIG_Linux),y)
 PROGS += init-xenstore-domain
 endif
 
+XEN_INIT_DOM0_OBJS = xen-init-dom0.o
+$(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
+$(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
+$(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenlight)
+
 INIT_XENSTORE_DOMAIN_OBJS = init-xenstore-domain.o
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenguest)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
@@ -17,12 +23,16 @@ $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 .PHONY: all
 all: $(PROGS)
 
+xen-init-dom0: $(XEN_INIT_DOM0_OBJS)
+	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
+
 init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
 	$(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
 
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) xen-init-dom0 $(DESTDIR)$(LIBEXEC_BIN)
 ifeq ($(CONFIG_Linux),y)
 	$(INSTALL_PROG) init-xenstore-domain $(DESTDIR)$(LIBEXEC_BIN)
 endif
diff --git a/tools/helpers/xen-init-dom0.c b/tools/helpers/xen-init-dom0.c
new file mode 100644
index 0000000..2f7aa7c
--- /dev/null
+++ b/tools/helpers/xen-init-dom0.c
@@ -0,0 +1,120 @@
+#include <err.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <xentoollog.h>
+#include <xenstore.h>
+#include <libxl.h>
+
+#define DOMNAME_PATH   "/local/domain/0/name"
+#define DOMID_PATH     "/local/domain/0/domid"
+
+static libxl_ctx *ctx;
+static xentoollog_logger_stdiostream *logger;
+static struct xs_handle *xsh;
+
+static void ctx_alloc(void)
+{
+    if (libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0,
+                        (xentoollog_logger *)logger)) {
+        fprintf(stderr, "cannot init libxl context\n");
+        exit(1);
+    }
+    xsh = xs_open(0);
+    if (!xsh) {
+        fprintf(stderr, "cannot open xenstore connection\n");
+        exit(1);
+    }
+}
+
+static void ctx_free(void)
+{
+    if (ctx) {
+        libxl_ctx_free(ctx);
+        ctx = NULL;
+    }
+    if (logger) {
+        xtl_logger_destroy((xentoollog_logger *)logger);
+        logger = NULL;
+    }
+    if (xsh) {
+        xs_close(xsh);
+        xsh = NULL;
+    }
+}
+
+int main(int argc, char **argv)
+{
+    int rc;
+    libxl_domain_config dom0_config;
+    char *domname_string = NULL, *domid_string = NULL;
+    char *json = NULL;;
+
+    logger = xtl_createlogger_stdiostream(stderr, XTL_ERROR, 0);
+    if (!logger) exit(1);
+
+    atexit(ctx_free);
+
+    ctx_alloc();
+
+    libxl_domain_config_init(&dom0_config);
+
+    /* Sanity check: this program can only be run once. */
+    domid_string = xs_read(xsh, XBT_NULL, DOMID_PATH, NULL);
+    domname_string = xs_read(xsh, XBT_NULL, DOMNAME_PATH, NULL);
+    if (domid_string && domname_string) {
+        fprintf(stderr, "Dom0 is already set up\n");
+        rc = 0;
+        goto out;
+    }
+
+    /* Generate stub JSON config. */
+    dom0_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
+    libxl_domain_build_info_init_type(&dom0_config.b_info,
+                                      LIBXL_DOMAIN_TYPE_PV);
+
+    json = libxl_domain_config_to_json(ctx, &dom0_config);
+    /* libxl-json format requires the string ends with '\0'. Code
+     * snippet taken from libxl.
+     */
+    rc = libxl_userdata_store(ctx, 0, "libxl-json",
+                              (const uint8_t *)json,
+                              strlen(json) + 1 /* include '\0' */);
+    if (rc) {
+        fprintf(stderr, "cannot store stub json config for Dom0\n");
+        goto out;
+    }
+
+    /* Write xenstore entries. */
+    if (!xs_write(xsh, XBT_NULL, DOMID_PATH, "0", strlen("0"))) {
+        fprintf(stderr, "cannot set domid for Dom0\n");
+        rc = 1;
+        goto out;
+    }
+
+    if (!xs_write(xsh, XBT_NULL, DOMNAME_PATH, "Domain-0",
+                  strlen("Domain-0"))) {
+        fprintf(stderr, "cannot set domain name for Dom0\n");
+        rc = 1;
+        goto out;
+    }
+
+    printf("Done setting up Dom0\n");
+
+out:
+    libxl_domain_config_dispose(&dom0_config);
+    free(domid_string);
+    free(domname_string);
+    free(json);
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 2abae0c..b0cb9e4 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -143,7 +143,7 @@ LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_l.o libxlu_cfg.o \
 	libxlu_disk_l.o libxlu_disk.o libxlu_vif.o libxlu_pci.o
 $(LIBXLU_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
 
-CLIENTS = xl testidl libxl-save-helper xen-init-dom0
+CLIENTS = xl testidl libxl-save-helper
 
 CFLAGS_XL += $(CFLAGS_libxenlight)
 CFLAGS_XL += -Wshadow
@@ -154,10 +154,6 @@ $(XL_OBJS) $(TEST_PROG_OBJS) _libxl.api-for-check: \
 $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
 $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
 
-XEN_INIT_DOM0_OBJS = xen-init-dom0.o
-$(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
-$(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
-
 SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
 $(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
 
@@ -174,7 +170,7 @@ all: $(CLIENTS) $(TEST_PROGS) $(PKG_CONFIG) \
 	$(AUTOSRCS) $(AUTOINCS)
 
 $(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS) \
-		$(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS) $(XEN_INIT_DOM0_OBJS): \
+		$(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): \
 	$(AUTOINCS) libxl.api-ok
 
 %.c %.h:: %.y
@@ -215,7 +211,7 @@ libxl_internal_json.h: _libxl_types_internal_json.h
 xl.h: _paths.h
 
 $(LIBXL_OBJS) $(LIBXL_TEST_OBJS) $(LIBXLU_OBJS) \
-	$(XL_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS) $(XEN_INIT_DOM0_OBJS): libxl.h
+	$(XL_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): libxl.h
 $(LIBXL_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h
 
 _libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py
@@ -256,9 +252,6 @@ libxlutil.a: $(LIBXLU_OBJS)
 xl: $(XL_OBJS) libxlutil.so libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
 
-xen-init-dom0: $(XEN_INIT_DOM0_OBJS) libxenlight.so
-	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
-
 test_%: test_%.o test_common.o libxlutil.so libxenlight_test.so
 	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
 
@@ -281,7 +274,6 @@ install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/pkgconfig
 	$(INSTALL_PROG) xl $(DESTDIR)$(sbindir)
-	$(INSTALL_PROG) xen-init-dom0 $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenlight.so.$(MAJOR)
diff --git a/tools/libxl/xen-init-dom0.c b/tools/libxl/xen-init-dom0.c
deleted file mode 100644
index 7925d64..0000000
--- a/tools/libxl/xen-init-dom0.c
+++ /dev/null
@@ -1,120 +0,0 @@
-#include <err.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <xenctrl.h>
-#include <xenstore.h>
-#include <libxl.h>
-
-#define DOMNAME_PATH   "/local/domain/0/name"
-#define DOMID_PATH     "/local/domain/0/domid"
-
-static libxl_ctx *ctx;
-static xentoollog_logger_stdiostream *logger;
-static struct xs_handle *xsh;
-
-static void ctx_alloc(void)
-{
-    if (libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0,
-                        (xentoollog_logger *)logger)) {
-        fprintf(stderr, "cannot init libxl context\n");
-        exit(1);
-    }
-    xsh = xs_open(0);
-    if (!xsh) {
-        fprintf(stderr, "cannot open xenstore connection\n");
-        exit(1);
-    }
-}
-
-static void ctx_free(void)
-{
-    if (ctx) {
-        libxl_ctx_free(ctx);
-        ctx = NULL;
-    }
-    if (logger) {
-        xtl_logger_destroy((xentoollog_logger *)logger);
-        logger = NULL;
-    }
-    if (xsh) {
-        xs_close(xsh);
-        xsh = NULL;
-    }
-}
-
-int main(int argc, char **argv)
-{
-    int rc;
-    libxl_domain_config dom0_config;
-    char *domname_string = NULL, *domid_string = NULL;
-    char *json = NULL;;
-
-    logger = xtl_createlogger_stdiostream(stderr, XTL_ERROR, 0);
-    if (!logger) exit(1);
-
-    atexit(ctx_free);
-
-    ctx_alloc();
-
-    libxl_domain_config_init(&dom0_config);
-
-    /* Sanity check: this program can only be run once. */
-    domid_string = xs_read(xsh, XBT_NULL, DOMID_PATH, NULL);
-    domname_string = xs_read(xsh, XBT_NULL, DOMNAME_PATH, NULL);
-    if (domid_string && domname_string) {
-        fprintf(stderr, "Dom0 is already set up\n");
-        rc = 0;
-        goto out;
-    }
-
-    /* Generate stub JSON config. */
-    dom0_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
-    libxl_domain_build_info_init_type(&dom0_config.b_info,
-                                      LIBXL_DOMAIN_TYPE_PV);
-
-    json = libxl_domain_config_to_json(ctx, &dom0_config);
-    /* libxl-json format requires the string ends with '\0'. Code
-     * snippet taken from libxl.
-     */
-    rc = libxl_userdata_store(ctx, 0, "libxl-json",
-                              (const uint8_t *)json,
-                              strlen(json) + 1 /* include '\0' */);
-    if (rc) {
-        fprintf(stderr, "cannot store stub json config for Dom0\n");
-        goto out;
-    }
-
-    /* Write xenstore entries. */
-    if (!xs_write(xsh, XBT_NULL, DOMID_PATH, "0", strlen("0"))) {
-        fprintf(stderr, "cannot set domid for Dom0\n");
-        rc = 1;
-        goto out;
-    }
-
-    if (!xs_write(xsh, XBT_NULL, DOMNAME_PATH, "Domain-0",
-                  strlen("Domain-0"))) {
-        fprintf(stderr, "cannot set domain name for Dom0\n");
-        rc = 1;
-        goto out;
-    }
-
-    printf("Done setting up Dom0\n");
-
-out:
-    libxl_domain_config_dispose(&dom0_config);
-    free(domid_string);
-    free(domname_string);
-    free(json);
-    return rc;
-}
-
-/*
- * Local variables:
- * mode: C
- * 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 Jan 21 17:07:03 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:07: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 1aMIhL-0008Cg-UP; Thu, 21 Jan 2016 17:07: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 1aMIhK-0008CG-D7
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:02 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	E2/52-23366-53011A65; Thu, 21 Jan 2016 17:07:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1453396019!18456434!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18662 invoked from network); 21 Jan 2016 17:07:00 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:07:00 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhv-0008Vn-I6
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhH-0005BV-HM
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:06:59 +0000
Date: Thu, 21 Jan 2016 17:06:59 +0000
Message-Id: <E1aMIhH-0005BV-HM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: move xen-init-dom0 to
	tools/helpers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 175f00bcedee5901213fe2e348a3e41edb641146
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:55 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:20 2016 +0000

    libxl: move xen-init-dom0 to tools/helpers
    
    Move xen-init-dom0 from tools/libxl to tools/helpers, as it is just a
    helper program.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 .gitignore                    |    2 +-
 tools/helpers/Makefile        |   10 ++++
 tools/helpers/xen-init-dom0.c |  120 +++++++++++++++++++++++++++++++++++++++++
 tools/libxl/Makefile          |   14 +----
 tools/libxl/xen-init-dom0.c   |  120 -----------------------------------------
 5 files changed, 134 insertions(+), 132 deletions(-)

diff --git a/.gitignore b/.gitignore
index 01d3305..141c2be 100644
--- a/.gitignore
+++ b/.gitignore
@@ -134,6 +134,7 @@ tools/flask/utils/flask-setenforce
 tools/flask/utils/flask-set-bool
 tools/flask/utils/flask-label-pci
 tools/helpers/init-xenstore-domain
+tools/helpers/xen-init-dom0
 tools/hotplug/common/hotplugpath.sh
 tools/hotplug/FreeBSD/rc.d/xencommons
 tools/hotplug/FreeBSD/rc.d/xendriverdomain
@@ -301,7 +302,6 @@ tools/libxl/*.pyc
 tools/libxl/libxl-save-helper
 tools/libxl/test_timedereg
 tools/libxl/test_fdderegrace
-tools/libxl/xen-init-dom0
 tools/blktap2/control/tap-ctl
 tools/firmware/etherboot/eb-roms.h
 tools/firmware/etherboot/gpxe-git-snapshot.tar.gz
diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index 52347fd..826e0ed 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -5,10 +5,16 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
+PROGS += xen-init-dom0
 ifeq ($(CONFIG_Linux),y)
 PROGS += init-xenstore-domain
 endif
 
+XEN_INIT_DOM0_OBJS = xen-init-dom0.o
+$(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
+$(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
+$(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenlight)
+
 INIT_XENSTORE_DOMAIN_OBJS = init-xenstore-domain.o
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenguest)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
@@ -17,12 +23,16 @@ $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 .PHONY: all
 all: $(PROGS)
 
+xen-init-dom0: $(XEN_INIT_DOM0_OBJS)
+	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
+
 init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
 	$(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
 
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) xen-init-dom0 $(DESTDIR)$(LIBEXEC_BIN)
 ifeq ($(CONFIG_Linux),y)
 	$(INSTALL_PROG) init-xenstore-domain $(DESTDIR)$(LIBEXEC_BIN)
 endif
diff --git a/tools/helpers/xen-init-dom0.c b/tools/helpers/xen-init-dom0.c
new file mode 100644
index 0000000..2f7aa7c
--- /dev/null
+++ b/tools/helpers/xen-init-dom0.c
@@ -0,0 +1,120 @@
+#include <err.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <xentoollog.h>
+#include <xenstore.h>
+#include <libxl.h>
+
+#define DOMNAME_PATH   "/local/domain/0/name"
+#define DOMID_PATH     "/local/domain/0/domid"
+
+static libxl_ctx *ctx;
+static xentoollog_logger_stdiostream *logger;
+static struct xs_handle *xsh;
+
+static void ctx_alloc(void)
+{
+    if (libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0,
+                        (xentoollog_logger *)logger)) {
+        fprintf(stderr, "cannot init libxl context\n");
+        exit(1);
+    }
+    xsh = xs_open(0);
+    if (!xsh) {
+        fprintf(stderr, "cannot open xenstore connection\n");
+        exit(1);
+    }
+}
+
+static void ctx_free(void)
+{
+    if (ctx) {
+        libxl_ctx_free(ctx);
+        ctx = NULL;
+    }
+    if (logger) {
+        xtl_logger_destroy((xentoollog_logger *)logger);
+        logger = NULL;
+    }
+    if (xsh) {
+        xs_close(xsh);
+        xsh = NULL;
+    }
+}
+
+int main(int argc, char **argv)
+{
+    int rc;
+    libxl_domain_config dom0_config;
+    char *domname_string = NULL, *domid_string = NULL;
+    char *json = NULL;;
+
+    logger = xtl_createlogger_stdiostream(stderr, XTL_ERROR, 0);
+    if (!logger) exit(1);
+
+    atexit(ctx_free);
+
+    ctx_alloc();
+
+    libxl_domain_config_init(&dom0_config);
+
+    /* Sanity check: this program can only be run once. */
+    domid_string = xs_read(xsh, XBT_NULL, DOMID_PATH, NULL);
+    domname_string = xs_read(xsh, XBT_NULL, DOMNAME_PATH, NULL);
+    if (domid_string && domname_string) {
+        fprintf(stderr, "Dom0 is already set up\n");
+        rc = 0;
+        goto out;
+    }
+
+    /* Generate stub JSON config. */
+    dom0_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
+    libxl_domain_build_info_init_type(&dom0_config.b_info,
+                                      LIBXL_DOMAIN_TYPE_PV);
+
+    json = libxl_domain_config_to_json(ctx, &dom0_config);
+    /* libxl-json format requires the string ends with '\0'. Code
+     * snippet taken from libxl.
+     */
+    rc = libxl_userdata_store(ctx, 0, "libxl-json",
+                              (const uint8_t *)json,
+                              strlen(json) + 1 /* include '\0' */);
+    if (rc) {
+        fprintf(stderr, "cannot store stub json config for Dom0\n");
+        goto out;
+    }
+
+    /* Write xenstore entries. */
+    if (!xs_write(xsh, XBT_NULL, DOMID_PATH, "0", strlen("0"))) {
+        fprintf(stderr, "cannot set domid for Dom0\n");
+        rc = 1;
+        goto out;
+    }
+
+    if (!xs_write(xsh, XBT_NULL, DOMNAME_PATH, "Domain-0",
+                  strlen("Domain-0"))) {
+        fprintf(stderr, "cannot set domain name for Dom0\n");
+        rc = 1;
+        goto out;
+    }
+
+    printf("Done setting up Dom0\n");
+
+out:
+    libxl_domain_config_dispose(&dom0_config);
+    free(domid_string);
+    free(domname_string);
+    free(json);
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 2abae0c..b0cb9e4 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -143,7 +143,7 @@ LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_l.o libxlu_cfg.o \
 	libxlu_disk_l.o libxlu_disk.o libxlu_vif.o libxlu_pci.o
 $(LIBXLU_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
 
-CLIENTS = xl testidl libxl-save-helper xen-init-dom0
+CLIENTS = xl testidl libxl-save-helper
 
 CFLAGS_XL += $(CFLAGS_libxenlight)
 CFLAGS_XL += -Wshadow
@@ -154,10 +154,6 @@ $(XL_OBJS) $(TEST_PROG_OBJS) _libxl.api-for-check: \
 $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
 $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
 
-XEN_INIT_DOM0_OBJS = xen-init-dom0.o
-$(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
-$(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
-
 SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
 $(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
 
@@ -174,7 +170,7 @@ all: $(CLIENTS) $(TEST_PROGS) $(PKG_CONFIG) \
 	$(AUTOSRCS) $(AUTOINCS)
 
 $(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS) \
-		$(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS) $(XEN_INIT_DOM0_OBJS): \
+		$(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): \
 	$(AUTOINCS) libxl.api-ok
 
 %.c %.h:: %.y
@@ -215,7 +211,7 @@ libxl_internal_json.h: _libxl_types_internal_json.h
 xl.h: _paths.h
 
 $(LIBXL_OBJS) $(LIBXL_TEST_OBJS) $(LIBXLU_OBJS) \
-	$(XL_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS) $(XEN_INIT_DOM0_OBJS): libxl.h
+	$(XL_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): libxl.h
 $(LIBXL_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h
 
 _libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py
@@ -256,9 +252,6 @@ libxlutil.a: $(LIBXLU_OBJS)
 xl: $(XL_OBJS) libxlutil.so libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
 
-xen-init-dom0: $(XEN_INIT_DOM0_OBJS) libxenlight.so
-	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
-
 test_%: test_%.o test_common.o libxlutil.so libxenlight_test.so
 	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
 
@@ -281,7 +274,6 @@ install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/pkgconfig
 	$(INSTALL_PROG) xl $(DESTDIR)$(sbindir)
-	$(INSTALL_PROG) xen-init-dom0 $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenlight.so.$(MAJOR)
diff --git a/tools/libxl/xen-init-dom0.c b/tools/libxl/xen-init-dom0.c
deleted file mode 100644
index 7925d64..0000000
--- a/tools/libxl/xen-init-dom0.c
+++ /dev/null
@@ -1,120 +0,0 @@
-#include <err.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <xenctrl.h>
-#include <xenstore.h>
-#include <libxl.h>
-
-#define DOMNAME_PATH   "/local/domain/0/name"
-#define DOMID_PATH     "/local/domain/0/domid"
-
-static libxl_ctx *ctx;
-static xentoollog_logger_stdiostream *logger;
-static struct xs_handle *xsh;
-
-static void ctx_alloc(void)
-{
-    if (libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0,
-                        (xentoollog_logger *)logger)) {
-        fprintf(stderr, "cannot init libxl context\n");
-        exit(1);
-    }
-    xsh = xs_open(0);
-    if (!xsh) {
-        fprintf(stderr, "cannot open xenstore connection\n");
-        exit(1);
-    }
-}
-
-static void ctx_free(void)
-{
-    if (ctx) {
-        libxl_ctx_free(ctx);
-        ctx = NULL;
-    }
-    if (logger) {
-        xtl_logger_destroy((xentoollog_logger *)logger);
-        logger = NULL;
-    }
-    if (xsh) {
-        xs_close(xsh);
-        xsh = NULL;
-    }
-}
-
-int main(int argc, char **argv)
-{
-    int rc;
-    libxl_domain_config dom0_config;
-    char *domname_string = NULL, *domid_string = NULL;
-    char *json = NULL;;
-
-    logger = xtl_createlogger_stdiostream(stderr, XTL_ERROR, 0);
-    if (!logger) exit(1);
-
-    atexit(ctx_free);
-
-    ctx_alloc();
-
-    libxl_domain_config_init(&dom0_config);
-
-    /* Sanity check: this program can only be run once. */
-    domid_string = xs_read(xsh, XBT_NULL, DOMID_PATH, NULL);
-    domname_string = xs_read(xsh, XBT_NULL, DOMNAME_PATH, NULL);
-    if (domid_string && domname_string) {
-        fprintf(stderr, "Dom0 is already set up\n");
-        rc = 0;
-        goto out;
-    }
-
-    /* Generate stub JSON config. */
-    dom0_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
-    libxl_domain_build_info_init_type(&dom0_config.b_info,
-                                      LIBXL_DOMAIN_TYPE_PV);
-
-    json = libxl_domain_config_to_json(ctx, &dom0_config);
-    /* libxl-json format requires the string ends with '\0'. Code
-     * snippet taken from libxl.
-     */
-    rc = libxl_userdata_store(ctx, 0, "libxl-json",
-                              (const uint8_t *)json,
-                              strlen(json) + 1 /* include '\0' */);
-    if (rc) {
-        fprintf(stderr, "cannot store stub json config for Dom0\n");
-        goto out;
-    }
-
-    /* Write xenstore entries. */
-    if (!xs_write(xsh, XBT_NULL, DOMID_PATH, "0", strlen("0"))) {
-        fprintf(stderr, "cannot set domid for Dom0\n");
-        rc = 1;
-        goto out;
-    }
-
-    if (!xs_write(xsh, XBT_NULL, DOMNAME_PATH, "Domain-0",
-                  strlen("Domain-0"))) {
-        fprintf(stderr, "cannot set domain name for Dom0\n");
-        rc = 1;
-        goto out;
-    }
-
-    printf("Done setting up Dom0\n");
-
-out:
-    libxl_domain_config_dispose(&dom0_config);
-    free(domid_string);
-    free(domname_string);
-    free(json);
-    return rc;
-}
-
-/*
- * Local variables:
- * mode: C
- * 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 Jan 21 17:07:14 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:07: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 1aMIhW-0008ER-2y; Thu, 21 Jan 2016 17:07: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 1aMIhU-0008E0-7Y
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:12 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	6B/69-24494-F3011A65; Thu, 21 Jan 2016 17:07:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1453396030!17373448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12830 invoked from network); 21 Jan 2016 17:07:10 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:07:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIi5-0008W0-SD
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhR-0005C3-QR
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:09 +0000
Date: Thu, 21 Jan 2016 17:07:09 +0000
Message-Id: <E1aMIhR-0005C3-QR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: destroy xenstore domain in
	case of error after creating 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 80a6904bdb8644c17963e709d6093190511127ac
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:56 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:20 2016 +0000

    xenstore: destroy xenstore domain in case of error after creating it
    
    When creating a xenstore domain via init-xenstore-domain destroy it
    in case of an error occurred after calling xc_domain_create().
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/helpers/init-xenstore-domain.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 9c47af1..a9c5821 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -11,7 +11,7 @@
 #include <xenstore.h>
 #include <xen/sys/xenbus_dev.h>
 
-static uint32_t domid = -1;
+static uint32_t domid = ~0;
 
 static int build(xc_interface *xch, int argc, char** argv)
 {
@@ -94,6 +94,8 @@ static int build(xc_interface *xch, int argc, char** argv)
 err:
     if ( dom )
         xc_dom_release(dom);
+    if ( domid != ~0 )
+        xc_domain_destroy(xch, domid);
     close(xs_fd);
     return rv;
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:07:14 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:07: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 1aMIhW-0008ER-2y; Thu, 21 Jan 2016 17:07: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 1aMIhU-0008E0-7Y
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:12 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	6B/69-24494-F3011A65; Thu, 21 Jan 2016 17:07:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1453396030!17373448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12830 invoked from network); 21 Jan 2016 17:07:10 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:07:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIi5-0008W0-SD
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhR-0005C3-QR
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:09 +0000
Date: Thu, 21 Jan 2016 17:07:09 +0000
Message-Id: <E1aMIhR-0005C3-QR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: destroy xenstore domain in
	case of error after creating 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 80a6904bdb8644c17963e709d6093190511127ac
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:56 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:20 2016 +0000

    xenstore: destroy xenstore domain in case of error after creating it
    
    When creating a xenstore domain via init-xenstore-domain destroy it
    in case of an error occurred after calling xc_domain_create().
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/helpers/init-xenstore-domain.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 9c47af1..a9c5821 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -11,7 +11,7 @@
 #include <xenstore.h>
 #include <xen/sys/xenbus_dev.h>
 
-static uint32_t domid = -1;
+static uint32_t domid = ~0;
 
 static int build(xc_interface *xch, int argc, char** argv)
 {
@@ -94,6 +94,8 @@ static int build(xc_interface *xch, int argc, char** argv)
 err:
     if ( dom )
         xc_dom_release(dom);
+    if ( domid != ~0 )
+        xc_domain_destroy(xch, domid);
     close(xs_fd);
     return rv;
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:07:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:07: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 1aMIhg-0008GF-7T; Thu, 21 Jan 2016 17:07: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 1aMIhe-0008G0-QB
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:22 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	6F/83-12889-A4011A65; Thu, 21 Jan 2016 17:07:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1453396040!18514567!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19212 invoked from network); 21 Jan 2016 17:07:21 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:07:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIiG-000054-5k
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhc-0005CT-4T
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:20 +0000
Date: Thu, 21 Jan 2016 17:07:20 +0000
Message-Id: <E1aMIhc-0005CT-4T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: add error messages to
	init-xenstore-domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit befd991a360da2b18226a96c2a1c3c09e0a6577f
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:57 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:20 2016 +0000

    xenstore: add error messages to init-xenstore-domain
    
    Additional add some diagnostic messages to the program to have an idea
    why it failed.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/helpers/init-xenstore-domain.c |   66 ++++++++++++++++++++++++++++++++-
 1 files changed, 64 insertions(+), 2 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index a9c5821..124f29c 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -10,6 +10,7 @@
 #include <xc_dom.h>
 #include <xenstore.h>
 #include <xen/sys/xenbus_dev.h>
+#include <xen-xsm/flask/flask.h>
 
 static uint32_t domid = ~0;
 
@@ -25,69 +26,120 @@ static int build(xc_interface *xch, int argc, char** argv)
 
     xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
     if ( xs_fd == -1 )
+    {
+        fprintf(stderr, "Could not open /dev/xen/xenbus_backend\n");
         return -1;
+    }
 
     rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
     if ( rv )
+    {
+        fprintf(stderr, "xc_flask_context_to_sid failed\n");
         goto err;
+    }
     rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
     if ( rv )
+    {
+        fprintf(stderr, "xc_domain_create failed\n");
         goto err;
+    }
     rv = xc_domain_max_vcpus(xch, domid, 1);
     if ( rv )
+    {
+        fprintf(stderr, "xc_domain_max_vcpus failed\n");
         goto err;
+    }
     rv = xc_domain_setmaxmem(xch, domid, limit_kb);
     if ( rv )
+    {
+        fprintf(stderr, "xc_domain_setmaxmem failed\n");
         goto err;
+    }
     rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
     if ( rv )
+    {
+        fprintf(stderr, "xc_domain_set_memmap_limit failed\n");
         goto err;
+    }
 
     rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
     if ( rv < 0 )
+    {
+        fprintf(stderr, "Xenbus setup ioctl failed\n");
         goto err;
+    }
     snprintf(cmdline, 512, "--event %d --internal-db", rv);
 
     dom = xc_dom_allocate(xch, cmdline, NULL);
     rv = xc_dom_kernel_file(dom, argv[1]);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_kernel_file failed\n");
         goto err;
+    }
 
     if ( argc > 4 )
     {
         rv = xc_dom_ramdisk_file(dom, argv[4]);
         if ( rv )
+        {
+            fprintf(stderr, "xc_dom_ramdisk_file failed\n");
             goto err;
+        }
     }
 
     rv = xc_dom_boot_xen_init(dom, xch, domid);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_boot_xen_init failed\n");
         goto err;
+    }
     rv = xc_dom_parse_image(dom);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_parse_image failed\n");
         goto err;
+    }
     rv = xc_dom_mem_init(dom, maxmem);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_mem_init failed\n");
         goto err;
+    }
     rv = xc_dom_boot_mem_init(dom);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_boot_mem_init failed\n");
         goto err;
+    }
     rv = xc_dom_build_image(dom);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_build_image failed\n");
         goto err;
+    }
     rv = xc_dom_boot_image(dom);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_boot_image failed\n");
         goto err;
+    }
 
     xc_dom_release(dom);
     dom = NULL;
 
     rv = xc_domain_set_virq_handler(xch, domid, VIRQ_DOM_EXC);
     if ( rv )
+    {
+        fprintf(stderr, "xc_domain_set_virq_handler failed\n");
         goto err;
+    }
     rv = xc_domain_unpause(xch, domid);
     if ( rv )
+    {
+        fprintf(stderr, "xc_domain_unpause failed\n");
         goto err;
+    }
 
     return 0;
 
@@ -109,14 +161,18 @@ int main(int argc, char** argv)
 
     if ( argc < 4 || argc > 5 )
     {
-        printf("Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n",
-               argv[0]);
+        fprintf(stderr,
+                "Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n",
+            argv[0]);
         return 2;
     }
 
     xch = xc_interface_open(NULL, NULL, 0);
     if ( !xch )
+    {
+        fprintf(stderr, "xc_interface_open() failed\n");
         return 1;
+    }
 
     rv = build(xch, argc, argv);
 
@@ -132,12 +188,18 @@ int main(int argc, char** argv)
 
     fd = creat("/var/run/xenstored.pid", 0666);
     if ( fd < 0 )
+    {
+        fprintf(stderr, "Creating /var/run/xenstored.pid failed\n");
         return 3;
+    }
     rv = snprintf(buf, 16, "domid:%d\n", domid);
     rv = write(fd, buf, rv);
     close(fd);
     if ( rv < 0 )
+    {
+        fprintf(stderr, "Writing domid to /var/run/xenstored.pid failed\n");
         return 3;
+    }
 
     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 Jan 21 17:07:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:07: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 1aMIhg-0008GF-7T; Thu, 21 Jan 2016 17:07: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 1aMIhe-0008G0-QB
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:22 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	6F/83-12889-A4011A65; Thu, 21 Jan 2016 17:07:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1453396040!18514567!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19212 invoked from network); 21 Jan 2016 17:07:21 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:07:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIiG-000054-5k
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhc-0005CT-4T
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:20 +0000
Date: Thu, 21 Jan 2016 17:07:20 +0000
Message-Id: <E1aMIhc-0005CT-4T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: add error messages to
	init-xenstore-domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit befd991a360da2b18226a96c2a1c3c09e0a6577f
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:57 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:20 2016 +0000

    xenstore: add error messages to init-xenstore-domain
    
    Additional add some diagnostic messages to the program to have an idea
    why it failed.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/helpers/init-xenstore-domain.c |   66 ++++++++++++++++++++++++++++++++-
 1 files changed, 64 insertions(+), 2 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index a9c5821..124f29c 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -10,6 +10,7 @@
 #include <xc_dom.h>
 #include <xenstore.h>
 #include <xen/sys/xenbus_dev.h>
+#include <xen-xsm/flask/flask.h>
 
 static uint32_t domid = ~0;
 
@@ -25,69 +26,120 @@ static int build(xc_interface *xch, int argc, char** argv)
 
     xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
     if ( xs_fd == -1 )
+    {
+        fprintf(stderr, "Could not open /dev/xen/xenbus_backend\n");
         return -1;
+    }
 
     rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
     if ( rv )
+    {
+        fprintf(stderr, "xc_flask_context_to_sid failed\n");
         goto err;
+    }
     rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
     if ( rv )
+    {
+        fprintf(stderr, "xc_domain_create failed\n");
         goto err;
+    }
     rv = xc_domain_max_vcpus(xch, domid, 1);
     if ( rv )
+    {
+        fprintf(stderr, "xc_domain_max_vcpus failed\n");
         goto err;
+    }
     rv = xc_domain_setmaxmem(xch, domid, limit_kb);
     if ( rv )
+    {
+        fprintf(stderr, "xc_domain_setmaxmem failed\n");
         goto err;
+    }
     rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
     if ( rv )
+    {
+        fprintf(stderr, "xc_domain_set_memmap_limit failed\n");
         goto err;
+    }
 
     rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
     if ( rv < 0 )
+    {
+        fprintf(stderr, "Xenbus setup ioctl failed\n");
         goto err;
+    }
     snprintf(cmdline, 512, "--event %d --internal-db", rv);
 
     dom = xc_dom_allocate(xch, cmdline, NULL);
     rv = xc_dom_kernel_file(dom, argv[1]);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_kernel_file failed\n");
         goto err;
+    }
 
     if ( argc > 4 )
     {
         rv = xc_dom_ramdisk_file(dom, argv[4]);
         if ( rv )
+        {
+            fprintf(stderr, "xc_dom_ramdisk_file failed\n");
             goto err;
+        }
     }
 
     rv = xc_dom_boot_xen_init(dom, xch, domid);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_boot_xen_init failed\n");
         goto err;
+    }
     rv = xc_dom_parse_image(dom);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_parse_image failed\n");
         goto err;
+    }
     rv = xc_dom_mem_init(dom, maxmem);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_mem_init failed\n");
         goto err;
+    }
     rv = xc_dom_boot_mem_init(dom);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_boot_mem_init failed\n");
         goto err;
+    }
     rv = xc_dom_build_image(dom);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_build_image failed\n");
         goto err;
+    }
     rv = xc_dom_boot_image(dom);
     if ( rv )
+    {
+        fprintf(stderr, "xc_dom_boot_image failed\n");
         goto err;
+    }
 
     xc_dom_release(dom);
     dom = NULL;
 
     rv = xc_domain_set_virq_handler(xch, domid, VIRQ_DOM_EXC);
     if ( rv )
+    {
+        fprintf(stderr, "xc_domain_set_virq_handler failed\n");
         goto err;
+    }
     rv = xc_domain_unpause(xch, domid);
     if ( rv )
+    {
+        fprintf(stderr, "xc_domain_unpause failed\n");
         goto err;
+    }
 
     return 0;
 
@@ -109,14 +161,18 @@ int main(int argc, char** argv)
 
     if ( argc < 4 || argc > 5 )
     {
-        printf("Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n",
-               argv[0]);
+        fprintf(stderr,
+                "Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n",
+            argv[0]);
         return 2;
     }
 
     xch = xc_interface_open(NULL, NULL, 0);
     if ( !xch )
+    {
+        fprintf(stderr, "xc_interface_open() failed\n");
         return 1;
+    }
 
     rv = build(xch, argc, argv);
 
@@ -132,12 +188,18 @@ int main(int argc, char** argv)
 
     fd = creat("/var/run/xenstored.pid", 0666);
     if ( fd < 0 )
+    {
+        fprintf(stderr, "Creating /var/run/xenstored.pid failed\n");
         return 3;
+    }
     rv = snprintf(buf, 16, "domid:%d\n", domid);
     rv = write(fd, buf, rv);
     close(fd);
     if ( rv < 0 )
+    {
+        fprintf(stderr, "Writing domid to /var/run/xenstored.pid failed\n");
         return 3;
+    }
 
     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 Jan 21 17:07:34 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:07: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 1aMIhq-0008IL-Gg; Thu, 21 Jan 2016 17:07: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 1aMIhp-0008I2-1Y
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:33 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	7B/7B-02499-45011A65; Thu, 21 Jan 2016 17:07:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1453396050!17357210!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60223 invoked from network); 21 Jan 2016 17:07:31 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:07:31 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIiQ-00005k-He
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhm-0005Cw-HG
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:30 +0000
Date: Thu, 21 Jan 2016 17:07:30 +0000
Message-Id: <E1aMIhm-0005Cw-HG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: modify init-xenstore-domain
	parameter syntax
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d873eeb39949ec69fa92b10752226f2309c74157
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:58 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:20 2016 +0000

    xenstore: modify init-xenstore-domain parameter syntax
    
    init-xenstore-domain takes only positional parameters today. Change
    this to a more flexible parameter syntax allowing to specify additional
    options or to omit some.
    
    Today the supported usage is:
    
    init-xenstore-domain <xenstore-kernel> <memory_mb> <flask-label>
                         [<ramdisk-file>]
    
    Modify this to:
    
    init-xenstore-domain --kernel <xenstore-kernel>
                         --memory <memory_mb>
                         [--flask <flask-label>]
                         [--ramdisk <ramdisk-file>]
    
    The flask label is made optional in order to support xenstore domains
    without the need of a flask enabled hypervisor.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/helpers/init-xenstore-domain.c |   87 +++++++++++++++++++++++++++------
 1 files changed, 71 insertions(+), 16 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 124f29c..ff9968f 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -4,6 +4,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <stdlib.h>
+#include <getopt.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 #include <xenctrl.h>
@@ -13,16 +14,42 @@
 #include <xen-xsm/flask/flask.h>
 
 static uint32_t domid = ~0;
+static char *kernel;
+static char *ramdisk;
+static char *flask;
+static int memory;
 
-static int build(xc_interface *xch, int argc, char** argv)
+static struct option options[] = {
+    { "kernel", 1, NULL, 'k' },
+    { "memory", 1, NULL, 'm' },
+    { "flask", 1, NULL, 'f' },
+    { "ramdisk", 1, NULL, 'r' },
+    { NULL, 0, NULL, 0 }
+};
+
+static void usage(void)
+{
+    fprintf(stderr,
+"Usage:\n"
+"\n"
+"init-xenstore-domain <options>\n"
+"\n"
+"where options may include:\n"
+"\n"
+"  --kernel <xenstore-kernel> kernel file of the xenstore domain, mandatory\n"
+"  --memory <memory size>     size of the domain in MB, mandatory\n"
+"  --flask <flask-label>      optional flask label of the domain\n"
+"  --ramdisk <ramdisk-file>   optional ramdisk file for the domain\n");
+}
+
+static int build(xc_interface *xch)
 {
     char cmdline[512];
     uint32_t ssid;
     xen_domain_handle_t handle = { 0 };
     int rv, xs_fd;
     struct xc_dom_image *dom = NULL;
-    int maxmem = atoi(argv[2]);
-    int limit_kb = (maxmem + 1) * 1024;
+    int limit_kb = (memory + 1) * 1024;
 
     xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
     if ( xs_fd == -1 )
@@ -31,11 +58,18 @@ static int build(xc_interface *xch, int argc, char** argv)
         return -1;
     }
 
-    rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
-    if ( rv )
+    if ( flask )
     {
-        fprintf(stderr, "xc_flask_context_to_sid failed\n");
-        goto err;
+        rv = xc_flask_context_to_sid(xch, flask, strlen(flask), &ssid);
+        if ( rv )
+        {
+            fprintf(stderr, "xc_flask_context_to_sid failed\n");
+            goto err;
+        }
+    }
+    else
+    {
+        ssid = SECINITSID_DOMU;
     }
     rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
     if ( rv )
@@ -71,16 +105,16 @@ static int build(xc_interface *xch, int argc, char** argv)
     snprintf(cmdline, 512, "--event %d --internal-db", rv);
 
     dom = xc_dom_allocate(xch, cmdline, NULL);
-    rv = xc_dom_kernel_file(dom, argv[1]);
+    rv = xc_dom_kernel_file(dom, kernel);
     if ( rv )
     {
         fprintf(stderr, "xc_dom_kernel_file failed\n");
         goto err;
     }
 
-    if ( argc > 4 )
+    if ( ramdisk )
     {
-        rv = xc_dom_ramdisk_file(dom, argv[4]);
+        rv = xc_dom_ramdisk_file(dom, ramdisk);
         if ( rv )
         {
             fprintf(stderr, "xc_dom_ramdisk_file failed\n");
@@ -100,7 +134,7 @@ static int build(xc_interface *xch, int argc, char** argv)
         fprintf(stderr, "xc_dom_parse_image failed\n");
         goto err;
     }
-    rv = xc_dom_mem_init(dom, maxmem);
+    rv = xc_dom_mem_init(dom, memory);
     if ( rv )
     {
         fprintf(stderr, "xc_dom_mem_init failed\n");
@@ -154,16 +188,37 @@ err:
 
 int main(int argc, char** argv)
 {
+    int opt;
     xc_interface *xch;
     struct xs_handle *xsh;
     char buf[16];
     int rv, fd;
 
-    if ( argc < 4 || argc > 5 )
+    while ( (opt = getopt_long(argc, argv, "", options, NULL)) != -1 )
+    {
+        switch ( opt )
+        {
+        case 'k':
+            kernel = optarg;
+            break;
+        case 'm':
+            memory = strtol(optarg, NULL, 10);
+            break;
+        case 'f':
+            flask = optarg;
+            break;
+        case 'r':
+            ramdisk = optarg;
+            break;
+        default:
+            usage();
+            return 2;
+        }
+    }
+
+    if ( optind != argc || !kernel || !memory )
     {
-        fprintf(stderr,
-                "Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n",
-            argv[0]);
+        usage();
         return 2;
     }
 
@@ -174,7 +229,7 @@ int main(int argc, char** argv)
         return 1;
     }
 
-    rv = build(xch, argc, argv);
+    rv = build(xch);
 
     xc_interface_close(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 Jan 21 17:07:34 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:07: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 1aMIhq-0008IL-Gg; Thu, 21 Jan 2016 17:07: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 1aMIhp-0008I2-1Y
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:33 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	7B/7B-02499-45011A65; Thu, 21 Jan 2016 17:07:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1453396050!17357210!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60223 invoked from network); 21 Jan 2016 17:07:31 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:07:31 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIiQ-00005k-He
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhm-0005Cw-HG
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:30 +0000
Date: Thu, 21 Jan 2016 17:07:30 +0000
Message-Id: <E1aMIhm-0005Cw-HG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: modify init-xenstore-domain
	parameter syntax
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d873eeb39949ec69fa92b10752226f2309c74157
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:58 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:20 2016 +0000

    xenstore: modify init-xenstore-domain parameter syntax
    
    init-xenstore-domain takes only positional parameters today. Change
    this to a more flexible parameter syntax allowing to specify additional
    options or to omit some.
    
    Today the supported usage is:
    
    init-xenstore-domain <xenstore-kernel> <memory_mb> <flask-label>
                         [<ramdisk-file>]
    
    Modify this to:
    
    init-xenstore-domain --kernel <xenstore-kernel>
                         --memory <memory_mb>
                         [--flask <flask-label>]
                         [--ramdisk <ramdisk-file>]
    
    The flask label is made optional in order to support xenstore domains
    without the need of a flask enabled hypervisor.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/helpers/init-xenstore-domain.c |   87 +++++++++++++++++++++++++++------
 1 files changed, 71 insertions(+), 16 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 124f29c..ff9968f 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -4,6 +4,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <stdlib.h>
+#include <getopt.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 #include <xenctrl.h>
@@ -13,16 +14,42 @@
 #include <xen-xsm/flask/flask.h>
 
 static uint32_t domid = ~0;
+static char *kernel;
+static char *ramdisk;
+static char *flask;
+static int memory;
 
-static int build(xc_interface *xch, int argc, char** argv)
+static struct option options[] = {
+    { "kernel", 1, NULL, 'k' },
+    { "memory", 1, NULL, 'm' },
+    { "flask", 1, NULL, 'f' },
+    { "ramdisk", 1, NULL, 'r' },
+    { NULL, 0, NULL, 0 }
+};
+
+static void usage(void)
+{
+    fprintf(stderr,
+"Usage:\n"
+"\n"
+"init-xenstore-domain <options>\n"
+"\n"
+"where options may include:\n"
+"\n"
+"  --kernel <xenstore-kernel> kernel file of the xenstore domain, mandatory\n"
+"  --memory <memory size>     size of the domain in MB, mandatory\n"
+"  --flask <flask-label>      optional flask label of the domain\n"
+"  --ramdisk <ramdisk-file>   optional ramdisk file for the domain\n");
+}
+
+static int build(xc_interface *xch)
 {
     char cmdline[512];
     uint32_t ssid;
     xen_domain_handle_t handle = { 0 };
     int rv, xs_fd;
     struct xc_dom_image *dom = NULL;
-    int maxmem = atoi(argv[2]);
-    int limit_kb = (maxmem + 1) * 1024;
+    int limit_kb = (memory + 1) * 1024;
 
     xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
     if ( xs_fd == -1 )
@@ -31,11 +58,18 @@ static int build(xc_interface *xch, int argc, char** argv)
         return -1;
     }
 
-    rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
-    if ( rv )
+    if ( flask )
     {
-        fprintf(stderr, "xc_flask_context_to_sid failed\n");
-        goto err;
+        rv = xc_flask_context_to_sid(xch, flask, strlen(flask), &ssid);
+        if ( rv )
+        {
+            fprintf(stderr, "xc_flask_context_to_sid failed\n");
+            goto err;
+        }
+    }
+    else
+    {
+        ssid = SECINITSID_DOMU;
     }
     rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
     if ( rv )
@@ -71,16 +105,16 @@ static int build(xc_interface *xch, int argc, char** argv)
     snprintf(cmdline, 512, "--event %d --internal-db", rv);
 
     dom = xc_dom_allocate(xch, cmdline, NULL);
-    rv = xc_dom_kernel_file(dom, argv[1]);
+    rv = xc_dom_kernel_file(dom, kernel);
     if ( rv )
     {
         fprintf(stderr, "xc_dom_kernel_file failed\n");
         goto err;
     }
 
-    if ( argc > 4 )
+    if ( ramdisk )
     {
-        rv = xc_dom_ramdisk_file(dom, argv[4]);
+        rv = xc_dom_ramdisk_file(dom, ramdisk);
         if ( rv )
         {
             fprintf(stderr, "xc_dom_ramdisk_file failed\n");
@@ -100,7 +134,7 @@ static int build(xc_interface *xch, int argc, char** argv)
         fprintf(stderr, "xc_dom_parse_image failed\n");
         goto err;
     }
-    rv = xc_dom_mem_init(dom, maxmem);
+    rv = xc_dom_mem_init(dom, memory);
     if ( rv )
     {
         fprintf(stderr, "xc_dom_mem_init failed\n");
@@ -154,16 +188,37 @@ err:
 
 int main(int argc, char** argv)
 {
+    int opt;
     xc_interface *xch;
     struct xs_handle *xsh;
     char buf[16];
     int rv, fd;
 
-    if ( argc < 4 || argc > 5 )
+    while ( (opt = getopt_long(argc, argv, "", options, NULL)) != -1 )
+    {
+        switch ( opt )
+        {
+        case 'k':
+            kernel = optarg;
+            break;
+        case 'm':
+            memory = strtol(optarg, NULL, 10);
+            break;
+        case 'f':
+            flask = optarg;
+            break;
+        case 'r':
+            ramdisk = optarg;
+            break;
+        default:
+            usage();
+            return 2;
+        }
+    }
+
+    if ( optind != argc || !kernel || !memory )
     {
-        fprintf(stderr,
-                "Use: %s <xenstore-kernel> <memory_mb> <flask-label> [<ramdisk-file>]\n",
-            argv[0]);
+        usage();
         return 2;
     }
 
@@ -174,7 +229,7 @@ int main(int argc, char** argv)
         return 1;
     }
 
-    rv = build(xch, argc, argv);
+    rv = build(xch);
 
     xc_interface_close(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 Jan 21 17:07:44 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:07: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 1aMIi0-0008Jo-KL; Thu, 21 Jan 2016 17:07:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhz-0008JV-5z
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:43 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	99/2D-09570-E5011A65; Thu, 21 Jan 2016 17:07:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1453396061!17341168!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62091 invoked from network); 21 Jan 2016 17:07:41 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:07:41 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIia-00005s-QS
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhw-0005E5-Qv
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:40 +0000
Date: Thu, 21 Jan 2016 17:07:40 +0000
Message-Id: <E1aMIhw-0005E5-Qv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: make use of the "xenstore
	domain" flag
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4a30094c0630cbce06ca8b0d1bc58c90bb384497
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:59 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:20 2016 +0000

    xenstore: make use of the "xenstore domain" flag
    
    Create the xenstore domain with the xenstore flag specified. This
    enables us to test whether such a domain is already running before
    we create it. As there ought to be only one xenstore in the system
    we don't need to start another one.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/helpers/init-xenstore-domain.c |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index ff9968f..ecced04 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -71,7 +71,8 @@ static int build(xc_interface *xch)
     {
         ssid = SECINITSID_DOMU;
     }
-    rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
+    rv = xc_domain_create(xch, ssid, handle, XEN_DOMCTL_CDF_xs_domain,
+                          &domid, NULL);
     if ( rv )
     {
         fprintf(stderr, "xc_domain_create failed\n");
@@ -186,6 +187,28 @@ err:
     return rv;
 }
 
+static int check_domain(xc_interface *xch)
+{
+    xc_dominfo_t info;
+    uint32_t dom;
+    int ret;
+
+    dom = 1;
+    while ( (ret = xc_domain_getinfo(xch, dom, 1, &info)) == 1 )
+    {
+        if ( info.xenstore )
+            return 1;
+        dom = info.domid + 1;
+    }
+    if ( ret < 0 && errno != ESRCH )
+    {
+        fprintf(stderr, "xc_domain_getinfo failed\n");
+        return ret;
+    }
+
+    return 0;
+}
+
 int main(int argc, char** argv)
 {
     int opt;
@@ -229,7 +252,12 @@ int main(int argc, char** argv)
         return 1;
     }
 
-    rv = build(xch);
+    rv = check_domain(xch);
+
+    if ( !rv )
+        rv = build(xch);
+    else if ( rv > 0 )
+        fprintf(stderr, "xenstore domain already present.\n");
 
     xc_interface_close(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 Jan 21 17:07:44 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:07: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 1aMIi0-0008Jo-KL; Thu, 21 Jan 2016 17:07:44 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhz-0008JV-5z
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:43 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	99/2D-09570-E5011A65; Thu, 21 Jan 2016 17:07:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1453396061!17341168!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62091 invoked from network); 21 Jan 2016 17:07:41 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:07:41 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIia-00005s-QS
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIhw-0005E5-Qv
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:40 +0000
Date: Thu, 21 Jan 2016 17:07:40 +0000
Message-Id: <E1aMIhw-0005E5-Qv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: make use of the "xenstore
	domain" flag
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4a30094c0630cbce06ca8b0d1bc58c90bb384497
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:03:59 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:20 2016 +0000

    xenstore: make use of the "xenstore domain" flag
    
    Create the xenstore domain with the xenstore flag specified. This
    enables us to test whether such a domain is already running before
    we create it. As there ought to be only one xenstore in the system
    we don't need to start another one.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/helpers/init-xenstore-domain.c |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index ff9968f..ecced04 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -71,7 +71,8 @@ static int build(xc_interface *xch)
     {
         ssid = SECINITSID_DOMU;
     }
-    rv = xc_domain_create(xch, ssid, handle, 0, &domid, NULL);
+    rv = xc_domain_create(xch, ssid, handle, XEN_DOMCTL_CDF_xs_domain,
+                          &domid, NULL);
     if ( rv )
     {
         fprintf(stderr, "xc_domain_create failed\n");
@@ -186,6 +187,28 @@ err:
     return rv;
 }
 
+static int check_domain(xc_interface *xch)
+{
+    xc_dominfo_t info;
+    uint32_t dom;
+    int ret;
+
+    dom = 1;
+    while ( (ret = xc_domain_getinfo(xch, dom, 1, &info)) == 1 )
+    {
+        if ( info.xenstore )
+            return 1;
+        dom = info.domid + 1;
+    }
+    if ( ret < 0 && errno != ESRCH )
+    {
+        fprintf(stderr, "xc_domain_getinfo failed\n");
+        return ret;
+    }
+
+    return 0;
+}
+
 int main(int argc, char** argv)
 {
     int opt;
@@ -229,7 +252,12 @@ int main(int argc, char** argv)
         return 1;
     }
 
-    rv = build(xch);
+    rv = check_domain(xch);
+
+    if ( !rv )
+        rv = build(xch);
+    else if ( rv > 0 )
+        fprintf(stderr, "xenstore domain already present.\n");
 
     xc_interface_close(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 Jan 21 17:07:56 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:07: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 1aMIiB-0008MH-Ql; Thu, 21 Jan 2016 17:07: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 1aMIi9-0008Lw-PS
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:53 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	DB/05-09708-86011A65; Thu, 21 Jan 2016 17:07:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1453396071!7015301!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57274 invoked from network); 21 Jan 2016 17:07:52 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:07:52 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIil-000066-8q
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIi7-0005Ef-2L
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:51 +0000
Date: Thu, 21 Jan 2016 17:07:51 +0000
Message-Id: <E1aMIi7-0005Ef-2L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: add init-xenstore-domain
	parameter to specify cmdline
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83c365e6395f39c7ff91785b400682173d5e5d04
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:04:00 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:21 2016 +0000

    xenstore: add init-xenstore-domain parameter to specify cmdline
    
    Add a parameter to init-xenstore-domain for support of arbitrary
    parameters for the xenstore domain.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/helpers/init-xenstore-domain.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index ecced04..238007b 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -17,6 +17,7 @@ static uint32_t domid = ~0;
 static char *kernel;
 static char *ramdisk;
 static char *flask;
+static char *param;
 static int memory;
 
 static struct option options[] = {
@@ -24,6 +25,7 @@ static struct option options[] = {
     { "memory", 1, NULL, 'm' },
     { "flask", 1, NULL, 'f' },
     { "ramdisk", 1, NULL, 'r' },
+    { "param", 1, NULL, 'p' },
     { NULL, 0, NULL, 0 }
 };
 
@@ -39,7 +41,8 @@ static void usage(void)
 "  --kernel <xenstore-kernel> kernel file of the xenstore domain, mandatory\n"
 "  --memory <memory size>     size of the domain in MB, mandatory\n"
 "  --flask <flask-label>      optional flask label of the domain\n"
-"  --ramdisk <ramdisk-file>   optional ramdisk file for the domain\n");
+"  --ramdisk <ramdisk-file>   optional ramdisk file for the domain\n"
+"  --param <cmdline>          optional additional parameters for the domain\n");
 }
 
 static int build(xc_interface *xch)
@@ -103,7 +106,11 @@ static int build(xc_interface *xch)
         fprintf(stderr, "Xenbus setup ioctl failed\n");
         goto err;
     }
-    snprintf(cmdline, 512, "--event %d --internal-db", rv);
+
+    if ( param )
+        snprintf(cmdline, 512, "--event %d --internal-db %s", rv, param);
+    else
+        snprintf(cmdline, 512, "--event %d --internal-db", rv);
 
     dom = xc_dom_allocate(xch, cmdline, NULL);
     rv = xc_dom_kernel_file(dom, kernel);
@@ -233,6 +240,9 @@ int main(int argc, char** argv)
         case 'r':
             ramdisk = optarg;
             break;
+        case 'p':
+            param = optarg;
+            break;
         default:
             usage();
             return 2;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:07:56 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:07: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 1aMIiB-0008MH-Ql; Thu, 21 Jan 2016 17:07: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 1aMIi9-0008Lw-PS
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:53 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	DB/05-09708-86011A65; Thu, 21 Jan 2016 17:07:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1453396071!7015301!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57274 invoked from network); 21 Jan 2016 17:07:52 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:07:52 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIil-000066-8q
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIi7-0005Ef-2L
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:07:51 +0000
Date: Thu, 21 Jan 2016 17:07:51 +0000
Message-Id: <E1aMIi7-0005Ef-2L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: add init-xenstore-domain
	parameter to specify cmdline
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83c365e6395f39c7ff91785b400682173d5e5d04
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:04:00 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:21 2016 +0000

    xenstore: add init-xenstore-domain parameter to specify cmdline
    
    Add a parameter to init-xenstore-domain for support of arbitrary
    parameters for the xenstore domain.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/helpers/init-xenstore-domain.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index ecced04..238007b 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -17,6 +17,7 @@ static uint32_t domid = ~0;
 static char *kernel;
 static char *ramdisk;
 static char *flask;
+static char *param;
 static int memory;
 
 static struct option options[] = {
@@ -24,6 +25,7 @@ static struct option options[] = {
     { "memory", 1, NULL, 'm' },
     { "flask", 1, NULL, 'f' },
     { "ramdisk", 1, NULL, 'r' },
+    { "param", 1, NULL, 'p' },
     { NULL, 0, NULL, 0 }
 };
 
@@ -39,7 +41,8 @@ static void usage(void)
 "  --kernel <xenstore-kernel> kernel file of the xenstore domain, mandatory\n"
 "  --memory <memory size>     size of the domain in MB, mandatory\n"
 "  --flask <flask-label>      optional flask label of the domain\n"
-"  --ramdisk <ramdisk-file>   optional ramdisk file for the domain\n");
+"  --ramdisk <ramdisk-file>   optional ramdisk file for the domain\n"
+"  --param <cmdline>          optional additional parameters for the domain\n");
 }
 
 static int build(xc_interface *xch)
@@ -103,7 +106,11 @@ static int build(xc_interface *xch)
         fprintf(stderr, "Xenbus setup ioctl failed\n");
         goto err;
     }
-    snprintf(cmdline, 512, "--event %d --internal-db", rv);
+
+    if ( param )
+        snprintf(cmdline, 512, "--event %d --internal-db %s", rv, param);
+    else
+        snprintf(cmdline, 512, "--event %d --internal-db", rv);
 
     dom = xc_dom_allocate(xch, cmdline, NULL);
     rv = xc_dom_kernel_file(dom, kernel);
@@ -233,6 +240,9 @@ int main(int argc, char** argv)
         case 'r':
             ramdisk = optarg;
             break;
+        case 'p':
+            param = optarg;
+            break;
         default:
             usage();
             return 2;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:08:06 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:08: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 1aMIiM-0008Nu-0B; Thu, 21 Jan 2016 17:08: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 1aMIiK-0008Ne-R1
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:05 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	5D/EE-31443-47011A65; Thu, 21 Jan 2016 17:08:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1453396082!17323920!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47189 invoked from network); 21 Jan 2016 17:08:03 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:08:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIiw-00006E-7o
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIiH-0005FM-In
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:02 +0000
Date: Thu, 21 Jan 2016 17:08:01 +0000
Message-Id: <E1aMIiH-0005FM-In@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: split up xen-init-dom0.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 1a25da88a7c04e511bcd2601a3a4b35fd2c61e52
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:04:01 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:21 2016 +0000

    tools: split up xen-init-dom0.c
    
    Split up tools/helpers/xen-init-dom0.c in order to prepare reusing
    generation of the json configuration by init-xenstore-domain.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/helpers/Makefile        |    2 +-
 tools/helpers/init-dom-json.c |   59 +++++++++++++++++++++++++++++++++
 tools/helpers/init-dom-json.h |   18 ++++++++++
 tools/helpers/xen-init-dom0.c |   73 ++++++-----------------------------------
 4 files changed, 88 insertions(+), 64 deletions(-)

diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index 826e0ed..0325ba2 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -10,7 +10,7 @@ ifeq ($(CONFIG_Linux),y)
 PROGS += init-xenstore-domain
 endif
 
-XEN_INIT_DOM0_OBJS = xen-init-dom0.o
+XEN_INIT_DOM0_OBJS = xen-init-dom0.o init-dom-json.o
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenlight)
diff --git a/tools/helpers/init-dom-json.c b/tools/helpers/init-dom-json.c
new file mode 100644
index 0000000..91b1fdf
--- /dev/null
+++ b/tools/helpers/init-dom-json.c
@@ -0,0 +1,59 @@
+#include <err.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <xenctrl.h>
+#include <libxl.h>
+
+int gen_stub_json_config(uint32_t domid)
+{
+    int rc = 1;
+    xentoollog_logger_stdiostream *logger;
+    libxl_ctx *ctx;
+    libxl_domain_config dom_config;
+    char *json = NULL;
+
+    logger = xtl_createlogger_stdiostream(stderr, XTL_ERROR, 0);
+    if (!logger)
+        return 1;
+
+    if (libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0,
+                        (xentoollog_logger *)logger)) {
+        fprintf(stderr, "cannot init libxl context\n");
+        goto outlog;
+    }
+
+    libxl_domain_config_init(&dom_config);
+
+    /* Generate stub JSON config. */
+    dom_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
+    libxl_domain_build_info_init_type(&dom_config.b_info,
+                                      LIBXL_DOMAIN_TYPE_PV);
+
+    json = libxl_domain_config_to_json(ctx, &dom_config);
+    /* libxl-json format requires the string ends with '\0'. Code
+     * snippet taken from libxl.
+     */
+    rc = libxl_userdata_store(ctx, domid, "libxl-json",
+                              (const uint8_t *)json,
+                              strlen(json) + 1 /* include '\0' */);
+    if (rc)
+        fprintf(stderr, "cannot store stub json config for domain %u\n", domid);
+
+    libxl_domain_config_dispose(&dom_config);
+    free(json);
+    libxl_ctx_free(ctx);
+outlog:
+    xtl_logger_destroy((xentoollog_logger *)logger);
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/helpers/init-dom-json.h b/tools/helpers/init-dom-json.h
new file mode 100644
index 0000000..58c85df
--- /dev/null
+++ b/tools/helpers/init-dom-json.h
@@ -0,0 +1,18 @@
+#ifndef __INIT_DOM_JSON_H
+#define __INIT_DOM_JSON_H
+
+/*
+ * Generate a stub JSON config for a domain with the given domid.
+ */
+int gen_stub_json_config(uint32_t domid);
+
+#endif
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/helpers/xen-init-dom0.c b/tools/helpers/xen-init-dom0.c
index 2f7aa7c..9ab8468 100644
--- a/tools/helpers/xen-init-dom0.c
+++ b/tools/helpers/xen-init-dom0.c
@@ -1,65 +1,26 @@
-#include <err.h>
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
 #include <stdio.h>
 
-#include <xentoollog.h>
 #include <xenstore.h>
-#include <libxl.h>
+
+#include "init-dom-json.h"
 
 #define DOMNAME_PATH   "/local/domain/0/name"
 #define DOMID_PATH     "/local/domain/0/domid"
 
-static libxl_ctx *ctx;
-static xentoollog_logger_stdiostream *logger;
-static struct xs_handle *xsh;
-
-static void ctx_alloc(void)
+int main(int argc, char **argv)
 {
-    if (libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0,
-                        (xentoollog_logger *)logger)) {
-        fprintf(stderr, "cannot init libxl context\n");
-        exit(1);
-    }
+    int rc;
+    struct xs_handle *xsh;
+    char *domname_string = NULL, *domid_string = NULL;
+
     xsh = xs_open(0);
     if (!xsh) {
         fprintf(stderr, "cannot open xenstore connection\n");
         exit(1);
     }
-}
-
-static void ctx_free(void)
-{
-    if (ctx) {
-        libxl_ctx_free(ctx);
-        ctx = NULL;
-    }
-    if (logger) {
-        xtl_logger_destroy((xentoollog_logger *)logger);
-        logger = NULL;
-    }
-    if (xsh) {
-        xs_close(xsh);
-        xsh = NULL;
-    }
-}
-
-int main(int argc, char **argv)
-{
-    int rc;
-    libxl_domain_config dom0_config;
-    char *domname_string = NULL, *domid_string = NULL;
-    char *json = NULL;;
-
-    logger = xtl_createlogger_stdiostream(stderr, XTL_ERROR, 0);
-    if (!logger) exit(1);
-
-    atexit(ctx_free);
-
-    ctx_alloc();
-
-    libxl_domain_config_init(&dom0_config);
 
     /* Sanity check: this program can only be run once. */
     domid_string = xs_read(xsh, XBT_NULL, DOMID_PATH, NULL);
@@ -70,22 +31,9 @@ int main(int argc, char **argv)
         goto out;
     }
 
-    /* Generate stub JSON config. */
-    dom0_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
-    libxl_domain_build_info_init_type(&dom0_config.b_info,
-                                      LIBXL_DOMAIN_TYPE_PV);
-
-    json = libxl_domain_config_to_json(ctx, &dom0_config);
-    /* libxl-json format requires the string ends with '\0'. Code
-     * snippet taken from libxl.
-     */
-    rc = libxl_userdata_store(ctx, 0, "libxl-json",
-                              (const uint8_t *)json,
-                              strlen(json) + 1 /* include '\0' */);
-    if (rc) {
-        fprintf(stderr, "cannot store stub json config for Dom0\n");
+    rc = gen_stub_json_config(0);
+    if (rc)
         goto out;
-    }
 
     /* Write xenstore entries. */
     if (!xs_write(xsh, XBT_NULL, DOMID_PATH, "0", strlen("0"))) {
@@ -104,10 +52,9 @@ int main(int argc, char **argv)
     printf("Done setting up Dom0\n");
 
 out:
-    libxl_domain_config_dispose(&dom0_config);
     free(domid_string);
     free(domname_string);
-    free(json);
+    xs_close(xsh);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:08:06 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:08: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 1aMIiM-0008Nu-0B; Thu, 21 Jan 2016 17:08: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 1aMIiK-0008Ne-R1
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:05 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	5D/EE-31443-47011A65; Thu, 21 Jan 2016 17:08:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1453396082!17323920!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47189 invoked from network); 21 Jan 2016 17:08:03 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:08:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIiw-00006E-7o
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIiH-0005FM-In
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:02 +0000
Date: Thu, 21 Jan 2016 17:08:01 +0000
Message-Id: <E1aMIiH-0005FM-In@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: split up xen-init-dom0.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 1a25da88a7c04e511bcd2601a3a4b35fd2c61e52
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:04:01 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:21 2016 +0000

    tools: split up xen-init-dom0.c
    
    Split up tools/helpers/xen-init-dom0.c in order to prepare reusing
    generation of the json configuration by init-xenstore-domain.c.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/helpers/Makefile        |    2 +-
 tools/helpers/init-dom-json.c |   59 +++++++++++++++++++++++++++++++++
 tools/helpers/init-dom-json.h |   18 ++++++++++
 tools/helpers/xen-init-dom0.c |   73 ++++++-----------------------------------
 4 files changed, 88 insertions(+), 64 deletions(-)

diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index 826e0ed..0325ba2 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -10,7 +10,7 @@ ifeq ($(CONFIG_Linux),y)
 PROGS += init-xenstore-domain
 endif
 
-XEN_INIT_DOM0_OBJS = xen-init-dom0.o
+XEN_INIT_DOM0_OBJS = xen-init-dom0.o init-dom-json.o
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenlight)
diff --git a/tools/helpers/init-dom-json.c b/tools/helpers/init-dom-json.c
new file mode 100644
index 0000000..91b1fdf
--- /dev/null
+++ b/tools/helpers/init-dom-json.c
@@ -0,0 +1,59 @@
+#include <err.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <xenctrl.h>
+#include <libxl.h>
+
+int gen_stub_json_config(uint32_t domid)
+{
+    int rc = 1;
+    xentoollog_logger_stdiostream *logger;
+    libxl_ctx *ctx;
+    libxl_domain_config dom_config;
+    char *json = NULL;
+
+    logger = xtl_createlogger_stdiostream(stderr, XTL_ERROR, 0);
+    if (!logger)
+        return 1;
+
+    if (libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0,
+                        (xentoollog_logger *)logger)) {
+        fprintf(stderr, "cannot init libxl context\n");
+        goto outlog;
+    }
+
+    libxl_domain_config_init(&dom_config);
+
+    /* Generate stub JSON config. */
+    dom_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
+    libxl_domain_build_info_init_type(&dom_config.b_info,
+                                      LIBXL_DOMAIN_TYPE_PV);
+
+    json = libxl_domain_config_to_json(ctx, &dom_config);
+    /* libxl-json format requires the string ends with '\0'. Code
+     * snippet taken from libxl.
+     */
+    rc = libxl_userdata_store(ctx, domid, "libxl-json",
+                              (const uint8_t *)json,
+                              strlen(json) + 1 /* include '\0' */);
+    if (rc)
+        fprintf(stderr, "cannot store stub json config for domain %u\n", domid);
+
+    libxl_domain_config_dispose(&dom_config);
+    free(json);
+    libxl_ctx_free(ctx);
+outlog:
+    xtl_logger_destroy((xentoollog_logger *)logger);
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/helpers/init-dom-json.h b/tools/helpers/init-dom-json.h
new file mode 100644
index 0000000..58c85df
--- /dev/null
+++ b/tools/helpers/init-dom-json.h
@@ -0,0 +1,18 @@
+#ifndef __INIT_DOM_JSON_H
+#define __INIT_DOM_JSON_H
+
+/*
+ * Generate a stub JSON config for a domain with the given domid.
+ */
+int gen_stub_json_config(uint32_t domid);
+
+#endif
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/helpers/xen-init-dom0.c b/tools/helpers/xen-init-dom0.c
index 2f7aa7c..9ab8468 100644
--- a/tools/helpers/xen-init-dom0.c
+++ b/tools/helpers/xen-init-dom0.c
@@ -1,65 +1,26 @@
-#include <err.h>
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
 #include <stdio.h>
 
-#include <xentoollog.h>
 #include <xenstore.h>
-#include <libxl.h>
+
+#include "init-dom-json.h"
 
 #define DOMNAME_PATH   "/local/domain/0/name"
 #define DOMID_PATH     "/local/domain/0/domid"
 
-static libxl_ctx *ctx;
-static xentoollog_logger_stdiostream *logger;
-static struct xs_handle *xsh;
-
-static void ctx_alloc(void)
+int main(int argc, char **argv)
 {
-    if (libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0,
-                        (xentoollog_logger *)logger)) {
-        fprintf(stderr, "cannot init libxl context\n");
-        exit(1);
-    }
+    int rc;
+    struct xs_handle *xsh;
+    char *domname_string = NULL, *domid_string = NULL;
+
     xsh = xs_open(0);
     if (!xsh) {
         fprintf(stderr, "cannot open xenstore connection\n");
         exit(1);
     }
-}
-
-static void ctx_free(void)
-{
-    if (ctx) {
-        libxl_ctx_free(ctx);
-        ctx = NULL;
-    }
-    if (logger) {
-        xtl_logger_destroy((xentoollog_logger *)logger);
-        logger = NULL;
-    }
-    if (xsh) {
-        xs_close(xsh);
-        xsh = NULL;
-    }
-}
-
-int main(int argc, char **argv)
-{
-    int rc;
-    libxl_domain_config dom0_config;
-    char *domname_string = NULL, *domid_string = NULL;
-    char *json = NULL;;
-
-    logger = xtl_createlogger_stdiostream(stderr, XTL_ERROR, 0);
-    if (!logger) exit(1);
-
-    atexit(ctx_free);
-
-    ctx_alloc();
-
-    libxl_domain_config_init(&dom0_config);
 
     /* Sanity check: this program can only be run once. */
     domid_string = xs_read(xsh, XBT_NULL, DOMID_PATH, NULL);
@@ -70,22 +31,9 @@ int main(int argc, char **argv)
         goto out;
     }
 
-    /* Generate stub JSON config. */
-    dom0_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
-    libxl_domain_build_info_init_type(&dom0_config.b_info,
-                                      LIBXL_DOMAIN_TYPE_PV);
-
-    json = libxl_domain_config_to_json(ctx, &dom0_config);
-    /* libxl-json format requires the string ends with '\0'. Code
-     * snippet taken from libxl.
-     */
-    rc = libxl_userdata_store(ctx, 0, "libxl-json",
-                              (const uint8_t *)json,
-                              strlen(json) + 1 /* include '\0' */);
-    if (rc) {
-        fprintf(stderr, "cannot store stub json config for Dom0\n");
+    rc = gen_stub_json_config(0);
+    if (rc)
         goto out;
-    }
 
     /* Write xenstore entries. */
     if (!xs_write(xsh, XBT_NULL, DOMID_PATH, "0", strlen("0"))) {
@@ -104,10 +52,9 @@ int main(int argc, char **argv)
     printf("Done setting up Dom0\n");
 
 out:
-    libxl_domain_config_dispose(&dom0_config);
     free(domid_string);
     free(domname_string);
-    free(json);
+    xs_close(xsh);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:08:16 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:08: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 1aMIiW-0008QF-Mh; Thu, 21 Jan 2016 17:08:16 +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 1aMIiV-0008Ps-B5
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:15 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	D6/90-02940-E7011A65; Thu, 21 Jan 2016 17:08:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1453396093!16799601!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14438 invoked from network); 21 Jan 2016 17:08:13 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:08:13 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIj6-00007A-MK
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIiS-0005Fr-Jc
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:12 +0000
Date: Thu, 21 Jan 2016 17:08:12 +0000
Message-Id: <E1aMIiS-0005Fr-Jc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: write xenstore domain data
	to xenstore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1367af1cca57e051d6f7b723056a422cc9d4fd46
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:04:02 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:21 2016 +0000

    xenstore: write xenstore domain data to xenstore
    
    After starting the xenstore domain write the basic data (domid, name
    and memory values) to the xenstore. This makes the domain appear
    correctly in xl list. Create a stub json object in order to make e.g.
    xl list -l happy.
    
    Add a new option to init-xenstore-domain to be able to specify the
    domain's name.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/helpers/Makefile               |    6 +++-
 tools/helpers/init-xenstore-domain.c |   44 ++++++++++++++++++++++++++++++---
 2 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index 0325ba2..a05a368 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -15,10 +15,12 @@ $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenlight)
 
-INIT_XENSTORE_DOMAIN_OBJS = init-xenstore-domain.o
+INIT_XENSTORE_DOMAIN_OBJS = init-xenstore-domain.o init-dom-json.o
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenguest)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenstore)
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenlight)
 
 .PHONY: all
 all: $(PROGS)
@@ -27,7 +29,7 @@ xen-init-dom0: $(XEN_INIT_DOM0_OBJS)
 	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
 
 init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
-	$(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
 
 .PHONY: install
 install: all
diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 238007b..5c5af2d 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -13,11 +13,14 @@
 #include <xen/sys/xenbus_dev.h>
 #include <xen-xsm/flask/flask.h>
 
+#include "init-dom-json.h"
+
 static uint32_t domid = ~0;
 static char *kernel;
 static char *ramdisk;
 static char *flask;
 static char *param;
+static char *name = "Xenstore";
 static int memory;
 
 static struct option options[] = {
@@ -26,6 +29,7 @@ static struct option options[] = {
     { "flask", 1, NULL, 'f' },
     { "ramdisk", 1, NULL, 'r' },
     { "param", 1, NULL, 'p' },
+    { "name", 1, NULL, 'n' },
     { NULL, 0, NULL, 0 }
 };
 
@@ -42,7 +46,8 @@ static void usage(void)
 "  --memory <memory size>     size of the domain in MB, mandatory\n"
 "  --flask <flask-label>      optional flask label of the domain\n"
 "  --ramdisk <ramdisk-file>   optional ramdisk file for the domain\n"
-"  --param <cmdline>          optional additional parameters for the domain\n");
+"  --param <cmdline>          optional additional parameters for the domain\n"
+"  --name <name>              name of the domain (default: Xenstore)\n");
 }
 
 static int build(xc_interface *xch)
@@ -216,6 +221,20 @@ static int check_domain(xc_interface *xch)
     return 0;
 }
 
+static void do_xs_write(struct xs_handle *xsh, char *path, char *val)
+{
+    if ( !xs_write(xsh, XBT_NULL, path, val, strlen(val)) )
+        fprintf(stderr, "writing %s to xenstore failed.\n", path);
+}
+
+static void do_xs_write_dom(struct xs_handle *xsh, char *path, char *val)
+{
+    char full_path[64];
+
+    snprintf(full_path, 64, "/local/domain/%d/%s", domid, path);
+    do_xs_write(xsh, full_path, val);
+}
+
 int main(int argc, char** argv)
 {
     int opt;
@@ -243,6 +262,9 @@ int main(int argc, char** argv)
         case 'p':
             param = optarg;
             break;
+        case 'n':
+            name = optarg;
+            break;
         default:
             usage();
             return 2;
@@ -274,10 +296,24 @@ int main(int argc, char** argv)
     if ( rv )
         return 1;
 
+    rv = gen_stub_json_config(domid);
+    if ( rv )
+        return 3;
+
     xsh = xs_open(0);
-    rv = snprintf(buf, 16, "%d", domid);
-    xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
-    xs_daemon_close(xsh);
+    if ( !xsh )
+    {
+        fprintf(stderr, "xs_open() failed.\n");
+        return 3;
+    }
+    snprintf(buf, 16, "%d", domid);
+    do_xs_write(xsh, "/tool/xenstored/domid", buf);
+    do_xs_write_dom(xsh, "domid", buf);
+    do_xs_write_dom(xsh, "name", name);
+    snprintf(buf, 16, "%d", memory * 1024);
+    do_xs_write_dom(xsh, "memory/target", buf);
+    do_xs_write_dom(xsh, "memory/static-max", buf);
+    xs_close(xsh);
 
     fd = creat("/var/run/xenstored.pid", 0666);
     if ( fd < 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 Jan 21 17:08:16 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:08: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 1aMIiW-0008QF-Mh; Thu, 21 Jan 2016 17:08:16 +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 1aMIiV-0008Ps-B5
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:15 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	D6/90-02940-E7011A65; Thu, 21 Jan 2016 17:08:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1453396093!16799601!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14438 invoked from network); 21 Jan 2016 17:08:13 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:08:13 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIj6-00007A-MK
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIiS-0005Fr-Jc
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:12 +0000
Date: Thu, 21 Jan 2016 17:08:12 +0000
Message-Id: <E1aMIiS-0005Fr-Jc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: write xenstore domain data
	to xenstore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1367af1cca57e051d6f7b723056a422cc9d4fd46
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:04:02 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:34:21 2016 +0000

    xenstore: write xenstore domain data to xenstore
    
    After starting the xenstore domain write the basic data (domid, name
    and memory values) to the xenstore. This makes the domain appear
    correctly in xl list. Create a stub json object in order to make e.g.
    xl list -l happy.
    
    Add a new option to init-xenstore-domain to be able to specify the
    domain's name.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/helpers/Makefile               |    6 +++-
 tools/helpers/init-xenstore-domain.c |   44 ++++++++++++++++++++++++++++++---
 2 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index 0325ba2..a05a368 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -15,10 +15,12 @@ $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenlight)
 
-INIT_XENSTORE_DOMAIN_OBJS = init-xenstore-domain.o
+INIT_XENSTORE_DOMAIN_OBJS = init-xenstore-domain.o init-dom-json.o
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenguest)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
 $(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenstore)
+$(INIT_XENSTORE_DOMAIN_OBJS): CFLAGS += $(CFLAGS_libxenlight)
 
 .PHONY: all
 all: $(PROGS)
@@ -27,7 +29,7 @@ xen-init-dom0: $(XEN_INIT_DOM0_OBJS)
 	$(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
 
 init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
-	$(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
 
 .PHONY: install
 install: all
diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 238007b..5c5af2d 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -13,11 +13,14 @@
 #include <xen/sys/xenbus_dev.h>
 #include <xen-xsm/flask/flask.h>
 
+#include "init-dom-json.h"
+
 static uint32_t domid = ~0;
 static char *kernel;
 static char *ramdisk;
 static char *flask;
 static char *param;
+static char *name = "Xenstore";
 static int memory;
 
 static struct option options[] = {
@@ -26,6 +29,7 @@ static struct option options[] = {
     { "flask", 1, NULL, 'f' },
     { "ramdisk", 1, NULL, 'r' },
     { "param", 1, NULL, 'p' },
+    { "name", 1, NULL, 'n' },
     { NULL, 0, NULL, 0 }
 };
 
@@ -42,7 +46,8 @@ static void usage(void)
 "  --memory <memory size>     size of the domain in MB, mandatory\n"
 "  --flask <flask-label>      optional flask label of the domain\n"
 "  --ramdisk <ramdisk-file>   optional ramdisk file for the domain\n"
-"  --param <cmdline>          optional additional parameters for the domain\n");
+"  --param <cmdline>          optional additional parameters for the domain\n"
+"  --name <name>              name of the domain (default: Xenstore)\n");
 }
 
 static int build(xc_interface *xch)
@@ -216,6 +221,20 @@ static int check_domain(xc_interface *xch)
     return 0;
 }
 
+static void do_xs_write(struct xs_handle *xsh, char *path, char *val)
+{
+    if ( !xs_write(xsh, XBT_NULL, path, val, strlen(val)) )
+        fprintf(stderr, "writing %s to xenstore failed.\n", path);
+}
+
+static void do_xs_write_dom(struct xs_handle *xsh, char *path, char *val)
+{
+    char full_path[64];
+
+    snprintf(full_path, 64, "/local/domain/%d/%s", domid, path);
+    do_xs_write(xsh, full_path, val);
+}
+
 int main(int argc, char** argv)
 {
     int opt;
@@ -243,6 +262,9 @@ int main(int argc, char** argv)
         case 'p':
             param = optarg;
             break;
+        case 'n':
+            name = optarg;
+            break;
         default:
             usage();
             return 2;
@@ -274,10 +296,24 @@ int main(int argc, char** argv)
     if ( rv )
         return 1;
 
+    rv = gen_stub_json_config(domid);
+    if ( rv )
+        return 3;
+
     xsh = xs_open(0);
-    rv = snprintf(buf, 16, "%d", domid);
-    xs_write(xsh, XBT_NULL, "/tool/xenstored/domid", buf, rv);
-    xs_daemon_close(xsh);
+    if ( !xsh )
+    {
+        fprintf(stderr, "xs_open() failed.\n");
+        return 3;
+    }
+    snprintf(buf, 16, "%d", domid);
+    do_xs_write(xsh, "/tool/xenstored/domid", buf);
+    do_xs_write_dom(xsh, "domid", buf);
+    do_xs_write_dom(xsh, "name", name);
+    snprintf(buf, 16, "%d", memory * 1024);
+    do_xs_write_dom(xsh, "memory/target", buf);
+    do_xs_write_dom(xsh, "memory/static-max", buf);
+    xs_close(xsh);
 
     fd = creat("/var/run/xenstored.pid", 0666);
     if ( fd < 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 Jan 21 17:08:26 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:08: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 1aMIig-0008Ta-G2; Thu, 21 Jan 2016 17:08: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 1aMIif-0008T4-Ec
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:25 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	C0/6D-02499-88011A65; Thu, 21 Jan 2016 17:08:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1453396103!1507968!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18858 invoked from network); 21 Jan 2016 17:08:24 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:08:24 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjH-00007m-2V
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIid-0005GW-1T
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:23 +0000
Date: Thu, 21 Jan 2016 17:08:23 +0000
Message-Id: <E1aMIid-0005GW-1T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: don't stop xenstore domain when
	stopping 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 c5df1c4b5474e1c2197aa1cf96a721a6e113893b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:04:03 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:35:56 2016 +0000

    tools: don't stop xenstore domain when stopping dom0
    
    When restarting or shutting down dom0 the xendomains script tries to
    stop all other domains. Don't do this for the xenstore domain, as it
    might survive a dom0 reboot in the future.
    
    The same applies to xl shutdown --all. Here the xenstore domain is
    flagged as "never stop".
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/Linux/xendomains.in |   15 +++++++++++++++
 tools/libxl/xl_cmdimpl.c          |    9 +++++----
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/tools/hotplug/Linux/xendomains.in b/tools/hotplug/Linux/xendomains.in
index dfe0b33..9f88649 100644
--- a/tools/hotplug/Linux/xendomains.in
+++ b/tools/hotplug/Linux/xendomains.in
@@ -196,6 +196,15 @@ rdnames()
     done
 }
 
+# get xenstore domain id (or 0 if no xenstore domain)
+get_xsdomid()
+{
+    XS_DOMID=`${bindir}/xenstore-read /tool/xenstored/domid 2>/dev/null`
+    if test $? -ne 0; then
+        XS_DOMID=0
+    fi
+}
+
 LIST_GREP='(domain\|(domid\|(name\|^    {$\|"name":\|"domid":'
 parseln()
 {
@@ -216,12 +225,14 @@ parseln()
 
 is_running()
 {
+    get_xsdomid
     rdname $1
     RC=1
     name=;id=
     while read LN; do
 	parseln "$LN" || continue
 	if test $id = 0; then continue; fi
+	if test $id = $XS_DOMID; then continue; fi
 	case $name in
 	    ($NM)
 		RC=0
@@ -302,10 +313,12 @@ start()
 
 all_zombies()
 {
+    get_xsdomid
     name=;id=
     while read LN; do
 	parseln "$LN" || continue
 	if test $id = 0; then continue; fi
+	if test $id = $XS_DOMID; then continue; fi
 	if test "$state" != "-b---d" -a "$state" != "-----d"; then
 	    return 1;
 	fi
@@ -351,11 +364,13 @@ stop()
     if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
 	rdnames
     fi
+    get_xsdomid
     echo -n "Shutting down Xen domains:"
     name=;id=
     while read LN; do
 	parseln "$LN" || continue
 	if test $id = 0; then continue; fi
+	if test $id = $XS_DOMID; then continue; fi
 	echo -n " $name"
 	if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
 	    eval "
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index f9933cb..25507c7 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4820,7 +4820,7 @@ static int main_shutdown_or_reboot(int do_reboot, int argc, char **argv)
                libxl_evgen_domain_death **, libxl_ev_user, int) =
         do_reboot ? &reboot_domain : &shutdown_domain;
     int opt, i, nb_domain;
-    int wait_for_it = 0, all =0;
+    int wait_for_it = 0, all = 0, nrdeathws = 0;
     int fallback_trigger = 0;
     static struct option opts[] = {
         {"all", 0, 0, 'a'},
@@ -4857,14 +4857,15 @@ static int main_shutdown_or_reboot(int do_reboot, int argc, char **argv)
             deathws = calloc(nb_domain, sizeof(*deathws));
 
         for (i = 0; i<nb_domain; i++) {
-            if (dominfo[i].domid == 0)
+            if (dominfo[i].domid == 0 || dominfo[i].never_stop)
                 continue;
             fn(dominfo[i].domid, deathws ? &deathws[i] : NULL, i,
                fallback_trigger);
+            nrdeathws++;
         }
 
-        if (wait_for_it) {
-            wait_for_domain_deaths(deathws, nb_domain - 1 /* not dom 0 */);
+        if (deathws) {
+            wait_for_domain_deaths(deathws, nrdeathws);
             free(deathws);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:08:26 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:08: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 1aMIig-0008Ta-G2; Thu, 21 Jan 2016 17:08: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 1aMIif-0008T4-Ec
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:25 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	C0/6D-02499-88011A65; Thu, 21 Jan 2016 17:08:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1453396103!1507968!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18858 invoked from network); 21 Jan 2016 17:08:24 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:08:24 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjH-00007m-2V
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIid-0005GW-1T
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:23 +0000
Date: Thu, 21 Jan 2016 17:08:23 +0000
Message-Id: <E1aMIid-0005GW-1T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: don't stop xenstore domain when
	stopping 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 c5df1c4b5474e1c2197aa1cf96a721a6e113893b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:04:03 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:35:56 2016 +0000

    tools: don't stop xenstore domain when stopping dom0
    
    When restarting or shutting down dom0 the xendomains script tries to
    stop all other domains. Don't do this for the xenstore domain, as it
    might survive a dom0 reboot in the future.
    
    The same applies to xl shutdown --all. Here the xenstore domain is
    flagged as "never stop".
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/Linux/xendomains.in |   15 +++++++++++++++
 tools/libxl/xl_cmdimpl.c          |    9 +++++----
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/tools/hotplug/Linux/xendomains.in b/tools/hotplug/Linux/xendomains.in
index dfe0b33..9f88649 100644
--- a/tools/hotplug/Linux/xendomains.in
+++ b/tools/hotplug/Linux/xendomains.in
@@ -196,6 +196,15 @@ rdnames()
     done
 }
 
+# get xenstore domain id (or 0 if no xenstore domain)
+get_xsdomid()
+{
+    XS_DOMID=`${bindir}/xenstore-read /tool/xenstored/domid 2>/dev/null`
+    if test $? -ne 0; then
+        XS_DOMID=0
+    fi
+}
+
 LIST_GREP='(domain\|(domid\|(name\|^    {$\|"name":\|"domid":'
 parseln()
 {
@@ -216,12 +225,14 @@ parseln()
 
 is_running()
 {
+    get_xsdomid
     rdname $1
     RC=1
     name=;id=
     while read LN; do
 	parseln "$LN" || continue
 	if test $id = 0; then continue; fi
+	if test $id = $XS_DOMID; then continue; fi
 	case $name in
 	    ($NM)
 		RC=0
@@ -302,10 +313,12 @@ start()
 
 all_zombies()
 {
+    get_xsdomid
     name=;id=
     while read LN; do
 	parseln "$LN" || continue
 	if test $id = 0; then continue; fi
+	if test $id = $XS_DOMID; then continue; fi
 	if test "$state" != "-b---d" -a "$state" != "-----d"; then
 	    return 1;
 	fi
@@ -351,11 +364,13 @@ stop()
     if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
 	rdnames
     fi
+    get_xsdomid
     echo -n "Shutting down Xen domains:"
     name=;id=
     while read LN; do
 	parseln "$LN" || continue
 	if test $id = 0; then continue; fi
+	if test $id = $XS_DOMID; then continue; fi
 	echo -n " $name"
 	if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
 	    eval "
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index f9933cb..25507c7 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4820,7 +4820,7 @@ static int main_shutdown_or_reboot(int do_reboot, int argc, char **argv)
                libxl_evgen_domain_death **, libxl_ev_user, int) =
         do_reboot ? &reboot_domain : &shutdown_domain;
     int opt, i, nb_domain;
-    int wait_for_it = 0, all =0;
+    int wait_for_it = 0, all = 0, nrdeathws = 0;
     int fallback_trigger = 0;
     static struct option opts[] = {
         {"all", 0, 0, 'a'},
@@ -4857,14 +4857,15 @@ static int main_shutdown_or_reboot(int do_reboot, int argc, char **argv)
             deathws = calloc(nb_domain, sizeof(*deathws));
 
         for (i = 0; i<nb_domain; i++) {
-            if (dominfo[i].domid == 0)
+            if (dominfo[i].domid == 0 || dominfo[i].never_stop)
                 continue;
             fn(dominfo[i].domid, deathws ? &deathws[i] : NULL, i,
                fallback_trigger);
+            nrdeathws++;
         }
 
-        if (wait_for_it) {
-            wait_for_domain_deaths(deathws, nb_domain - 1 /* not dom 0 */);
+        if (deathws) {
+            wait_for_domain_deaths(deathws, nrdeathws);
             free(deathws);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:08:36 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:08: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 1aMIiq-00004w-KZ; Thu, 21 Jan 2016 17:08:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIip-0008WD-On
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:35 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	1B/1D-09478-29011A65; Thu, 21 Jan 2016 17:08:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1453396113!17326650!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 36600 invoked from network); 21 Jan 2016 17:08:34 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:08:34 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjR-000081-C8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIin-0005HC-BC
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:33 +0000
Date: Thu, 21 Jan 2016 17:08:33 +0000
Message-Id: <E1aMIin-0005HC-BC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: document xenstore domain
	xenstore 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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f58f295f39fcbab71174c5abbe7e1f66040bda9
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:04:04 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:36:08 2016 +0000

    docs: document xenstore domain xenstore paths
    
    Add the xenstore domain specific xenstore paths to
    docs/misc/xenstore-paths.markdown
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/xenstore-paths.markdown |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xenstore-paths.markdown b/docs/misc/xenstore-paths.markdown
index 197bb0f..6a6fda9 100644
--- a/docs/misc/xenstore-paths.markdown
+++ b/docs/misc/xenstore-paths.markdown
@@ -509,6 +509,16 @@ The device model version for a domain.
 
 ifb device used by Remus to buffer network output from the associated vif.
 
+### xenstored specific paths
+
+The /tool/xenstored namespace is created by the xenstore daemon or domain
+for the toolstack to obtain e.g. the domain id of a xenstore domain.
+
+#### /tool/xenstored/domid = INTEGER [n,INTERNAL]
+
+Domain Id of the xenstore domain in case xenstore is provided via a
+domain instead of a daemon in dom0.
+
 [BLKIF]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,blkif.h.html
 [FBIF]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,fbif.h.html
 [HVMPARAMS]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,hvm,params.h.html
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:08:36 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:08: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 1aMIiq-00004w-KZ; Thu, 21 Jan 2016 17:08:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIip-0008WD-On
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:35 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	1B/1D-09478-29011A65; Thu, 21 Jan 2016 17:08:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1453396113!17326650!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 36600 invoked from network); 21 Jan 2016 17:08:34 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:08:34 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjR-000081-C8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIin-0005HC-BC
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:33 +0000
Date: Thu, 21 Jan 2016 17:08:33 +0000
Message-Id: <E1aMIin-0005HC-BC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: document xenstore domain
	xenstore 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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f58f295f39fcbab71174c5abbe7e1f66040bda9
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Jan 18 09:04:04 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 16:36:08 2016 +0000

    docs: document xenstore domain xenstore paths
    
    Add the xenstore domain specific xenstore paths to
    docs/misc/xenstore-paths.markdown
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/xenstore-paths.markdown |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xenstore-paths.markdown b/docs/misc/xenstore-paths.markdown
index 197bb0f..6a6fda9 100644
--- a/docs/misc/xenstore-paths.markdown
+++ b/docs/misc/xenstore-paths.markdown
@@ -509,6 +509,16 @@ The device model version for a domain.
 
 ifb device used by Remus to buffer network output from the associated vif.
 
+### xenstored specific paths
+
+The /tool/xenstored namespace is created by the xenstore daemon or domain
+for the toolstack to obtain e.g. the domain id of a xenstore domain.
+
+#### /tool/xenstored/domid = INTEGER [n,INTERNAL]
+
+Domain Id of the xenstore domain in case xenstore is provided via a
+domain instead of a daemon in dom0.
+
 [BLKIF]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,blkif.h.html
 [FBIF]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,io,fbif.h.html
 [HVMPARAMS]: http://xenbits.xen.org/docs/unstable/hypercall/include,public,hvm,params.h.html
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:08:47 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:08: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 1aMIj1-00008m-Of; Thu, 21 Jan 2016 17:08:47 +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 1aMIj0-00007g-67
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:46 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	F0/14-25435-D9011A65; Thu, 21 Jan 2016 17:08:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1453396123!14745097!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23502 invoked from network); 21 Jan 2016 17:08:44 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:08:44 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjb-00008K-Kd
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIix-0005IA-L3
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:43 +0000
Date: Thu, 21 Jan 2016 17:08:43 +0000
Message-Id: <E1aMIix-0005IA-L3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: add myself for kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9fe43a2664cb6a36888220ae67732deafaa3f82b
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Wed Dec 16 08:41:56 2015 -0600
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 17:04:16 2016 +0000

    MAINTAINERS: add myself for kconfig
    
    Added myself as the maintainer of kconfig.
    
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Ian Jackson <ian.jackson@eu.citrix.com>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Keir Fraser <keir@xen.org>
    CC: Tim Deegan <tim@xen.org>
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 MAINTAINERS |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 0e8af01..7c1bf82 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -214,6 +214,12 @@ X:	xen/drivers/passthrough/vtd/
 X:	xen/drivers/passthrough/device_tree.c
 F:	xen/include/xen/iommu.h
 
+KCONFIG
+M:	Doug Goldstein <cardoe@cardoe.com>
+S:	Supported
+F:	docs/misc/kconfig{,-language}.txt
+F:	xen/tools/kconfig/
+
 KDD DEBUGGER
 M:	Tim Deegan <tim@xen.org>
 S:	Odd Fixes
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:08:47 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:08: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 1aMIj1-00008m-Of; Thu, 21 Jan 2016 17:08:47 +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 1aMIj0-00007g-67
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:46 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	F0/14-25435-D9011A65; Thu, 21 Jan 2016 17:08:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1453396123!14745097!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23502 invoked from network); 21 Jan 2016 17:08:44 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:08:44 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjb-00008K-Kd
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIix-0005IA-L3
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:43 +0000
Date: Thu, 21 Jan 2016 17:08:43 +0000
Message-Id: <E1aMIix-0005IA-L3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: add myself for kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9fe43a2664cb6a36888220ae67732deafaa3f82b
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Wed Dec 16 08:41:56 2015 -0600
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 18 17:04:16 2016 +0000

    MAINTAINERS: add myself for kconfig
    
    Added myself as the maintainer of kconfig.
    
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Ian Jackson <ian.jackson@eu.citrix.com>
    CC: Jan Beulich <jbeulich@suse.com>
    CC: Keir Fraser <keir@xen.org>
    CC: Tim Deegan <tim@xen.org>
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 MAINTAINERS |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 0e8af01..7c1bf82 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -214,6 +214,12 @@ X:	xen/drivers/passthrough/vtd/
 X:	xen/drivers/passthrough/device_tree.c
 F:	xen/include/xen/iommu.h
 
+KCONFIG
+M:	Doug Goldstein <cardoe@cardoe.com>
+S:	Supported
+F:	docs/misc/kconfig{,-language}.txt
+F:	xen/tools/kconfig/
+
 KDD DEBUGGER
 M:	Tim Deegan <tim@xen.org>
 S:	Odd Fixes
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:08:57 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:08: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 1aMIjB-0000Ap-SC; Thu, 21 Jan 2016 17:08:57 +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 1aMIjA-0000AT-8C
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:56 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	41/3A-02745-7A011A65; Thu, 21 Jan 2016 17:08:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1453396134!17321676!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54248 invoked from network); 21 Jan 2016 17:08:55 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:08:55 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjl-00008U-Uw
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIj7-0005Io-U5
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:53 +0000
Date: Thu, 21 Jan 2016 17:08:53 +0000
Message-Id: <E1aMIj7-0005Io-U5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] INSTALL: fix typo
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c2f1283486f953604a282188a06e2db143f475d
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Mon Jan 18 17:17:43 2016 -0600
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 09:27:16 2016 +0000

    INSTALL: fix typo
    
    There's a case of a missing T in the word 'the'.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 INSTALL |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/INSTALL b/INSTALL
index 3d2e86a..95fa94d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -275,7 +275,7 @@ Building the python tools may fail unless certain options are passed to
 setup.py. Config.mk contains additional info how to use this variable.
 PYTHON_PREFIX_ARG=
 
-he hypervisor may be build with XSM/Flask support, which can be changed
+The hypervisor may be build with XSM/Flask support, which can be changed
 by running:
 make -C xen menuconfig
 and enabling XSM/Flask in the 'Common Features' menu.
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:08:57 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:08: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 1aMIjB-0000Ap-SC; Thu, 21 Jan 2016 17:08:57 +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 1aMIjA-0000AT-8C
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:56 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	41/3A-02745-7A011A65; Thu, 21 Jan 2016 17:08:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1453396134!17321676!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54248 invoked from network); 21 Jan 2016 17:08:55 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:08:55 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjl-00008U-Uw
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIj7-0005Io-U5
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:08:53 +0000
Date: Thu, 21 Jan 2016 17:08:53 +0000
Message-Id: <E1aMIj7-0005Io-U5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] INSTALL: fix typo
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c2f1283486f953604a282188a06e2db143f475d
Author:     Doug Goldstein <cardoe@cardoe.com>
AuthorDate: Mon Jan 18 17:17:43 2016 -0600
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 09:27:16 2016 +0000

    INSTALL: fix typo
    
    There's a case of a missing T in the word 'the'.
    
    Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 INSTALL |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/INSTALL b/INSTALL
index 3d2e86a..95fa94d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -275,7 +275,7 @@ Building the python tools may fail unless certain options are passed to
 setup.py. Config.mk contains additional info how to use this variable.
 PYTHON_PREFIX_ARG=
 
-he hypervisor may be build with XSM/Flask support, which can be changed
+The hypervisor may be build with XSM/Flask support, which can be changed
 by running:
 make -C xen menuconfig
 and enabling XSM/Flask in the 'Common Features' menu.
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:09:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:09: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 1aMIjO-0000Cv-0F; Thu, 21 Jan 2016 17:09: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 1aMIjM-0000Cf-9j
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:08 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	44/89-10715-3B011A65; Thu, 21 Jan 2016 17:09:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1453396146!18464863!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47201 invoked from network); 21 Jan 2016 17:09:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:09:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjx-00008f-Oi
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjI-0005Jh-Jp
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:05 +0000
Date: Thu, 21 Jan 2016 17:09:04 +0000
Message-Id: <E1aMIjI-0005Jh-Jp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstat: handle more than 1024 domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b80d9bd74b01508549179950bfdc2ab07f3ff75
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Jan 15 17:07:39 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 10:42:37 2016 +0000

    xenstat: handle more than 1024 domains
    
    get_domain_ids() in libxenstat used by read_attributes_qdisk() is
    limited to 1024 domains. Remove that limit.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstat/libxenstat/src/xenstat_qmp.c |   79 +++++++++++++--------------
 1 files changed, 38 insertions(+), 41 deletions(-)

diff --git a/tools/xenstat/libxenstat/src/xenstat_qmp.c b/tools/xenstat/libxenstat/src/xenstat_qmp.c
index 5e261af..c12929a 100644
--- a/tools/xenstat/libxenstat/src/xenstat_qmp.c
+++ b/tools/xenstat/libxenstat/src/xenstat_qmp.c
@@ -356,18 +356,6 @@ static int qmp_connect(char *path)
 	return s;
 }
 
-/* Get up to 1024 active domains */
-static xc_domaininfo_t *get_domain_ids(xc_interface *xc_handle, int *num_doms)
-{
-	xc_domaininfo_t *dominfo;
-
-	dominfo = calloc(1024, sizeof(xc_domaininfo_t));
-	if (dominfo == NULL)
-		return NULL;
-	*num_doms = xc_domain_getinfolist(xc_handle, 0, 1024, dominfo);
-	return dominfo;
-}
-
 /* Gather the qdisk statistics by querying QMP
    Resources: http://wiki.qemu.org/QMP and qmp-commands.hx from the qemu code
    QMP Syntax for entering command mode. This command must be issued before
@@ -394,48 +382,57 @@ static xc_domaininfo_t *get_domain_ids(xc_interface *xc_handle, int *num_doms)
             }
           }]}
 */
-void read_attributes_qdisk(xenstat_node * node)
+static void read_attributes_qdisk_dom(xenstat_node *node, domid_t domain)
 {
 	char *cmd_mode = "{ \"execute\": \"qmp_capabilities\" }";
 	char *query_blockstats_cmd = "{ \"execute\": \"query-blockstats\" }";
-	xc_domaininfo_t *dominfo = NULL;
 	unsigned char *qmp_stats, *val;
 	char path[80];
-	int i, qfd, num_doms;
+	int qfd;
 
-	dominfo = get_domain_ids(node->handle->xc_handle, &num_doms);
-	if (dominfo == NULL)
+	/* Verify that qdisk disks are used with this VM */
+	snprintf(path, sizeof(path),"/local/domain/0/backend/qdisk/%i", domain);
+	val = xs_read(node->handle->xshandle, XBT_NULL, path, NULL);
+	if (val == NULL)
 		return;
+	free(val);
 
-	for (i=0; i<num_doms; i++) {
-		if (dominfo[i].domain <= 0)
-			continue;
-
-		/* Verify that qdisk disks are used with this VM */
-		snprintf(path, sizeof(path),"/local/domain/0/backend/qdisk/%i", dominfo[i].domain);
-		if ((val = xs_read(node->handle->xshandle, XBT_NULL, path, NULL)) == NULL)
-			continue;
-		free(val);
-
-		/* Connect to this VMs QMP socket */
-		snprintf(path, sizeof(path), "/var/run/xen/qmp-libxenstat-%i", dominfo[i].domain);
-		if ((qfd = qmp_connect(path)) < 0) {
-			continue;
-		}
+	/* Connect to this VMs QMP socket */
+	snprintf(path, sizeof(path), "/var/run/xen/qmp-libxenstat-%i", domain);
+	if ((qfd = qmp_connect(path)) < 0)
+		return;
 
-		/* First enable QMP capabilities so that we can query for data */
-		if ((qmp_stats = qmp_query(qfd, cmd_mode)) != NULL) {
+	/* First enable QMP capabilities so that we can query for data */
+	if ((qmp_stats = qmp_query(qfd, cmd_mode)) != NULL) {
+		free(qmp_stats);
+		/* Query QMP for this VMs blockstats */
+		qmp_stats = qmp_query(qfd, query_blockstats_cmd);
+		if (qmp_stats != NULL) {
+			qmp_parse_stats(node, domain, qmp_stats, qfd);
 			free(qmp_stats);
-			/* Query QMP for this VMs blockstats */
-			if ((qmp_stats = qmp_query(qfd, query_blockstats_cmd)) != NULL) {
-				qmp_parse_stats(node, dominfo[i].domain, qmp_stats, qfd);
-				free(qmp_stats);
-			}
 		}
-		close(qfd);
 	}
+	close(qfd);
+}
+
+void read_attributes_qdisk(xenstat_node * node)
+{
+	xc_domaininfo_t dominfo[1024];
+	int i, num_doms;
+	domid_t next_domid = 0;
+
+	for (;;) {
+		num_doms = xc_domain_getinfolist(node->handle->xc_handle,
+						 next_domid, 1024, dominfo);
+		if (num_doms <= 0)
+			return;
 
-	free(dominfo);
+		for (i = 0; i < num_doms; i++)
+			if (dominfo[i].domain > 0)
+				read_attributes_qdisk_dom(node, dominfo[i].domain);
+
+		next_domid = dominfo[num_doms - 1].domain + 1;
+	}
 }
 
 #else /* !HAVE_YAJL_V2 */
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:09:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:09: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 1aMIjO-0000Cv-0F; Thu, 21 Jan 2016 17:09: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 1aMIjM-0000Cf-9j
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:08 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	44/89-10715-3B011A65; Thu, 21 Jan 2016 17:09:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1453396146!18464863!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47201 invoked from network); 21 Jan 2016 17:09:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:09:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjx-00008f-Oi
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjI-0005Jh-Jp
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:05 +0000
Date: Thu, 21 Jan 2016 17:09:04 +0000
Message-Id: <E1aMIjI-0005Jh-Jp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstat: handle more than 1024 domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b80d9bd74b01508549179950bfdc2ab07f3ff75
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Jan 15 17:07:39 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 10:42:37 2016 +0000

    xenstat: handle more than 1024 domains
    
    get_domain_ids() in libxenstat used by read_attributes_qdisk() is
    limited to 1024 domains. Remove that limit.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstat/libxenstat/src/xenstat_qmp.c |   79 +++++++++++++--------------
 1 files changed, 38 insertions(+), 41 deletions(-)

diff --git a/tools/xenstat/libxenstat/src/xenstat_qmp.c b/tools/xenstat/libxenstat/src/xenstat_qmp.c
index 5e261af..c12929a 100644
--- a/tools/xenstat/libxenstat/src/xenstat_qmp.c
+++ b/tools/xenstat/libxenstat/src/xenstat_qmp.c
@@ -356,18 +356,6 @@ static int qmp_connect(char *path)
 	return s;
 }
 
-/* Get up to 1024 active domains */
-static xc_domaininfo_t *get_domain_ids(xc_interface *xc_handle, int *num_doms)
-{
-	xc_domaininfo_t *dominfo;
-
-	dominfo = calloc(1024, sizeof(xc_domaininfo_t));
-	if (dominfo == NULL)
-		return NULL;
-	*num_doms = xc_domain_getinfolist(xc_handle, 0, 1024, dominfo);
-	return dominfo;
-}
-
 /* Gather the qdisk statistics by querying QMP
    Resources: http://wiki.qemu.org/QMP and qmp-commands.hx from the qemu code
    QMP Syntax for entering command mode. This command must be issued before
@@ -394,48 +382,57 @@ static xc_domaininfo_t *get_domain_ids(xc_interface *xc_handle, int *num_doms)
             }
           }]}
 */
-void read_attributes_qdisk(xenstat_node * node)
+static void read_attributes_qdisk_dom(xenstat_node *node, domid_t domain)
 {
 	char *cmd_mode = "{ \"execute\": \"qmp_capabilities\" }";
 	char *query_blockstats_cmd = "{ \"execute\": \"query-blockstats\" }";
-	xc_domaininfo_t *dominfo = NULL;
 	unsigned char *qmp_stats, *val;
 	char path[80];
-	int i, qfd, num_doms;
+	int qfd;
 
-	dominfo = get_domain_ids(node->handle->xc_handle, &num_doms);
-	if (dominfo == NULL)
+	/* Verify that qdisk disks are used with this VM */
+	snprintf(path, sizeof(path),"/local/domain/0/backend/qdisk/%i", domain);
+	val = xs_read(node->handle->xshandle, XBT_NULL, path, NULL);
+	if (val == NULL)
 		return;
+	free(val);
 
-	for (i=0; i<num_doms; i++) {
-		if (dominfo[i].domain <= 0)
-			continue;
-
-		/* Verify that qdisk disks are used with this VM */
-		snprintf(path, sizeof(path),"/local/domain/0/backend/qdisk/%i", dominfo[i].domain);
-		if ((val = xs_read(node->handle->xshandle, XBT_NULL, path, NULL)) == NULL)
-			continue;
-		free(val);
-
-		/* Connect to this VMs QMP socket */
-		snprintf(path, sizeof(path), "/var/run/xen/qmp-libxenstat-%i", dominfo[i].domain);
-		if ((qfd = qmp_connect(path)) < 0) {
-			continue;
-		}
+	/* Connect to this VMs QMP socket */
+	snprintf(path, sizeof(path), "/var/run/xen/qmp-libxenstat-%i", domain);
+	if ((qfd = qmp_connect(path)) < 0)
+		return;
 
-		/* First enable QMP capabilities so that we can query for data */
-		if ((qmp_stats = qmp_query(qfd, cmd_mode)) != NULL) {
+	/* First enable QMP capabilities so that we can query for data */
+	if ((qmp_stats = qmp_query(qfd, cmd_mode)) != NULL) {
+		free(qmp_stats);
+		/* Query QMP for this VMs blockstats */
+		qmp_stats = qmp_query(qfd, query_blockstats_cmd);
+		if (qmp_stats != NULL) {
+			qmp_parse_stats(node, domain, qmp_stats, qfd);
 			free(qmp_stats);
-			/* Query QMP for this VMs blockstats */
-			if ((qmp_stats = qmp_query(qfd, query_blockstats_cmd)) != NULL) {
-				qmp_parse_stats(node, dominfo[i].domain, qmp_stats, qfd);
-				free(qmp_stats);
-			}
 		}
-		close(qfd);
 	}
+	close(qfd);
+}
+
+void read_attributes_qdisk(xenstat_node * node)
+{
+	xc_domaininfo_t dominfo[1024];
+	int i, num_doms;
+	domid_t next_domid = 0;
+
+	for (;;) {
+		num_doms = xc_domain_getinfolist(node->handle->xc_handle,
+						 next_domid, 1024, dominfo);
+		if (num_doms <= 0)
+			return;
 
-	free(dominfo);
+		for (i = 0; i < num_doms; i++)
+			if (dominfo[i].domain > 0)
+				read_attributes_qdisk_dom(node, dominfo[i].domain);
+
+		next_domid = dominfo[num_doms - 1].domain + 1;
+	}
 }
 
 #else /* !HAVE_YAJL_V2 */
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:09:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:09: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 1aMIjY-0000F0-4w; Thu, 21 Jan 2016 17:09: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 1aMIjW-0000Ei-Cr
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:18 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	9C/25-31122-DB011A65; Thu, 21 Jan 2016 17:09:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1453396156!11395728!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7832 invoked from network); 21 Jan 2016 17:09:17 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:09:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIk8-00009S-5q
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjU-0005KS-4l
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:16 +0000
Date: Thu, 21 Jan 2016 17:09:16 +0000
Message-Id: <E1aMIjU-0005KS-4l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/io/netif.h: clarifications to
	wire formats
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0ebdfa144463eaf8fb762c72798a803111b5b544
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Jan 12 09:58:55 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 10:43:30 2016 +0000

    public/io/netif.h: clarifications to wire formats
    
    My previous patch 03809ae7 "document transmit and receive wire formats
    separately" improved documentation of the receive and transmit wire
    formats but further clarifications were requested.
    
    This patch adds those clarifications.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/io/netif.h |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index 1790ea0..0a3272f 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -154,19 +154,29 @@
  * Guest transmit
  * ==============
  *
- * This is the 'wire' format for packets:
+ * This is the 'wire' format for transmit (frontend -> backend) packets:
+ *
  *  Fragment 1: netif_tx_request_t  - flags = NETTXF_*
  *                                    size = total packet size
  * [Extra 1: netif_extra_info_t]    - (only if fragment 1 flags include
  *                                     NETTXF_extra_info)
+ *  ...
  * [Extra N: netif_extra_info_t]    - (only if extra N-1 flags include
  *                                     XEN_NETIF_EXTRA_MORE)
  *  ...
  *  Fragment N: netif_tx_request_t  - (only if fragment N-1 flags include
- *                                     NETTXF_more_data)
+ *                                     NETTXF_more_data - flags on preceding
+ *                                     extras are not relevent here)
  *                                    flags = 0
  *                                    size = fragment size
  *
+ * NOTE:
+ *
+ * This format slightly is different from that used for receive
+ * (backend -> frontend) packets. Specifically, in a multi-fragment
+ * packet the actual size of fragment 1 can only be determined by
+ * subtracting the sizes of fragments 2..N from the total packet size.
+ *
  * Ring slot size is 12 octets, however not all request/response
  * structs use the full size.
  *
@@ -202,19 +212,29 @@
  * Guest receive
  * =============
  *
- * This is the 'wire' format for packets:
+ * This is the 'wire' format for receive (backend -> frontend) packets:
+ *
  *  Fragment 1: netif_rx_request_t  - flags = NETRXF_*
  *                                    size = fragment size
  * [Extra 1: netif_extra_info_t]    - (only if fragment 1 flags include
  *                                     NETRXF_extra_info)
+ *  ...
  * [Extra N: netif_extra_info_t]    - (only if extra N-1 flags include
  *                                     XEN_NETIF_EXTRA_MORE)
  *  ...
  *  Fragment N: netif_rx_request_t  - (only if fragment N-1 flags include
- *                                     NETRXF_more_data)
+ *                                     NETRXF_more_data - flags on preceding
+ *                                     extras are not relevent here)
  *                                    flags = 0
  *                                    size = fragment size
  *
+ * NOTE:
+ *
+ * This format slightly is different from that used for transmit
+ * (frontend -> backend) packets. Specifically, in a multi-fragment
+ * packet the size of the packet can only be determined by summing the
+ * sizes of fragments 1..N.
+ *
  * Ring slot size is 8 octets.
  *
  * rx request (netif_rx_request_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 Jan 21 17:09:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:09: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 1aMIjY-0000F0-4w; Thu, 21 Jan 2016 17:09: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 1aMIjW-0000Ei-Cr
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:18 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	9C/25-31122-DB011A65; Thu, 21 Jan 2016 17:09:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1453396156!11395728!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7832 invoked from network); 21 Jan 2016 17:09:17 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:09:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIk8-00009S-5q
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjU-0005KS-4l
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:16 +0000
Date: Thu, 21 Jan 2016 17:09:16 +0000
Message-Id: <E1aMIjU-0005KS-4l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/io/netif.h: clarifications to
	wire formats
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0ebdfa144463eaf8fb762c72798a803111b5b544
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Jan 12 09:58:55 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 10:43:30 2016 +0000

    public/io/netif.h: clarifications to wire formats
    
    My previous patch 03809ae7 "document transmit and receive wire formats
    separately" improved documentation of the receive and transmit wire
    formats but further clarifications were requested.
    
    This patch adds those clarifications.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/io/netif.h |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index 1790ea0..0a3272f 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -154,19 +154,29 @@
  * Guest transmit
  * ==============
  *
- * This is the 'wire' format for packets:
+ * This is the 'wire' format for transmit (frontend -> backend) packets:
+ *
  *  Fragment 1: netif_tx_request_t  - flags = NETTXF_*
  *                                    size = total packet size
  * [Extra 1: netif_extra_info_t]    - (only if fragment 1 flags include
  *                                     NETTXF_extra_info)
+ *  ...
  * [Extra N: netif_extra_info_t]    - (only if extra N-1 flags include
  *                                     XEN_NETIF_EXTRA_MORE)
  *  ...
  *  Fragment N: netif_tx_request_t  - (only if fragment N-1 flags include
- *                                     NETTXF_more_data)
+ *                                     NETTXF_more_data - flags on preceding
+ *                                     extras are not relevent here)
  *                                    flags = 0
  *                                    size = fragment size
  *
+ * NOTE:
+ *
+ * This format slightly is different from that used for receive
+ * (backend -> frontend) packets. Specifically, in a multi-fragment
+ * packet the actual size of fragment 1 can only be determined by
+ * subtracting the sizes of fragments 2..N from the total packet size.
+ *
  * Ring slot size is 12 octets, however not all request/response
  * structs use the full size.
  *
@@ -202,19 +212,29 @@
  * Guest receive
  * =============
  *
- * This is the 'wire' format for packets:
+ * This is the 'wire' format for receive (backend -> frontend) packets:
+ *
  *  Fragment 1: netif_rx_request_t  - flags = NETRXF_*
  *                                    size = fragment size
  * [Extra 1: netif_extra_info_t]    - (only if fragment 1 flags include
  *                                     NETRXF_extra_info)
+ *  ...
  * [Extra N: netif_extra_info_t]    - (only if extra N-1 flags include
  *                                     XEN_NETIF_EXTRA_MORE)
  *  ...
  *  Fragment N: netif_rx_request_t  - (only if fragment N-1 flags include
- *                                     NETRXF_more_data)
+ *                                     NETRXF_more_data - flags on preceding
+ *                                     extras are not relevent here)
  *                                    flags = 0
  *                                    size = fragment size
  *
+ * NOTE:
+ *
+ * This format slightly is different from that used for transmit
+ * (frontend -> backend) packets. Specifically, in a multi-fragment
+ * packet the size of the packet can only be determined by summing the
+ * sizes of fragments 1..N.
+ *
  * Ring slot size is 8 octets.
  *
  * rx request (netif_rx_request_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 Jan 21 17:09:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:09: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 1aMIjj-0000HH-9N; Thu, 21 Jan 2016 17:09: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 1aMIjh-0000Gp-NA
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:29 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	C3/65-31122-9C011A65; Thu, 21 Jan 2016 17:09:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1453396166!11527176!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56659 invoked from network); 21 Jan 2016 17:09:27 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:09:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkI-0000A3-Fo
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIje-0005L5-DP
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:26 +0000
Date: Thu, 21 Jan 2016 17:09:26 +0000
Message-Id: <E1aMIje-0005L5-DP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/io/netif.h: document control
	ring and toeplitz hashing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 162a81abb1c55ff77a3fcc82c7971a766ca122f6
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Jan 12 09:58:56 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 10:43:30 2016 +0000

    public/io/netif.h: document control ring and toeplitz hashing
    
    This patch documents a new shared ring between frontend and backend that
    can be used to pass bulk out-of-band data, such as that required to
    implement toeplitz hashing in the backend such that it is configurable by
    the frontend (which is needed to support NDIS RSS for Windows guests).
    
    The patch then goes on to document the messages passed over the control
    ring that can be used to configure toeplitz hashing and a new extra info
    fragment that can be used to pass hash values between frontend and
    backend for both transmit and receive packets.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/io/netif.h |  380 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 379 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index 0a3272f..fe0a87f 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -151,6 +151,361 @@
  */
 
 /*
+ * Control ring
+ * ============
+ *
+ * Some features, such as toeplitz hashing (detailed below), require a
+ * significant amount of out-of-band data to be passed from frontend to
+ * backend. Use of xenstore is not suitable for large quantities of data
+ * because of quota limitations and so a dedicated 'control ring' is used.
+ * The ability of the backend to use a control ring is advertised by
+ * setting:
+ *
+ * /local/domain/X/backend/<domid>/<vif>/feature-ctrl-ring = "1"
+ *
+ * The frontend provides a control ring to the backend by setting:
+ *
+ * /local/domain/<domid>/device/vif/<vif>/ctrl-ring-ref = <gref>
+ * /local/domain/<domid>/device/vif/<vif>/event-channel-ctrl = <port>
+ *
+ * where <gref> is the grant reference of the shared page used to
+ * implement the control ring and <port> is an event channel to be used
+ * as a mailbox interrupt. These keys must be set before the frontend
+ * moves into the connected state.
+ *
+ * The control ring uses a fixed request/response message size and is
+ * balanced (i.e. one request to one response), so operationally it is much
+ * the same as a transmit or receive ring.
+ * Note that there is no requirement that responses are issued in the same
+ * order as requests.
+ */
+
+/*
+ * Toeplitz hash types
+ * ===================
+ *
+ * For the purposes of the definitions below, 'Packet[]' is an array of
+ * octets containing an IP packet without options, 'Array[X..Y]' means a
+ * sub-array of 'Array' containing bytes X thru Y inclusive, and '+' is
+ * used to indicate concatenation of arrays.
+ */
+
+/*
+ * A hash calculated over an IP version 4 header as follows:
+ *
+ * Buffer[0..8] = Packet[12..15] (source address) +
+ *                Packet[16..19] (destination address)
+ *
+ * Result = ToeplitzHash(Buffer, 8)
+ */
+#define _NETIF_CTRL_TOEPLITZ_HASH_IPV4     0
+#define NETIF_CTRL_TOEPLITZ_HASH_IPV4      (1 << _NETIF_CTRL_TOEPLITZ_HASH_IPV4)
+
+/*
+ * A hash calculated over an IP version 4 header and TCP header as
+ * follows:
+ *
+ * Buffer[0..12] = Packet[12..15] (source address) +
+ *                 Packet[16..19] (destination address) +
+ *                 Packet[20..21] (source port) +
+ *                 Packet[22..23] (destination port)
+ *
+ * Result = ToeplitzHash(Buffer, 12)
+ */
+#define _NETIF_CTRL_TOEPLITZ_HASH_IPV4_TCP 1
+#define NETIF_CTRL_TOEPLITZ_HASH_IPV4_TCP  (1 << _NETIF_CTRL_TOEPLITZ_HASH_IPV4_TCP)
+
+/*
+ * A hash calculated over an IP version 6 header as follows:
+ *
+ * Buffer[0..32] = Packet[8..23]  (source address ) +
+ *                 Packet[24..39] (destination address)
+ *
+ * Result = ToeplitzHash(Buffer, 32)
+ */
+#define _NETIF_CTRL_TOEPLITZ_HASH_IPV6     2
+#define NETIF_CTRL_TOEPLITZ_HASH_IPV6      (1 << _NETIF_CTRL_TOEPLITZ_HASH_IPV4)
+
+/*
+ * A hash calculated over an IP version 6 header and TCP header as
+ * follows:
+ *
+ * Buffer[0..36] = Packet[8..23]  (source address) +
+ *                 Packet[24..39] (destination address) +
+ *                 Packet[40..41] (source port) +
+ *                 Packet[42..43] (destination port)
+ *
+ * Result = ToeplitzHash(Buffer, 36)
+ */
+#define _NETIF_CTRL_TOEPLITZ_HASH_IPV6_TCP 3
+#define NETIF_CTRL_TOEPLITZ_HASH_IPV6_TCP  (1 << _NETIF_CTRL_TOEPLITZ_HASH_IPV4_TCP)
+
+/*
+ * Control requests (netif_ctrl_request_t)
+ * =======================================
+ *
+ * All requests have the following format:
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |    id     |   type    |         data[0]       |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |         data[1]       |         data[2]       |
+ * +-----+-----+-----+-----+-----------------------+
+ *
+ * id: the request identifier, echoed in response.
+ * type: the type of request (see below)
+ * data[]: any data associated with the request (determined by type)
+ */
+
+struct netif_ctrl_request {
+    uint16_t id;
+    uint16_t type;
+
+#define NETIF_CTRL_TYPE_INVALID                    0
+#define NETIF_CTRL_TYPE_GET_TOEPLITZ_FLAGS         1
+#define NETIF_CTRL_TYPE_SET_TOEPLITZ_FLAGS         2
+#define NETIF_CTRL_TYPE_SET_TOEPLITZ_KEY           3
+#define NETIF_CTRL_TYPE_GET_TOEPLITZ_MAPPING_ORDER 4
+#define NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING_ORDER 5
+#define NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING       6
+
+    uint32_t data[3];
+};
+typedef struct netif_ctrl_request netif_ctrl_request_t;
+
+/*
+ * Control responses (netif_ctrl_response_t)
+ * =========================================
+ *
+ * All responses have the following format:
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |    id     |   type    |         status        |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |         data          |
+ * +-----+-----+-----+-----+
+ *
+ * id: the corresponding request identifier
+ * type: the type of the corresponding request
+ * status: the status of request processing
+ * data: any data associated with the response (determined by type and
+ *       status)
+ */
+
+struct netif_ctrl_response {
+    uint16_t id;
+    uint16_t type;
+    uint32_t status;
+
+#define NETIF_CTRL_STATUS_SUCCESS           0
+#define NETIF_CTRL_STATUS_NOT_SUPPORTED     1
+#define NETIF_CTRL_STATUS_INVALID_PARAMETER 2
+#define NETIF_CTRL_STATUS_BUFFER_OVERFLOW   3
+
+    uint32_t data;
+};
+typedef struct netif_ctrl_response netif_ctrl_response_t;
+
+/*
+ * Control messages
+ * ================
+ *
+ * NETIF_CTRL_TYPE_GET_TOEPLITZ_FLAGS
+ * ----------------------------------
+ *
+ * This is sent by the frontend to query the types of toeplitz
+ * hash supported by the backend.
+ *
+ * Request:
+ *
+ *  type    = NETIF_CTRL_TYPE_GET_TOEPLITZ_FLAGS
+ *  data[0] = 0
+ *  data[1] = 0
+ *  data[2] = 0
+ *
+ * Response:
+ *
+ *  status = NETIF_CTRL_STATUS_NOT_SUPPORTED - Operation not supported
+ *           NETIF_CTRL_STATUS_SUCCESS       - Operation successful
+ *  data   = supported hash types (if operation was successful)
+ *
+ * NETIF_CTRL_TYPE_SET_TOEPLITZ_FLAGS
+ * ----------------------------------
+ *
+ * This is sent by the frontend to set the types of toeplitz hash that
+ * the backend should calculate. (See above for hash type definitions).
+ * Note that the 'maximal' type of hash should always be chosen. For
+ * example, if the frontend sets both IPV4 and IPV4_TCP hash types then
+ * the latter hash type should be calculated for any TCP packet and the
+ * former only calculated for non-TCP packets.
+ *
+ * Request:
+ *
+ *  type    = NETIF_CTRL_TYPE_SET_TOEPLITZ_FLAGS
+ *  data[0] = bitwise OR of NETIF_CTRL_TOEPLITZ_HASH_* values
+ *  data[1] = 0
+ *  data[2] = 0
+ *
+ * Response:
+ *
+ *  status = NETIF_CTRL_STATUS_NOT_SUPPORTED     - Operation not supported
+ *           NETIF_CTRL_STATUS_INVALID_PARAMETER - One or more flag value
+ *                                                 is invalid or
+ *                                                 unsupported
+ *           NETIF_CTRL_STATUS_SUCCESS           - Operation successful
+ *  data   = 0
+ *
+ * NOTE: Setting data[0] to zero disables toeplitz hashing and the backend
+ *       is free to choose how it steers packets to queues (which is the
+ *       default behaviour).
+ *
+ * NETIF_CTRL_TYPE_SET_TOEPLITZ_KEY
+ * --------------------------------
+ *
+ * This is sent by the frontend to set the key of the toeplitz hash that
+ * the backend should calculate. The toeplitz algorithm is illustrated
+ * by the following pseudo-code:
+ *
+ * (Buffer[] and Key[] are treated as shift-registers where the MSB of
+ * Buffer/Key[0] is considered 'left-most' and the LSB of Buffer/Key[N-1]
+ * is the 'right-most').
+ *
+ * Value = 0
+ * For number of bits in Buffer[]
+ *    If (left-most bit of Buffer[] is 1)
+ *        Value ^= left-most 32 bits of Key[]
+ *    Key[] << 1
+ *    Buffer[] << 1
+ *
+ * Request:
+ *
+ *  type    = NETIF_CTRL_TYPE_SET_TOEPLITZ_KEY
+ *  data[0] = grant reference of page containing the key (assumed to
+ *            start at beginning of grant)
+ *  data[1] = size of key in octets
+ *  data[2] = 0
+ *
+ * Response:
+ *
+ *  status = NETIF_CTRL_STATUS_NOT_SUPPORTED     - Operation not supported
+ *           NETIF_CTRL_STATUS_INVALID_PARAMETER - Key size is invalid
+ *           NETIF_CTRL_STATUS_BUFFER_OVERFLOW   - Key size is larger than
+ *                                                 the backend supports
+ *           NETIF_CTRL_STATUS_SUCCESS           - Operation successful
+ *  data   = 0
+ *
+ * NOTE: Any key octets not specified are assumed to be zero (the key
+ *       is assumed to be empty by default) and specifying a new key
+ *       invalidates any previous key, hence specifying a key size of
+ *       zero will clear the key (which ensures that the calculated hash
+ *       will always be zero).
+ *       The maximum size of key is backend specific, but is also limited
+ *       by the single grant reference.
+ *       The grant reference may be read-only and must remain valid until
+ *       the response has been processed.
+ *
+ * NETIF_CTRL_TYPE_GET_TOEPLITZ_MAPPING_ORDER
+ * ------------------------------------------
+ *
+ * This is sent by the frontend to query the maximum order of mapping
+ * table supported by the backend. The order is specified in terms of
+ * table entries i.e. the table may contain up to 2^order entries.
+ *
+ * Request:
+ *
+ *  type    = NETIF_CTRL_TYPE_GET_TOEPLITZ_MAPPING_ORDER
+ *  data[0] = 0
+ *  data[1] = 0
+ *  data[2] = 0
+ *
+ * Response:
+ *
+ *  status = NETIF_CTRL_STATUS_NOT_SUPPORTED - Operation not supported
+ *           NETIF_CTRL_STATUS_SUCCESS       - Operation successful
+ *  data   = maximum order of mapping table (if operation was successful)
+ *
+ * NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING_ORDER
+ * ------------------------------------------
+ *
+ * This is sent by the frontend to set the actual order of the mapping
+ * table to be used by the backend. The order is specified in terms of
+ * table entries i.e. the table will contain to 2^order entries.
+ * Any previous table is invalidated by this message and any new table
+ * is assumed to be zero filled. The default order is zero and hence the
+ * default table contains a single entry mapping all hashes to queue-0.
+ *
+ * Request:
+ *
+ *  type    = NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING_ORDER
+ *  data[0] = order of mapping table
+ *  data[1] = 0
+ *  data[2] = 0
+ *
+ * Response:
+ *
+ *  status = NETIF_CTRL_STATUS_NOT_SUPPORTED     - Operation not supported
+ *           NETIF_CTRL_STATUS_INVALID_PARAMETER - Table order is invalid
+ *           NETIF_CTRL_STATUS_SUCCESS           - Operation successful
+ *  data   = 0
+ *
+ * NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING
+ * ------------------------------------
+ *
+ * This is sent by the frontend to set the content of the table mapping
+ * toeplitz hash value to queue number. The backend should calculate the
+ * hash from the packet header, use it as an index into the table (modulo
+ * the size of the table) and then steer the packet to the queue number
+ * found at that index.
+ *
+ * Request:
+ *
+ *  type    = NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING
+ *  data[0] = grant reference of page containing the mapping (sub-)table
+ *            (assumed to start at beginning of grant)
+ *  data[1] = size of (sub-)table in entries
+ *  data[2] = offset, in entries, of sub-table within overall table
+ *
+ * Response:
+ *
+ *  status = NETIF_CTRL_STATUS_NOT_SUPPORTED     - Operation not supported
+ *           NETIF_CTRL_STATUS_INVALID_PARAMETER - Table size or content is
+ *                                                 invalid
+ *           NETIF_CTRL_STATUS_BUFFER_OVERFLOW   - Table size is larger than
+ *                                                 the backend supports
+ *           NETIF_CTRL_STATUS_SUCCESS           - Operation successful
+ *  data   = 0
+ *
+ * NOTE: The overall table has the following format:
+ *
+ *          0     1     2     3     4     5     6     7  octet
+ *       +-----+-----+-----+-----+-----+-----+-----+-----+
+ *       |       mapping[0]      |       mapping[1]      |
+ *       +-----+-----+-----+-----+-----+-----+-----+-----+
+ *       |                       .                       |
+ *       |                       .                       |
+ *       |                       .                       |
+ *       +-----+-----+-----+-----+-----+-----+-----+-----+
+ *       |      mapping[N-2]     |      mapping[N-1]     |
+ *       +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ *       where N == 2^order as specified by a
+ *       NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING_ORDER message and each
+ *       mapping must specifies a queue between 0 and
+ *       "multi-queue-num-queues" (see above).
+ *       The backend may support a mapping table larger than can be
+ *       mapped by a single grant reference. Thus sub-tables within a
+ *       larger table can be individually set by sending multiple messages
+ *       with differing offset values. Specifying a new sub-table does not
+ *       invalidate any table data outside that range.
+ *       The grant reference may be read-only and must remain valid until
+ *       the response has been processed.
+ */
+
+DEFINE_RING_TYPES(netif_ctrl, struct netif_ctrl_request, struct netif_ctrl_response);
+
+/*
  * Guest transmit
  * ==============
  *
@@ -330,6 +685,23 @@
  * type: Must be XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}
  * flags: XEN_NETIF_EXTRA_FLAG_*
  * addr: address to add/remove
+ *
+ * XEN_NETIF_EXTRA_TYPE_TOEPLITZ:
+ *
+ * A backend that supports teoplitz hashing is assumed to accept
+ * this type of extra info in transmit packets.
+ * A frontend that enables toeplitz hashing is assumed to accept
+ * this type of extra info in receive packets.
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |type |flags|htype| pad |LSB ---- value ---- MSB|
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ * type: Must be XEN_NETIF_EXTRA_TYPE_TOEPLITZ
+ * flags: XEN_NETIF_EXTRA_FLAG_*
+ * htype: Hash type (one of _NETIF_CTRL_TOEPLITZ_HASH_* - see above)
+ * value: Hash value
  */
 
 /* Protocol checksum field is blank in the packet (hardware offload)? */
@@ -363,7 +735,8 @@ typedef struct netif_tx_request netif_tx_request_t;
 #define XEN_NETIF_EXTRA_TYPE_GSO       (1)  /* u.gso */
 #define XEN_NETIF_EXTRA_TYPE_MCAST_ADD (2)  /* u.mcast */
 #define XEN_NETIF_EXTRA_TYPE_MCAST_DEL (3)  /* u.mcast */
-#define XEN_NETIF_EXTRA_TYPE_MAX       (4)
+#define XEN_NETIF_EXTRA_TYPE_TOEPLITZ  (4)  /* u.toeplitz */
+#define XEN_NETIF_EXTRA_TYPE_MAX       (5)
 
 /* netif_extra_info_t flags. */
 #define _XEN_NETIF_EXTRA_FLAG_MORE (0)
@@ -391,6 +764,11 @@ struct netif_extra_info {
         struct {
             uint8_t addr[6];
         } mcast;
+        struct {
+            uint8_t type;
+            uint8_t pad;
+            uint8_t value[4];
+        } toeplitz;
         uint16_t pad[3];
     } u;
 };
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:09:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:09: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 1aMIjj-0000HH-9N; Thu, 21 Jan 2016 17:09: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 1aMIjh-0000Gp-NA
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:29 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	C3/65-31122-9C011A65; Thu, 21 Jan 2016 17:09:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1453396166!11527176!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56659 invoked from network); 21 Jan 2016 17:09:27 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:09:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkI-0000A3-Fo
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIje-0005L5-DP
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:26 +0000
Date: Thu, 21 Jan 2016 17:09:26 +0000
Message-Id: <E1aMIje-0005L5-DP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/io/netif.h: document control
	ring and toeplitz hashing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 162a81abb1c55ff77a3fcc82c7971a766ca122f6
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Jan 12 09:58:56 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 10:43:30 2016 +0000

    public/io/netif.h: document control ring and toeplitz hashing
    
    This patch documents a new shared ring between frontend and backend that
    can be used to pass bulk out-of-band data, such as that required to
    implement toeplitz hashing in the backend such that it is configurable by
    the frontend (which is needed to support NDIS RSS for Windows guests).
    
    The patch then goes on to document the messages passed over the control
    ring that can be used to configure toeplitz hashing and a new extra info
    fragment that can be used to pass hash values between frontend and
    backend for both transmit and receive packets.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/io/netif.h |  380 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 379 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index 0a3272f..fe0a87f 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -151,6 +151,361 @@
  */
 
 /*
+ * Control ring
+ * ============
+ *
+ * Some features, such as toeplitz hashing (detailed below), require a
+ * significant amount of out-of-band data to be passed from frontend to
+ * backend. Use of xenstore is not suitable for large quantities of data
+ * because of quota limitations and so a dedicated 'control ring' is used.
+ * The ability of the backend to use a control ring is advertised by
+ * setting:
+ *
+ * /local/domain/X/backend/<domid>/<vif>/feature-ctrl-ring = "1"
+ *
+ * The frontend provides a control ring to the backend by setting:
+ *
+ * /local/domain/<domid>/device/vif/<vif>/ctrl-ring-ref = <gref>
+ * /local/domain/<domid>/device/vif/<vif>/event-channel-ctrl = <port>
+ *
+ * where <gref> is the grant reference of the shared page used to
+ * implement the control ring and <port> is an event channel to be used
+ * as a mailbox interrupt. These keys must be set before the frontend
+ * moves into the connected state.
+ *
+ * The control ring uses a fixed request/response message size and is
+ * balanced (i.e. one request to one response), so operationally it is much
+ * the same as a transmit or receive ring.
+ * Note that there is no requirement that responses are issued in the same
+ * order as requests.
+ */
+
+/*
+ * Toeplitz hash types
+ * ===================
+ *
+ * For the purposes of the definitions below, 'Packet[]' is an array of
+ * octets containing an IP packet without options, 'Array[X..Y]' means a
+ * sub-array of 'Array' containing bytes X thru Y inclusive, and '+' is
+ * used to indicate concatenation of arrays.
+ */
+
+/*
+ * A hash calculated over an IP version 4 header as follows:
+ *
+ * Buffer[0..8] = Packet[12..15] (source address) +
+ *                Packet[16..19] (destination address)
+ *
+ * Result = ToeplitzHash(Buffer, 8)
+ */
+#define _NETIF_CTRL_TOEPLITZ_HASH_IPV4     0
+#define NETIF_CTRL_TOEPLITZ_HASH_IPV4      (1 << _NETIF_CTRL_TOEPLITZ_HASH_IPV4)
+
+/*
+ * A hash calculated over an IP version 4 header and TCP header as
+ * follows:
+ *
+ * Buffer[0..12] = Packet[12..15] (source address) +
+ *                 Packet[16..19] (destination address) +
+ *                 Packet[20..21] (source port) +
+ *                 Packet[22..23] (destination port)
+ *
+ * Result = ToeplitzHash(Buffer, 12)
+ */
+#define _NETIF_CTRL_TOEPLITZ_HASH_IPV4_TCP 1
+#define NETIF_CTRL_TOEPLITZ_HASH_IPV4_TCP  (1 << _NETIF_CTRL_TOEPLITZ_HASH_IPV4_TCP)
+
+/*
+ * A hash calculated over an IP version 6 header as follows:
+ *
+ * Buffer[0..32] = Packet[8..23]  (source address ) +
+ *                 Packet[24..39] (destination address)
+ *
+ * Result = ToeplitzHash(Buffer, 32)
+ */
+#define _NETIF_CTRL_TOEPLITZ_HASH_IPV6     2
+#define NETIF_CTRL_TOEPLITZ_HASH_IPV6      (1 << _NETIF_CTRL_TOEPLITZ_HASH_IPV4)
+
+/*
+ * A hash calculated over an IP version 6 header and TCP header as
+ * follows:
+ *
+ * Buffer[0..36] = Packet[8..23]  (source address) +
+ *                 Packet[24..39] (destination address) +
+ *                 Packet[40..41] (source port) +
+ *                 Packet[42..43] (destination port)
+ *
+ * Result = ToeplitzHash(Buffer, 36)
+ */
+#define _NETIF_CTRL_TOEPLITZ_HASH_IPV6_TCP 3
+#define NETIF_CTRL_TOEPLITZ_HASH_IPV6_TCP  (1 << _NETIF_CTRL_TOEPLITZ_HASH_IPV4_TCP)
+
+/*
+ * Control requests (netif_ctrl_request_t)
+ * =======================================
+ *
+ * All requests have the following format:
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |    id     |   type    |         data[0]       |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |         data[1]       |         data[2]       |
+ * +-----+-----+-----+-----+-----------------------+
+ *
+ * id: the request identifier, echoed in response.
+ * type: the type of request (see below)
+ * data[]: any data associated with the request (determined by type)
+ */
+
+struct netif_ctrl_request {
+    uint16_t id;
+    uint16_t type;
+
+#define NETIF_CTRL_TYPE_INVALID                    0
+#define NETIF_CTRL_TYPE_GET_TOEPLITZ_FLAGS         1
+#define NETIF_CTRL_TYPE_SET_TOEPLITZ_FLAGS         2
+#define NETIF_CTRL_TYPE_SET_TOEPLITZ_KEY           3
+#define NETIF_CTRL_TYPE_GET_TOEPLITZ_MAPPING_ORDER 4
+#define NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING_ORDER 5
+#define NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING       6
+
+    uint32_t data[3];
+};
+typedef struct netif_ctrl_request netif_ctrl_request_t;
+
+/*
+ * Control responses (netif_ctrl_response_t)
+ * =========================================
+ *
+ * All responses have the following format:
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |    id     |   type    |         status        |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |         data          |
+ * +-----+-----+-----+-----+
+ *
+ * id: the corresponding request identifier
+ * type: the type of the corresponding request
+ * status: the status of request processing
+ * data: any data associated with the response (determined by type and
+ *       status)
+ */
+
+struct netif_ctrl_response {
+    uint16_t id;
+    uint16_t type;
+    uint32_t status;
+
+#define NETIF_CTRL_STATUS_SUCCESS           0
+#define NETIF_CTRL_STATUS_NOT_SUPPORTED     1
+#define NETIF_CTRL_STATUS_INVALID_PARAMETER 2
+#define NETIF_CTRL_STATUS_BUFFER_OVERFLOW   3
+
+    uint32_t data;
+};
+typedef struct netif_ctrl_response netif_ctrl_response_t;
+
+/*
+ * Control messages
+ * ================
+ *
+ * NETIF_CTRL_TYPE_GET_TOEPLITZ_FLAGS
+ * ----------------------------------
+ *
+ * This is sent by the frontend to query the types of toeplitz
+ * hash supported by the backend.
+ *
+ * Request:
+ *
+ *  type    = NETIF_CTRL_TYPE_GET_TOEPLITZ_FLAGS
+ *  data[0] = 0
+ *  data[1] = 0
+ *  data[2] = 0
+ *
+ * Response:
+ *
+ *  status = NETIF_CTRL_STATUS_NOT_SUPPORTED - Operation not supported
+ *           NETIF_CTRL_STATUS_SUCCESS       - Operation successful
+ *  data   = supported hash types (if operation was successful)
+ *
+ * NETIF_CTRL_TYPE_SET_TOEPLITZ_FLAGS
+ * ----------------------------------
+ *
+ * This is sent by the frontend to set the types of toeplitz hash that
+ * the backend should calculate. (See above for hash type definitions).
+ * Note that the 'maximal' type of hash should always be chosen. For
+ * example, if the frontend sets both IPV4 and IPV4_TCP hash types then
+ * the latter hash type should be calculated for any TCP packet and the
+ * former only calculated for non-TCP packets.
+ *
+ * Request:
+ *
+ *  type    = NETIF_CTRL_TYPE_SET_TOEPLITZ_FLAGS
+ *  data[0] = bitwise OR of NETIF_CTRL_TOEPLITZ_HASH_* values
+ *  data[1] = 0
+ *  data[2] = 0
+ *
+ * Response:
+ *
+ *  status = NETIF_CTRL_STATUS_NOT_SUPPORTED     - Operation not supported
+ *           NETIF_CTRL_STATUS_INVALID_PARAMETER - One or more flag value
+ *                                                 is invalid or
+ *                                                 unsupported
+ *           NETIF_CTRL_STATUS_SUCCESS           - Operation successful
+ *  data   = 0
+ *
+ * NOTE: Setting data[0] to zero disables toeplitz hashing and the backend
+ *       is free to choose how it steers packets to queues (which is the
+ *       default behaviour).
+ *
+ * NETIF_CTRL_TYPE_SET_TOEPLITZ_KEY
+ * --------------------------------
+ *
+ * This is sent by the frontend to set the key of the toeplitz hash that
+ * the backend should calculate. The toeplitz algorithm is illustrated
+ * by the following pseudo-code:
+ *
+ * (Buffer[] and Key[] are treated as shift-registers where the MSB of
+ * Buffer/Key[0] is considered 'left-most' and the LSB of Buffer/Key[N-1]
+ * is the 'right-most').
+ *
+ * Value = 0
+ * For number of bits in Buffer[]
+ *    If (left-most bit of Buffer[] is 1)
+ *        Value ^= left-most 32 bits of Key[]
+ *    Key[] << 1
+ *    Buffer[] << 1
+ *
+ * Request:
+ *
+ *  type    = NETIF_CTRL_TYPE_SET_TOEPLITZ_KEY
+ *  data[0] = grant reference of page containing the key (assumed to
+ *            start at beginning of grant)
+ *  data[1] = size of key in octets
+ *  data[2] = 0
+ *
+ * Response:
+ *
+ *  status = NETIF_CTRL_STATUS_NOT_SUPPORTED     - Operation not supported
+ *           NETIF_CTRL_STATUS_INVALID_PARAMETER - Key size is invalid
+ *           NETIF_CTRL_STATUS_BUFFER_OVERFLOW   - Key size is larger than
+ *                                                 the backend supports
+ *           NETIF_CTRL_STATUS_SUCCESS           - Operation successful
+ *  data   = 0
+ *
+ * NOTE: Any key octets not specified are assumed to be zero (the key
+ *       is assumed to be empty by default) and specifying a new key
+ *       invalidates any previous key, hence specifying a key size of
+ *       zero will clear the key (which ensures that the calculated hash
+ *       will always be zero).
+ *       The maximum size of key is backend specific, but is also limited
+ *       by the single grant reference.
+ *       The grant reference may be read-only and must remain valid until
+ *       the response has been processed.
+ *
+ * NETIF_CTRL_TYPE_GET_TOEPLITZ_MAPPING_ORDER
+ * ------------------------------------------
+ *
+ * This is sent by the frontend to query the maximum order of mapping
+ * table supported by the backend. The order is specified in terms of
+ * table entries i.e. the table may contain up to 2^order entries.
+ *
+ * Request:
+ *
+ *  type    = NETIF_CTRL_TYPE_GET_TOEPLITZ_MAPPING_ORDER
+ *  data[0] = 0
+ *  data[1] = 0
+ *  data[2] = 0
+ *
+ * Response:
+ *
+ *  status = NETIF_CTRL_STATUS_NOT_SUPPORTED - Operation not supported
+ *           NETIF_CTRL_STATUS_SUCCESS       - Operation successful
+ *  data   = maximum order of mapping table (if operation was successful)
+ *
+ * NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING_ORDER
+ * ------------------------------------------
+ *
+ * This is sent by the frontend to set the actual order of the mapping
+ * table to be used by the backend. The order is specified in terms of
+ * table entries i.e. the table will contain to 2^order entries.
+ * Any previous table is invalidated by this message and any new table
+ * is assumed to be zero filled. The default order is zero and hence the
+ * default table contains a single entry mapping all hashes to queue-0.
+ *
+ * Request:
+ *
+ *  type    = NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING_ORDER
+ *  data[0] = order of mapping table
+ *  data[1] = 0
+ *  data[2] = 0
+ *
+ * Response:
+ *
+ *  status = NETIF_CTRL_STATUS_NOT_SUPPORTED     - Operation not supported
+ *           NETIF_CTRL_STATUS_INVALID_PARAMETER - Table order is invalid
+ *           NETIF_CTRL_STATUS_SUCCESS           - Operation successful
+ *  data   = 0
+ *
+ * NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING
+ * ------------------------------------
+ *
+ * This is sent by the frontend to set the content of the table mapping
+ * toeplitz hash value to queue number. The backend should calculate the
+ * hash from the packet header, use it as an index into the table (modulo
+ * the size of the table) and then steer the packet to the queue number
+ * found at that index.
+ *
+ * Request:
+ *
+ *  type    = NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING
+ *  data[0] = grant reference of page containing the mapping (sub-)table
+ *            (assumed to start at beginning of grant)
+ *  data[1] = size of (sub-)table in entries
+ *  data[2] = offset, in entries, of sub-table within overall table
+ *
+ * Response:
+ *
+ *  status = NETIF_CTRL_STATUS_NOT_SUPPORTED     - Operation not supported
+ *           NETIF_CTRL_STATUS_INVALID_PARAMETER - Table size or content is
+ *                                                 invalid
+ *           NETIF_CTRL_STATUS_BUFFER_OVERFLOW   - Table size is larger than
+ *                                                 the backend supports
+ *           NETIF_CTRL_STATUS_SUCCESS           - Operation successful
+ *  data   = 0
+ *
+ * NOTE: The overall table has the following format:
+ *
+ *          0     1     2     3     4     5     6     7  octet
+ *       +-----+-----+-----+-----+-----+-----+-----+-----+
+ *       |       mapping[0]      |       mapping[1]      |
+ *       +-----+-----+-----+-----+-----+-----+-----+-----+
+ *       |                       .                       |
+ *       |                       .                       |
+ *       |                       .                       |
+ *       +-----+-----+-----+-----+-----+-----+-----+-----+
+ *       |      mapping[N-2]     |      mapping[N-1]     |
+ *       +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ *       where N == 2^order as specified by a
+ *       NETIF_CTRL_TYPE_SET_TOEPLITZ_MAPPING_ORDER message and each
+ *       mapping must specifies a queue between 0 and
+ *       "multi-queue-num-queues" (see above).
+ *       The backend may support a mapping table larger than can be
+ *       mapped by a single grant reference. Thus sub-tables within a
+ *       larger table can be individually set by sending multiple messages
+ *       with differing offset values. Specifying a new sub-table does not
+ *       invalidate any table data outside that range.
+ *       The grant reference may be read-only and must remain valid until
+ *       the response has been processed.
+ */
+
+DEFINE_RING_TYPES(netif_ctrl, struct netif_ctrl_request, struct netif_ctrl_response);
+
+/*
  * Guest transmit
  * ==============
  *
@@ -330,6 +685,23 @@
  * type: Must be XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}
  * flags: XEN_NETIF_EXTRA_FLAG_*
  * addr: address to add/remove
+ *
+ * XEN_NETIF_EXTRA_TYPE_TOEPLITZ:
+ *
+ * A backend that supports teoplitz hashing is assumed to accept
+ * this type of extra info in transmit packets.
+ * A frontend that enables toeplitz hashing is assumed to accept
+ * this type of extra info in receive packets.
+ *
+ *    0     1     2     3     4     5     6     7  octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |type |flags|htype| pad |LSB ---- value ---- MSB|
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ * type: Must be XEN_NETIF_EXTRA_TYPE_TOEPLITZ
+ * flags: XEN_NETIF_EXTRA_FLAG_*
+ * htype: Hash type (one of _NETIF_CTRL_TOEPLITZ_HASH_* - see above)
+ * value: Hash value
  */
 
 /* Protocol checksum field is blank in the packet (hardware offload)? */
@@ -363,7 +735,8 @@ typedef struct netif_tx_request netif_tx_request_t;
 #define XEN_NETIF_EXTRA_TYPE_GSO       (1)  /* u.gso */
 #define XEN_NETIF_EXTRA_TYPE_MCAST_ADD (2)  /* u.mcast */
 #define XEN_NETIF_EXTRA_TYPE_MCAST_DEL (3)  /* u.mcast */
-#define XEN_NETIF_EXTRA_TYPE_MAX       (4)
+#define XEN_NETIF_EXTRA_TYPE_TOEPLITZ  (4)  /* u.toeplitz */
+#define XEN_NETIF_EXTRA_TYPE_MAX       (5)
 
 /* netif_extra_info_t flags. */
 #define _XEN_NETIF_EXTRA_FLAG_MORE (0)
@@ -391,6 +764,11 @@ struct netif_extra_info {
         struct {
             uint8_t addr[6];
         } mcast;
+        struct {
+            uint8_t type;
+            uint8_t pad;
+            uint8_t value[4];
+        } toeplitz;
         uint16_t pad[3];
     } u;
 };
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:09:41 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:09: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 1aMIjt-0000Jw-Lj; Thu, 21 Jan 2016 17:09: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 1aMIjr-0000JS-F1
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:39 +0000
Content-Length: 2699
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	6D/D0-17090-2D011A65; Thu, 21 Jan 2016 17:09:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1453396177!17297816!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37781 invoked from network); 21 Jan 2016 17:09:37 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:09:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkS-0000AB-OY
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjo-0005MO-Nz
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:36 +0000
Date: Thu, 21 Jan 2016 17:09:36 +0000
Message-Id: <E1aMIjo-0005MO-Nz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] elfnotes: check phys_entry against
	UNSET_ADDR32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============7818380737800237174=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7818380737800237174==
Content-Length: 2305
Content-Transfer-Encoding: quoted-printable

commit c2ba8c24f34426c993afa841bf94d933d2461cd9
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Jan 19 16:06:31 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 19 16:06:31 2016 +0100

    elfnotes: check phys_entry against UNSET_ADDR32
    
    And introduce UNSET_ADDR32.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_elfloader.c     |    2 +-
 xen/common/libelf/libelf-dominfo.c |    1 +
 xen/include/xen/libelf.h           |    1 +
 3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 2ae575e..5039f3f 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -57,7 +57,7 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
     uint64_t machine =3D elf_uval(elf, elf->ehdr, e_machine);
 
     if ( dom->container_type =3D=3D XC_DOM_HVM_CONTAINER &&
-         dom->parms.phys_entry !=3D UNSET_ADDR )
+         dom->parms.phys_entry !=3D UNSET_ADDR32 )
         return "hvm-3.0-x86_32";
 
     switch ( machine )
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index 02d6cfb..ec69449 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -503,6 +503,7 @@ elf_errorstatus elf_xen_parse(struct elf_binary *elf,
     parms->virt_hv_start_low =3D UNSET_ADDR;
     parms->p2m_base =3D UNSET_ADDR;
     parms->elf_paddr_offset =3D UNSET_ADDR;
+    parms->phys_entry =3D UNSET_ADDR32;
 
     /* Find and parse elf notes. */
     count =3D elf_phdr_count(elf);
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index 6da4cc0..95b5370 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -386,6 +386,7 @@ elf_errorstatus elf_reloc(struct elf_binary *elf);
 /* xc_libelf_dominfo.c                                                      */
 
 #define UNSET_ADDR          ((uint64_t)-1)
+#define UNSET_ADDR32        ((uint32_t)-1)
 
 enum xen_elfnote_type {
     XEN_ENT_NONE =3D 0,
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:09:41 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:09: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 1aMIjt-0000Jw-Lj; Thu, 21 Jan 2016 17:09: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 1aMIjr-0000JS-F1
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:39 +0000
Content-Length: 2699
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	6D/D0-17090-2D011A65; Thu, 21 Jan 2016 17:09:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1453396177!17297816!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37781 invoked from network); 21 Jan 2016 17:09:37 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:09:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkS-0000AB-OY
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjo-0005MO-Nz
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:36 +0000
Date: Thu, 21 Jan 2016 17:09:36 +0000
Message-Id: <E1aMIjo-0005MO-Nz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] elfnotes: check phys_entry against
	UNSET_ADDR32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============7818380737800237174=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7818380737800237174==
Content-Length: 2305
Content-Transfer-Encoding: quoted-printable

commit c2ba8c24f34426c993afa841bf94d933d2461cd9
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Jan 19 16:06:31 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 19 16:06:31 2016 +0100

    elfnotes: check phys_entry against UNSET_ADDR32
    
    And introduce UNSET_ADDR32.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_elfloader.c     |    2 +-
 xen/common/libelf/libelf-dominfo.c |    1 +
 xen/include/xen/libelf.h           |    1 +
 3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 2ae575e..5039f3f 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -57,7 +57,7 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
     uint64_t machine =3D elf_uval(elf, elf->ehdr, e_machine);
 
     if ( dom->container_type =3D=3D XC_DOM_HVM_CONTAINER &&
-         dom->parms.phys_entry !=3D UNSET_ADDR )
+         dom->parms.phys_entry !=3D UNSET_ADDR32 )
         return "hvm-3.0-x86_32";
 
     switch ( machine )
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index 02d6cfb..ec69449 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -503,6 +503,7 @@ elf_errorstatus elf_xen_parse(struct elf_binary *elf,
     parms->virt_hv_start_low =3D UNSET_ADDR;
     parms->p2m_base =3D UNSET_ADDR;
     parms->elf_paddr_offset =3D UNSET_ADDR;
+    parms->phys_entry =3D UNSET_ADDR32;
 
     /* Find and parse elf notes. */
     count =3D elf_phdr_count(elf);
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index 6da4cc0..95b5370 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -386,6 +386,7 @@ elf_errorstatus elf_reloc(struct elf_binary *elf);
 /* xc_libelf_dominfo.c                                                      */
 
 #define UNSET_ADDR          ((uint64_t)-1)
+#define UNSET_ADDR32        ((uint32_t)-1)
 
 enum xen_elfnote_type {
     XEN_ENT_NONE =3D 0,
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:09:50 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:09: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 1aMIk1-0000Mg-RC; Thu, 21 Jan 2016 17:09: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 1aMIk1-0000MO-3N
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:49 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	5B/D7-08977-CD011A65; Thu, 21 Jan 2016 17:09:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1453396187!11380002!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11056 invoked from network); 21 Jan 2016 17:09:48 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:09:48 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkd-0000AS-0I
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjz-0005N1-0F
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:47 +0000
Date: Thu, 21 Jan 2016 17:09:47 +0000
Message-Id: <E1aMIjz-0005N1-0F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: scale host TSC when
	setting/getting guest TSC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 52fd9a46f6e9eb050a6b402ce3b04fa57907acc5
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Tue Jan 19 16:07:15 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 19 16:07:15 2016 +0100

    x86/hvm: scale host TSC when setting/getting guest TSC
    
    The existing hvm_[set|get]_guest_tsc_fixed() calculate the guest TSC by
    adding the TSC offset to the host TSC. When the TSC scaling is enabled,
    the host TSC should be scaled first. This patch adds the scaling logic
    to those two functions.
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/hvm.c        |   17 +++++++----------
 xen/arch/x86/hvm/svm/svm.c    |    9 +++++++++
 xen/include/asm-x86/hvm/hvm.h |    2 ++
 3 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index f646c1e..e0cb82d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -60,6 +60,7 @@
 #include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/event.h>
 #include <asm/hvm/vmx/vmx.h>
+#include <asm/hvm/svm/svm.h> /* for cpu_has_tsc_ratio */
 #include <asm/altp2m.h>
 #include <asm/mtrr.h>
 #include <asm/apic.h>
@@ -310,13 +311,11 @@ void hvm_set_guest_tsc_fixed(struct vcpu *v, u64 guest_tsc, u64 at_tsc)
         tsc = hvm_get_guest_time_fixed(v, at_tsc);
         tsc = gtime_to_gtsc(v->domain, tsc);
     }
-    else if ( at_tsc )
-    {
-        tsc = at_tsc;
-    }
     else
     {
-        tsc = rdtsc();
+        tsc = at_tsc ?: rdtsc();
+        if ( cpu_has_tsc_ratio )
+            tsc = hvm_funcs.scale_tsc(v, tsc);
     }
 
     delta_tsc = guest_tsc - tsc;
@@ -344,13 +343,11 @@ u64 hvm_get_guest_tsc_fixed(struct vcpu *v, uint64_t at_tsc)
         tsc = hvm_get_guest_time_fixed(v, at_tsc);
         tsc = gtime_to_gtsc(v->domain, tsc);
     }
-    else if ( at_tsc )
-    {
-        tsc = at_tsc;
-    }
     else
     {
-        tsc = rdtsc();
+        tsc = at_tsc ?: rdtsc();
+        if ( cpu_has_tsc_ratio )
+            tsc = hvm_funcs.scale_tsc(v, tsc);
     }
 
     return tsc + v->arch.hvm_vcpu.cache_tsc_offset;
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index a66d854..a46bc98 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -804,6 +804,13 @@ static uint64_t scale_tsc(uint64_t host_tsc, uint64_t ratio)
     return scaled_host_tsc;
 }
 
+static uint64_t svm_scale_tsc(const struct vcpu *v, uint64_t tsc)
+{
+    ASSERT(cpu_has_tsc_ratio && !v->domain->arch.vtsc);
+
+    return scale_tsc(tsc, vcpu_tsc_ratio(v));
+}
+
 static uint64_t svm_get_tsc_offset(uint64_t host_tsc, uint64_t guest_tsc,
     uint64_t ratio)
 {
@@ -2272,6 +2279,8 @@ static struct hvm_function_table __initdata svm_function_table = {
     .nhvm_vmcx_hap_enabled = nsvm_vmcb_hap_enabled,
     .nhvm_intr_blocked = nsvm_intr_blocked,
     .nhvm_hap_walk_L1_p2m = nsvm_hap_walk_L1_p2m,
+
+    .scale_tsc            = svm_scale_tsc,
 };
 
 void svm_vmexit_handler(struct cpu_user_regs *regs)
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index b9d893d..a87224b 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -212,6 +212,8 @@ struct hvm_function_table {
     void (*altp2m_vcpu_update_vmfunc_ve)(struct vcpu *v);
     bool_t (*altp2m_vcpu_emulate_ve)(struct vcpu *v);
     int (*altp2m_vcpu_emulate_vmfunc)(struct cpu_user_regs *regs);
+
+    uint64_t (*scale_tsc)(const struct vcpu *v, uint64_t tsc);
 };
 
 extern struct hvm_function_table hvm_funcs;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:09:50 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:09: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 1aMIk1-0000Mg-RC; Thu, 21 Jan 2016 17:09: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 1aMIk1-0000MO-3N
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:49 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	5B/D7-08977-CD011A65; Thu, 21 Jan 2016 17:09:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1453396187!11380002!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11056 invoked from network); 21 Jan 2016 17:09:48 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:09:48 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkd-0000AS-0I
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIjz-0005N1-0F
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:47 +0000
Date: Thu, 21 Jan 2016 17:09:47 +0000
Message-Id: <E1aMIjz-0005N1-0F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: scale host TSC when
	setting/getting guest TSC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 52fd9a46f6e9eb050a6b402ce3b04fa57907acc5
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Tue Jan 19 16:07:15 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 19 16:07:15 2016 +0100

    x86/hvm: scale host TSC when setting/getting guest TSC
    
    The existing hvm_[set|get]_guest_tsc_fixed() calculate the guest TSC by
    adding the TSC offset to the host TSC. When the TSC scaling is enabled,
    the host TSC should be scaled first. This patch adds the scaling logic
    to those two functions.
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/hvm.c        |   17 +++++++----------
 xen/arch/x86/hvm/svm/svm.c    |    9 +++++++++
 xen/include/asm-x86/hvm/hvm.h |    2 ++
 3 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index f646c1e..e0cb82d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -60,6 +60,7 @@
 #include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/event.h>
 #include <asm/hvm/vmx/vmx.h>
+#include <asm/hvm/svm/svm.h> /* for cpu_has_tsc_ratio */
 #include <asm/altp2m.h>
 #include <asm/mtrr.h>
 #include <asm/apic.h>
@@ -310,13 +311,11 @@ void hvm_set_guest_tsc_fixed(struct vcpu *v, u64 guest_tsc, u64 at_tsc)
         tsc = hvm_get_guest_time_fixed(v, at_tsc);
         tsc = gtime_to_gtsc(v->domain, tsc);
     }
-    else if ( at_tsc )
-    {
-        tsc = at_tsc;
-    }
     else
     {
-        tsc = rdtsc();
+        tsc = at_tsc ?: rdtsc();
+        if ( cpu_has_tsc_ratio )
+            tsc = hvm_funcs.scale_tsc(v, tsc);
     }
 
     delta_tsc = guest_tsc - tsc;
@@ -344,13 +343,11 @@ u64 hvm_get_guest_tsc_fixed(struct vcpu *v, uint64_t at_tsc)
         tsc = hvm_get_guest_time_fixed(v, at_tsc);
         tsc = gtime_to_gtsc(v->domain, tsc);
     }
-    else if ( at_tsc )
-    {
-        tsc = at_tsc;
-    }
     else
     {
-        tsc = rdtsc();
+        tsc = at_tsc ?: rdtsc();
+        if ( cpu_has_tsc_ratio )
+            tsc = hvm_funcs.scale_tsc(v, tsc);
     }
 
     return tsc + v->arch.hvm_vcpu.cache_tsc_offset;
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index a66d854..a46bc98 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -804,6 +804,13 @@ static uint64_t scale_tsc(uint64_t host_tsc, uint64_t ratio)
     return scaled_host_tsc;
 }
 
+static uint64_t svm_scale_tsc(const struct vcpu *v, uint64_t tsc)
+{
+    ASSERT(cpu_has_tsc_ratio && !v->domain->arch.vtsc);
+
+    return scale_tsc(tsc, vcpu_tsc_ratio(v));
+}
+
 static uint64_t svm_get_tsc_offset(uint64_t host_tsc, uint64_t guest_tsc,
     uint64_t ratio)
 {
@@ -2272,6 +2279,8 @@ static struct hvm_function_table __initdata svm_function_table = {
     .nhvm_vmcx_hap_enabled = nsvm_vmcb_hap_enabled,
     .nhvm_intr_blocked = nsvm_intr_blocked,
     .nhvm_hap_walk_L1_p2m = nsvm_hap_walk_L1_p2m,
+
+    .scale_tsc            = svm_scale_tsc,
 };
 
 void svm_vmexit_handler(struct cpu_user_regs *regs)
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index b9d893d..a87224b 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -212,6 +212,8 @@ struct hvm_function_table {
     void (*altp2m_vcpu_update_vmfunc_ve)(struct vcpu *v);
     bool_t (*altp2m_vcpu_emulate_ve)(struct vcpu *v);
     int (*altp2m_vcpu_emulate_vmfunc)(struct cpu_user_regs *regs);
+
+    uint64_t (*scale_tsc)(const struct vcpu *v, uint64_t tsc);
 };
 
 extern struct hvm_function_table hvm_funcs;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:10:01 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:10: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 1aMIkD-0000PZ-1H; Thu, 21 Jan 2016 17:10:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkB-0000PH-U5
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:00 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	87/58-10115-7E011A65; Thu, 21 Jan 2016 17:09:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1453396197!18469575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29299 invoked from network); 21 Jan 2016 17:09:58 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:09:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkn-0000Aa-AZ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIk9-0005Ny-9G
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:57 +0000
Date: Thu, 21 Jan 2016 17:09:57 +0000
Message-Id: <E1aMIk9-0005Ny-9G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/time: scale host TSC in pvclock
	properly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eab8a90be723d742d607aff2005ea0ab521bfd6a
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Tue Jan 19 16:07:39 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 19 16:07:39 2016 +0100

    x86/time: scale host TSC in pvclock properly
    
    This patch makes the pvclock return the scaled host TSC and
    corresponding scaling parameters to HVM domains if guest TSC is not
    emulated and TSC scaling is enabled.
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/time.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index ec3f33e..988403a 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -815,10 +815,18 @@ static void __update_vcpu_system_time(struct vcpu *v, int force)
     }
     else
     {
-        tsc_stamp = t->local_tsc_stamp;
-
-        _u.tsc_to_system_mul = t->tsc_scale.mul_frac;
-        _u.tsc_shift         = (s8)t->tsc_scale.shift;
+        if ( has_hvm_container_domain(d) && cpu_has_tsc_ratio )
+        {
+            tsc_stamp            = hvm_funcs.scale_tsc(v, t->local_tsc_stamp);
+            _u.tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
+            _u.tsc_shift         = d->arch.vtsc_to_ns.shift;
+        }
+        else
+        {
+            tsc_stamp            = t->local_tsc_stamp;
+            _u.tsc_to_system_mul = t->tsc_scale.mul_frac;
+            _u.tsc_shift         = t->tsc_scale.shift;
+        }
     }
 
     _u.tsc_timestamp = tsc_stamp;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:10:01 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:10: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 1aMIkD-0000PZ-1H; Thu, 21 Jan 2016 17:10:01 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkB-0000PH-U5
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:00 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	87/58-10115-7E011A65; Thu, 21 Jan 2016 17:09:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1453396197!18469575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29299 invoked from network); 21 Jan 2016 17:09:58 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:09:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkn-0000Aa-AZ
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIk9-0005Ny-9G
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:09:57 +0000
Date: Thu, 21 Jan 2016 17:09:57 +0000
Message-Id: <E1aMIk9-0005Ny-9G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/time: scale host TSC in pvclock
	properly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eab8a90be723d742d607aff2005ea0ab521bfd6a
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Tue Jan 19 16:07:39 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 19 16:07:39 2016 +0100

    x86/time: scale host TSC in pvclock properly
    
    This patch makes the pvclock return the scaled host TSC and
    corresponding scaling parameters to HVM domains if guest TSC is not
    emulated and TSC scaling is enabled.
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/time.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index ec3f33e..988403a 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -815,10 +815,18 @@ static void __update_vcpu_system_time(struct vcpu *v, int force)
     }
     else
     {
-        tsc_stamp = t->local_tsc_stamp;
-
-        _u.tsc_to_system_mul = t->tsc_scale.mul_frac;
-        _u.tsc_shift         = (s8)t->tsc_scale.shift;
+        if ( has_hvm_container_domain(d) && cpu_has_tsc_ratio )
+        {
+            tsc_stamp            = hvm_funcs.scale_tsc(v, t->local_tsc_stamp);
+            _u.tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
+            _u.tsc_shift         = d->arch.vtsc_to_ns.shift;
+        }
+        else
+        {
+            tsc_stamp            = t->local_tsc_stamp;
+            _u.tsc_to_system_mul = t->tsc_scale.mul_frac;
+            _u.tsc_shift         = t->tsc_scale.shift;
+        }
     }
 
     _u.tsc_timestamp = tsc_stamp;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:10:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:10: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 1aMIkN-0000Rl-5M; Thu, 21 Jan 2016 17:10: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 1aMIkM-0000RN-4k
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:10 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	24/41-02499-1F011A65; Thu, 21 Jan 2016 17:10:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1453396208!17321941!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 61972 invoked from network); 21 Jan 2016 17:10:08 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:10:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkx-0000Ai-Nz
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkJ-0005Ot-IB
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:07 +0000
Date: Thu, 21 Jan 2016 17:10:07 +0000
Message-Id: <E1aMIkJ-0005Ot-IB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] svm: remove redundant TSC scaling in
	svm_set_tsc_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 805b7484b85e77b15c68e837b3d7b77053182d37
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Tue Jan 19 16:07:59 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 19 16:07:59 2016 +0100

    svm: remove redundant TSC scaling in svm_set_tsc_offset()
    
    Now every caller passes an already scaled offset to
    svm_set_tsc_offset(), so it's not necessary to recalculate a scaled TSC
    offset in svm_set_tsc_offset().
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/svm/svm.c |   20 +++++---------------
 1 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index a46bc98..953e0b5 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -823,19 +823,6 @@ static void svm_set_tsc_offset(struct vcpu *v, u64 offset, u64 at_tsc)
     struct vmcb_struct *n1vmcb, *n2vmcb;
     uint64_t n2_tsc_offset = 0;
     struct domain *d = v->domain;
-    uint64_t host_tsc, guest_tsc;
-
-    guest_tsc = hvm_get_guest_tsc_fixed(v, at_tsc);
-
-    /* Re-adjust the offset value when TSC_RATIO is available */
-    if ( cpu_has_tsc_ratio && !d->arch.vtsc )
-    {
-        if ( at_tsc )
-            host_tsc = at_tsc;
-        else
-            host_tsc = rdtsc();
-        offset = svm_get_tsc_offset(host_tsc, guest_tsc, vcpu_tsc_ratio(v));
-    }
 
     if ( !nestedhvm_enabled(d) ) {
         vmcb_set_tsc_offset(vmcb, offset);
@@ -849,10 +836,13 @@ static void svm_set_tsc_offset(struct vcpu *v, u64 offset, u64 at_tsc)
         struct nestedsvm *svm = &vcpu_nestedsvm(v);
 
         n2_tsc_offset = vmcb_get_tsc_offset(n2vmcb) -
-            vmcb_get_tsc_offset(n1vmcb);
+                        vmcb_get_tsc_offset(n1vmcb);
         if ( svm->ns_tscratio != DEFAULT_TSC_RATIO ) {
+            uint64_t guest_tsc = hvm_get_guest_tsc_fixed(v, at_tsc);
+
             n2_tsc_offset = svm_get_tsc_offset(guest_tsc,
-                guest_tsc + n2_tsc_offset, svm->ns_tscratio);
+                                               guest_tsc + n2_tsc_offset,
+                                               svm->ns_tscratio);
         }
         vmcb_set_tsc_offset(n1vmcb, offset);
     }
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:10:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:10: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 1aMIkN-0000Rl-5M; Thu, 21 Jan 2016 17:10: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 1aMIkM-0000RN-4k
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:10 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	24/41-02499-1F011A65; Thu, 21 Jan 2016 17:10:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1453396208!17321941!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 61972 invoked from network); 21 Jan 2016 17:10:08 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:10:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkx-0000Ai-Nz
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkJ-0005Ot-IB
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:07 +0000
Date: Thu, 21 Jan 2016 17:10:07 +0000
Message-Id: <E1aMIkJ-0005Ot-IB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] svm: remove redundant TSC scaling in
	svm_set_tsc_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 805b7484b85e77b15c68e837b3d7b77053182d37
Author:     Haozhong Zhang <haozhong.zhang@intel.com>
AuthorDate: Tue Jan 19 16:07:59 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 19 16:07:59 2016 +0100

    svm: remove redundant TSC scaling in svm_set_tsc_offset()
    
    Now every caller passes an already scaled offset to
    svm_set_tsc_offset(), so it's not necessary to recalculate a scaled TSC
    offset in svm_set_tsc_offset().
    
    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/svm/svm.c |   20 +++++---------------
 1 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index a46bc98..953e0b5 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -823,19 +823,6 @@ static void svm_set_tsc_offset(struct vcpu *v, u64 offset, u64 at_tsc)
     struct vmcb_struct *n1vmcb, *n2vmcb;
     uint64_t n2_tsc_offset = 0;
     struct domain *d = v->domain;
-    uint64_t host_tsc, guest_tsc;
-
-    guest_tsc = hvm_get_guest_tsc_fixed(v, at_tsc);
-
-    /* Re-adjust the offset value when TSC_RATIO is available */
-    if ( cpu_has_tsc_ratio && !d->arch.vtsc )
-    {
-        if ( at_tsc )
-            host_tsc = at_tsc;
-        else
-            host_tsc = rdtsc();
-        offset = svm_get_tsc_offset(host_tsc, guest_tsc, vcpu_tsc_ratio(v));
-    }
 
     if ( !nestedhvm_enabled(d) ) {
         vmcb_set_tsc_offset(vmcb, offset);
@@ -849,10 +836,13 @@ static void svm_set_tsc_offset(struct vcpu *v, u64 offset, u64 at_tsc)
         struct nestedsvm *svm = &vcpu_nestedsvm(v);
 
         n2_tsc_offset = vmcb_get_tsc_offset(n2vmcb) -
-            vmcb_get_tsc_offset(n1vmcb);
+                        vmcb_get_tsc_offset(n1vmcb);
         if ( svm->ns_tscratio != DEFAULT_TSC_RATIO ) {
+            uint64_t guest_tsc = hvm_get_guest_tsc_fixed(v, at_tsc);
+
             n2_tsc_offset = svm_get_tsc_offset(guest_tsc,
-                guest_tsc + n2_tsc_offset, svm->ns_tscratio);
+                                               guest_tsc + n2_tsc_offset,
+                                               svm->ns_tscratio);
         }
         vmcb_set_tsc_offset(n1vmcb, offset);
     }
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:10:22 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:10: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 1aMIkY-0000U9-AS; Thu, 21 Jan 2016 17:10:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkW-0000TX-Lm
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:20 +0000
Content-Length: 2121
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	E8/80-06010-BF011A65; Thu, 21 Jan 2016 17:10:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1453396218!1508402!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55177 invoked from network); 21 Jan 2016 17:10:19 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:10:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIl8-0000BZ-33
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkU-0005PQ-1j
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:18 +0000
Date: Thu, 21 Jan 2016 17:10:18 +0000
Message-Id: <E1aMIkU-0005PQ-1j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: add padding to struct
	hvm_hw_cpu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4136178286382032678=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4136178286382032678==
Content-Length: 1714
Content-Transfer-Encoding: quoted-printable

commit eb68c40ba5d0212adc176290f09e4ee133c96e83
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Jan 19 16:08:39 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 19 16:08:39 2016 +0100

    x86/HVM: add padding to struct hvm_hw_cpu
    
    So that the size of the structure is the same on 32 and 64bit.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c                 |    3 +++
 xen/include/public/arch-x86/hvm/save.h |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index e0cb82d..8f98956 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1987,6 +1987,9 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     if ( hvm_load_entry_zeroextend(CPU, h, &ctxt) !=3D 0 )
         return -EINVAL;
 
+    if ( ctxt.pad0 !=3D 0 )
+        return -EINVAL;
+
     /* Sanity check some control registers. */
     if ( (ctxt.cr0 & HVM_CR0_GUEST_RESERVED_BITS) ||
          !(ctxt.cr0 & X86_CR0_ET) ||
diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h
index b6b1bf8..6862720 100644
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -163,6 +163,7 @@ struct hvm_hw_cpu {
 #define _XEN_X86_FPU_INITIALISED        0
 #define XEN_X86_FPU_INITIALISED         (1U<<_XEN_X86_FPU_INITIALISED)
     uint32_t flags;
+    uint32_t pad0;
 };
 
 struct hvm_hw_cpu_compat {
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:10:22 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:10: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 1aMIkY-0000U9-AS; Thu, 21 Jan 2016 17:10:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkW-0000TX-Lm
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:20 +0000
Content-Length: 2121
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	E8/80-06010-BF011A65; Thu, 21 Jan 2016 17:10:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1453396218!1508402!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55177 invoked from network); 21 Jan 2016 17:10:19 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:10:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIl8-0000BZ-33
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIkU-0005PQ-1j
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:18 +0000
Date: Thu, 21 Jan 2016 17:10:18 +0000
Message-Id: <E1aMIkU-0005PQ-1j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: add padding to struct
	hvm_hw_cpu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4136178286382032678=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4136178286382032678==
Content-Length: 1714
Content-Transfer-Encoding: quoted-printable

commit eb68c40ba5d0212adc176290f09e4ee133c96e83
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Jan 19 16:08:39 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jan 19 16:08:39 2016 +0100

    x86/HVM: add padding to struct hvm_hw_cpu
    
    So that the size of the structure is the same on 32 and 64bit.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c                 |    3 +++
 xen/include/public/arch-x86/hvm/save.h |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index e0cb82d..8f98956 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1987,6 +1987,9 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     if ( hvm_load_entry_zeroextend(CPU, h, &ctxt) !=3D 0 )
         return -EINVAL;
 
+    if ( ctxt.pad0 !=3D 0 )
+        return -EINVAL;
+
     /* Sanity check some control registers. */
     if ( (ctxt.cr0 & HVM_CR0_GUEST_RESERVED_BITS) ||
          !(ctxt.cr0 & X86_CR0_ET) ||
diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h
index b6b1bf8..6862720 100644
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -163,6 +163,7 @@ struct hvm_hw_cpu {
 #define _XEN_X86_FPU_INITIALISED        0
 #define XEN_X86_FPU_INITIALISED         (1U<<_XEN_X86_FPU_INITIALISED)
     uint32_t flags;
+    uint32_t pad0;
 };
 
 struct hvm_hw_cpu_compat {
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:10:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:10: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 1aMIkn-0000Wm-F2; Thu, 21 Jan 2016 17:10:37 +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 1aMIkm-0000Wb-BP
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:36 +0000
Content-Length: 9417
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	FB/0C-32641-B0111A65; Thu, 21 Jan 2016 17:10:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1453396233!9852502!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10221 invoked from network); 21 Jan 2016 17:10:34 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:10:34 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIlI-0000CM-BM
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIke-0005Ps-Au
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:28 +0000
Date: Thu, 21 Jan 2016 17:10:28 +0000
Message-Id: <E1aMIke-0005Ps-Au@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Defer initialization of
	start_page for 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="===============1154983085485898624=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1154983085485898624==
Content-Length: 9208
Content-Transfer-Encoding: quoted-printable

commit 38a048a3c6f44008a83ac77aecac01a7bce0e7d1
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 7 17:19:07 2016 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 16:14:32 2016 +0000

    libxc: Defer initialization of start_page for HVM guests
    
    With commit 8c45adec18e0 ("libxc: create unmapped initrd in domain
    builder if supported") location of ramdisk may not be available to
    HVMlite guests by the time alloc_magic_pages_hvm() is invoked if the
    guest supports unmapped initrd.
    
    So let's move ramdisk info initialization (along with a few other
    operations that are not directly related to allocating magic/special
    pages) from alloc_magic_pages_hvm() to bootlate_hvm().
    
    Since we now split allocation and mapping of the start_info segment
    let's stash it, along with cmdline length, in xc_dom_image so that we
    can check whether we are mapping correctly-sized range.
    
    We can also stop using xc_dom_image.start_info_pfn and leave it for
    PV(H) guests only.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/include/xc_dom.h |    2 +
 tools/libxc/xc_dom_x86.c     |  140 +++++++++++++++++++++++------------------
 2 files changed, 80 insertions(+), 62 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 2460818..cac4698 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -71,6 +71,7 @@ struct xc_dom_image {
 
     /* arguments and parameters */
     char *cmdline;
+    size_t cmdline_size;
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
 
     /* info from (elf) kernel image */
@@ -91,6 +92,7 @@ struct xc_dom_image {
     struct xc_dom_seg p2m_seg;
     struct xc_dom_seg pgtables_seg;
     struct xc_dom_seg devicetree_seg;
+    struct xc_dom_seg start_info_seg; /* HVMlite only */
     xen_pfn_t start_info_pfn;
     xen_pfn_t console_pfn;
     xen_pfn_t xenstore_pfn;
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index b650762..ef474a8 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -586,23 +586,12 @@ static void build_hvm_info(void *hvm_info_page, struct xc_dom_image *dom)
 static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 {
     unsigned long i;
-    void *hvm_info_page;
     uint32_t *ident_pt, domid =3D dom->guest_domid;
     int rc;
     xen_pfn_t special_array[X86_HVM_NR_SPECIAL_PAGES];
     xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
     xc_interface *xch =3D dom->xch;
 
-    if ( dom->device_model )
-    {
-        if ( (hvm_info_page =3D xc_map_foreign_range(
-                  xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
-                  HVM_INFO_PFN)) =3D=3D NULL )
-            goto error_out;
-        build_hvm_info(hvm_info_page, dom);
-        munmap(hvm_info_page, PAGE_SIZE);
-    }
-
     /* Allocate and clear special pages. */
     for ( i =3D 0; i < X86_HVM_NR_SPECIAL_PAGES; i++ )
         special_array[i] =3D special_pfn(i);
@@ -636,65 +625,25 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 
     if ( !dom->device_model )
     {
-        struct xc_dom_seg seg;
-        struct hvm_start_info *start_info;
-        char *cmdline;
-        struct hvm_modlist_entry *modlist;
-        void *start_page;
-        size_t cmdline_size =3D 0;
-        size_t start_info_size =3D sizeof(*start_info);
+        size_t start_info_size =3D sizeof(struct hvm_start_info);
 
         if ( dom->cmdline )
         {
-            cmdline_size =3D ROUNDUP(strlen(dom->cmdline) + 1, 8);
-            start_info_size +=3D cmdline_size;
-
+            dom->cmdline_size =3D ROUNDUP(strlen(dom->cmdline) + 1, 8);
+            start_info_size +=3D dom->cmdline_size;
         }
+
+        /* Limited to one module. */
         if ( dom->ramdisk_blob )
-            start_info_size +=3D sizeof(*modlist); /* Limited to one module. */
+            start_info_size +=3D sizeof(struct hvm_modlist_entry);
 
-        rc =3D xc_dom_alloc_segment(dom, &seg, "HVMlite start info", 0,
-                                  start_info_size);
+        rc =3D xc_dom_alloc_segment(dom, &dom->start_info_seg,
+                                  "HVMlite start info", 0, start_info_size);
         if ( rc !=3D 0 )
         {
             DOMPRINTF("Unable to reserve memory for the start info");
             goto out;
         }
-
-        start_page =3D xc_map_foreign_range(xch, domid, start_info_size,
-                                          PROT_READ | PROT_WRITE,
-                                          seg.pfn);
-        if ( start_page =3D=3D NULL )
-        {
-            DOMPRINTF("Unable to map HVM start info page");
-            goto error_out;
-        }
-
-        start_info =3D start_page;
-        cmdline =3D start_page + sizeof(*start_info);
-        modlist =3D start_page + sizeof(*start_info) + cmdline_size;
-
-        if ( dom->cmdline )
-        {
-            strncpy(cmdline, dom->cmdline, cmdline_size);
-            start_info->cmdline_paddr =3D (seg.pfn << PAGE_SHIFT) +
-                                ((uintptr_t)cmdline - (uintptr_t)start_info);
-        }
-
-        if ( dom->ramdisk_blob )
-        {
-            modlist[0].paddr =3D dom->ramdisk_seg.vstart - dom->parms.virt_base;
-            modlist[0].size =3D dom->ramdisk_seg.vend - dom->ramdisk_seg.vstart;
-            start_info->modlist_paddr =3D (seg.pfn << PAGE_SHIFT) +
-                                ((uintptr_t)modlist - (uintptr_t)start_info);
-            start_info->nr_modules =3D 1;
-        }
-
-        start_info->magic =3D HVM_START_MAGIC_VALUE;
-
-        munmap(start_page, start_info_size);
-
-        dom->start_info_pfn =3D seg.pfn;
     }
     else
     {
@@ -1057,8 +1006,8 @@ static int vcpu_hvm(struct xc_dom_image *dom)
     /* Set the IP. */
     bsp_ctx.cpu.rip =3D dom->parms.phys_entry;
 
-    if ( dom->start_info_pfn )
-        bsp_ctx.cpu.rbx =3D dom->start_info_pfn << PAGE_SHIFT;
+    if ( dom->start_info_seg.pfn )
+        bsp_ctx.cpu.rbx =3D dom->start_info_seg.pfn << PAGE_SHIFT;
 
     /* Set the end descriptor. */
     bsp_ctx.end_d.typecode =3D HVM_SAVE_CODE(END);
@@ -1745,7 +1694,74 @@ static int alloc_pgtables_hvm(struct xc_dom_image *dom)
 
 static int bootlate_hvm(struct xc_dom_image *dom)
 {
-    DOMPRINTF("%s: doing nothing", __func__);
+    uint32_t domid =3D dom->guest_domid;
+    xc_interface *xch =3D dom->xch;
+
+    if ( !dom->device_model )
+    {
+        struct hvm_start_info *start_info;
+        size_t start_info_size;
+        void *start_page;
+
+        start_info_size =3D sizeof(*start_info) + dom->cmdline_size;
+        if ( dom->ramdisk_blob )
+            start_info_size +=3D sizeof(struct hvm_modlist_entry);
+
+        if ( start_info_size >
+             dom->start_info_seg.pages << XC_DOM_PAGE_SHIFT(dom) )
+        {
+            DOMPRINTF("Trying to map beyond start_info_seg");
+            return -1;
+        }
+
+        start_page =3D xc_map_foreign_range(xch, domid, start_info_size,
+                                          PROT_READ | PROT_WRITE,
+                                          dom->start_info_seg.pfn);
+        if ( start_page =3D=3D NULL )
+        {
+            DOMPRINTF("Unable to map HVM start info page");
+            return -1;
+        }
+
+        start_info =3D start_page;
+
+        if ( dom->cmdline )
+        {
+            char *cmdline =3D start_page + sizeof(*start_info);
+
+            strncpy(cmdline, dom->cmdline, dom->cmdline_size);
+            start_info->cmdline_paddr =3D (dom->start_info_seg.pfn << PAGE_SHIFT) +
+                                ((uintptr_t)cmdline - (uintptr_t)start_info);
+        }
+
+        if ( dom->ramdisk_blob )
+        {
+            struct hvm_modlist_entry *modlist =3D
+                start_page + sizeof(*start_info) + dom->cmdline_size;
+
+            modlist[0].paddr =3D dom->ramdisk_seg.vstart - dom->parms.virt_base;
+            modlist[0].size =3D dom->ramdisk_seg.vend - dom->ramdisk_seg.vstart;
+            start_info->modlist_paddr =3D (dom->start_info_seg.pfn << PAGE_SHIFT) +
+                                ((uintptr_t)modlist - (uintptr_t)start_info);
+            start_info->nr_modules =3D 1;
+        }
+
+        start_info->magic =3D HVM_START_MAGIC_VALUE;
+
+        munmap(start_page, start_info_size);
+    }
+    else
+    {
+        void *hvm_info_page;
+
+        if ( (hvm_info_page =3D xc_map_foreign_range(
+                  xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
+                  HVM_INFO_PFN)) =3D=3D NULL )
+            return -1;
+        build_hvm_info(hvm_info_page, dom);
+        munmap(hvm_info_page, PAGE_SIZE);
+    }
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:10:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:10: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 1aMIkn-0000Wm-F2; Thu, 21 Jan 2016 17:10:37 +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 1aMIkm-0000Wb-BP
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:36 +0000
Content-Length: 9417
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	FB/0C-32641-B0111A65; Thu, 21 Jan 2016 17:10:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1453396233!9852502!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10221 invoked from network); 21 Jan 2016 17:10:34 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:10:34 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIlI-0000CM-BM
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIke-0005Ps-Au
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:28 +0000
Date: Thu, 21 Jan 2016 17:10:28 +0000
Message-Id: <E1aMIke-0005Ps-Au@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Defer initialization of
	start_page for 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="===============1154983085485898624=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1154983085485898624==
Content-Length: 9208
Content-Transfer-Encoding: quoted-printable

commit 38a048a3c6f44008a83ac77aecac01a7bce0e7d1
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 7 17:19:07 2016 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 16:14:32 2016 +0000

    libxc: Defer initialization of start_page for HVM guests
    
    With commit 8c45adec18e0 ("libxc: create unmapped initrd in domain
    builder if supported") location of ramdisk may not be available to
    HVMlite guests by the time alloc_magic_pages_hvm() is invoked if the
    guest supports unmapped initrd.
    
    So let's move ramdisk info initialization (along with a few other
    operations that are not directly related to allocating magic/special
    pages) from alloc_magic_pages_hvm() to bootlate_hvm().
    
    Since we now split allocation and mapping of the start_info segment
    let's stash it, along with cmdline length, in xc_dom_image so that we
    can check whether we are mapping correctly-sized range.
    
    We can also stop using xc_dom_image.start_info_pfn and leave it for
    PV(H) guests only.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/include/xc_dom.h |    2 +
 tools/libxc/xc_dom_x86.c     |  140 +++++++++++++++++++++++------------------
 2 files changed, 80 insertions(+), 62 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 2460818..cac4698 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -71,6 +71,7 @@ struct xc_dom_image {
 
     /* arguments and parameters */
     char *cmdline;
+    size_t cmdline_size;
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
 
     /* info from (elf) kernel image */
@@ -91,6 +92,7 @@ struct xc_dom_image {
     struct xc_dom_seg p2m_seg;
     struct xc_dom_seg pgtables_seg;
     struct xc_dom_seg devicetree_seg;
+    struct xc_dom_seg start_info_seg; /* HVMlite only */
     xen_pfn_t start_info_pfn;
     xen_pfn_t console_pfn;
     xen_pfn_t xenstore_pfn;
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index b650762..ef474a8 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -586,23 +586,12 @@ static void build_hvm_info(void *hvm_info_page, struct xc_dom_image *dom)
 static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 {
     unsigned long i;
-    void *hvm_info_page;
     uint32_t *ident_pt, domid =3D dom->guest_domid;
     int rc;
     xen_pfn_t special_array[X86_HVM_NR_SPECIAL_PAGES];
     xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
     xc_interface *xch =3D dom->xch;
 
-    if ( dom->device_model )
-    {
-        if ( (hvm_info_page =3D xc_map_foreign_range(
-                  xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
-                  HVM_INFO_PFN)) =3D=3D NULL )
-            goto error_out;
-        build_hvm_info(hvm_info_page, dom);
-        munmap(hvm_info_page, PAGE_SIZE);
-    }
-
     /* Allocate and clear special pages. */
     for ( i =3D 0; i < X86_HVM_NR_SPECIAL_PAGES; i++ )
         special_array[i] =3D special_pfn(i);
@@ -636,65 +625,25 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 
     if ( !dom->device_model )
     {
-        struct xc_dom_seg seg;
-        struct hvm_start_info *start_info;
-        char *cmdline;
-        struct hvm_modlist_entry *modlist;
-        void *start_page;
-        size_t cmdline_size =3D 0;
-        size_t start_info_size =3D sizeof(*start_info);
+        size_t start_info_size =3D sizeof(struct hvm_start_info);
 
         if ( dom->cmdline )
         {
-            cmdline_size =3D ROUNDUP(strlen(dom->cmdline) + 1, 8);
-            start_info_size +=3D cmdline_size;
-
+            dom->cmdline_size =3D ROUNDUP(strlen(dom->cmdline) + 1, 8);
+            start_info_size +=3D dom->cmdline_size;
         }
+
+        /* Limited to one module. */
         if ( dom->ramdisk_blob )
-            start_info_size +=3D sizeof(*modlist); /* Limited to one module. */
+            start_info_size +=3D sizeof(struct hvm_modlist_entry);
 
-        rc =3D xc_dom_alloc_segment(dom, &seg, "HVMlite start info", 0,
-                                  start_info_size);
+        rc =3D xc_dom_alloc_segment(dom, &dom->start_info_seg,
+                                  "HVMlite start info", 0, start_info_size);
         if ( rc !=3D 0 )
         {
             DOMPRINTF("Unable to reserve memory for the start info");
             goto out;
         }
-
-        start_page =3D xc_map_foreign_range(xch, domid, start_info_size,
-                                          PROT_READ | PROT_WRITE,
-                                          seg.pfn);
-        if ( start_page =3D=3D NULL )
-        {
-            DOMPRINTF("Unable to map HVM start info page");
-            goto error_out;
-        }
-
-        start_info =3D start_page;
-        cmdline =3D start_page + sizeof(*start_info);
-        modlist =3D start_page + sizeof(*start_info) + cmdline_size;
-
-        if ( dom->cmdline )
-        {
-            strncpy(cmdline, dom->cmdline, cmdline_size);
-            start_info->cmdline_paddr =3D (seg.pfn << PAGE_SHIFT) +
-                                ((uintptr_t)cmdline - (uintptr_t)start_info);
-        }
-
-        if ( dom->ramdisk_blob )
-        {
-            modlist[0].paddr =3D dom->ramdisk_seg.vstart - dom->parms.virt_base;
-            modlist[0].size =3D dom->ramdisk_seg.vend - dom->ramdisk_seg.vstart;
-            start_info->modlist_paddr =3D (seg.pfn << PAGE_SHIFT) +
-                                ((uintptr_t)modlist - (uintptr_t)start_info);
-            start_info->nr_modules =3D 1;
-        }
-
-        start_info->magic =3D HVM_START_MAGIC_VALUE;
-
-        munmap(start_page, start_info_size);
-
-        dom->start_info_pfn =3D seg.pfn;
     }
     else
     {
@@ -1057,8 +1006,8 @@ static int vcpu_hvm(struct xc_dom_image *dom)
     /* Set the IP. */
     bsp_ctx.cpu.rip =3D dom->parms.phys_entry;
 
-    if ( dom->start_info_pfn )
-        bsp_ctx.cpu.rbx =3D dom->start_info_pfn << PAGE_SHIFT;
+    if ( dom->start_info_seg.pfn )
+        bsp_ctx.cpu.rbx =3D dom->start_info_seg.pfn << PAGE_SHIFT;
 
     /* Set the end descriptor. */
     bsp_ctx.end_d.typecode =3D HVM_SAVE_CODE(END);
@@ -1745,7 +1694,74 @@ static int alloc_pgtables_hvm(struct xc_dom_image *dom)
 
 static int bootlate_hvm(struct xc_dom_image *dom)
 {
-    DOMPRINTF("%s: doing nothing", __func__);
+    uint32_t domid =3D dom->guest_domid;
+    xc_interface *xch =3D dom->xch;
+
+    if ( !dom->device_model )
+    {
+        struct hvm_start_info *start_info;
+        size_t start_info_size;
+        void *start_page;
+
+        start_info_size =3D sizeof(*start_info) + dom->cmdline_size;
+        if ( dom->ramdisk_blob )
+            start_info_size +=3D sizeof(struct hvm_modlist_entry);
+
+        if ( start_info_size >
+             dom->start_info_seg.pages << XC_DOM_PAGE_SHIFT(dom) )
+        {
+            DOMPRINTF("Trying to map beyond start_info_seg");
+            return -1;
+        }
+
+        start_page =3D xc_map_foreign_range(xch, domid, start_info_size,
+                                          PROT_READ | PROT_WRITE,
+                                          dom->start_info_seg.pfn);
+        if ( start_page =3D=3D NULL )
+        {
+            DOMPRINTF("Unable to map HVM start info page");
+            return -1;
+        }
+
+        start_info =3D start_page;
+
+        if ( dom->cmdline )
+        {
+            char *cmdline =3D start_page + sizeof(*start_info);
+
+            strncpy(cmdline, dom->cmdline, dom->cmdline_size);
+            start_info->cmdline_paddr =3D (dom->start_info_seg.pfn << PAGE_SHIFT) +
+                                ((uintptr_t)cmdline - (uintptr_t)start_info);
+        }
+
+        if ( dom->ramdisk_blob )
+        {
+            struct hvm_modlist_entry *modlist =3D
+                start_page + sizeof(*start_info) + dom->cmdline_size;
+
+            modlist[0].paddr =3D dom->ramdisk_seg.vstart - dom->parms.virt_base;
+            modlist[0].size =3D dom->ramdisk_seg.vend - dom->ramdisk_seg.vstart;
+            start_info->modlist_paddr =3D (dom->start_info_seg.pfn << PAGE_SHIFT) +
+                                ((uintptr_t)modlist - (uintptr_t)start_info);
+            start_info->nr_modules =3D 1;
+        }
+
+        start_info->magic =3D HVM_START_MAGIC_VALUE;
+
+        munmap(start_page, start_info_size);
+    }
+    else
+    {
+        void *hvm_info_page;
+
+        if ( (hvm_info_page =3D xc_map_foreign_range(
+                  xch, domid, PAGE_SIZE, PROT_READ | PROT_WRITE,
+                  HVM_INFO_PFN)) =3D=3D NULL )
+            return -1;
+        build_hvm_info(hvm_info_page, dom);
+        munmap(hvm_info_page, PAGE_SIZE);
+    }
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:10:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:10: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 1aMIks-0000ZQ-Ne; Thu, 21 Jan 2016 17:10: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 1aMIkq-0000Xk-Um
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:41 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	95/D4-03066-01111A65; Thu, 21 Jan 2016 17:10:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453396238!7732424!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54819 invoked from network); 21 Jan 2016 17:10:39 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:10:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIlS-0000CQ-Jn
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIko-0005Qv-KH
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:38 +0000
Date: Thu, 21 Jan 2016 17:10:38 +0000
Message-Id: <E1aMIko-0005Qv-KH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: fix comment in
	xc__hypercall_bounce_pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1e72eebd21a5bdb799fa1fbc0eb60c4b58e30af8
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jan 19 12:03:05 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 16:14:58 2016 +0000

    libxc: fix comment in xc__hypercall_bounce_pre
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_hcall_buf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_hcall_buf.c b/tools/libxc/xc_hcall_buf.c
index 6e3c958..4f4444c 100644
--- a/tools/libxc/xc_hcall_buf.c
+++ b/tools/libxc/xc_hcall_buf.c
@@ -198,7 +198,7 @@ int xc__hypercall_bounce_pre(xc_interface *xch, xc_hypercall_buffer_t *b)
         abort();
 
     /*
-     * Do need to bounce a NULL buffer.
+     * Don't need to bounce a NULL buffer.
      */
     if ( b->ubuf == 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 Jan 21 17:10:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:10: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 1aMIks-0000ZQ-Ne; Thu, 21 Jan 2016 17:10: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 1aMIkq-0000Xk-Um
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:41 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	95/D4-03066-01111A65; Thu, 21 Jan 2016 17:10:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453396238!7732424!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54819 invoked from network); 21 Jan 2016 17:10:39 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:10:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIlS-0000CQ-Jn
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIko-0005Qv-KH
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:38 +0000
Date: Thu, 21 Jan 2016 17:10:38 +0000
Message-Id: <E1aMIko-0005Qv-KH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: fix comment in
	xc__hypercall_bounce_pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1e72eebd21a5bdb799fa1fbc0eb60c4b58e30af8
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jan 19 12:03:05 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 16:14:58 2016 +0000

    libxc: fix comment in xc__hypercall_bounce_pre
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_hcall_buf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_hcall_buf.c b/tools/libxc/xc_hcall_buf.c
index 6e3c958..4f4444c 100644
--- a/tools/libxc/xc_hcall_buf.c
+++ b/tools/libxc/xc_hcall_buf.c
@@ -198,7 +198,7 @@ int xc__hypercall_bounce_pre(xc_interface *xch, xc_hypercall_buffer_t *b)
         abort();
 
     /*
-     * Do need to bounce a NULL buffer.
+     * Don't need to bounce a NULL buffer.
      */
     if ( b->ubuf == 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 Jan 21 17:10:53 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:10: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 1aMIl2-0000dV-RH; Thu, 21 Jan 2016 17:10:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIl1-0000dE-C8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:51 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	47/DA-13475-A1111A65; Thu, 21 Jan 2016 17:10:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1453396249!18532914!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48590 invoked from network); 21 Jan 2016 17:10:49 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:10:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIlc-0000Ch-Qe
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIky-0005Rd-Qf
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:48 +0000
Date: Thu, 21 Jan 2016 17:10:48 +0000
Message-Id: <E1aMIky-0005Rd-Qf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenpm: Add option to report average
	CPU frequency
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa037dc9d3e09850f8a0e4ba9fba8e487f8a64cc
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jan 19 11:27:56 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 16:16:08 2016 +0000

    xenpm: Add option to report average CPU frequency
    
    The average is calculated over the period of time from the last
    xenpm report of the average CPU frequency.
    
    Reporting the average CPU frequency helps confirm the level of turbo
    boost being achieved per CPU.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/misc/xenpm.c |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 08f2242..a2edee5 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -45,6 +45,8 @@ void show_help(void)
             "xenpm command list:\n\n"
             " get-cpuidle-states    [cpuid]       list cpu idle info of CPU <cpuid> or all\n"
             " get-cpufreq-states    [cpuid]       list cpu freq info of CPU <cpuid> or all\n"
+            " get-cpufreq-average   [cpuid]       average cpu frequency since last invocation\n"
+            "                                     for CPU <cpuid> or all\n"
             " get-cpufreq-para      [cpuid]       list cpu freq parameter of CPU <cpuid> or all\n"
             " set-scaling-maxfreq   [cpuid] <HZ>  set max cpu frequency <HZ> on CPU <cpuid>\n"
             "                                     or all CPUs\n"
@@ -343,6 +345,40 @@ void pxstat_func(int argc, char *argv[])
         show_pxstat_by_cpuid(xc_handle, cpuid);
 }
 
+static int show_cpufreq_by_cpuid(xc_interface *xc_handle, int cpuid)
+{
+    int ret = 0;
+    int average_cpufreq;
+
+    ret = get_avgfreq_by_cpuid(xc_handle, cpuid, &average_cpufreq);
+    if ( ret )
+        return ret;
+
+    printf("cpu id               : %d\n", cpuid);
+    printf("average cpu frequency: %d\n", average_cpufreq);
+    printf("\n");
+    return 0;
+}
+
+void cpufreq_func(int argc, char *argv[])
+{
+    int cpuid = -1;
+
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpuid);
+
+    if ( cpuid < 0 )
+    {
+        /* show average frequency on all cpus */
+        int i;
+        for ( i = 0; i < max_cpu_nr; i++ )
+            if ( show_cpufreq_by_cpuid(xc_handle, i) == -ENODEV )
+                break;
+    }
+    else
+        show_cpufreq_by_cpuid(xc_handle, cpuid);
+}
+
 static uint64_t usec_start, usec_end;
 static struct xc_cx_stat *cxstat, *cxstat_start, *cxstat_end;
 static struct xc_px_stat *pxstat, *pxstat_start, *pxstat_end;
@@ -1129,6 +1165,7 @@ struct {
     { "help", help_func },
     { "get-cpuidle-states", cxstat_func },
     { "get-cpufreq-states", pxstat_func },
+    { "get-cpufreq-average", cpufreq_func },
     { "start", start_gather_func },
     { "get-cpufreq-para", cpufreq_para_func },
     { "set-scaling-maxfreq", scaling_max_freq_func },
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:10:53 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:10: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 1aMIl2-0000dV-RH; Thu, 21 Jan 2016 17:10:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIl1-0000dE-C8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:51 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	47/DA-13475-A1111A65; Thu, 21 Jan 2016 17:10:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1453396249!18532914!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48590 invoked from network); 21 Jan 2016 17:10:49 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:10:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIlc-0000Ch-Qe
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIky-0005Rd-Qf
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:48 +0000
Date: Thu, 21 Jan 2016 17:10:48 +0000
Message-Id: <E1aMIky-0005Rd-Qf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenpm: Add option to report average
	CPU frequency
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa037dc9d3e09850f8a0e4ba9fba8e487f8a64cc
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jan 19 11:27:56 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 16:16:08 2016 +0000

    xenpm: Add option to report average CPU frequency
    
    The average is calculated over the period of time from the last
    xenpm report of the average CPU frequency.
    
    Reporting the average CPU frequency helps confirm the level of turbo
    boost being achieved per CPU.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/misc/xenpm.c |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 08f2242..a2edee5 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -45,6 +45,8 @@ void show_help(void)
             "xenpm command list:\n\n"
             " get-cpuidle-states    [cpuid]       list cpu idle info of CPU <cpuid> or all\n"
             " get-cpufreq-states    [cpuid]       list cpu freq info of CPU <cpuid> or all\n"
+            " get-cpufreq-average   [cpuid]       average cpu frequency since last invocation\n"
+            "                                     for CPU <cpuid> or all\n"
             " get-cpufreq-para      [cpuid]       list cpu freq parameter of CPU <cpuid> or all\n"
             " set-scaling-maxfreq   [cpuid] <HZ>  set max cpu frequency <HZ> on CPU <cpuid>\n"
             "                                     or all CPUs\n"
@@ -343,6 +345,40 @@ void pxstat_func(int argc, char *argv[])
         show_pxstat_by_cpuid(xc_handle, cpuid);
 }
 
+static int show_cpufreq_by_cpuid(xc_interface *xc_handle, int cpuid)
+{
+    int ret = 0;
+    int average_cpufreq;
+
+    ret = get_avgfreq_by_cpuid(xc_handle, cpuid, &average_cpufreq);
+    if ( ret )
+        return ret;
+
+    printf("cpu id               : %d\n", cpuid);
+    printf("average cpu frequency: %d\n", average_cpufreq);
+    printf("\n");
+    return 0;
+}
+
+void cpufreq_func(int argc, char *argv[])
+{
+    int cpuid = -1;
+
+    if ( argc > 0 )
+        parse_cpuid(argv[0], &cpuid);
+
+    if ( cpuid < 0 )
+    {
+        /* show average frequency on all cpus */
+        int i;
+        for ( i = 0; i < max_cpu_nr; i++ )
+            if ( show_cpufreq_by_cpuid(xc_handle, i) == -ENODEV )
+                break;
+    }
+    else
+        show_cpufreq_by_cpuid(xc_handle, cpuid);
+}
+
 static uint64_t usec_start, usec_end;
 static struct xc_cx_stat *cxstat, *cxstat_start, *cxstat_end;
 static struct xc_px_stat *pxstat, *pxstat_start, *pxstat_end;
@@ -1129,6 +1165,7 @@ struct {
     { "help", help_func },
     { "get-cpuidle-states", cxstat_func },
     { "get-cpufreq-states", pxstat_func },
+    { "get-cpufreq-average", cpufreq_func },
     { "start", start_gather_func },
     { "get-cpufreq-para", cpufreq_para_func },
     { "set-scaling-maxfreq", scaling_max_freq_func },
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:11:04 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:11: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 1aMIlE-0000fO-11; Thu, 21 Jan 2016 17:11: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 1aMIlB-0000f4-QN
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:01 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	BF/25-28221-52111A65; Thu, 21 Jan 2016 17:11:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1453396259!18457323!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9764 invoked from network); 21 Jan 2016 17:11:00 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:11:00 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIln-0000Cp-Ay
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIl9-0005SL-2i
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:59 +0000
Date: Thu, 21 Jan 2016 17:10:59 +0000
Message-Id: <E1aMIl9-0005SL-2i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: correct descriptions of
	gnttab_max_{, maptrack}_frames
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef17887d848dae0ca46231b47bf30d3c1d4aa87d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jan 19 11:56:50 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 16:24:44 2016 +0000

    docs: correct descriptions of gnttab_max_{, maptrack}_frames
    
    gnttab_max_frames incorrectly referred to numbers of grant tab
    operations and gnttab_max_maptrack_frames was confusingly worded.
    
    Add the default for gnttab_max_frames while here (it's currently the
    same on all arches since no arch uses the available arch override) and
    adjust the default for gnttab_max_maptrack_frames to match the normal
    form.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 5ed0730..d267a04 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -740,13 +740,18 @@ Specify which console gdbstub should use. See **console**.
 ### gnttab\_max\_frames
 > `= <integer>`
 
-Specify the maximum number of frames per grant table operation.
+> Default: `32`
+
+Specify the maximum number of frames which any domain may use as part
+of its grant table.
 
 ### gnttab\_max\_maptrack\_frames
 > `= <integer>`
 
-Specify the maximum number of maptrack frames domain.
-The default value is 8 times **gnttab\_max\_frames**.
+> Default: `8 * gnttab_max_frames`
+
+Specify the maximum number of frames to use as part of a domains
+maptrack array.
 
 ### gnttab\_max\_nr\_frames
 > `= <integer>`
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:11:04 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17:11: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 1aMIlE-0000fO-11; Thu, 21 Jan 2016 17:11: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 1aMIlB-0000f4-QN
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:01 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	BF/25-28221-52111A65; Thu, 21 Jan 2016 17:11:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1453396259!18457323!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9764 invoked from network); 21 Jan 2016 17:11:00 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:11:00 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIln-0000Cp-Ay
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIl9-0005SL-2i
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:10:59 +0000
Date: Thu, 21 Jan 2016 17:10:59 +0000
Message-Id: <E1aMIl9-0005SL-2i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: correct descriptions of
	gnttab_max_{, maptrack}_frames
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef17887d848dae0ca46231b47bf30d3c1d4aa87d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jan 19 11:56:50 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 19 16:24:44 2016 +0000

    docs: correct descriptions of gnttab_max_{, maptrack}_frames
    
    gnttab_max_frames incorrectly referred to numbers of grant tab
    operations and gnttab_max_maptrack_frames was confusingly worded.
    
    Add the default for gnttab_max_frames while here (it's currently the
    same on all arches since no arch uses the available arch override) and
    adjust the default for gnttab_max_maptrack_frames to match the normal
    form.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 5ed0730..d267a04 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -740,13 +740,18 @@ Specify which console gdbstub should use. See **console**.
 ### gnttab\_max\_frames
 > `= <integer>`
 
-Specify the maximum number of frames per grant table operation.
+> Default: `32`
+
+Specify the maximum number of frames which any domain may use as part
+of its grant table.
 
 ### gnttab\_max\_maptrack\_frames
 > `= <integer>`
 
-Specify the maximum number of maptrack frames domain.
-The default value is 8 times **gnttab\_max\_frames**.
+> Default: `8 * gnttab_max_frames`
+
+Specify the maximum number of frames to use as part of a domains
+maptrack array.
 
 ### gnttab\_max\_nr\_frames
 > `= <integer>`
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 21 17:11:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17: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 1aMIlN-0000gu-4V; Thu, 21 Jan 2016 17:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIlL-0000gf-PP
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:11 +0000
Content-Length: 2288
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	C1/0A-03225-F2111A65; Thu, 21 Jan 2016 17:11:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1453396269!17327235!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56430 invoked from network); 21 Jan 2016 17:11:10 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:11:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIlx-0000D1-LX
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIlJ-0005Tk-K8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:09 +0000
Date: Thu, 21 Jan 2016 17:11:09 +0000
Message-Id: <E1aMIlJ-0005Tk-K8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: memset CPU context save 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: multipart/mixed; boundary="===============1729574242452206076=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1729574242452206076==
Content-Length: 1883
Content-Transfer-Encoding: quoted-printable

commit 1949868d640427dc91bfb23741d78eb1d86841c8
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Jan 19 17:47:19 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Jan 19 18:33:02 2016 +0000

    x86/HVM: memset CPU context save area
    
    In order to prevent leaking data in the padding field. Also remove the
    memset done to the fpu_regs in case of no FPU context present, since it's
    already taken care by the memset of the whole CPU context structure. The
    same applies to setting ctxt.flags to 0 in case there's no FPU context.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 8f98956..674feea 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1732,6 +1732,8 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         if ( v->pause_flags & VPF_down )
             continue;
 
+        memset(&ctxt, 0, sizeof(ctxt));
+
         /* Architecture-specific vmcs/vmcb bits */
         hvm_funcs.save_cpu_ctxt(v, &ctxt);
 
@@ -1798,11 +1800,6 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
             memcpy(ctxt.fpu_regs, v->arch.fpu_ctxt, sizeof(ctxt.fpu_regs));
             ctxt.flags =3D XEN_X86_FPU_INITIALISED;
         }
-        else
-        {
-             memset(ctxt.fpu_regs, 0, sizeof(ctxt.fpu_regs));
-             ctxt.flags =3D 0;
-        }
 
         ctxt.rax =3D v->arch.user_regs.eax;
         ctxt.rbx =3D v->arch.user_regs.ebx;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Thu Jan 21 17:11:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 Jan 2016 17: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 1aMIlN-0000gu-4V; Thu, 21 Jan 2016 17:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIlL-0000gf-PP
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:11 +0000
Content-Length: 2288
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	C1/0A-03225-F2111A65; Thu, 21 Jan 2016 17:11:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1453396269!17327235!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56430 invoked from network); 21 Jan 2016 17:11:10 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jan 2016 17:11:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIlx-0000D1-LX
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMIlJ-0005Tk-K8
	for xen-changelog@lists.xensource.com; Thu, 21 Jan 2016 17:11:09 +0000
Date: Thu, 21 Jan 2016 17:11:09 +0000
Message-Id: <E1aMIlJ-0005Tk-K8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: memset CPU context save 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: multipart/mixed; boundary="===============1729574242452206076=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1729574242452206076==
Content-Length: 1883
Content-Transfer-Encoding: quoted-printable

commit 1949868d640427dc91bfb23741d78eb1d86841c8
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Jan 19 17:47:19 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Jan 19 18:33:02 2016 +0000

    x86/HVM: memset CPU context save area
    
    In order to prevent leaking data in the padding field. Also remove the
    memset done to the fpu_regs in case of no FPU context present, since it's
    already taken care by the memset of the whole CPU context structure. The
    same applies to setting ctxt.flags to 0 in case there's no FPU context.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 8f98956..674feea 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1732,6 +1732,8 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         if ( v->pause_flags & VPF_down )
             continue;
 
+        memset(&ctxt, 0, sizeof(ctxt));
+
         /* Architecture-specific vmcs/vmcb bits */
         hvm_funcs.save_cpu_ctxt(v, &ctxt);
 
@@ -1798,11 +1800,6 @@ static int hvm_save_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
             memcpy(ctxt.fpu_regs, v->arch.fpu_ctxt, sizeof(ctxt.fpu_regs));
             ctxt.flags =3D XEN_X86_FPU_INITIALISED;
         }
-        else
-        {
-             memset(ctxt.fpu_regs, 0, sizeof(ctxt.fpu_regs));
-             ctxt.flags =3D 0;
-        }
 
         ctxt.rax =3D v->arch.user_regs.eax;
         ctxt.rbx =3D v->arch.user_regs.ebx;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:00:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:00: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 1aMZRr-00052x-1f; Fri, 22 Jan 2016 11:00:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZRp-00052d-AD
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:09 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	B0/41-24494-8BB02A65; Fri, 22 Jan 2016 11:00:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1453460407!9102927!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47689 invoked from network); 22 Jan 2016 11:00:08 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:00:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSS-0006f3-QL
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZRm-0001jc-Bp
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:06 +0000
Date: Fri, 22 Jan 2016 11:00:06 +0000
Message-Id: <E1aMZRm-0001jc-Bp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] xen/device-tree: Print the DT path
	on error in dt_for_each_range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 00fa9ac155ff33f5a70655476fd086ab676d0a16
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Oct 19 13:58:00 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 15:50:54 2016 +0000

    xen/device-tree: Print the DT path on error in dt_for_each_range
    
    With the current log is not possible for the user to understand
    properly the error:
    
    (XEN) Grant table range: 0x0000007fc00000-0x0000007fc72000
    (XEN) DT: no ranges; cannot enumerate
    (XEN) Device tree generation failed (-22).
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Could not set up DOM0 guest OS
    (XEN) ****************************************
    (XEN)
    
    The other error message within the function already print the DT path.
    Do the same here.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    (cherry picked from commit 01a8a8126d02b81bac4fe81541be0cccefc8a4c8)
---
 xen/common/device_tree.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 18cdb6f..08a97ef 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -849,7 +849,8 @@ int dt_for_each_range(const struct dt_device_node *dev,
     ranges = dt_get_property(dev, "ranges", &rlen);
     if ( ranges == NULL )
     {
-        printk(XENLOG_ERR "DT: no ranges; cannot enumerate\n");
+        printk(XENLOG_ERR "DT: no ranges; cannot enumerate %s\n",
+               dev->full_name);
         return -EINVAL;
     }
     if ( rlen == 0 ) /* Nothing to do */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:00:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:00: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 1aMZRr-00052x-1f; Fri, 22 Jan 2016 11:00:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZRp-00052d-AD
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:09 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	B0/41-24494-8BB02A65; Fri, 22 Jan 2016 11:00:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1453460407!9102927!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47689 invoked from network); 22 Jan 2016 11:00:08 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:00:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSS-0006f3-QL
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZRm-0001jc-Bp
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:06 +0000
Date: Fri, 22 Jan 2016 11:00:06 +0000
Message-Id: <E1aMZRm-0001jc-Bp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] xen/device-tree: Print the DT path
	on error in dt_for_each_range
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 00fa9ac155ff33f5a70655476fd086ab676d0a16
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Mon Oct 19 13:58:00 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 15:50:54 2016 +0000

    xen/device-tree: Print the DT path on error in dt_for_each_range
    
    With the current log is not possible for the user to understand
    properly the error:
    
    (XEN) Grant table range: 0x0000007fc00000-0x0000007fc72000
    (XEN) DT: no ranges; cannot enumerate
    (XEN) Device tree generation failed (-22).
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Could not set up DOM0 guest OS
    (XEN) ****************************************
    (XEN)
    
    The other error message within the function already print the DT path.
    Do the same here.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    (cherry picked from commit 01a8a8126d02b81bac4fe81541be0cccefc8a4c8)
---
 xen/common/device_tree.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 18cdb6f..08a97ef 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -849,7 +849,8 @@ int dt_for_each_range(const struct dt_device_node *dev,
     ranges = dt_get_property(dev, "ranges", &rlen);
     if ( ranges == NULL )
     {
-        printk(XENLOG_ERR "DT: no ranges; cannot enumerate\n");
+        printk(XENLOG_ERR "DT: no ranges; cannot enumerate %s\n",
+               dev->full_name);
         return -EINVAL;
     }
     if ( rlen == 0 ) /* Nothing to do */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:00:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:00: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 1aMZS4-00055B-5V; Fri, 22 Jan 2016 11:00: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 1aMZS2-00054m-Rp
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:23 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	F2/AD-07165-5CB02A65; Fri, 22 Jan 2016 11:00:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1453460418!18704689!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6436 invoked from network); 22 Jan 2016 11:00:20 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:00:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSe-0006fB-63
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZRy-0001kE-6I
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:18 +0000
Date: Fri, 22 Jan 2016 11:00:18 +0000
Message-Id: <E1aMZRy-0001kE-6I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] xen/arm: vgic-v2: Report the
	correct GICC size to the guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 93f67ce718a020686d98db7edd7e9298bd7b36a5
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 8 19:23:51 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 15:51:41 2016 +0000

    xen/arm: vgic-v2: Report the correct GICC size to the guest
    
    The GICv2 DT node is usually used by the guest to know the address/size
    of the regions (GICD, GICC...) to map into their virtual memory.
    
    While the GICv2 spec requires the size of the GICC to be 8KB, we
    correctly do an 8KB stage-2 mapping but erroneously report 256 in the
    device tree (based on GUEST_GICC_SIZE).
    
    I bet we didn't see any issue so far because all the registers except
    GICC_DIR lives in the first 256 bytes of the GICC region and all the
    guests I have seen so far are driving the GIC with GICC_CTLR.EIOmode =
    0.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fixed some typos in commit message ]
    
    (cherry picked from commit 8ee6d574b7073b5c98fcf94d20a53197609b85e1)
---
 xen/include/public/arch-arm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 9a96401..3c365f3 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -397,7 +397,7 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GICD_BASE   0x03001000ULL
 #define GUEST_GICD_SIZE   0x00001000ULL
 #define GUEST_GICC_BASE   0x03002000ULL
-#define GUEST_GICC_SIZE   0x00000100ULL
+#define GUEST_GICC_SIZE   0x00002000ULL
 
 /* vGIC v3 mappings */
 #define GUEST_GICV3_GICD_BASE      0x03001000ULL
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:00:24 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:00: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 1aMZS4-00055B-5V; Fri, 22 Jan 2016 11:00: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 1aMZS2-00054m-Rp
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:23 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	F2/AD-07165-5CB02A65; Fri, 22 Jan 2016 11:00:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1453460418!18704689!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6436 invoked from network); 22 Jan 2016 11:00:20 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:00:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSe-0006fB-63
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZRy-0001kE-6I
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:18 +0000
Date: Fri, 22 Jan 2016 11:00:18 +0000
Message-Id: <E1aMZRy-0001kE-6I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] xen/arm: vgic-v2: Report the
	correct GICC size to the guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 93f67ce718a020686d98db7edd7e9298bd7b36a5
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 8 19:23:51 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 15:51:41 2016 +0000

    xen/arm: vgic-v2: Report the correct GICC size to the guest
    
    The GICv2 DT node is usually used by the guest to know the address/size
    of the regions (GICD, GICC...) to map into their virtual memory.
    
    While the GICv2 spec requires the size of the GICC to be 8KB, we
    correctly do an 8KB stage-2 mapping but erroneously report 256 in the
    device tree (based on GUEST_GICC_SIZE).
    
    I bet we didn't see any issue so far because all the registers except
    GICC_DIR lives in the first 256 bytes of the GICC region and all the
    guests I have seen so far are driving the GIC with GICC_CTLR.EIOmode =
    0.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- fixed some typos in commit message ]
    
    (cherry picked from commit 8ee6d574b7073b5c98fcf94d20a53197609b85e1)
---
 xen/include/public/arch-arm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 9a96401..3c365f3 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -397,7 +397,7 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GICD_BASE   0x03001000ULL
 #define GUEST_GICD_SIZE   0x00001000ULL
 #define GUEST_GICC_BASE   0x03002000ULL
-#define GUEST_GICC_SIZE   0x00000100ULL
+#define GUEST_GICC_SIZE   0x00002000ULL
 
 /* vGIC v3 mappings */
 #define GUEST_GICV3_GICD_BASE      0x03001000ULL
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:00:33 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:00:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMZSD-00056h-8i; Fri, 22 Jan 2016 11:00: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 1aMZSB-00056R-SP
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:31 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	4B/0A-09570-FCB02A65; Fri, 22 Jan 2016 11:00:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453460429!7879379!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32621 invoked from network); 22 Jan 2016 11:00:30 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:00:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSo-0006fr-QR
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZS8-0001kh-OK
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:28 +0000
Date: Fri, 22 Jan 2016 11:00:28 +0000
Message-Id: <E1aMZS8-0001kh-OK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] xen/arm: vgic-v2: Implement
	correctly ITARGETSR0 - ITARGETSR7 read-only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 70ed1226d2e27f43c6f7d3aa9d5f2a0e1b29347d
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:38 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 15:53:39 2016 +0000

    xen/arm: vgic-v2: Implement correctly ITARGETSR0 - ITARGETSR7 read-only
    
    Each ITARGETSR register are 4-byte wide and the offset is in byte.
    
    The current implementation is computing the end of the range wrongly
    resulting to emulate only ITARGETSR{0,1} read-only. The rest will be
    treated as read-write.
    
    As 8 registers should be read-only, the end of the range should be
    ITARGETSR + (4 * 8) - 1.
    
    For convenience introduce ITARGETSR7 and ITARGETSR8.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    (cherry picked from commit bc50de883847c1ebc7c8b4d73283d9be6c4df38e)
---
 xen/arch/arm/vgic-v2.c    |    4 ++--
 xen/include/asm-arm/gic.h |    2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index fa71598..cb1fbb8 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -341,11 +341,11 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
                v, *r, gicd_reg - GICD_ICACTIVER);
         return 0;
 
-    case GICD_ITARGETSR ... GICD_ITARGETSR + 7:
+    case GICD_ITARGETSR ... GICD_ITARGETSR7:
         /* SGI/PPI target is read only */
         goto write_ignore_32;
 
-    case GICD_ITARGETSR + 8 ... GICD_ITARGETSRN:
+    case GICD_ITARGETSR8 ... GICD_ITARGETSRN:
     {
         /* unsigned long needed for find_next_bit */
         unsigned long target;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index d343abf..66bd070 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -42,6 +42,8 @@
 #define GICD_IPRIORITYR (0x400)
 #define GICD_IPRIORITYRN (0x7F8)
 #define GICD_ITARGETSR  (0x800)
+#define GICD_ITARGETSR7 (0x81C)
+#define GICD_ITARGETSR8 (0x820)
 #define GICD_ITARGETSRN (0xBF8)
 #define GICD_ICFGR      (0xC00)
 #define GICD_ICFGRN     (0xCFC)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:00:33 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:00:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMZSD-00056h-8i; Fri, 22 Jan 2016 11:00: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 1aMZSB-00056R-SP
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:31 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	4B/0A-09570-FCB02A65; Fri, 22 Jan 2016 11:00:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453460429!7879379!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32621 invoked from network); 22 Jan 2016 11:00:30 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:00:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSo-0006fr-QR
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZS8-0001kh-OK
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:28 +0000
Date: Fri, 22 Jan 2016 11:00:28 +0000
Message-Id: <E1aMZS8-0001kh-OK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] xen/arm: vgic-v2: Implement
	correctly ITARGETSR0 - ITARGETSR7 read-only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 70ed1226d2e27f43c6f7d3aa9d5f2a0e1b29347d
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:38 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 15:53:39 2016 +0000

    xen/arm: vgic-v2: Implement correctly ITARGETSR0 - ITARGETSR7 read-only
    
    Each ITARGETSR register are 4-byte wide and the offset is in byte.
    
    The current implementation is computing the end of the range wrongly
    resulting to emulate only ITARGETSR{0,1} read-only. The rest will be
    treated as read-write.
    
    As 8 registers should be read-only, the end of the range should be
    ITARGETSR + (4 * 8) - 1.
    
    For convenience introduce ITARGETSR7 and ITARGETSR8.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    (cherry picked from commit bc50de883847c1ebc7c8b4d73283d9be6c4df38e)
---
 xen/arch/arm/vgic-v2.c    |    4 ++--
 xen/include/asm-arm/gic.h |    2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index fa71598..cb1fbb8 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -341,11 +341,11 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
                v, *r, gicd_reg - GICD_ICACTIVER);
         return 0;
 
-    case GICD_ITARGETSR ... GICD_ITARGETSR + 7:
+    case GICD_ITARGETSR ... GICD_ITARGETSR7:
         /* SGI/PPI target is read only */
         goto write_ignore_32;
 
-    case GICD_ITARGETSR + 8 ... GICD_ITARGETSRN:
+    case GICD_ITARGETSR8 ... GICD_ITARGETSRN:
     {
         /* unsigned long needed for find_next_bit */
         unsigned long target;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index d343abf..66bd070 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -42,6 +42,8 @@
 #define GICD_IPRIORITYR (0x400)
 #define GICD_IPRIORITYRN (0x7F8)
 #define GICD_ITARGETSR  (0x800)
+#define GICD_ITARGETSR7 (0x81C)
+#define GICD_ITARGETSR8 (0x820)
 #define GICD_ITARGETSRN (0xBF8)
 #define GICD_ICFGR      (0xC00)
 #define GICD_ICFGRN     (0xCFC)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:00:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:00: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 1aMZSM-0005C9-UM; Fri, 22 Jan 2016 11:00: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 1aMZSL-00059S-Ls
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:41 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	69/E5-03225-8DB02A65; Fri, 22 Jan 2016 11:00:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1453460439!9103226!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54073 invoked from network); 22 Jan 2016 11:00:40 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:00:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSz-0006g1-39
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSJ-0001l3-8N
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:39 +0000
Date: Fri, 22 Jan 2016 11:00:39 +0000
Message-Id: <E1aMZSJ-0001l3-8N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] xen/arm: Add r1p12 to the list of
	supported Cadence UARTs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 19563a5b9e4c2006a7f2bee940a8f49408b77702
Author:     Edgar E. Iglesias <edgar.iglesias@xilinx.com>
AuthorDate: Thu Jan 14 19:44:07 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 16:00:02 2016 +0000

    xen/arm: Add r1p12 to the list of supported Cadence UARTs
    
    Add r1p12 to the list of supported Cadence UARTs. Xen only
    uses the subset of features available in r1p8, so we don't
    need to differentiate between r1p8 and r1p12 yet.
    
    Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 67f7afd26f7a61c31f6b3c3112828a3996434e17)
---
 xen/drivers/char/cadence-uart.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/char/cadence-uart.c b/xen/drivers/char/cadence-uart.c
index 933672f..7f90f8d 100644
--- a/xen/drivers/char/cadence-uart.c
+++ b/xen/drivers/char/cadence-uart.c
@@ -206,6 +206,7 @@ static int __init cuart_init(struct dt_device_node *dev, const void *data)
 static const struct dt_device_match cuart_dt_match[] __initconst =
 {
     DT_MATCH_COMPATIBLE("cdns,uart-r1p8"),
+    DT_MATCH_COMPATIBLE("cdns,uart-r1p12"),
     { /* sentinel */ },
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:00:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:00: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 1aMZSM-0005C9-UM; Fri, 22 Jan 2016 11:00: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 1aMZSL-00059S-Ls
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:41 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	69/E5-03225-8DB02A65; Fri, 22 Jan 2016 11:00:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1453460439!9103226!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54073 invoked from network); 22 Jan 2016 11:00:40 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:00:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSz-0006g1-39
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSJ-0001l3-8N
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:39 +0000
Date: Fri, 22 Jan 2016 11:00:39 +0000
Message-Id: <E1aMZSJ-0001l3-8N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] xen/arm: Add r1p12 to the list of
	supported Cadence UARTs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 19563a5b9e4c2006a7f2bee940a8f49408b77702
Author:     Edgar E. Iglesias <edgar.iglesias@xilinx.com>
AuthorDate: Thu Jan 14 19:44:07 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 16:00:02 2016 +0000

    xen/arm: Add r1p12 to the list of supported Cadence UARTs
    
    Add r1p12 to the list of supported Cadence UARTs. Xen only
    uses the subset of features available in r1p8, so we don't
    need to differentiate between r1p8 and r1p12 yet.
    
    Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 67f7afd26f7a61c31f6b3c3112828a3996434e17)
---
 xen/drivers/char/cadence-uart.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/char/cadence-uart.c b/xen/drivers/char/cadence-uart.c
index 933672f..7f90f8d 100644
--- a/xen/drivers/char/cadence-uart.c
+++ b/xen/drivers/char/cadence-uart.c
@@ -206,6 +206,7 @@ static int __init cuart_init(struct dt_device_node *dev, const void *data)
 static const struct dt_device_match cuart_dt_match[] __initconst =
 {
     DT_MATCH_COMPATIBLE("cdns,uart-r1p8"),
+    DT_MATCH_COMPATIBLE("cdns,uart-r1p12"),
     { /* sentinel */ },
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:00:58 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:00: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 1aMZSc-0005Pg-7m; Fri, 22 Jan 2016 11:00: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 1aMZSa-0005PC-A4
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:56 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	23/34-31122-7EB02A65; Fri, 22 Jan 2016 11:00:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1453460449!11530937!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18066 invoked from network); 22 Jan 2016 11:00:54 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:00:54 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZT9-0006gJ-CL
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZST-0001lR-HC
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:49 +0000
Date: Fri, 22 Jan 2016 11:00:49 +0000
Message-Id: <E1aMZST-0001lR-HC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/hvm: make sure stdvga cache
	cannot be re-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 18593631f2c0fbbd5eaee471ee838d407c74fb4e
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Thu Jan 21 09:46:38 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 09:46:38 2016 +0100

    x86/hvm: make sure stdvga cache cannot be re-enabled
    
    As soon as the cache is disabled, it will become out-of-sync with the
    VGA device model and since no mechanism exists to acquire current VRAM
    state from the device model, re-enabling it leads to stale data
    being seen by the guest.
    
    The problem was introduced by commit 3bbaaec0 ("x86/hvm: unify stdvga
    mmio intercept with standard mmio intercept") and can be seen by
    deliberately crashing a Windows guest; the BSOD output is corrupted.
    
    This patch changes the existing 'cache' boolean in hvm_hw_stdvga into a
    tri-state enum and only allows the state to move from 'uninitialized' to
    'enabled'. Once the cache state becomes 'disabled' it will remain so for
    the lifetime of the VM.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 22a1fbb575df3a3a7726cdeb5ddf19cc8f60827c
    master date: 2015-11-06 15:17:00 +0100
---
 xen/arch/x86/hvm/save.c      |    2 +-
 xen/arch/x86/hvm/stdvga.c    |   50 +++++++++++++++++++++++++++++++-----------
 xen/include/asm-x86/hvm/io.h |    8 ++++++-
 3 files changed, 45 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
index 4660beb..f7d4999 100644
--- a/xen/arch/x86/hvm/save.c
+++ b/xen/arch/x86/hvm/save.c
@@ -73,7 +73,7 @@ int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr)
     d->arch.hvm_domain.sync_tsc = rdtsc();
 
     /* VGA state is not saved/restored, so we nobble the cache. */
-    d->arch.hvm_domain.stdvga.cache = 0;
+    d->arch.hvm_domain.stdvga.cache = STDVGA_CACHE_DISABLED;
 
     return 0;
 }
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index f50bff7..60d93a8 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -101,6 +101,37 @@ static void vram_put(struct hvm_hw_stdvga *s, void *p)
     unmap_domain_page(p);
 }
 
+static void stdvga_try_cache_enable(struct hvm_hw_stdvga *s)
+{
+    /*
+     * Caching mode can only be enabled if the the cache has
+     * never been used before. As soon as it is disabled, it will
+     * become out-of-sync with the VGA device model and since no
+     * mechanism exists to acquire current VRAM state from the
+     * device model, re-enabling it would lead to stale data being
+     * seen by the guest.
+     */
+    if ( s->cache != STDVGA_CACHE_UNINITIALIZED )
+        return;
+
+    gdprintk(XENLOG_INFO, "entering caching mode\n");
+    s->cache = STDVGA_CACHE_ENABLED;
+}
+
+static void stdvga_cache_disable(struct hvm_hw_stdvga *s)
+{
+    if ( s->cache != STDVGA_CACHE_ENABLED )
+        return;
+
+    gdprintk(XENLOG_INFO, "leaving caching mode\n");
+    s->cache = STDVGA_CACHE_DISABLED;
+}
+
+static bool_t stdvga_cache_is_enabled(const struct hvm_hw_stdvga *s)
+{
+    return s->cache == STDVGA_CACHE_ENABLED;
+}
+
 static int stdvga_outb(uint64_t addr, uint8_t val)
 {
     struct hvm_hw_stdvga *s = &current->domain->arch.hvm_domain.stdvga;
@@ -139,12 +170,8 @@ static int stdvga_outb(uint64_t addr, uint8_t val)
 
     if ( !prev_stdvga && s->stdvga )
     {
-        /*
-         * (Re)start caching of video buffer.
-         * XXX TODO: In case of a restart the cache could be unsynced.
-         */
-        s->cache = 1;
-        gdprintk(XENLOG_INFO, "entering stdvga and caching modes\n");
+        gdprintk(XENLOG_INFO, "entering stdvga mode\n");
+        stdvga_try_cache_enable(s);
     }
     else if ( prev_stdvga && !s->stdvga )
     {
@@ -441,7 +468,7 @@ static int stdvga_mem_write(const struct hvm_io_handler *handler,
     };
     struct hvm_ioreq_server *srv;
 
-    if ( !s->cache || !s->stdvga )
+    if ( !stdvga_cache_is_enabled(s) || !s->stdvga )
         goto done;
 
     /* Intercept mmio write */
@@ -515,15 +542,12 @@ static bool_t stdvga_mem_accept(const struct hvm_io_handler *handler,
          * not active since we can assert, when in stdvga mode, that writes
          * to VRAM have no side effect and thus we can try to buffer them.
          */
-        if ( s->cache )
-        {
-            gdprintk(XENLOG_INFO, "leaving caching mode\n");
-            s->cache = 0;
-        }
+        stdvga_cache_disable(s);
 
         goto reject;
     }
-    else if ( p->dir == IOREQ_READ && (!s->cache || !s->stdvga) )
+    else if ( p->dir == IOREQ_READ &&
+              (!stdvga_cache_is_enabled(s) || !s->stdvga) )
         goto reject;
 
     /* s->lock intentionally held */
diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h
index 8585a1f..ceefa2e 100644
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -128,13 +128,19 @@ void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
 void msix_write_completion(struct vcpu *);
 void msixtbl_init(struct domain *d);
 
+enum stdvga_cache_state {
+    STDVGA_CACHE_UNINITIALIZED,
+    STDVGA_CACHE_ENABLED,
+    STDVGA_CACHE_DISABLED
+};
+
 struct hvm_hw_stdvga {
     uint8_t sr_index;
     uint8_t sr[8];
     uint8_t gr_index;
     uint8_t gr[9];
     bool_t stdvga;
-    bool_t cache;
+    enum stdvga_cache_state cache;
     uint32_t latch;
     struct page_info *vram_page[64];  /* shadow of 0xa0000-0xaffff */
     spinlock_t lock;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:00:58 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:00: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 1aMZSc-0005Pg-7m; Fri, 22 Jan 2016 11:00: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 1aMZSa-0005PC-A4
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:56 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	23/34-31122-7EB02A65; Fri, 22 Jan 2016 11:00:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1453460449!11530937!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18066 invoked from network); 22 Jan 2016 11:00:54 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:00:54 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZT9-0006gJ-CL
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZST-0001lR-HC
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:00:49 +0000
Date: Fri, 22 Jan 2016 11:00:49 +0000
Message-Id: <E1aMZST-0001lR-HC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/hvm: make sure stdvga cache
	cannot be re-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 18593631f2c0fbbd5eaee471ee838d407c74fb4e
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Thu Jan 21 09:46:38 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 09:46:38 2016 +0100

    x86/hvm: make sure stdvga cache cannot be re-enabled
    
    As soon as the cache is disabled, it will become out-of-sync with the
    VGA device model and since no mechanism exists to acquire current VRAM
    state from the device model, re-enabling it leads to stale data
    being seen by the guest.
    
    The problem was introduced by commit 3bbaaec0 ("x86/hvm: unify stdvga
    mmio intercept with standard mmio intercept") and can be seen by
    deliberately crashing a Windows guest; the BSOD output is corrupted.
    
    This patch changes the existing 'cache' boolean in hvm_hw_stdvga into a
    tri-state enum and only allows the state to move from 'uninitialized' to
    'enabled'. Once the cache state becomes 'disabled' it will remain so for
    the lifetime of the VM.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 22a1fbb575df3a3a7726cdeb5ddf19cc8f60827c
    master date: 2015-11-06 15:17:00 +0100
---
 xen/arch/x86/hvm/save.c      |    2 +-
 xen/arch/x86/hvm/stdvga.c    |   50 +++++++++++++++++++++++++++++++-----------
 xen/include/asm-x86/hvm/io.h |    8 ++++++-
 3 files changed, 45 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
index 4660beb..f7d4999 100644
--- a/xen/arch/x86/hvm/save.c
+++ b/xen/arch/x86/hvm/save.c
@@ -73,7 +73,7 @@ int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr)
     d->arch.hvm_domain.sync_tsc = rdtsc();
 
     /* VGA state is not saved/restored, so we nobble the cache. */
-    d->arch.hvm_domain.stdvga.cache = 0;
+    d->arch.hvm_domain.stdvga.cache = STDVGA_CACHE_DISABLED;
 
     return 0;
 }
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index f50bff7..60d93a8 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -101,6 +101,37 @@ static void vram_put(struct hvm_hw_stdvga *s, void *p)
     unmap_domain_page(p);
 }
 
+static void stdvga_try_cache_enable(struct hvm_hw_stdvga *s)
+{
+    /*
+     * Caching mode can only be enabled if the the cache has
+     * never been used before. As soon as it is disabled, it will
+     * become out-of-sync with the VGA device model and since no
+     * mechanism exists to acquire current VRAM state from the
+     * device model, re-enabling it would lead to stale data being
+     * seen by the guest.
+     */
+    if ( s->cache != STDVGA_CACHE_UNINITIALIZED )
+        return;
+
+    gdprintk(XENLOG_INFO, "entering caching mode\n");
+    s->cache = STDVGA_CACHE_ENABLED;
+}
+
+static void stdvga_cache_disable(struct hvm_hw_stdvga *s)
+{
+    if ( s->cache != STDVGA_CACHE_ENABLED )
+        return;
+
+    gdprintk(XENLOG_INFO, "leaving caching mode\n");
+    s->cache = STDVGA_CACHE_DISABLED;
+}
+
+static bool_t stdvga_cache_is_enabled(const struct hvm_hw_stdvga *s)
+{
+    return s->cache == STDVGA_CACHE_ENABLED;
+}
+
 static int stdvga_outb(uint64_t addr, uint8_t val)
 {
     struct hvm_hw_stdvga *s = &current->domain->arch.hvm_domain.stdvga;
@@ -139,12 +170,8 @@ static int stdvga_outb(uint64_t addr, uint8_t val)
 
     if ( !prev_stdvga && s->stdvga )
     {
-        /*
-         * (Re)start caching of video buffer.
-         * XXX TODO: In case of a restart the cache could be unsynced.
-         */
-        s->cache = 1;
-        gdprintk(XENLOG_INFO, "entering stdvga and caching modes\n");
+        gdprintk(XENLOG_INFO, "entering stdvga mode\n");
+        stdvga_try_cache_enable(s);
     }
     else if ( prev_stdvga && !s->stdvga )
     {
@@ -441,7 +468,7 @@ static int stdvga_mem_write(const struct hvm_io_handler *handler,
     };
     struct hvm_ioreq_server *srv;
 
-    if ( !s->cache || !s->stdvga )
+    if ( !stdvga_cache_is_enabled(s) || !s->stdvga )
         goto done;
 
     /* Intercept mmio write */
@@ -515,15 +542,12 @@ static bool_t stdvga_mem_accept(const struct hvm_io_handler *handler,
          * not active since we can assert, when in stdvga mode, that writes
          * to VRAM have no side effect and thus we can try to buffer them.
          */
-        if ( s->cache )
-        {
-            gdprintk(XENLOG_INFO, "leaving caching mode\n");
-            s->cache = 0;
-        }
+        stdvga_cache_disable(s);
 
         goto reject;
     }
-    else if ( p->dir == IOREQ_READ && (!s->cache || !s->stdvga) )
+    else if ( p->dir == IOREQ_READ &&
+              (!stdvga_cache_is_enabled(s) || !s->stdvga) )
         goto reject;
 
     /* s->lock intentionally held */
diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h
index 8585a1f..ceefa2e 100644
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -128,13 +128,19 @@ void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
 void msix_write_completion(struct vcpu *);
 void msixtbl_init(struct domain *d);
 
+enum stdvga_cache_state {
+    STDVGA_CACHE_UNINITIALIZED,
+    STDVGA_CACHE_ENABLED,
+    STDVGA_CACHE_DISABLED
+};
+
 struct hvm_hw_stdvga {
     uint8_t sr_index;
     uint8_t sr[8];
     uint8_t gr_index;
     uint8_t gr[9];
     bool_t stdvga;
-    bool_t cache;
+    enum stdvga_cache_state cache;
     uint32_t latch;
     struct page_info *vram_page[64];  /* shadow of 0xa0000-0xaffff */
     spinlock_t lock;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:01:04 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:01: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 1aMZSi-0005R9-BW; Fri, 22 Jan 2016 11:01:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSg-0005Qk-Rw
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:03 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	53/E7-18633-EEB02A65; Fri, 22 Jan 2016 11:01:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1453460460!17527165!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42833 invoked from network); 22 Jan 2016 11:01:01 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:01:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZTJ-0006h7-S0
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSd-0001mO-PF
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:00 +0000
Date: Fri, 22 Jan 2016 11:00:59 +0000
Message-Id: <E1aMZSd-0001mO-PF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/VPMU: support only versions 2
	through 4 of architectural performance monitoring
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b62a5d83b24bd9304ecbfa2404166968c59ee59
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 21 09:47:30 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 09:47:30 2016 +0100

    x86/VPMU: support only versions 2 through 4 of architectural performance monitoring
    
    We need to have at least version 2 since it's the first version to
    support various control and status registers (such as
    MSR_CORE_PERF_GLOBAL_CTRL) that VPMU relies on always having.
    
    We don't fully emulate version 4 but since it's back compatible with
    earlier versions we can fall back to v3. At this point there is no
    compatibility statement for v5 so anything above 4 is not supported.
    
    For guests querying PMU version via CPUID leaf 0xa clip it at v3.
    
    With explicit testing for PMU version we can now remove CPUID model
    check.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 00e248ce7f25d1e7705c87403065e1f6fd440dc8
    master date: 2015-12-10 13:15:35 +0100
---
 xen/arch/x86/cpu/vpmu_intel.c |   80 +++++++++++++++-------------------------
 1 files changed, 30 insertions(+), 50 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index d5ea7fe..c27f095 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -733,11 +733,11 @@ static void core2_vpmu_do_cpuid(unsigned int input,
                                 unsigned int *eax, unsigned int *ebx,
                                 unsigned int *ecx, unsigned int *edx)
 {
-    if (input == 0x1)
+    switch ( input )
     {
-        struct vpmu_struct *vpmu = vcpu_vpmu(current);
+    case 0x1:
 
-        if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
+        if ( vpmu_is_set(vcpu_vpmu(current), VPMU_CPU_HAS_DS) )
         {
             /* Switch on the 'Debug Store' feature in CPUID.EAX[1]:EDX[21] */
             *edx |= cpufeat_mask(X86_FEATURE_DS);
@@ -746,6 +746,13 @@ static void core2_vpmu_do_cpuid(unsigned int input,
             if ( cpu_has(&current_cpu_data, X86_FEATURE_DSCPL) )
                 *ecx |= cpufeat_mask(X86_FEATURE_DSCPL);
         }
+        break;
+
+    case 0xa:
+        /* Report at most version 3 since that's all we currently emulate */
+        if ( MASK_EXTR(*eax, PMU_VERSION_MASK) > 3 )
+            *eax = (*eax & ~PMU_VERSION_MASK) | MASK_INSR(3, PMU_VERSION_MASK);
+        break;
     }
 }
 
@@ -955,59 +962,32 @@ int vmx_vpmu_initialise(struct vcpu *v)
 int __init core2_vpmu_init(void)
 {
     u64 caps;
+    unsigned int version = 0;
 
-    if ( current_cpu_data.x86 != 6 )
+    if ( current_cpu_data.cpuid_level >= 0xa )
+        version = MASK_EXTR(cpuid_eax(0xa), PMU_VERSION_MASK);
+
+    switch ( version )
     {
-        printk(XENLOG_WARNING "VPMU: only family 6 is supported\n");
+    case 4:
+        printk(XENLOG_INFO "VPMU: PMU version 4 is not fully supported. "
+               "Emulating version 3\n");
+        /* FALLTHROUGH */
+
+    case 2:
+    case 3:
+        break;
+
+    default:
+        printk(XENLOG_WARNING "VPMU: PMU version %u is not supported\n",
+               version);
         return -EINVAL;
     }
 
-    switch ( current_cpu_data.x86_model )
+    if ( current_cpu_data.x86 != 6 )
     {
-        /* Core2: */
-        case 0x0f: /* original 65 nm celeron/pentium/core2/xeon, "Merom"/"Conroe" */
-        case 0x16: /* single-core 65 nm celeron/core2solo "Merom-L"/"Conroe-L" */
-        case 0x17: /* 45 nm celeron/core2/xeon "Penryn"/"Wolfdale" */
-        case 0x1d: /* six-core 45 nm xeon "Dunnington" */
-
-        case 0x2a: /* SandyBridge */
-        case 0x2d: /* SandyBridge, "Romley-EP" */
-
-        /* Nehalem: */
-        case 0x1a: /* 45 nm nehalem, "Bloomfield" */
-        case 0x1e: /* 45 nm nehalem, "Lynnfield", "Clarksfield", "Jasper Forest" */
-        case 0x2e: /* 45 nm nehalem-ex, "Beckton" */
-
-        /* Westmere: */
-        case 0x25: /* 32 nm nehalem, "Clarkdale", "Arrandale" */
-        case 0x2c: /* 32 nm nehalem, "Gulftown", "Westmere-EP" */
-        case 0x2f: /* 32 nm Westmere-EX */
-
-        case 0x3a: /* IvyBridge */
-        case 0x3e: /* IvyBridge EP */
-
-        /* Haswell: */
-        case 0x3c:
-        case 0x3f:
-        case 0x45:
-        case 0x46:
-
-        /* Broadwell */
-        case 0x3d:
-        case 0x4f:
-        case 0x56:
-
-        /* future: */
-        case 0x4e:
-
-        /* next gen Xeon Phi */
-        case 0x57:
-            break;
-
-        default:
-            printk(XENLOG_WARNING "VPMU: Unsupported CPU model %#x\n",
-                   current_cpu_data.x86_model);
-            return -EINVAL;
+        printk(XENLOG_WARNING "VPMU: only family 6 is supported\n");
+        return -EINVAL;
     }
 
     arch_pmc_cnt = core2_get_arch_pmc_count();
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:01:04 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:01: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 1aMZSi-0005R9-BW; Fri, 22 Jan 2016 11:01:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSg-0005Qk-Rw
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:03 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	53/E7-18633-EEB02A65; Fri, 22 Jan 2016 11:01:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1453460460!17527165!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42833 invoked from network); 22 Jan 2016 11:01:01 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:01:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZTJ-0006h7-S0
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSd-0001mO-PF
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:00 +0000
Date: Fri, 22 Jan 2016 11:00:59 +0000
Message-Id: <E1aMZSd-0001mO-PF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/VPMU: support only versions 2
	through 4 of architectural performance monitoring
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b62a5d83b24bd9304ecbfa2404166968c59ee59
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 21 09:47:30 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 09:47:30 2016 +0100

    x86/VPMU: support only versions 2 through 4 of architectural performance monitoring
    
    We need to have at least version 2 since it's the first version to
    support various control and status registers (such as
    MSR_CORE_PERF_GLOBAL_CTRL) that VPMU relies on always having.
    
    We don't fully emulate version 4 but since it's back compatible with
    earlier versions we can fall back to v3. At this point there is no
    compatibility statement for v5 so anything above 4 is not supported.
    
    For guests querying PMU version via CPUID leaf 0xa clip it at v3.
    
    With explicit testing for PMU version we can now remove CPUID model
    check.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 00e248ce7f25d1e7705c87403065e1f6fd440dc8
    master date: 2015-12-10 13:15:35 +0100
---
 xen/arch/x86/cpu/vpmu_intel.c |   80 +++++++++++++++-------------------------
 1 files changed, 30 insertions(+), 50 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index d5ea7fe..c27f095 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -733,11 +733,11 @@ static void core2_vpmu_do_cpuid(unsigned int input,
                                 unsigned int *eax, unsigned int *ebx,
                                 unsigned int *ecx, unsigned int *edx)
 {
-    if (input == 0x1)
+    switch ( input )
     {
-        struct vpmu_struct *vpmu = vcpu_vpmu(current);
+    case 0x1:
 
-        if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
+        if ( vpmu_is_set(vcpu_vpmu(current), VPMU_CPU_HAS_DS) )
         {
             /* Switch on the 'Debug Store' feature in CPUID.EAX[1]:EDX[21] */
             *edx |= cpufeat_mask(X86_FEATURE_DS);
@@ -746,6 +746,13 @@ static void core2_vpmu_do_cpuid(unsigned int input,
             if ( cpu_has(&current_cpu_data, X86_FEATURE_DSCPL) )
                 *ecx |= cpufeat_mask(X86_FEATURE_DSCPL);
         }
+        break;
+
+    case 0xa:
+        /* Report at most version 3 since that's all we currently emulate */
+        if ( MASK_EXTR(*eax, PMU_VERSION_MASK) > 3 )
+            *eax = (*eax & ~PMU_VERSION_MASK) | MASK_INSR(3, PMU_VERSION_MASK);
+        break;
     }
 }
 
@@ -955,59 +962,32 @@ int vmx_vpmu_initialise(struct vcpu *v)
 int __init core2_vpmu_init(void)
 {
     u64 caps;
+    unsigned int version = 0;
 
-    if ( current_cpu_data.x86 != 6 )
+    if ( current_cpu_data.cpuid_level >= 0xa )
+        version = MASK_EXTR(cpuid_eax(0xa), PMU_VERSION_MASK);
+
+    switch ( version )
     {
-        printk(XENLOG_WARNING "VPMU: only family 6 is supported\n");
+    case 4:
+        printk(XENLOG_INFO "VPMU: PMU version 4 is not fully supported. "
+               "Emulating version 3\n");
+        /* FALLTHROUGH */
+
+    case 2:
+    case 3:
+        break;
+
+    default:
+        printk(XENLOG_WARNING "VPMU: PMU version %u is not supported\n",
+               version);
         return -EINVAL;
     }
 
-    switch ( current_cpu_data.x86_model )
+    if ( current_cpu_data.x86 != 6 )
     {
-        /* Core2: */
-        case 0x0f: /* original 65 nm celeron/pentium/core2/xeon, "Merom"/"Conroe" */
-        case 0x16: /* single-core 65 nm celeron/core2solo "Merom-L"/"Conroe-L" */
-        case 0x17: /* 45 nm celeron/core2/xeon "Penryn"/"Wolfdale" */
-        case 0x1d: /* six-core 45 nm xeon "Dunnington" */
-
-        case 0x2a: /* SandyBridge */
-        case 0x2d: /* SandyBridge, "Romley-EP" */
-
-        /* Nehalem: */
-        case 0x1a: /* 45 nm nehalem, "Bloomfield" */
-        case 0x1e: /* 45 nm nehalem, "Lynnfield", "Clarksfield", "Jasper Forest" */
-        case 0x2e: /* 45 nm nehalem-ex, "Beckton" */
-
-        /* Westmere: */
-        case 0x25: /* 32 nm nehalem, "Clarkdale", "Arrandale" */
-        case 0x2c: /* 32 nm nehalem, "Gulftown", "Westmere-EP" */
-        case 0x2f: /* 32 nm Westmere-EX */
-
-        case 0x3a: /* IvyBridge */
-        case 0x3e: /* IvyBridge EP */
-
-        /* Haswell: */
-        case 0x3c:
-        case 0x3f:
-        case 0x45:
-        case 0x46:
-
-        /* Broadwell */
-        case 0x3d:
-        case 0x4f:
-        case 0x56:
-
-        /* future: */
-        case 0x4e:
-
-        /* next gen Xeon Phi */
-        case 0x57:
-            break;
-
-        default:
-            printk(XENLOG_WARNING "VPMU: Unsupported CPU model %#x\n",
-                   current_cpu_data.x86_model);
-            return -EINVAL;
+        printk(XENLOG_WARNING "VPMU: only family 6 is supported\n");
+        return -EINVAL;
     }
 
     arch_pmc_cnt = core2_get_arch_pmc_count();
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:01:14 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:01: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 1aMZSs-0005TO-GH; Fri, 22 Jan 2016 11:01: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 1aMZSr-0005Sr-1I
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:13 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	19/0C-21901-8FB02A65; Fri, 22 Jan 2016 11:01:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1453460470!17446642!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51278 invoked from network); 22 Jan 2016 11:01:11 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:01:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZTU-0006hK-7s
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSo-0001nE-8f
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:10 +0000
Date: Fri, 22 Jan 2016 11:01:10 +0000
Message-Id: <E1aMZSo-0001nE-8f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/VPMU: check more carefully
	which bits are allowed to be written to 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 39d7fde885d5d9f8b035ce09211e64100ccfe288
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 21 09:47:59 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 09:47:59 2016 +0100

    x86/VPMU: check more carefully which bits are allowed to be written to MSRs
    
    Current Intel VPMU emulation needs to perform more checks when writing
    PMU MSRs on guest's behalf:
    * MSR_CORE_PERF_GLOBAL_CTRL is not checked at all
    * MSR_CORE_PERF_FIXED_CTR_CTRL has more reserved bits in PMU version 2
    * MSR_CORE_PERF_GLOBAL_OVF_CTRL's bit 61 is allowed on versions greater
    * than 2.
    
    We can also use precomputed mask in core2_vpmu_do_interrupt().
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 31af0d76759328161cb5db73b50b23dded51e15c
    master date: 2016-01-07 15:26:37 +0100
---
 xen/arch/x86/cpu/vpmu_intel.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index c27f095..7a8c824 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -87,7 +87,7 @@ static unsigned int __read_mostly arch_pmc_cnt, fixed_pmc_cnt;
 /* Masks used for testing whether and MSR is valid */
 #define ARCH_CTRL_MASK  (~((1ull << 32) - 1) | (1ull << 21))
 static uint64_t __read_mostly fixed_ctrl_mask, fixed_counters_mask;
-static uint64_t __read_mostly global_ovf_ctrl_mask;
+static uint64_t __read_mostly global_ovf_ctrl_mask, global_ctrl_mask;
 
 /* Total size of PMU registers block (copied to/from PV(H) guest) */
 static unsigned int __read_mostly regs_sz;
@@ -391,6 +391,8 @@ static int core2_vpmu_verify(struct vcpu *v)
 
     if ( core2_vpmu_cxt->global_ovf_ctrl & global_ovf_ctrl_mask )
         return -EINVAL;
+    if ( core2_vpmu_cxt->global_ctrl & global_ctrl_mask )
+        return -EINVAL;
 
     fixed_ctrl = core2_vpmu_cxt->fixed_ctrl;
     if ( fixed_ctrl & fixed_ctrl_mask )
@@ -622,6 +624,8 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         gdprintk(XENLOG_WARNING, "Guest setting of DTS is ignored.\n");
         return 0;
     case MSR_CORE_PERF_GLOBAL_CTRL:
+        if ( msr_content & global_ctrl_mask )
+            return -EINVAL;
         core2_vpmu_cxt->global_ctrl = msr_content;
         break;
     case MSR_CORE_PERF_FIXED_CTR_CTRL:
@@ -815,7 +819,7 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
         if ( is_pmc_quirk )
             handle_pmc_quirk(msr_content);
         core2_vpmu_cxt->global_status |= msr_content;
-        msr_content = 0xC000000700000000 | ((1 << arch_pmc_cnt) - 1);
+        msr_content = ~global_ovf_ctrl_mask;
         wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, msr_content);
     }
     else
@@ -996,10 +1000,20 @@ int __init core2_vpmu_init(void)
     full_width_write = (caps >> 13) & 1;
 
     fixed_ctrl_mask = ~((1ull << (fixed_pmc_cnt * FIXED_CTR_CTRL_BITS)) - 1);
+    if ( version == 2 )
+        fixed_ctrl_mask |= 0x444;
     fixed_counters_mask = ~((1ull << core2_get_bitwidth_fix_count()) - 1);
+    global_ctrl_mask = ~((((1ULL << fixed_pmc_cnt) - 1) << 32) |
+                         ((1ULL << arch_pmc_cnt) - 1));
     global_ovf_ctrl_mask = ~(0xC000000000000000 |
                              (((1ULL << fixed_pmc_cnt) - 1) << 32) |
                              ((1ULL << arch_pmc_cnt) - 1));
+    if ( version > 2 )
+        /*
+         * Even though we don't support Uncore counters guests should be
+         * able to clear all available overflows.
+         */
+        global_ovf_ctrl_mask &= ~(1ULL << 61);
 
     regs_sz = (sizeof(struct xen_pmu_intel_ctxt) - regs_off) +
               sizeof(uint64_t) * fixed_pmc_cnt +
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:01:14 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:01: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 1aMZSs-0005TO-GH; Fri, 22 Jan 2016 11:01: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 1aMZSr-0005Sr-1I
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:13 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	19/0C-21901-8FB02A65; Fri, 22 Jan 2016 11:01:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1453460470!17446642!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51278 invoked from network); 22 Jan 2016 11:01:11 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:01:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZTU-0006hK-7s
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSo-0001nE-8f
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:10 +0000
Date: Fri, 22 Jan 2016 11:01:10 +0000
Message-Id: <E1aMZSo-0001nE-8f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/VPMU: check more carefully
	which bits are allowed to be written to 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 39d7fde885d5d9f8b035ce09211e64100ccfe288
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 21 09:47:59 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 09:47:59 2016 +0100

    x86/VPMU: check more carefully which bits are allowed to be written to MSRs
    
    Current Intel VPMU emulation needs to perform more checks when writing
    PMU MSRs on guest's behalf:
    * MSR_CORE_PERF_GLOBAL_CTRL is not checked at all
    * MSR_CORE_PERF_FIXED_CTR_CTRL has more reserved bits in PMU version 2
    * MSR_CORE_PERF_GLOBAL_OVF_CTRL's bit 61 is allowed on versions greater
    * than 2.
    
    We can also use precomputed mask in core2_vpmu_do_interrupt().
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 31af0d76759328161cb5db73b50b23dded51e15c
    master date: 2016-01-07 15:26:37 +0100
---
 xen/arch/x86/cpu/vpmu_intel.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index c27f095..7a8c824 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -87,7 +87,7 @@ static unsigned int __read_mostly arch_pmc_cnt, fixed_pmc_cnt;
 /* Masks used for testing whether and MSR is valid */
 #define ARCH_CTRL_MASK  (~((1ull << 32) - 1) | (1ull << 21))
 static uint64_t __read_mostly fixed_ctrl_mask, fixed_counters_mask;
-static uint64_t __read_mostly global_ovf_ctrl_mask;
+static uint64_t __read_mostly global_ovf_ctrl_mask, global_ctrl_mask;
 
 /* Total size of PMU registers block (copied to/from PV(H) guest) */
 static unsigned int __read_mostly regs_sz;
@@ -391,6 +391,8 @@ static int core2_vpmu_verify(struct vcpu *v)
 
     if ( core2_vpmu_cxt->global_ovf_ctrl & global_ovf_ctrl_mask )
         return -EINVAL;
+    if ( core2_vpmu_cxt->global_ctrl & global_ctrl_mask )
+        return -EINVAL;
 
     fixed_ctrl = core2_vpmu_cxt->fixed_ctrl;
     if ( fixed_ctrl & fixed_ctrl_mask )
@@ -622,6 +624,8 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
         gdprintk(XENLOG_WARNING, "Guest setting of DTS is ignored.\n");
         return 0;
     case MSR_CORE_PERF_GLOBAL_CTRL:
+        if ( msr_content & global_ctrl_mask )
+            return -EINVAL;
         core2_vpmu_cxt->global_ctrl = msr_content;
         break;
     case MSR_CORE_PERF_FIXED_CTR_CTRL:
@@ -815,7 +819,7 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
         if ( is_pmc_quirk )
             handle_pmc_quirk(msr_content);
         core2_vpmu_cxt->global_status |= msr_content;
-        msr_content = 0xC000000700000000 | ((1 << arch_pmc_cnt) - 1);
+        msr_content = ~global_ovf_ctrl_mask;
         wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, msr_content);
     }
     else
@@ -996,10 +1000,20 @@ int __init core2_vpmu_init(void)
     full_width_write = (caps >> 13) & 1;
 
     fixed_ctrl_mask = ~((1ull << (fixed_pmc_cnt * FIXED_CTR_CTRL_BITS)) - 1);
+    if ( version == 2 )
+        fixed_ctrl_mask |= 0x444;
     fixed_counters_mask = ~((1ull << core2_get_bitwidth_fix_count()) - 1);
+    global_ctrl_mask = ~((((1ULL << fixed_pmc_cnt) - 1) << 32) |
+                         ((1ULL << arch_pmc_cnt) - 1));
     global_ovf_ctrl_mask = ~(0xC000000000000000 |
                              (((1ULL << fixed_pmc_cnt) - 1) << 32) |
                              ((1ULL << arch_pmc_cnt) - 1));
+    if ( version > 2 )
+        /*
+         * Even though we don't support Uncore counters guests should be
+         * able to clear all available overflows.
+         */
+        global_ovf_ctrl_mask &= ~(1ULL << 61);
 
     regs_sz = (sizeof(struct xen_pmu_intel_ctxt) - regs_off) +
               sizeof(uint64_t) * fixed_pmc_cnt +
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:01:27 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:01: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 1aMZT5-0005WP-LS; Fri, 22 Jan 2016 11:01: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 1aMZT3-0005Vr-Qy
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:25 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	34/74-24450-50C02A65; Fri, 22 Jan 2016 11:01:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1453460481!10076992!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6638 invoked from network); 22 Jan 2016 11:01:23 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:01:23 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZTe-0006hz-JX
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:02:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSy-0001nb-NE
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:20 +0000
Date: Fri, 22 Jan 2016 11:01:20 +0000
Message-Id: <E1aMZSy-0001nb-NE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/VPMU: don't allow any non-zero
	writes to MSR_IA32_PEBS_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 ffb237937a38989e5d598e7774ad45791f164ae7
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 21 09:48:21 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 09:48:21 2016 +0100

    x86/VPMU: don't allow any non-zero writes to MSR_IA32_PEBS_ENABLE
    
    Calculation reserved bits for MSR_IA32_PEBS_ENABLE is model-dependent
    and since we don't support PEBS anyway we shouldn't allow any writes to
    it (but let's still permit guests wishing to disable PEBS).
    
    We should also report PEBS as unsupported to HVM, just like we do on PV.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: fb424bf6b5b0df0155ab4e56a1b8f67e6470fa46
    master date: 2016-01-07 15:27:16 +0100
---
 xen/arch/x86/cpu/vpmu_intel.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 7a8c824..80eecc7 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -264,7 +264,6 @@ static void core2_vpmu_set_msr_bitmap(unsigned long *msr_bitmap)
          clear_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
 
     clear_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR_CTRL), msr_bitmap);
-    clear_bit(msraddr_to_bitpos(MSR_IA32_PEBS_ENABLE), msr_bitmap);
     clear_bit(msraddr_to_bitpos(MSR_IA32_DS_AREA), msr_bitmap);
 }
 
@@ -296,7 +295,6 @@ static void core2_vpmu_unset_msr_bitmap(unsigned long *msr_bitmap)
         set_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
 
     set_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR_CTRL), msr_bitmap);
-    set_bit(msraddr_to_bitpos(MSR_IA32_PEBS_ENABLE), msr_bitmap);
     set_bit(msraddr_to_bitpos(MSR_IA32_DS_AREA), msr_bitmap);
 }
 
@@ -367,7 +365,6 @@ static inline void __core2_vpmu_load(struct vcpu *v)
 
     wrmsrl(MSR_CORE_PERF_FIXED_CTR_CTRL, core2_vpmu_cxt->fixed_ctrl);
     wrmsrl(MSR_IA32_DS_AREA, core2_vpmu_cxt->ds_area);
-    wrmsrl(MSR_IA32_PEBS_ENABLE, core2_vpmu_cxt->pebs_enable);
 
     if ( !has_hvm_container_vcpu(v) )
     {
@@ -393,6 +390,8 @@ static int core2_vpmu_verify(struct vcpu *v)
         return -EINVAL;
     if ( core2_vpmu_cxt->global_ctrl & global_ctrl_mask )
         return -EINVAL;
+    if ( core2_vpmu_cxt->pebs_enable )
+        return -EINVAL;
 
     fixed_ctrl = core2_vpmu_cxt->fixed_ctrl;
     if ( fixed_ctrl & fixed_ctrl_mask )
@@ -603,10 +602,9 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
                  "MSR_PERF_GLOBAL_STATUS(0x38E)!\n");
         return -EINVAL;
     case MSR_IA32_PEBS_ENABLE:
-        if ( msr_content & 1 )
-            gdprintk(XENLOG_WARNING, "Guest is trying to enable PEBS, "
-                     "which is not supported.\n");
-        core2_vpmu_cxt->pebs_enable = msr_content;
+        if ( msr_content )
+            /* PEBS is reported as unavailable in MSR_IA32_MISC_ENABLE */
+            return -EINVAL;
         return 0;
     case MSR_IA32_DS_AREA:
         if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
@@ -728,6 +726,7 @@ static int core2_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
         /* Extension for BTS */
         if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) )
             *msr_content &= ~MSR_IA32_MISC_ENABLE_BTS_UNAVAIL;
+        *msr_content |= MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL;
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:01:27 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:01: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 1aMZT5-0005WP-LS; Fri, 22 Jan 2016 11:01: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 1aMZT3-0005Vr-Qy
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:25 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	34/74-24450-50C02A65; Fri, 22 Jan 2016 11:01:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1453460481!10076992!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6638 invoked from network); 22 Jan 2016 11:01:23 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:01:23 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZTe-0006hz-JX
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:02:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZSy-0001nb-NE
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:20 +0000
Date: Fri, 22 Jan 2016 11:01:20 +0000
Message-Id: <E1aMZSy-0001nb-NE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/VPMU: don't allow any non-zero
	writes to MSR_IA32_PEBS_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 ffb237937a38989e5d598e7774ad45791f164ae7
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Thu Jan 21 09:48:21 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 09:48:21 2016 +0100

    x86/VPMU: don't allow any non-zero writes to MSR_IA32_PEBS_ENABLE
    
    Calculation reserved bits for MSR_IA32_PEBS_ENABLE is model-dependent
    and since we don't support PEBS anyway we shouldn't allow any writes to
    it (but let's still permit guests wishing to disable PEBS).
    
    We should also report PEBS as unsupported to HVM, just like we do on PV.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: fb424bf6b5b0df0155ab4e56a1b8f67e6470fa46
    master date: 2016-01-07 15:27:16 +0100
---
 xen/arch/x86/cpu/vpmu_intel.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 7a8c824..80eecc7 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -264,7 +264,6 @@ static void core2_vpmu_set_msr_bitmap(unsigned long *msr_bitmap)
          clear_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
 
     clear_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR_CTRL), msr_bitmap);
-    clear_bit(msraddr_to_bitpos(MSR_IA32_PEBS_ENABLE), msr_bitmap);
     clear_bit(msraddr_to_bitpos(MSR_IA32_DS_AREA), msr_bitmap);
 }
 
@@ -296,7 +295,6 @@ static void core2_vpmu_unset_msr_bitmap(unsigned long *msr_bitmap)
         set_bit(msraddr_to_bitpos(MSR_P6_EVNTSEL(i)), msr_bitmap);
 
     set_bit(msraddr_to_bitpos(MSR_CORE_PERF_FIXED_CTR_CTRL), msr_bitmap);
-    set_bit(msraddr_to_bitpos(MSR_IA32_PEBS_ENABLE), msr_bitmap);
     set_bit(msraddr_to_bitpos(MSR_IA32_DS_AREA), msr_bitmap);
 }
 
@@ -367,7 +365,6 @@ static inline void __core2_vpmu_load(struct vcpu *v)
 
     wrmsrl(MSR_CORE_PERF_FIXED_CTR_CTRL, core2_vpmu_cxt->fixed_ctrl);
     wrmsrl(MSR_IA32_DS_AREA, core2_vpmu_cxt->ds_area);
-    wrmsrl(MSR_IA32_PEBS_ENABLE, core2_vpmu_cxt->pebs_enable);
 
     if ( !has_hvm_container_vcpu(v) )
     {
@@ -393,6 +390,8 @@ static int core2_vpmu_verify(struct vcpu *v)
         return -EINVAL;
     if ( core2_vpmu_cxt->global_ctrl & global_ctrl_mask )
         return -EINVAL;
+    if ( core2_vpmu_cxt->pebs_enable )
+        return -EINVAL;
 
     fixed_ctrl = core2_vpmu_cxt->fixed_ctrl;
     if ( fixed_ctrl & fixed_ctrl_mask )
@@ -603,10 +602,9 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content,
                  "MSR_PERF_GLOBAL_STATUS(0x38E)!\n");
         return -EINVAL;
     case MSR_IA32_PEBS_ENABLE:
-        if ( msr_content & 1 )
-            gdprintk(XENLOG_WARNING, "Guest is trying to enable PEBS, "
-                     "which is not supported.\n");
-        core2_vpmu_cxt->pebs_enable = msr_content;
+        if ( msr_content )
+            /* PEBS is reported as unavailable in MSR_IA32_MISC_ENABLE */
+            return -EINVAL;
         return 0;
     case MSR_IA32_DS_AREA:
         if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
@@ -728,6 +726,7 @@ static int core2_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
         /* Extension for BTS */
         if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) )
             *msr_content &= ~MSR_IA32_MISC_ENABLE_BTS_UNAVAIL;
+        *msr_content |= MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL;
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:01:34 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:01: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 1aMZTC-0005Z4-Nk; Fri, 22 Jan 2016 11:01: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 1aMZTB-0005YZ-SN
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:33 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	D3/52-23747-D0C02A65; Fri, 22 Jan 2016 11:01:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1453460491!17473319!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62019 invoked from network); 22 Jan 2016 11:01:32 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:01:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZTp-0006i7-7I
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:02:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZT9-0001oB-0k
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:31 +0000
Date: Fri, 22 Jan 2016 11:01:31 +0000
Message-Id: <E1aMZT9-0001oB-0k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/shadow: Fix missing newline in
	dprintk()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 19fc53a92312876761659e82a1ae5d69b603a4ef
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 21 09:50:49 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 09:50:49 2016 +0100

    x86/shadow: Fix missing newline in dprintk()
    
    to avoid console corruption.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 42940c046902f4dbff383aaae2f1139afbbdfe17
    master date: 2015-10-12 16:01:56 +0200
---
 xen/arch/x86/mm/shadow/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 0264b91..bad8360 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1590,7 +1590,7 @@ shadow_alloc_p2m_page(struct domain *d)
         if ( !d->arch.paging.p2m_alloc_failed )
         {
             d->arch.paging.p2m_alloc_failed = 1;
-            dprintk(XENLOG_ERR, "d%i failed to allocate from shadow pool",
+            dprintk(XENLOG_ERR, "d%i failed to allocate from shadow pool\n",
                     d->domain_id);
         }
         paging_unlock(d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 11:01:34 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 11:01: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 1aMZTC-0005Z4-Nk; Fri, 22 Jan 2016 11:01: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 1aMZTB-0005YZ-SN
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:33 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	D3/52-23747-D0C02A65; Fri, 22 Jan 2016 11:01:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1453460491!17473319!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62019 invoked from network); 22 Jan 2016 11:01:32 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 11:01:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZTp-0006i7-7I
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:02:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMZT9-0001oB-0k
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 11:01:31 +0000
Date: Fri, 22 Jan 2016 11:01:31 +0000
Message-Id: <E1aMZT9-0001oB-0k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] x86/shadow: Fix missing newline in
	dprintk()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 19fc53a92312876761659e82a1ae5d69b603a4ef
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 21 09:50:49 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 09:50:49 2016 +0100

    x86/shadow: Fix missing newline in dprintk()
    
    to avoid console corruption.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    master commit: 42940c046902f4dbff383aaae2f1139afbbdfe17
    master date: 2015-10-12 16:01:56 +0200
---
 xen/arch/x86/mm/shadow/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 0264b91..bad8360 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1590,7 +1590,7 @@ shadow_alloc_p2m_page(struct domain *d)
         if ( !d->arch.paging.p2m_alloc_failed )
         {
             d->arch.paging.p2m_alloc_failed = 1;
-            dprintk(XENLOG_ERR, "d%i failed to allocate from shadow pool",
+            dprintk(XENLOG_ERR, "d%i failed to allocate from shadow pool\n",
                     d->domain_id);
         }
         paging_unlock(d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 14:22:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:22: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 1aMcbI-0003EI-05; Fri, 22 Jan 2016 14:22: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 1aMcbG-0003E7-OH
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:06 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	5B/97-06010-D0B32A65; Fri, 22 Jan 2016 14:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1453472524!16997215!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37826 invoked from network); 22 Jan 2016 14:22:04 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:22:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcbt-0002u5-UG
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcbD-00023n-7S
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:03 +0000
Date: Fri, 22 Jan 2016 14:22:03 +0000
Message-Id: <E1aMcbD-00023n-7S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional master] qemu-xen-traditional:
	Use libxenevtchn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ca2ff968de42d47dcda8973aa1528a14f99992d3
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:23:53 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:14:16 2016 +0000

    qemu-xen-traditional: Use libxenevtchn
    
    /dev/xen/evtchn related wrappers have been moved out of libxenctrl
    into their own library.
    
    Note that i386-dm/helper2.c's xc_interface * was always really an
    xc_evtchn *, it's just they used to be typedefs to the same thing...
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 hw/xen_backend.c  |   26 +++++++++++++-------------
 hw/xen_backend.h  |    2 +-
 hw/xen_common.h   |    1 +
 i386-dm/helper2.c |   19 ++++++++++---------
 xen-hooks.mak     |    2 ++
 5 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/hw/xen_backend.c b/hw/xen_backend.c
index 92b3506..40f6887 100644
--- a/hw/xen_backend.c
+++ b/hw/xen_backend.c
@@ -208,19 +208,19 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
     xendev->debug      = debug;
     xendev->local_port = -1;
 
-    xendev->evtchndev = xc_evtchn_open(NULL, 0);
+    xendev->evtchndev = xenevtchn_open(NULL, 0);
     if (xendev->evtchndev == NULL) {
 	xen_be_printf(NULL, 0, "can't open evtchn device\n");
 	qemu_free(xendev);
 	return NULL;
     }
-    fcntl(xc_evtchn_fd(xendev->evtchndev), F_SETFD, FD_CLOEXEC);
+    fcntl(xenevtchn_fd(xendev->evtchndev), F_SETFD, FD_CLOEXEC);
 
     if (ops->flags & DEVOPS_FLAG_NEED_GNTDEV) {
 	xendev->gnttabdev = xc_gnttab_open(NULL, 0);
 	if (xendev->gnttabdev == NULL) {
 	    xen_be_printf(NULL, 0, "can't open gnttab device\n");
-	    xc_evtchn_close(xendev->evtchndev);
+	    xenevtchn_close(xendev->evtchndev);
 	    qemu_free(xendev);
 	    return NULL;
 	}
@@ -268,7 +268,7 @@ static struct XenDevice *xen_be_del_xendev(int dom, int dev)
 	}
 
 	if (xendev->evtchndev != NULL)
-	    xc_evtchn_close(xendev->evtchndev);
+	    xenevtchn_close(xendev->evtchndev);
 	if (xendev->gnttabdev != NULL)
 	    xc_gnttab_close(xendev->gnttabdev);
 
@@ -630,13 +630,13 @@ static void xen_be_evtchn_event(void *opaque)
     struct XenDevice *xendev = opaque;
     evtchn_port_t port;
 
-    port = xc_evtchn_pending(xendev->evtchndev);
+    port = xenevtchn_pending(xendev->evtchndev);
     if (port != xendev->local_port) {
-	xen_be_printf(xendev, 0, "xc_evtchn_pending returned %d (expected %d)\n",
+	xen_be_printf(xendev, 0, "xenevtchn_pending returned %d (expected %d)\n",
 		      port, xendev->local_port);
 	return;
     }
-    xc_evtchn_unmask(xendev->evtchndev, port);
+    xenevtchn_unmask(xendev->evtchndev, port);
 
     if (xendev->ops->event)
 	xendev->ops->event(xendev);
@@ -683,14 +683,14 @@ int xen_be_bind_evtchn(struct XenDevice *xendev)
 {
     if (xendev->local_port != -1)
 	return 0;
-    xendev->local_port = xc_evtchn_bind_interdomain
+    xendev->local_port = xenevtchn_bind_interdomain
 	(xendev->evtchndev, xendev->dom, xendev->remote_port);
     if (xendev->local_port == -1) {
-	xen_be_printf(xendev, 0, "xc_evtchn_bind_interdomain failed\n");
+	xen_be_printf(xendev, 0, "xenevtchn_bind_interdomain failed\n");
 	return -1;
     }
     xen_be_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);
-    qemu_set_fd_handler(xc_evtchn_fd(xendev->evtchndev),
+    qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev),
 			xen_be_evtchn_event, NULL, xendev);
     return 0;
 }
@@ -699,15 +699,15 @@ void xen_be_unbind_evtchn(struct XenDevice *xendev)
 {
     if (xendev->local_port == -1)
 	return;
-    qemu_set_fd_handler(xc_evtchn_fd(xendev->evtchndev), NULL, NULL, NULL);
-    xc_evtchn_unbind(xendev->evtchndev, xendev->local_port);
+    qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL);
+    xenevtchn_unbind(xendev->evtchndev, xendev->local_port);
     xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port);
     xendev->local_port = -1;
 }
 
 int xen_be_send_notify(struct XenDevice *xendev)
 {
-    return xc_evtchn_notify(xendev->evtchndev, xendev->local_port);
+    return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
 }
 
 /*
diff --git a/hw/xen_backend.h b/hw/xen_backend.h
index e421391..60f18f8 100644
--- a/hw/xen_backend.h
+++ b/hw/xen_backend.h
@@ -44,7 +44,7 @@ struct XenDevice {
     int                remote_port;
     int                local_port;
 
-    xc_evtchn          *evtchndev;
+    xenevtchn_handle   *evtchndev;
     xc_gnttab          *gnttabdev;
 
     struct XenDevOps   *ops;
diff --git a/hw/xen_common.h b/hw/xen_common.h
index a615052..cee908f 100644
--- a/hw/xen_common.h
+++ b/hw/xen_common.h
@@ -4,6 +4,7 @@
 #include <stddef.h>
 #include <inttypes.h>
 
+#include <xenevtchn.h>
 #include <xenctrl.h>
 #include <xenstore.h>
 #include <xen/io/xenbus.h>
diff --git a/i386-dm/helper2.c b/i386-dm/helper2.c
index ede3105..2706f2e 100644
--- a/i386-dm/helper2.c
+++ b/i386-dm/helper2.c
@@ -48,6 +48,7 @@
 #include <limits.h>
 #include <fcntl.h>
 
+#include <xenevtchn.h>
 #include <xenctrl.h>
 #include <xen/hvm/ioreq.h>
 #include <xen/hvm/hvm_info_table.h>
@@ -104,7 +105,7 @@ buffered_iopage_t *buffered_io_page = NULL;
 QEMUTimer *buffered_io_timer;
 
 /* the evtchn fd for polling */
-xc_interface *xce_handle = NULL;
+xenevtchn_handle *xce_handle = NULL;
 
 /* which vcpu we are serving */
 int send_vcpu = 0;
@@ -141,7 +142,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
 
         cpu_single_env = env;
 
-        xce_handle = xc_evtchn_open(NULL, 0);
+        xce_handle = xenevtchn_open(NULL, 0);
         if (xce_handle == NULL) {
             perror("open");
             return NULL;
@@ -149,7 +150,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
 
         /* FIXME: how about if we overflow the page here? */
         for (i = 0; i < vcpus; i++) {
-            rc = xc_evtchn_bind_interdomain(
+            rc = xenevtchn_bind_interdomain(
                 xce_handle, domid, shared_page->vcpu_ioreq[i].vp_eport);
             if (rc == -1) {
                 fprintf(logfile, "bind interdomain ioctl error %d\n", errno);
@@ -164,7 +165,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
                     errno);
             return NULL;
         }
-        rc = xc_evtchn_bind_interdomain(xce_handle, domid, (uint32_t)bufioreq_evtchn);
+        rc = xenevtchn_bind_interdomain(xce_handle, domid, (uint32_t)bufioreq_evtchn);
         if (rc == -1) {
             fprintf(logfile, "bind interdomain ioctl error %d\n", errno);
             return NULL;
@@ -278,7 +279,7 @@ static ioreq_t *cpu_get_ioreq(void)
     int i;
     evtchn_port_t port;
 
-    port = xc_evtchn_pending(xce_handle);
+    port = xenevtchn_pending(xce_handle);
     if (port == bufioreq_local_port) {
         qemu_mod_timer(buffered_io_timer,
                 BUFFER_IO_MAX_DELAY + qemu_get_clock(rt_clock));
@@ -296,7 +297,7 @@ static ioreq_t *cpu_get_ioreq(void)
         }
 
         // unmask the wanted port again
-        xc_evtchn_unmask(xce_handle, port);
+        xenevtchn_unmask(xce_handle, port);
 
         //get the io packet from shared memory
         send_vcpu = i;
@@ -539,7 +540,7 @@ static void handle_buffered_io(void *opaque)
                 BUFFER_IO_MAX_DELAY + qemu_get_clock(rt_clock));
     } else {
         qemu_del_timer(buffered_io_timer);
-        xc_evtchn_unmask(xce_handle, bufioreq_local_port);
+        xenevtchn_unmask(xce_handle, bufioreq_local_port);
     }
 }
 
@@ -583,7 +584,7 @@ static void cpu_handle_ioreq(void *opaque)
 	}
 
         req->state = STATE_IORESP_READY;
-        xc_evtchn_notify(xce_handle, ioreq_local_port[send_vcpu]);
+        xenevtchn_notify(xce_handle, ioreq_local_port[send_vcpu]);
     }
 }
 
@@ -592,7 +593,7 @@ int xen_pause_requested;
 int main_loop(void)
 {
     CPUState *env = cpu_single_env;
-    int evtchn_fd = xce_handle == NULL ? -1 : xc_evtchn_fd(xce_handle);
+    int evtchn_fd = xce_handle == NULL ? -1 : xenevtchn_fd(xce_handle);
     char *qemu_file;
     fd_set fds;
 
diff --git a/xen-hooks.mak b/xen-hooks.mak
index bf7f027..18259d4 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -1,4 +1,5 @@
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/toollog/include
+CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/evtchn/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/include
@@ -18,6 +19,7 @@ endif
 
 CFLAGS += $(CMDLINE_CFLAGS)
 
+LIBS += -L$(XEN_ROOT)/tools/libs/evtchn -lxenevtchn
 LIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest
 LIBS += -L$(XEN_ROOT)/tools/xenstore -lxenstore
 LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Jan 22 14:22:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:22: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 1aMcbI-0003EI-05; Fri, 22 Jan 2016 14:22: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 1aMcbG-0003E7-OH
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:06 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	5B/97-06010-D0B32A65; Fri, 22 Jan 2016 14:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1453472524!16997215!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37826 invoked from network); 22 Jan 2016 14:22:04 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:22:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcbt-0002u5-UG
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcbD-00023n-7S
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:03 +0000
Date: Fri, 22 Jan 2016 14:22:03 +0000
Message-Id: <E1aMcbD-00023n-7S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional master] qemu-xen-traditional:
	Use libxenevtchn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ca2ff968de42d47dcda8973aa1528a14f99992d3
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:23:53 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:14:16 2016 +0000

    qemu-xen-traditional: Use libxenevtchn
    
    /dev/xen/evtchn related wrappers have been moved out of libxenctrl
    into their own library.
    
    Note that i386-dm/helper2.c's xc_interface * was always really an
    xc_evtchn *, it's just they used to be typedefs to the same thing...
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 hw/xen_backend.c  |   26 +++++++++++++-------------
 hw/xen_backend.h  |    2 +-
 hw/xen_common.h   |    1 +
 i386-dm/helper2.c |   19 ++++++++++---------
 xen-hooks.mak     |    2 ++
 5 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/hw/xen_backend.c b/hw/xen_backend.c
index 92b3506..40f6887 100644
--- a/hw/xen_backend.c
+++ b/hw/xen_backend.c
@@ -208,19 +208,19 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
     xendev->debug      = debug;
     xendev->local_port = -1;
 
-    xendev->evtchndev = xc_evtchn_open(NULL, 0);
+    xendev->evtchndev = xenevtchn_open(NULL, 0);
     if (xendev->evtchndev == NULL) {
 	xen_be_printf(NULL, 0, "can't open evtchn device\n");
 	qemu_free(xendev);
 	return NULL;
     }
-    fcntl(xc_evtchn_fd(xendev->evtchndev), F_SETFD, FD_CLOEXEC);
+    fcntl(xenevtchn_fd(xendev->evtchndev), F_SETFD, FD_CLOEXEC);
 
     if (ops->flags & DEVOPS_FLAG_NEED_GNTDEV) {
 	xendev->gnttabdev = xc_gnttab_open(NULL, 0);
 	if (xendev->gnttabdev == NULL) {
 	    xen_be_printf(NULL, 0, "can't open gnttab device\n");
-	    xc_evtchn_close(xendev->evtchndev);
+	    xenevtchn_close(xendev->evtchndev);
 	    qemu_free(xendev);
 	    return NULL;
 	}
@@ -268,7 +268,7 @@ static struct XenDevice *xen_be_del_xendev(int dom, int dev)
 	}
 
 	if (xendev->evtchndev != NULL)
-	    xc_evtchn_close(xendev->evtchndev);
+	    xenevtchn_close(xendev->evtchndev);
 	if (xendev->gnttabdev != NULL)
 	    xc_gnttab_close(xendev->gnttabdev);
 
@@ -630,13 +630,13 @@ static void xen_be_evtchn_event(void *opaque)
     struct XenDevice *xendev = opaque;
     evtchn_port_t port;
 
-    port = xc_evtchn_pending(xendev->evtchndev);
+    port = xenevtchn_pending(xendev->evtchndev);
     if (port != xendev->local_port) {
-	xen_be_printf(xendev, 0, "xc_evtchn_pending returned %d (expected %d)\n",
+	xen_be_printf(xendev, 0, "xenevtchn_pending returned %d (expected %d)\n",
 		      port, xendev->local_port);
 	return;
     }
-    xc_evtchn_unmask(xendev->evtchndev, port);
+    xenevtchn_unmask(xendev->evtchndev, port);
 
     if (xendev->ops->event)
 	xendev->ops->event(xendev);
@@ -683,14 +683,14 @@ int xen_be_bind_evtchn(struct XenDevice *xendev)
 {
     if (xendev->local_port != -1)
 	return 0;
-    xendev->local_port = xc_evtchn_bind_interdomain
+    xendev->local_port = xenevtchn_bind_interdomain
 	(xendev->evtchndev, xendev->dom, xendev->remote_port);
     if (xendev->local_port == -1) {
-	xen_be_printf(xendev, 0, "xc_evtchn_bind_interdomain failed\n");
+	xen_be_printf(xendev, 0, "xenevtchn_bind_interdomain failed\n");
 	return -1;
     }
     xen_be_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);
-    qemu_set_fd_handler(xc_evtchn_fd(xendev->evtchndev),
+    qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev),
 			xen_be_evtchn_event, NULL, xendev);
     return 0;
 }
@@ -699,15 +699,15 @@ void xen_be_unbind_evtchn(struct XenDevice *xendev)
 {
     if (xendev->local_port == -1)
 	return;
-    qemu_set_fd_handler(xc_evtchn_fd(xendev->evtchndev), NULL, NULL, NULL);
-    xc_evtchn_unbind(xendev->evtchndev, xendev->local_port);
+    qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL);
+    xenevtchn_unbind(xendev->evtchndev, xendev->local_port);
     xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port);
     xendev->local_port = -1;
 }
 
 int xen_be_send_notify(struct XenDevice *xendev)
 {
-    return xc_evtchn_notify(xendev->evtchndev, xendev->local_port);
+    return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
 }
 
 /*
diff --git a/hw/xen_backend.h b/hw/xen_backend.h
index e421391..60f18f8 100644
--- a/hw/xen_backend.h
+++ b/hw/xen_backend.h
@@ -44,7 +44,7 @@ struct XenDevice {
     int                remote_port;
     int                local_port;
 
-    xc_evtchn          *evtchndev;
+    xenevtchn_handle   *evtchndev;
     xc_gnttab          *gnttabdev;
 
     struct XenDevOps   *ops;
diff --git a/hw/xen_common.h b/hw/xen_common.h
index a615052..cee908f 100644
--- a/hw/xen_common.h
+++ b/hw/xen_common.h
@@ -4,6 +4,7 @@
 #include <stddef.h>
 #include <inttypes.h>
 
+#include <xenevtchn.h>
 #include <xenctrl.h>
 #include <xenstore.h>
 #include <xen/io/xenbus.h>
diff --git a/i386-dm/helper2.c b/i386-dm/helper2.c
index ede3105..2706f2e 100644
--- a/i386-dm/helper2.c
+++ b/i386-dm/helper2.c
@@ -48,6 +48,7 @@
 #include <limits.h>
 #include <fcntl.h>
 
+#include <xenevtchn.h>
 #include <xenctrl.h>
 #include <xen/hvm/ioreq.h>
 #include <xen/hvm/hvm_info_table.h>
@@ -104,7 +105,7 @@ buffered_iopage_t *buffered_io_page = NULL;
 QEMUTimer *buffered_io_timer;
 
 /* the evtchn fd for polling */
-xc_interface *xce_handle = NULL;
+xenevtchn_handle *xce_handle = NULL;
 
 /* which vcpu we are serving */
 int send_vcpu = 0;
@@ -141,7 +142,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
 
         cpu_single_env = env;
 
-        xce_handle = xc_evtchn_open(NULL, 0);
+        xce_handle = xenevtchn_open(NULL, 0);
         if (xce_handle == NULL) {
             perror("open");
             return NULL;
@@ -149,7 +150,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
 
         /* FIXME: how about if we overflow the page here? */
         for (i = 0; i < vcpus; i++) {
-            rc = xc_evtchn_bind_interdomain(
+            rc = xenevtchn_bind_interdomain(
                 xce_handle, domid, shared_page->vcpu_ioreq[i].vp_eport);
             if (rc == -1) {
                 fprintf(logfile, "bind interdomain ioctl error %d\n", errno);
@@ -164,7 +165,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
                     errno);
             return NULL;
         }
-        rc = xc_evtchn_bind_interdomain(xce_handle, domid, (uint32_t)bufioreq_evtchn);
+        rc = xenevtchn_bind_interdomain(xce_handle, domid, (uint32_t)bufioreq_evtchn);
         if (rc == -1) {
             fprintf(logfile, "bind interdomain ioctl error %d\n", errno);
             return NULL;
@@ -278,7 +279,7 @@ static ioreq_t *cpu_get_ioreq(void)
     int i;
     evtchn_port_t port;
 
-    port = xc_evtchn_pending(xce_handle);
+    port = xenevtchn_pending(xce_handle);
     if (port == bufioreq_local_port) {
         qemu_mod_timer(buffered_io_timer,
                 BUFFER_IO_MAX_DELAY + qemu_get_clock(rt_clock));
@@ -296,7 +297,7 @@ static ioreq_t *cpu_get_ioreq(void)
         }
 
         // unmask the wanted port again
-        xc_evtchn_unmask(xce_handle, port);
+        xenevtchn_unmask(xce_handle, port);
 
         //get the io packet from shared memory
         send_vcpu = i;
@@ -539,7 +540,7 @@ static void handle_buffered_io(void *opaque)
                 BUFFER_IO_MAX_DELAY + qemu_get_clock(rt_clock));
     } else {
         qemu_del_timer(buffered_io_timer);
-        xc_evtchn_unmask(xce_handle, bufioreq_local_port);
+        xenevtchn_unmask(xce_handle, bufioreq_local_port);
     }
 }
 
@@ -583,7 +584,7 @@ static void cpu_handle_ioreq(void *opaque)
 	}
 
         req->state = STATE_IORESP_READY;
-        xc_evtchn_notify(xce_handle, ioreq_local_port[send_vcpu]);
+        xenevtchn_notify(xce_handle, ioreq_local_port[send_vcpu]);
     }
 }
 
@@ -592,7 +593,7 @@ int xen_pause_requested;
 int main_loop(void)
 {
     CPUState *env = cpu_single_env;
-    int evtchn_fd = xce_handle == NULL ? -1 : xc_evtchn_fd(xce_handle);
+    int evtchn_fd = xce_handle == NULL ? -1 : xenevtchn_fd(xce_handle);
     char *qemu_file;
     fd_set fds;
 
diff --git a/xen-hooks.mak b/xen-hooks.mak
index bf7f027..18259d4 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -1,4 +1,5 @@
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/toollog/include
+CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/evtchn/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/include
@@ -18,6 +19,7 @@ endif
 
 CFLAGS += $(CMDLINE_CFLAGS)
 
+LIBS += -L$(XEN_ROOT)/tools/libs/evtchn -lxenevtchn
 LIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest
 LIBS += -L$(XEN_ROOT)/tools/xenstore -lxenstore
 LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Jan 22 14:22:19 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMcbT-0003FT-5M; Fri, 22 Jan 2016 14:22: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 1aMcbS-0003FD-5r
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:18 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	1B/19-08977-91B32A65; Fri, 22 Jan 2016 14:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1453472534!11590755!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54223 invoked from network); 22 Jan 2016 14:22:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:22:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcc4-0002uD-Bz
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcbO-00024D-4S
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:14 +0000
Date: Fri, 22 Jan 2016 14:22:14 +0000
Message-Id: <E1aMcbO-00024D-4S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional master] qemu-xen-traditional:
	Use libxengnttab
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8b5666074fdbc4ddba5283d70898a2edd785028
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:23:54 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:14:16 2016 +0000

    qemu-xen-traditional: Use libxengnttab
    
    /dev/xen/gntdev related wrappers have been moved out of libxenctrl
    into their own library.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 hw/xen_backend.c |    4 ++--
 hw/xen_backend.h |    2 +-
 hw/xen_common.h  |    1 +
 hw/xen_console.c |    4 ++--
 hw/xen_disk.c    |   24 ++++++++++++------------
 xen-hooks.mak    |    2 ++
 6 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/hw/xen_backend.c b/hw/xen_backend.c
index 40f6887..97d25da 100644
--- a/hw/xen_backend.c
+++ b/hw/xen_backend.c
@@ -217,7 +217,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
     fcntl(xenevtchn_fd(xendev->evtchndev), F_SETFD, FD_CLOEXEC);
 
     if (ops->flags & DEVOPS_FLAG_NEED_GNTDEV) {
-	xendev->gnttabdev = xc_gnttab_open(NULL, 0);
+	xendev->gnttabdev = xengnttab_open(NULL, 0);
 	if (xendev->gnttabdev == NULL) {
 	    xen_be_printf(NULL, 0, "can't open gnttab device\n");
 	    xenevtchn_close(xendev->evtchndev);
@@ -270,7 +270,7 @@ static struct XenDevice *xen_be_del_xendev(int dom, int dev)
 	if (xendev->evtchndev != NULL)
 	    xenevtchn_close(xendev->evtchndev);
 	if (xendev->gnttabdev != NULL)
-	    xc_gnttab_close(xendev->gnttabdev);
+	    xengnttab_close(xendev->gnttabdev);
 
 	TAILQ_REMOVE(&xendevs, xendev, next);
 	qemu_free(xendev);
diff --git a/hw/xen_backend.h b/hw/xen_backend.h
index 60f18f8..ba1e12f 100644
--- a/hw/xen_backend.h
+++ b/hw/xen_backend.h
@@ -45,7 +45,7 @@ struct XenDevice {
     int                local_port;
 
     xenevtchn_handle   *evtchndev;
-    xc_gnttab          *gnttabdev;
+    xengnttab_handle          *gnttabdev;
 
     struct XenDevOps   *ops;
     TAILQ_ENTRY(XenDevice) next;
diff --git a/hw/xen_common.h b/hw/xen_common.h
index cee908f..cc48892 100644
--- a/hw/xen_common.h
+++ b/hw/xen_common.h
@@ -5,6 +5,7 @@
 #include <inttypes.h>
 
 #include <xenevtchn.h>
+#include <xengnttab.h>
 #include <xenctrl.h>
 #include <xenstore.h>
 #include <xen/io/xenbus.h>
diff --git a/hw/xen_console.c b/hw/xen_console.c
index 80beb31..0bb4469 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -230,7 +230,7 @@ static int con_initialise(struct XenDevice *xendev)
                                           PROT_READ|PROT_WRITE,
                                           con->ring_ref);
     else
-        con->sring = xc_gnttab_map_grant_ref(xendev->gnttabdev, con->xendev.dom,
+        con->sring = xengnttab_map_grant_ref(xendev->gnttabdev, con->xendev.dom,
                                              con->ring_ref,
                                              PROT_READ|PROT_WRITE);
     if (!con->sring)
@@ -263,7 +263,7 @@ static void con_disconnect(struct XenDevice *xendev)
         if (!xendev->gnttabdev)
 	    munmap(con->sring, XC_PAGE_SIZE);
         else
-            xc_gnttab_munmap(xendev->gnttabdev, con->sring, 1);
+            xengnttab_unmap(xendev->gnttabdev, con->sring, 1);
 	con->sring = NULL;
     }
 }
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 250d806..bc78748 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -266,7 +266,7 @@ err:
 
 static void ioreq_unmap(struct ioreq *ioreq)
 {
-    xc_gnttab *gnt = ioreq->blkdev->xendev.gnttabdev;
+    xengnttab_handle *gnt = ioreq->blkdev->xendev.gnttabdev;
     int i;
 
     if (ioreq->v.niov == 0)
@@ -274,8 +274,8 @@ static void ioreq_unmap(struct ioreq *ioreq)
     if (batch_maps) {
 	if (!ioreq->pages)
 	    return;
-	if (xc_gnttab_munmap(gnt, ioreq->pages, ioreq->v.niov) != 0)
-	    xen_be_printf(&ioreq->blkdev->xendev, 0, "xc_gnttab_munmap failed: %s\n",
+	if (xengnttab_unmap(gnt, ioreq->pages, ioreq->v.niov) != 0)
+	    xen_be_printf(&ioreq->blkdev->xendev, 0, "xengnttab_unmap failed: %s\n",
 			  strerror(errno));
 	ioreq->blkdev->cnt_map -= ioreq->v.niov;
 	ioreq->pages = NULL;
@@ -283,8 +283,8 @@ static void ioreq_unmap(struct ioreq *ioreq)
 	for (i = 0; i < ioreq->v.niov; i++) {
 	    if (!ioreq->page[i])
 		continue;
-	    if (xc_gnttab_munmap(gnt, ioreq->page[i], 1) != 0)
-		xen_be_printf(&ioreq->blkdev->xendev, 0, "xc_gnttab_munmap failed: %s\n",
+	    if (xengnttab_unmap(gnt, ioreq->page[i], 1) != 0)
+		xen_be_printf(&ioreq->blkdev->xendev, 0, "xengnttab_unmap failed: %s\n",
 			      strerror(errno));
 	    ioreq->blkdev->cnt_map--;
 	    ioreq->page[i] = NULL;
@@ -294,13 +294,13 @@ static void ioreq_unmap(struct ioreq *ioreq)
 
 static int ioreq_map(struct ioreq *ioreq)
 {
-    xc_gnttab *gnt = ioreq->blkdev->xendev.gnttabdev;
+    xengnttab_handle *gnt = ioreq->blkdev->xendev.gnttabdev;
     int i;
 
     if (ioreq->v.niov == 0)
         return 0;
     if (batch_maps) {
-	ioreq->pages = xc_gnttab_map_grant_refs
+	ioreq->pages = xengnttab_map_grant_refs
 	    (gnt, ioreq->v.niov, ioreq->domids, ioreq->refs, ioreq->prot);
 	if (ioreq->pages == NULL) {
 	    xen_be_printf(&ioreq->blkdev->xendev, 0,
@@ -314,7 +314,7 @@ static int ioreq_map(struct ioreq *ioreq)
 	ioreq->blkdev->cnt_map += ioreq->v.niov;
     } else  {
 	for (i = 0; i < ioreq->v.niov; i++) {
-	    ioreq->page[i] = xc_gnttab_map_grant_ref
+	    ioreq->page[i] = xengnttab_map_grant_ref
 		(gnt, ioreq->domids[i], ioreq->refs[i], ioreq->prot);
 	    if (ioreq->page[i] == NULL) {
 		xen_be_printf(&ioreq->blkdev->xendev, 0,
@@ -611,9 +611,9 @@ static void blk_alloc(struct XenDevice *xendev)
     blkdev->bh = qemu_bh_new(blk_bh, blkdev);
     if (xen_mode != XEN_EMULATE)
         batch_maps = 1;
-    if (xc_gnttab_set_max_grants(xendev->gnttabdev,
+    if (xengnttab_set_max_grants(xendev->gnttabdev,
             MAX_GRANTS(max_requests, BLKIF_MAX_SEGMENTS_PER_REQUEST)) < 0) {
-        xen_be_printf(xendev, 0, "xc_gnttab_set_max_grants failed: %s\n",
+        xen_be_printf(xendev, 0, "xengnttab_set_max_grants failed: %s\n",
                       strerror(errno));
     }
 }
@@ -734,7 +734,7 @@ static int blk_connect(struct XenDevice *xendev)
             blkdev->protocol = BLKIF_PROTOCOL_X86_64;
     }
 
-    blkdev->sring = xc_gnttab_map_grant_ref(blkdev->xendev.gnttabdev,
+    blkdev->sring = xengnttab_map_grant_ref(blkdev->xendev.gnttabdev,
 					    blkdev->xendev.dom,
 					    blkdev->ring_ref,
 					    PROT_READ | PROT_WRITE);
@@ -787,7 +787,7 @@ static void blk_disconnect(struct XenDevice *xendev)
     xen_be_unbind_evtchn(&blkdev->xendev);
 
     if (blkdev->sring) {
-	xc_gnttab_munmap(blkdev->xendev.gnttabdev, blkdev->sring, 1);
+	xengnttab_unmap(blkdev->xendev.gnttabdev, blkdev->sring, 1);
 	blkdev->cnt_map--;
 	blkdev->sring = NULL;
     }
diff --git a/xen-hooks.mak b/xen-hooks.mak
index 18259d4..179a6b7 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -1,5 +1,6 @@
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/toollog/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/evtchn/include
+CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/gnttab/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/include
@@ -20,6 +21,7 @@ endif
 CFLAGS += $(CMDLINE_CFLAGS)
 
 LIBS += -L$(XEN_ROOT)/tools/libs/evtchn -lxenevtchn
+LIBS += -L$(XEN_ROOT)/tools/libs/gnttab -lxengnttab
 LIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest
 LIBS += -L$(XEN_ROOT)/tools/xenstore -lxenstore
 LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Jan 22 14:22:19 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMcbT-0003FT-5M; Fri, 22 Jan 2016 14:22: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 1aMcbS-0003FD-5r
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:18 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	1B/19-08977-91B32A65; Fri, 22 Jan 2016 14:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1453472534!11590755!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54223 invoked from network); 22 Jan 2016 14:22:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:22:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcc4-0002uD-Bz
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcbO-00024D-4S
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:14 +0000
Date: Fri, 22 Jan 2016 14:22:14 +0000
Message-Id: <E1aMcbO-00024D-4S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional master] qemu-xen-traditional:
	Use libxengnttab
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8b5666074fdbc4ddba5283d70898a2edd785028
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:23:54 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:14:16 2016 +0000

    qemu-xen-traditional: Use libxengnttab
    
    /dev/xen/gntdev related wrappers have been moved out of libxenctrl
    into their own library.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 hw/xen_backend.c |    4 ++--
 hw/xen_backend.h |    2 +-
 hw/xen_common.h  |    1 +
 hw/xen_console.c |    4 ++--
 hw/xen_disk.c    |   24 ++++++++++++------------
 xen-hooks.mak    |    2 ++
 6 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/hw/xen_backend.c b/hw/xen_backend.c
index 40f6887..97d25da 100644
--- a/hw/xen_backend.c
+++ b/hw/xen_backend.c
@@ -217,7 +217,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
     fcntl(xenevtchn_fd(xendev->evtchndev), F_SETFD, FD_CLOEXEC);
 
     if (ops->flags & DEVOPS_FLAG_NEED_GNTDEV) {
-	xendev->gnttabdev = xc_gnttab_open(NULL, 0);
+	xendev->gnttabdev = xengnttab_open(NULL, 0);
 	if (xendev->gnttabdev == NULL) {
 	    xen_be_printf(NULL, 0, "can't open gnttab device\n");
 	    xenevtchn_close(xendev->evtchndev);
@@ -270,7 +270,7 @@ static struct XenDevice *xen_be_del_xendev(int dom, int dev)
 	if (xendev->evtchndev != NULL)
 	    xenevtchn_close(xendev->evtchndev);
 	if (xendev->gnttabdev != NULL)
-	    xc_gnttab_close(xendev->gnttabdev);
+	    xengnttab_close(xendev->gnttabdev);
 
 	TAILQ_REMOVE(&xendevs, xendev, next);
 	qemu_free(xendev);
diff --git a/hw/xen_backend.h b/hw/xen_backend.h
index 60f18f8..ba1e12f 100644
--- a/hw/xen_backend.h
+++ b/hw/xen_backend.h
@@ -45,7 +45,7 @@ struct XenDevice {
     int                local_port;
 
     xenevtchn_handle   *evtchndev;
-    xc_gnttab          *gnttabdev;
+    xengnttab_handle          *gnttabdev;
 
     struct XenDevOps   *ops;
     TAILQ_ENTRY(XenDevice) next;
diff --git a/hw/xen_common.h b/hw/xen_common.h
index cee908f..cc48892 100644
--- a/hw/xen_common.h
+++ b/hw/xen_common.h
@@ -5,6 +5,7 @@
 #include <inttypes.h>
 
 #include <xenevtchn.h>
+#include <xengnttab.h>
 #include <xenctrl.h>
 #include <xenstore.h>
 #include <xen/io/xenbus.h>
diff --git a/hw/xen_console.c b/hw/xen_console.c
index 80beb31..0bb4469 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -230,7 +230,7 @@ static int con_initialise(struct XenDevice *xendev)
                                           PROT_READ|PROT_WRITE,
                                           con->ring_ref);
     else
-        con->sring = xc_gnttab_map_grant_ref(xendev->gnttabdev, con->xendev.dom,
+        con->sring = xengnttab_map_grant_ref(xendev->gnttabdev, con->xendev.dom,
                                              con->ring_ref,
                                              PROT_READ|PROT_WRITE);
     if (!con->sring)
@@ -263,7 +263,7 @@ static void con_disconnect(struct XenDevice *xendev)
         if (!xendev->gnttabdev)
 	    munmap(con->sring, XC_PAGE_SIZE);
         else
-            xc_gnttab_munmap(xendev->gnttabdev, con->sring, 1);
+            xengnttab_unmap(xendev->gnttabdev, con->sring, 1);
 	con->sring = NULL;
     }
 }
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 250d806..bc78748 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -266,7 +266,7 @@ err:
 
 static void ioreq_unmap(struct ioreq *ioreq)
 {
-    xc_gnttab *gnt = ioreq->blkdev->xendev.gnttabdev;
+    xengnttab_handle *gnt = ioreq->blkdev->xendev.gnttabdev;
     int i;
 
     if (ioreq->v.niov == 0)
@@ -274,8 +274,8 @@ static void ioreq_unmap(struct ioreq *ioreq)
     if (batch_maps) {
 	if (!ioreq->pages)
 	    return;
-	if (xc_gnttab_munmap(gnt, ioreq->pages, ioreq->v.niov) != 0)
-	    xen_be_printf(&ioreq->blkdev->xendev, 0, "xc_gnttab_munmap failed: %s\n",
+	if (xengnttab_unmap(gnt, ioreq->pages, ioreq->v.niov) != 0)
+	    xen_be_printf(&ioreq->blkdev->xendev, 0, "xengnttab_unmap failed: %s\n",
 			  strerror(errno));
 	ioreq->blkdev->cnt_map -= ioreq->v.niov;
 	ioreq->pages = NULL;
@@ -283,8 +283,8 @@ static void ioreq_unmap(struct ioreq *ioreq)
 	for (i = 0; i < ioreq->v.niov; i++) {
 	    if (!ioreq->page[i])
 		continue;
-	    if (xc_gnttab_munmap(gnt, ioreq->page[i], 1) != 0)
-		xen_be_printf(&ioreq->blkdev->xendev, 0, "xc_gnttab_munmap failed: %s\n",
+	    if (xengnttab_unmap(gnt, ioreq->page[i], 1) != 0)
+		xen_be_printf(&ioreq->blkdev->xendev, 0, "xengnttab_unmap failed: %s\n",
 			      strerror(errno));
 	    ioreq->blkdev->cnt_map--;
 	    ioreq->page[i] = NULL;
@@ -294,13 +294,13 @@ static void ioreq_unmap(struct ioreq *ioreq)
 
 static int ioreq_map(struct ioreq *ioreq)
 {
-    xc_gnttab *gnt = ioreq->blkdev->xendev.gnttabdev;
+    xengnttab_handle *gnt = ioreq->blkdev->xendev.gnttabdev;
     int i;
 
     if (ioreq->v.niov == 0)
         return 0;
     if (batch_maps) {
-	ioreq->pages = xc_gnttab_map_grant_refs
+	ioreq->pages = xengnttab_map_grant_refs
 	    (gnt, ioreq->v.niov, ioreq->domids, ioreq->refs, ioreq->prot);
 	if (ioreq->pages == NULL) {
 	    xen_be_printf(&ioreq->blkdev->xendev, 0,
@@ -314,7 +314,7 @@ static int ioreq_map(struct ioreq *ioreq)
 	ioreq->blkdev->cnt_map += ioreq->v.niov;
     } else  {
 	for (i = 0; i < ioreq->v.niov; i++) {
-	    ioreq->page[i] = xc_gnttab_map_grant_ref
+	    ioreq->page[i] = xengnttab_map_grant_ref
 		(gnt, ioreq->domids[i], ioreq->refs[i], ioreq->prot);
 	    if (ioreq->page[i] == NULL) {
 		xen_be_printf(&ioreq->blkdev->xendev, 0,
@@ -611,9 +611,9 @@ static void blk_alloc(struct XenDevice *xendev)
     blkdev->bh = qemu_bh_new(blk_bh, blkdev);
     if (xen_mode != XEN_EMULATE)
         batch_maps = 1;
-    if (xc_gnttab_set_max_grants(xendev->gnttabdev,
+    if (xengnttab_set_max_grants(xendev->gnttabdev,
             MAX_GRANTS(max_requests, BLKIF_MAX_SEGMENTS_PER_REQUEST)) < 0) {
-        xen_be_printf(xendev, 0, "xc_gnttab_set_max_grants failed: %s\n",
+        xen_be_printf(xendev, 0, "xengnttab_set_max_grants failed: %s\n",
                       strerror(errno));
     }
 }
@@ -734,7 +734,7 @@ static int blk_connect(struct XenDevice *xendev)
             blkdev->protocol = BLKIF_PROTOCOL_X86_64;
     }
 
-    blkdev->sring = xc_gnttab_map_grant_ref(blkdev->xendev.gnttabdev,
+    blkdev->sring = xengnttab_map_grant_ref(blkdev->xendev.gnttabdev,
 					    blkdev->xendev.dom,
 					    blkdev->ring_ref,
 					    PROT_READ | PROT_WRITE);
@@ -787,7 +787,7 @@ static void blk_disconnect(struct XenDevice *xendev)
     xen_be_unbind_evtchn(&blkdev->xendev);
 
     if (blkdev->sring) {
-	xc_gnttab_munmap(blkdev->xendev.gnttabdev, blkdev->sring, 1);
+	xengnttab_unmap(blkdev->xendev.gnttabdev, blkdev->sring, 1);
 	blkdev->cnt_map--;
 	blkdev->sring = NULL;
     }
diff --git a/xen-hooks.mak b/xen-hooks.mak
index 18259d4..179a6b7 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -1,5 +1,6 @@
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/toollog/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/evtchn/include
+CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/gnttab/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/include
@@ -20,6 +21,7 @@ endif
 CFLAGS += $(CMDLINE_CFLAGS)
 
 LIBS += -L$(XEN_ROOT)/tools/libs/evtchn -lxenevtchn
+LIBS += -L$(XEN_ROOT)/tools/libs/gnttab -lxengnttab
 LIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest
 LIBS += -L$(XEN_ROOT)/tools/xenstore -lxenstore
 LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Jan 22 14:22:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:22: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 1aMcbf-0003Hp-9v; Fri, 22 Jan 2016 14:22: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 1aMcbe-0003Hd-3m
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:30 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	4A/39-12889-52B32A65; Fri, 22 Jan 2016 14:22:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1453472547!18708162!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9042 invoked from network); 22 Jan 2016 14:22:28 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:22:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMccE-0002vK-Ms
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcbY-00025I-F2
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:24 +0000
Date: Fri, 22 Jan 2016 14:22:24 +0000
Message-Id: <E1aMcbY-00025I-F2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional master] qemu-xen-traditional:
	Add libxencall to rpath-link
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 79ed2c5733742a7b00f9c774bece30a620150a30
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:23:55 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:14:16 2016 +0000

    qemu-xen-traditional: Add libxencall to rpath-link
    
    libxenctrl links against this library
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen-hooks.mak |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen-hooks.mak b/xen-hooks.mak
index 179a6b7..229d642 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -25,6 +25,7 @@ LIBS += -L$(XEN_ROOT)/tools/libs/gnttab -lxengnttab
 LIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest
 LIBS += -L$(XEN_ROOT)/tools/xenstore -lxenstore
 LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog
+LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/call
 
 LDFLAGS := $(CFLAGS) $(LDFLAGS)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Jan 22 14:22:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:22: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 1aMcbf-0003Hp-9v; Fri, 22 Jan 2016 14:22: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 1aMcbe-0003Hd-3m
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:30 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	4A/39-12889-52B32A65; Fri, 22 Jan 2016 14:22:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1453472547!18708162!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9042 invoked from network); 22 Jan 2016 14:22:28 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:22:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMccE-0002vK-Ms
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcbY-00025I-F2
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:24 +0000
Date: Fri, 22 Jan 2016 14:22:24 +0000
Message-Id: <E1aMcbY-00025I-F2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional master] qemu-xen-traditional:
	Add libxencall to rpath-link
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 79ed2c5733742a7b00f9c774bece30a620150a30
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:23:55 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:14:16 2016 +0000

    qemu-xen-traditional: Add libxencall to rpath-link
    
    libxenctrl links against this library
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen-hooks.mak |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen-hooks.mak b/xen-hooks.mak
index 179a6b7..229d642 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -25,6 +25,7 @@ LIBS += -L$(XEN_ROOT)/tools/libs/gnttab -lxengnttab
 LIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest
 LIBS += -L$(XEN_ROOT)/tools/xenstore -lxenstore
 LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog
+LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/call
 
 LDFLAGS := $(CFLAGS) $(LDFLAGS)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Jan 22 14:22:39 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:22:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMcbn-0003JR-Dn; Fri, 22 Jan 2016 14:22: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 1aMcbm-0003J4-C1
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:38 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	51/78-31122-D2B32A65; Fri, 22 Jan 2016 14:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1453472555!11617461!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17754 invoked from network); 22 Jan 2016 14:22:37 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:22:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMccP-0002vX-05
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcbi-00025f-Ph
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:34 +0000
Date: Fri, 22 Jan 2016 14:22:34 +0000
Message-Id: <E1aMcbi-00025f-Ph@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional master] qemu-xen-traditional:
	Add libxenforeignmemory to rpath-link
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21f6526d1da331611ac5fe12967549d1a04e149b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:23:56 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:14:17 2016 +0000

    qemu-xen-traditional: Add libxenforeignmemory to rpath-link
    
    libxenctrl links against this library.
    
    Also, request the compat xc_map_foreign API from libxc.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen-hooks.mak |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen-hooks.mak b/xen-hooks.mak
index 229d642..c1ea4be 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -1,6 +1,7 @@
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/toollog/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/evtchn/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/gnttab/include
+CPPFLAGS+= -DXC_WANT_COMPAT_MAP_FOREIGN_API
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/include
@@ -26,6 +27,7 @@ LIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest
 LIBS += -L$(XEN_ROOT)/tools/xenstore -lxenstore
 LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog
 LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/call
+LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/foreignmemory
 
 LDFLAGS := $(CFLAGS) $(LDFLAGS)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Jan 22 14:22:39 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:22:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMcbn-0003JR-Dn; Fri, 22 Jan 2016 14:22: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 1aMcbm-0003J4-C1
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:38 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	51/78-31122-D2B32A65; Fri, 22 Jan 2016 14:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1453472555!11617461!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17754 invoked from network); 22 Jan 2016 14:22:37 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:22:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMccP-0002vX-05
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcbi-00025f-Ph
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:34 +0000
Date: Fri, 22 Jan 2016 14:22:34 +0000
Message-Id: <E1aMcbi-00025f-Ph@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-traditional master] qemu-xen-traditional:
	Add libxenforeignmemory to rpath-link
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21f6526d1da331611ac5fe12967549d1a04e149b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:23:56 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:14:17 2016 +0000

    qemu-xen-traditional: Add libxenforeignmemory to rpath-link
    
    libxenctrl links against this library.
    
    Also, request the compat xc_map_foreign API from libxc.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen-hooks.mak |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen-hooks.mak b/xen-hooks.mak
index 229d642..c1ea4be 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -1,6 +1,7 @@
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/toollog/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/evtchn/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libs/gnttab/include
+CPPFLAGS+= -DXC_WANT_COMPAT_MAP_FOREIGN_API
 CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/include
@@ -26,6 +27,7 @@ LIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest
 LIBS += -L$(XEN_ROOT)/tools/xenstore -lxenstore
 LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog
 LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/call
+LIBS += -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/foreignmemory
 
 LDFLAGS := $(CFLAGS) $(LDFLAGS)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.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 Jan 22 14:22:50 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:22: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 1aMcby-0003LW-Hw; Fri, 22 Jan 2016 14:22: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 1aMcbw-0003LH-KM
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:48 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	45/2B-31443-73B32A65; Fri, 22 Jan 2016 14:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1453472566!10071037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16822 invoked from network); 22 Jan 2016 14:22:47 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:22:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcca-0002vf-An
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcbu-00027k-1N
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:46 +0000
Date: Fri, 22 Jan 2016 14:22:46 +0000
Message-Id: <E1aMcbu-00027k-1N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] mini-os: Include libxenevtchn with
	libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb66c855c983aa07644cb179fd9bfe96d55f317d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:24:00 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:15:59 2016 +0000

    mini-os: Include libxenevtchn with libxc
    
    libxenevtchn has just been split out from libxc. From mini-os's point
    of view we don't care about the distinction, so keep things simple by
    just including libxenevtchn if libxc is enabled.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index daee46c..d1d8dc4 100644
--- a/Makefile
+++ b/Makefile
@@ -166,6 +166,7 @@ OBJS := $(filter-out $(OBJ_DIR)/lwip%.o $(LWO), $(OBJS))
 ifeq ($(libc),y)
 ifeq ($(CONFIG_XC),y)
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog -whole-archive -lxentoollog -no-whole-archive
+APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn -whole-archive -lxenevtchn -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) -whole-archive -lxenguest -lxenctrl -no-whole-archive
 endif
 APP_LDLIBS += -lpci
--
generated by git-patchbot for /home/xen/git/mini-os.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 Jan 22 14:22:50 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:22: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 1aMcby-0003LW-Hw; Fri, 22 Jan 2016 14:22: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 1aMcbw-0003LH-KM
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:48 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	45/2B-31443-73B32A65; Fri, 22 Jan 2016 14:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1453472566!10071037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16822 invoked from network); 22 Jan 2016 14:22:47 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:22:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcca-0002vf-An
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcbu-00027k-1N
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:46 +0000
Date: Fri, 22 Jan 2016 14:22:46 +0000
Message-Id: <E1aMcbu-00027k-1N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] mini-os: Include libxenevtchn with
	libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb66c855c983aa07644cb179fd9bfe96d55f317d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:24:00 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:15:59 2016 +0000

    mini-os: Include libxenevtchn with libxc
    
    libxenevtchn has just been split out from libxc. From mini-os's point
    of view we don't care about the distinction, so keep things simple by
    just including libxenevtchn if libxc is enabled.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index daee46c..d1d8dc4 100644
--- a/Makefile
+++ b/Makefile
@@ -166,6 +166,7 @@ OBJS := $(filter-out $(OBJ_DIR)/lwip%.o $(LWO), $(OBJS))
 ifeq ($(libc),y)
 ifeq ($(CONFIG_XC),y)
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog -whole-archive -lxentoollog -no-whole-archive
+APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn -whole-archive -lxenevtchn -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) -whole-archive -lxenguest -lxenctrl -no-whole-archive
 endif
 APP_LDLIBS += -lpci
--
generated by git-patchbot for /home/xen/git/mini-os.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 Jan 22 14:23:04 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:23: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 1aMccC-0003RM-EQ; Fri, 22 Jan 2016 14:23: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 1aMccB-0003PZ-0v
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:03 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	69/E8-31122-34B32A65; Fri, 22 Jan 2016 14:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1453472576!11590084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57689 invoked from network); 22 Jan 2016 14:22:58 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:22:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcck-0002vs-K0
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcc4-000288-Bv
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:56 +0000
Date: Fri, 22 Jan 2016 14:22:56 +0000
Message-Id: <E1aMcc4-000288-Bv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] mini-os: Include libxengnttab with
	libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9faa4c3b862291315912b81fe1d4ccca800f530d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:24:01 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:16:00 2016 +0000

    mini-os: Include libxengnttab with libxc
    
    libxengnttab has just been split out from libxc. From mini-os's point
    of view we don't care about the distinction, so keep things simple by
    just including libxengnttab if libxc is enabled.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index d1d8dc4..521f647 100644
--- a/Makefile
+++ b/Makefile
@@ -167,6 +167,7 @@ ifeq ($(libc),y)
 ifeq ($(CONFIG_XC),y)
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog -whole-archive -lxentoollog -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn -whole-archive -lxenevtchn -no-whole-archive
+APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/gnttab -whole-archive -lxengnttab -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) -whole-archive -lxenguest -lxenctrl -no-whole-archive
 endif
 APP_LDLIBS += -lpci
--
generated by git-patchbot for /home/xen/git/mini-os.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 Jan 22 14:23:04 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:23: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 1aMccC-0003RM-EQ; Fri, 22 Jan 2016 14:23: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 1aMccB-0003PZ-0v
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:03 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	69/E8-31122-34B32A65; Fri, 22 Jan 2016 14:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1453472576!11590084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57689 invoked from network); 22 Jan 2016 14:22:58 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:22:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcck-0002vs-K0
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcc4-000288-Bv
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:22:56 +0000
Date: Fri, 22 Jan 2016 14:22:56 +0000
Message-Id: <E1aMcc4-000288-Bv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] mini-os: Include libxengnttab with
	libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9faa4c3b862291315912b81fe1d4ccca800f530d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:24:01 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:16:00 2016 +0000

    mini-os: Include libxengnttab with libxc
    
    libxengnttab has just been split out from libxc. From mini-os's point
    of view we don't care about the distinction, so keep things simple by
    just including libxengnttab if libxc is enabled.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index d1d8dc4..521f647 100644
--- a/Makefile
+++ b/Makefile
@@ -167,6 +167,7 @@ ifeq ($(libc),y)
 ifeq ($(CONFIG_XC),y)
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog -whole-archive -lxentoollog -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn -whole-archive -lxenevtchn -no-whole-archive
+APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/gnttab -whole-archive -lxengnttab -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) -whole-archive -lxenguest -lxenctrl -no-whole-archive
 endif
 APP_LDLIBS += -lpci
--
generated by git-patchbot for /home/xen/git/mini-os.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 Jan 22 14:23:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:23: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 1aMccK-0003Uy-KI; Fri, 22 Jan 2016 14:23:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMccJ-0003UN-IM
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:11 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	A6/1A-08977-E4B32A65; Fri, 22 Jan 2016 14:23:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1453472587!11590922!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58847 invoked from network); 22 Jan 2016 14:23:10 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:23:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMccu-0002wC-TT
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMccE-00028q-NW
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:06 +0000
Date: Fri, 22 Jan 2016 14:23:06 +0000
Message-Id: <E1aMccE-00028q-NW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] mini-os: Include libxencall with
	libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c7d4f84e52d901068f9c7d5cd2cc05ced93c0157
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:24:02 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:16:00 2016 +0000

    mini-os: Include libxencall with libxc
    
    libxencall has just been split out from libxc. From mini-os's point
    of view we don't care about the distinction, so keep things simple by
    just including libxencall if libxc is enabled.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 521f647..c900540 100644
--- a/Makefile
+++ b/Makefile
@@ -168,6 +168,7 @@ ifeq ($(CONFIG_XC),y)
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog -whole-archive -lxentoollog -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn -whole-archive -lxenevtchn -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/gnttab -whole-archive -lxengnttab -no-whole-archive
+APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/call -whole-archive -lxencall -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) -whole-archive -lxenguest -lxenctrl -no-whole-archive
 endif
 APP_LDLIBS += -lpci
--
generated by git-patchbot for /home/xen/git/mini-os.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 Jan 22 14:23:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14:23: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 1aMccK-0003Uy-KI; Fri, 22 Jan 2016 14:23:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMccJ-0003UN-IM
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:11 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	A6/1A-08977-E4B32A65; Fri, 22 Jan 2016 14:23:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1453472587!11590922!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58847 invoked from network); 22 Jan 2016 14:23:10 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:23:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMccu-0002wC-TT
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMccE-00028q-NW
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:06 +0000
Date: Fri, 22 Jan 2016 14:23:06 +0000
Message-Id: <E1aMccE-00028q-NW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] mini-os: Include libxencall with
	libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c7d4f84e52d901068f9c7d5cd2cc05ced93c0157
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:24:02 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:16:00 2016 +0000

    mini-os: Include libxencall with libxc
    
    libxencall has just been split out from libxc. From mini-os's point
    of view we don't care about the distinction, so keep things simple by
    just including libxencall if libxc is enabled.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 521f647..c900540 100644
--- a/Makefile
+++ b/Makefile
@@ -168,6 +168,7 @@ ifeq ($(CONFIG_XC),y)
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog -whole-archive -lxentoollog -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn -whole-archive -lxenevtchn -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/gnttab -whole-archive -lxengnttab -no-whole-archive
+APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/call -whole-archive -lxencall -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) -whole-archive -lxenguest -lxenctrl -no-whole-archive
 endif
 APP_LDLIBS += -lpci
--
generated by git-patchbot for /home/xen/git/mini-os.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 Jan 22 14:23:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14: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 1aMccS-0003Xg-OT; Fri, 22 Jan 2016 14:23: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 1aMccR-0003XD-DT
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:19 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	D4/81-15353-65B32A65; Fri, 22 Jan 2016 14:23:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1453472597!17579536!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56810 invoked from network); 22 Jan 2016 14:23:18 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:23:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcd5-0002wO-9O
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMccP-00029L-1c
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:17 +0000
Date: Fri, 22 Jan 2016 14:23:17 +0000
Message-Id: <E1aMccP-00029L-1c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] mini-os: Include
	libxenforeignmemory with libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 89268f00b0b0215057cb74edd94e866536a02489
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:24:03 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:16:00 2016 +0000

    mini-os: Include libxenforeignmemory with libxc
    
    libxenforeignmemory has just been split out from libxc. From mini-os's
    point of view we don't care about the distinction, so keep things
    simple by just including libxenforeignmemory if libxc is enabled.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index c900540..cfe015a 100644
--- a/Makefile
+++ b/Makefile
@@ -169,6 +169,7 @@ APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog -whole-ar
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn -whole-archive -lxenevtchn -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/gnttab -whole-archive -lxengnttab -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/call -whole-archive -lxencall -no-whole-archive
+APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/foreignmemory -whole-archive -lxenforeignmemory -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) -whole-archive -lxenguest -lxenctrl -no-whole-archive
 endif
 APP_LDLIBS += -lpci
--
generated by git-patchbot for /home/xen/git/mini-os.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 Jan 22 14:23:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 14: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 1aMccS-0003Xg-OT; Fri, 22 Jan 2016 14:23: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 1aMccR-0003XD-DT
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:19 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	D4/81-15353-65B32A65; Fri, 22 Jan 2016 14:23:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1453472597!17579536!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56810 invoked from network); 22 Jan 2016 14:23:18 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 14:23:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMcd5-0002wO-9O
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMccP-00029L-1c
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 14:23:17 +0000
Date: Fri, 22 Jan 2016 14:23:17 +0000
Message-Id: <E1aMccP-00029L-1c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] mini-os: Include
	libxenforeignmemory with libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 89268f00b0b0215057cb74edd94e866536a02489
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 15 13:24:03 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:16:00 2016 +0000

    mini-os: Include libxenforeignmemory with libxc
    
    libxenforeignmemory has just been split out from libxc. From mini-os's
    point of view we don't care about the distinction, so keep things
    simple by just including libxenforeignmemory if libxc is enabled.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index c900540..cfe015a 100644
--- a/Makefile
+++ b/Makefile
@@ -169,6 +169,7 @@ APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog -whole-ar
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn -whole-archive -lxenevtchn -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/gnttab -whole-archive -lxengnttab -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/call -whole-archive -lxencall -no-whole-archive
+APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/foreignmemory -whole-archive -lxenforeignmemory -no-whole-archive
 APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH) -whole-archive -lxenguest -lxenctrl -no-whole-archive
 endif
 APP_LDLIBS += -lpci
--
generated by git-patchbot for /home/xen/git/mini-os.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 Jan 22 16:11:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 16:11: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 1aMeIl-0005JN-87; Fri, 22 Jan 2016 16:11: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 1aMeIj-0005JE-Uw
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:06 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	4F/5D-31122-99452A65; Fri, 22 Jan 2016 16:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1453479064!11609230!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21515 invoked from network); 22 Jan 2016 16:11:04 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 16:11:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMeJO-0005uG-6H
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMeIh-00070f-BF
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:03 +0000
Date: Fri, 22 Jan 2016 16:11:03 +0000
Message-Id: <E1aMeIh-00070f-BF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/mm: PV superpage handling
	lacks sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4a47fbb72ed42b6e2d5b0afa1e8265e9b16b4b38
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:11:52 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:11:52 2016 +0100

    x86/mm: PV superpage handling lacks sanity checks
    
    MMUEXT_{,UN}MARK_SUPER fail to check the input MFN for validity before
    dereferencing pointers into the superpage frame table.
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    
    get_superpage() has a similar issue.
    
    This is CVE-2016-1570 / XSA-167.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 47abf29a9255b2e7b94e56d66b455d0a584b68b8
    master date: 2016-01-20 13:49:23 +0100
---
 xen/arch/x86/mm.c |   29 +++++++----------------------
 1 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1caa555..222fe5f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2566,6 +2566,9 @@ int get_superpage(unsigned long mfn, struct domain *d)
 
     ASSERT(opt_allow_superpage);
 
+    if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+        return -EINVAL;
+
     spage = mfn_to_spage(mfn);
     y = spage->type_info;
     do {
@@ -3320,14 +3323,6 @@ long do_mmuext_op(
             unsigned long mfn;
             struct spage_info *spage;
 
-            mfn = op.arg1.mfn;
-            if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
-            {
-                MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
-                break;
-            }
-
             if ( !opt_allow_superpage )
             {
                 MEM_LOG("Superpages disallowed");
@@ -3336,16 +3331,6 @@ long do_mmuext_op(
                 break;
             }
 
-            spage = mfn_to_spage(mfn);
-            okay = (mark_superpage(spage, d) >= 0);
-            break;
-        }
-
-        case MMUEXT_UNMARK_SUPER:
-        {
-            unsigned long mfn;
-            struct spage_info *spage;
-
             mfn = op.arg1.mfn;
             if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
             {
@@ -3354,16 +3339,16 @@ long do_mmuext_op(
                 break;
             }
 
-            if ( !opt_allow_superpage )
+            if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
             {
-                MEM_LOG("Superpages disallowed");
                 okay = 0;
-                rc = -ENOSYS;
                 break;
             }
 
             spage = mfn_to_spage(mfn);
-            okay = (unmark_superpage(spage) >= 0);
+            okay = ((op.cmd == MMUEXT_MARK_SUPER
+                    ? mark_superpage(spage, d)
+                    : unmark_superpage(spage)) >= 0);
             break;
         }
 
--
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 Jan 22 16:11:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 16:11: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 1aMeIl-0005JN-87; Fri, 22 Jan 2016 16:11: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 1aMeIj-0005JE-Uw
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:06 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	4F/5D-31122-99452A65; Fri, 22 Jan 2016 16:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1453479064!11609230!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21515 invoked from network); 22 Jan 2016 16:11:04 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 16:11:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMeJO-0005uG-6H
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMeIh-00070f-BF
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:03 +0000
Date: Fri, 22 Jan 2016 16:11:03 +0000
Message-Id: <E1aMeIh-00070f-BF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/mm: PV superpage handling
	lacks sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4a47fbb72ed42b6e2d5b0afa1e8265e9b16b4b38
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:11:52 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:11:52 2016 +0100

    x86/mm: PV superpage handling lacks sanity checks
    
    MMUEXT_{,UN}MARK_SUPER fail to check the input MFN for validity before
    dereferencing pointers into the superpage frame table.
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    
    get_superpage() has a similar issue.
    
    This is CVE-2016-1570 / XSA-167.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 47abf29a9255b2e7b94e56d66b455d0a584b68b8
    master date: 2016-01-20 13:49:23 +0100
---
 xen/arch/x86/mm.c |   29 +++++++----------------------
 1 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1caa555..222fe5f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2566,6 +2566,9 @@ int get_superpage(unsigned long mfn, struct domain *d)
 
     ASSERT(opt_allow_superpage);
 
+    if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+        return -EINVAL;
+
     spage = mfn_to_spage(mfn);
     y = spage->type_info;
     do {
@@ -3320,14 +3323,6 @@ long do_mmuext_op(
             unsigned long mfn;
             struct spage_info *spage;
 
-            mfn = op.arg1.mfn;
-            if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
-            {
-                MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
-                break;
-            }
-
             if ( !opt_allow_superpage )
             {
                 MEM_LOG("Superpages disallowed");
@@ -3336,16 +3331,6 @@ long do_mmuext_op(
                 break;
             }
 
-            spage = mfn_to_spage(mfn);
-            okay = (mark_superpage(spage, d) >= 0);
-            break;
-        }
-
-        case MMUEXT_UNMARK_SUPER:
-        {
-            unsigned long mfn;
-            struct spage_info *spage;
-
             mfn = op.arg1.mfn;
             if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
             {
@@ -3354,16 +3339,16 @@ long do_mmuext_op(
                 break;
             }
 
-            if ( !opt_allow_superpage )
+            if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
             {
-                MEM_LOG("Superpages disallowed");
                 okay = 0;
-                rc = -ENOSYS;
                 break;
             }
 
             spage = mfn_to_spage(mfn);
-            okay = (unmark_superpage(spage) >= 0);
+            okay = ((op.cmd == MMUEXT_MARK_SUPER
+                    ? mark_superpage(spage, d)
+                    : unmark_superpage(spage)) >= 0);
             break;
         }
 
--
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 Jan 22 16:11:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 16:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMeIw-0005KU-CH; Fri, 22 Jan 2016 16:11: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 1aMeIu-0005KG-QX
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:16 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	4D/BA-03225-4A452A65; Fri, 22 Jan 2016 16:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453479074!17351404!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22357 invoked from network); 22 Jan 2016 16:11:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 16:11:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMeJY-0005uO-OI
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMeIs-00071m-2z
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:14 +0000
Date: Fri, 22 Jan 2016 16:11:14 +0000
Message-Id: <E1aMeIs-00071m-2z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/VMX: prevent INVVPID failure
	due to non-canonical guest 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 93d789e76102bc3ec940292f9c3450b777490931
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:12:48 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:12:48 2016 +0100

    x86/VMX: prevent INVVPID failure due to non-canonical guest address
    
    While INVLPG (and on SVM INVLPGA) don't fault on non-canonical
    addresses, INVVPID fails (in the "individual address" case) when passed
    such an address.
    
    Since such intercepted INVLPG are effectively no-ops anyway, don't fix
    this in vmx_invlpg_intercept(), but instead have paging_invlpg() never
    return true in such a case.
    
    This is CVE-2016-1571 / XSA-168.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: bf05e88ed7342a91cceba050b6c622accb809842
    master date: 2016-01-20 13:50:10 +0100
---
 xen/include/asm-x86/paging.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index dcc7471..aaaa1e9 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -238,7 +238,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
  * or 0 if it's safe not to do so. */
 static inline int paging_invlpg(struct vcpu *v, unsigned long va)
 {
-    return paging_get_hostmode(v)->invlpg(v, va);
+    return is_canonical_address(va) && paging_get_hostmode(v)->invlpg(v, va);
 }
 
 /* Translate a guest virtual address to the frame number that the
--
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 Jan 22 16:11:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 16:11:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMeIw-0005KU-CH; Fri, 22 Jan 2016 16:11: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 1aMeIu-0005KG-QX
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:16 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	4D/BA-03225-4A452A65; Fri, 22 Jan 2016 16:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453479074!17351404!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22357 invoked from network); 22 Jan 2016 16:11:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 16:11:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMeJY-0005uO-OI
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMeIs-00071m-2z
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:14 +0000
Date: Fri, 22 Jan 2016 16:11:14 +0000
Message-Id: <E1aMeIs-00071m-2z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/VMX: prevent INVVPID failure
	due to non-canonical guest 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 93d789e76102bc3ec940292f9c3450b777490931
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:12:48 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:12:48 2016 +0100

    x86/VMX: prevent INVVPID failure due to non-canonical guest address
    
    While INVLPG (and on SVM INVLPGA) don't fault on non-canonical
    addresses, INVVPID fails (in the "individual address" case) when passed
    such an address.
    
    Since such intercepted INVLPG are effectively no-ops anyway, don't fix
    this in vmx_invlpg_intercept(), but instead have paging_invlpg() never
    return true in such a case.
    
    This is CVE-2016-1571 / XSA-168.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: bf05e88ed7342a91cceba050b6c622accb809842
    master date: 2016-01-20 13:50:10 +0100
---
 xen/include/asm-x86/paging.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index dcc7471..aaaa1e9 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -238,7 +238,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
  * or 0 if it's safe not to do so. */
 static inline int paging_invlpg(struct vcpu *v, unsigned long va)
 {
-    return paging_get_hostmode(v)->invlpg(v, va);
+    return is_canonical_address(va) && paging_get_hostmode(v)->invlpg(v, va);
 }
 
 /* Translate a guest virtual address to the frame number that the
--
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 Jan 22 16:11:32 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 16:11: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 1aMeJA-0005Mx-IF; Fri, 22 Jan 2016 16:11: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 1aMeJ9-0005Mm-2j
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:31 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	EF/D3-23366-2B452A65; Fri, 22 Jan 2016 16:11:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1453479085!15013175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40220 invoked from network); 22 Jan 2016 16:11:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 16:11:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMeJj-0005v6-La
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:12:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMeJ2-00072W-K9
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:25 +0000
Date: Fri, 22 Jan 2016 16:11:24 +0000
Message-Id: <E1aMeJ2-00072W-K9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/vmx: Fix injection of #DB
	traps following XSA-156
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ac0cc84d7bdfc111d47236356e5d06b5681a1dd6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 20 14:20:57 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:20:57 2016 +0100

    x86/vmx: Fix injection of #DB traps following XSA-156
    
    Most #DB exceptions are traps rather than faults, meaning that the instruction
    pointer in the exception frame points after the instruction rather than at it.
    
    However, VMX intercepts all have fault semantics, even when intercepting a
    trap.  Re-injecting an intercepted trap as a fault causes an infinite loop in
    the guest, by re-executing the same trapping instruction repeatedly.  This
    breaks debugging inside the guest.
    
    Introduce a helper which copies VM_EXIT_INTR_INTO to VM_ENTRY_INTR_INFO, and
    use it to mirror the intercepted interrupt back to the guest.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 0747bc8b4d85f3fc0ee1e58418418fa0229e8ff8
    master date: 2016-01-05 11:28:56 +0000
---
 xen/arch/x86/hvm/vmx/vmx.c |   27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 72c823e..25ae750 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2414,6 +2414,28 @@ static int vmx_handle_eoi_write(void)
     return 0;
 }
 
+/*
+ * Propagate VM_EXIT_INTR_INFO to VM_ENTRY_INTR_INFO.  Used to mirror an
+ * intercepted exception back to the guest as if Xen hadn't intercepted it.
+ *
+ * It is the callers responsibility to ensure that this function is only used
+ * in the context of an appropriate vmexit.
+ */
+static void vmx_propagate_intr(void)
+{
+    unsigned long intr = __vmread(VM_EXIT_INTR_INFO);
+
+    ASSERT(intr & INTR_INFO_VALID_MASK);
+
+    __vmwrite(VM_ENTRY_INTR_INFO, intr);
+
+    if ( intr & INTR_INFO_DELIVER_CODE_MASK )
+        __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE,
+                  __vmread(VM_EXIT_INTR_ERROR_CODE));
+
+    __vmwrite(VM_ENTRY_INSTRUCTION_LEN, __vmread(VM_EXIT_INSTRUCTION_LEN));
+}
+
 static void vmx_idtv_reinject(unsigned long idtv_info)
 {
 
@@ -2611,7 +2633,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | 0xffff0ff0);
             if ( !v->domain->debugger_attached )
-                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+                vmx_propagate_intr();
             else
                 domain_pause_for_debugger();
             break;
@@ -2676,8 +2698,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             break;
         case TRAP_alignment_check:
             HVMTRACE_1D(TRAP, vector);
-            hvm_inject_hw_exception(vector,
-                                    __vmread(VM_EXIT_INTR_ERROR_CODE));
+            vmx_propagate_intr();
             break;
         case TRAP_nmi:
             if ( (intr_info & INTR_INFO_INTR_TYPE_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 Fri Jan 22 16:11:32 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 16:11: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 1aMeJA-0005Mx-IF; Fri, 22 Jan 2016 16:11: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 1aMeJ9-0005Mm-2j
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:31 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	EF/D3-23366-2B452A65; Fri, 22 Jan 2016 16:11:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1453479085!15013175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40220 invoked from network); 22 Jan 2016 16:11:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 16:11:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMeJj-0005v6-La
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:12:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMeJ2-00072W-K9
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 16:11:25 +0000
Date: Fri, 22 Jan 2016 16:11:24 +0000
Message-Id: <E1aMeJ2-00072W-K9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/vmx: Fix injection of #DB
	traps following XSA-156
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ac0cc84d7bdfc111d47236356e5d06b5681a1dd6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 20 14:20:57 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:20:57 2016 +0100

    x86/vmx: Fix injection of #DB traps following XSA-156
    
    Most #DB exceptions are traps rather than faults, meaning that the instruction
    pointer in the exception frame points after the instruction rather than at it.
    
    However, VMX intercepts all have fault semantics, even when intercepting a
    trap.  Re-injecting an intercepted trap as a fault causes an infinite loop in
    the guest, by re-executing the same trapping instruction repeatedly.  This
    breaks debugging inside the guest.
    
    Introduce a helper which copies VM_EXIT_INTR_INTO to VM_ENTRY_INTR_INFO, and
    use it to mirror the intercepted interrupt back to the guest.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 0747bc8b4d85f3fc0ee1e58418418fa0229e8ff8
    master date: 2016-01-05 11:28:56 +0000
---
 xen/arch/x86/hvm/vmx/vmx.c |   27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 72c823e..25ae750 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2414,6 +2414,28 @@ static int vmx_handle_eoi_write(void)
     return 0;
 }
 
+/*
+ * Propagate VM_EXIT_INTR_INFO to VM_ENTRY_INTR_INFO.  Used to mirror an
+ * intercepted exception back to the guest as if Xen hadn't intercepted it.
+ *
+ * It is the callers responsibility to ensure that this function is only used
+ * in the context of an appropriate vmexit.
+ */
+static void vmx_propagate_intr(void)
+{
+    unsigned long intr = __vmread(VM_EXIT_INTR_INFO);
+
+    ASSERT(intr & INTR_INFO_VALID_MASK);
+
+    __vmwrite(VM_ENTRY_INTR_INFO, intr);
+
+    if ( intr & INTR_INFO_DELIVER_CODE_MASK )
+        __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE,
+                  __vmread(VM_EXIT_INTR_ERROR_CODE));
+
+    __vmwrite(VM_ENTRY_INSTRUCTION_LEN, __vmread(VM_EXIT_INSTRUCTION_LEN));
+}
+
 static void vmx_idtv_reinject(unsigned long idtv_info)
 {
 
@@ -2611,7 +2633,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | 0xffff0ff0);
             if ( !v->domain->debugger_attached )
-                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+                vmx_propagate_intr();
             else
                 domain_pause_for_debugger();
             break;
@@ -2676,8 +2698,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             break;
         case TRAP_alignment_check:
             HVMTRACE_1D(TRAP, vector);
-            hvm_inject_hw_exception(vector,
-                                    __vmread(VM_EXIT_INTR_ERROR_CODE));
+            vmx_propagate_intr();
             break;
         case TRAP_nmi:
             if ( (intr_info & INTR_INFO_INTR_TYPE_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 Fri Jan 22 22:33:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 22: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 1aMkGS-0000LT-RA; Fri, 22 Jan 2016 22:33: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 1aMkGQ-0000LA-R2
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:06 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	4D/68-21201-22EA2A65; Fri, 22 Jan 2016 22:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1453501984!17325512!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37452 invoked from network); 22 Jan 2016 22:33:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 22:33:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkH5-0005ym-5v
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkGN-0006Ha-I5
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:04 +0000
Date: Fri, 22 Jan 2016 22:33:03 +0000
Message-Id: <E1aMkGN-0006Ha-I5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/mm: PV superpage handling
	lacks sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 642943d1614d25a035e9923b916e46e9b446ee81
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:02:17 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:02:17 2016 +0100

    x86/mm: PV superpage handling lacks sanity checks
    
    MMUEXT_{,UN}MARK_SUPER fail to check the input MFN for validity before
    dereferencing pointers into the superpage frame table.
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    
    get_superpage() has a similar issue.
    
    This is CVE-2016-1570 / XSA-167.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 47abf29a9255b2e7b94e56d66b455d0a584b68b8
    master date: 2016-01-20 13:49:23 +0100
---
 xen/arch/x86/mm.c |   37 ++++++++++++-------------------------
 1 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b4d3031..9179a8f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2550,6 +2550,9 @@ int get_superpage(unsigned long mfn, struct domain *d)
 
     ASSERT(opt_allow_superpage);
 
+    if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+        return -EINVAL;
+
     spage = mfn_to_spage(mfn);
     y = spage->type_info;
     do {
@@ -3320,42 +3323,26 @@ long do_mmuext_op(
         }
 
         case MMUEXT_MARK_SUPER:
+        case MMUEXT_UNMARK_SUPER:
         {
             unsigned long mfn = op.arg1.mfn;
 
-            if ( unlikely(d != pg_owner) )
-                rc = -EPERM;
-            else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
-            {
-                MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
-            }
-            else if ( !opt_allow_superpage )
+            if ( !opt_allow_superpage )
             {
                 MEM_LOG("Superpages disallowed");
                 rc = -ENOSYS;
             }
-            else
-                rc = mark_superpage(mfn_to_spage(mfn), d);
-            break;
-        }
-
-        case MMUEXT_UNMARK_SUPER:
-        {
-            unsigned long mfn = op.arg1.mfn;
-
-            if ( unlikely(d != pg_owner) )
+            else if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
-            else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
+            else if ( mfn & (L1_PAGETABLE_ENTRIES - 1) )
             {
                 MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
-            }
-            else if ( !opt_allow_superpage )
-            {
-                MEM_LOG("Superpages disallowed");
-                rc = -ENOSYS;
+                rc = -EINVAL;
             }
+            else if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+                rc = -EINVAL;
+            else if ( op.cmd == MMUEXT_MARK_SUPER )
+                rc = mark_superpage(mfn_to_spage(mfn), d);
             else
                 rc = unmark_superpage(mfn_to_spage(mfn));
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 22:33:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 22: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 1aMkGS-0000LT-RA; Fri, 22 Jan 2016 22:33: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 1aMkGQ-0000LA-R2
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:06 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	4D/68-21201-22EA2A65; Fri, 22 Jan 2016 22:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1453501984!17325512!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37452 invoked from network); 22 Jan 2016 22:33:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 22:33:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkH5-0005ym-5v
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkGN-0006Ha-I5
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:04 +0000
Date: Fri, 22 Jan 2016 22:33:03 +0000
Message-Id: <E1aMkGN-0006Ha-I5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/mm: PV superpage handling
	lacks sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 642943d1614d25a035e9923b916e46e9b446ee81
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:02:17 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:02:17 2016 +0100

    x86/mm: PV superpage handling lacks sanity checks
    
    MMUEXT_{,UN}MARK_SUPER fail to check the input MFN for validity before
    dereferencing pointers into the superpage frame table.
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    
    get_superpage() has a similar issue.
    
    This is CVE-2016-1570 / XSA-167.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 47abf29a9255b2e7b94e56d66b455d0a584b68b8
    master date: 2016-01-20 13:49:23 +0100
---
 xen/arch/x86/mm.c |   37 ++++++++++++-------------------------
 1 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b4d3031..9179a8f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2550,6 +2550,9 @@ int get_superpage(unsigned long mfn, struct domain *d)
 
     ASSERT(opt_allow_superpage);
 
+    if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+        return -EINVAL;
+
     spage = mfn_to_spage(mfn);
     y = spage->type_info;
     do {
@@ -3320,42 +3323,26 @@ long do_mmuext_op(
         }
 
         case MMUEXT_MARK_SUPER:
+        case MMUEXT_UNMARK_SUPER:
         {
             unsigned long mfn = op.arg1.mfn;
 
-            if ( unlikely(d != pg_owner) )
-                rc = -EPERM;
-            else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
-            {
-                MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
-            }
-            else if ( !opt_allow_superpage )
+            if ( !opt_allow_superpage )
             {
                 MEM_LOG("Superpages disallowed");
                 rc = -ENOSYS;
             }
-            else
-                rc = mark_superpage(mfn_to_spage(mfn), d);
-            break;
-        }
-
-        case MMUEXT_UNMARK_SUPER:
-        {
-            unsigned long mfn = op.arg1.mfn;
-
-            if ( unlikely(d != pg_owner) )
+            else if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
-            else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
+            else if ( mfn & (L1_PAGETABLE_ENTRIES - 1) )
             {
                 MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                okay = 0;
-            }
-            else if ( !opt_allow_superpage )
-            {
-                MEM_LOG("Superpages disallowed");
-                rc = -ENOSYS;
+                rc = -EINVAL;
             }
+            else if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+                rc = -EINVAL;
+            else if ( op.cmd == MMUEXT_MARK_SUPER )
+                rc = mark_superpage(mfn_to_spage(mfn), d);
             else
                 rc = unmark_superpage(mfn_to_spage(mfn));
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 22:33:19 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 22:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMkGd-0000Nk-2W; Fri, 22 Jan 2016 22:33:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkGb-0000NU-BA
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:17 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	DF/F1-21594-C2EA2A65; Fri, 22 Jan 2016 22:33:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1453501995!17613751!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13837 invoked from network); 22 Jan 2016 22:33:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 22:33:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkHF-0005yu-Py
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkGY-0006Hw-Dr
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:14 +0000
Date: Fri, 22 Jan 2016 22:33:14 +0000
Message-Id: <E1aMkGY-0006Hw-Dr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/VMX: prevent INVVPID failure
	due to non-canonical guest 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 934e86f1d9ba94bc7d50f4fa30cab495ef79bbdc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:03:02 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:03:02 2016 +0100

    x86/VMX: prevent INVVPID failure due to non-canonical guest address
    
    While INVLPG (and on SVM INVLPGA) don't fault on non-canonical
    addresses, INVVPID fails (in the "individual address" case) when passed
    such an address.
    
    Since such intercepted INVLPG are effectively no-ops anyway, don't fix
    this in vmx_invlpg_intercept(), but instead have paging_invlpg() never
    return true in such a case.
    
    This is CVE-2016-1571 / XSA-168.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: bf05e88ed7342a91cceba050b6c622accb809842
    master date: 2016-01-20 13:50:10 +0100
---
 xen/include/asm-x86/paging.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 5f810f6..d456d7a 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -238,7 +238,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
  * or 0 if it's safe not to do so. */
 static inline int paging_invlpg(struct vcpu *v, unsigned long va)
 {
-    return paging_get_hostmode(v)->invlpg(v, va);
+    return is_canonical_address(va) && paging_get_hostmode(v)->invlpg(v, va);
 }
 
 /* Translate a guest virtual address to the frame number that the
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 22:33:19 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 22:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aMkGd-0000Nk-2W; Fri, 22 Jan 2016 22:33:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkGb-0000NU-BA
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:17 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	DF/F1-21594-C2EA2A65; Fri, 22 Jan 2016 22:33:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1453501995!17613751!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13837 invoked from network); 22 Jan 2016 22:33:15 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 22:33:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkHF-0005yu-Py
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkGY-0006Hw-Dr
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:14 +0000
Date: Fri, 22 Jan 2016 22:33:14 +0000
Message-Id: <E1aMkGY-0006Hw-Dr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/VMX: prevent INVVPID failure
	due to non-canonical guest 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 934e86f1d9ba94bc7d50f4fa30cab495ef79bbdc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 14:03:02 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:03:02 2016 +0100

    x86/VMX: prevent INVVPID failure due to non-canonical guest address
    
    While INVLPG (and on SVM INVLPGA) don't fault on non-canonical
    addresses, INVVPID fails (in the "individual address" case) when passed
    such an address.
    
    Since such intercepted INVLPG are effectively no-ops anyway, don't fix
    this in vmx_invlpg_intercept(), but instead have paging_invlpg() never
    return true in such a case.
    
    This is CVE-2016-1571 / XSA-168.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: bf05e88ed7342a91cceba050b6c622accb809842
    master date: 2016-01-20 13:50:10 +0100
---
 xen/include/asm-x86/paging.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 5f810f6..d456d7a 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -238,7 +238,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
  * or 0 if it's safe not to do so. */
 static inline int paging_invlpg(struct vcpu *v, unsigned long va)
 {
-    return paging_get_hostmode(v)->invlpg(v, va);
+    return is_canonical_address(va) && paging_get_hostmode(v)->invlpg(v, va);
 }
 
 /* Translate a guest virtual address to the frame number that the
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 22:33:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 22: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 1aMkGm-0000Pn-6t; Fri, 22 Jan 2016 22:33: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 1aMkGl-0000Pe-Fi
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:27 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	6F/FC-31122-63EA2A65; Fri, 22 Jan 2016 22:33:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1453502005!11644514!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12618 invoked from network); 22 Jan 2016 22:33:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 22:33:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkHQ-0005zR-4B
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:34:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkGj-0006J1-1s
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:25 +0000
Date: Fri, 22 Jan 2016 22:33:25 +0000
Message-Id: <E1aMkGj-0006J1-1s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/vmx: Fix injection of #DB
	traps following XSA-156
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a1acb6a9e76a96ce7c63d230884ba9fb3265504
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 20 14:05:48 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:05:48 2016 +0100

    x86/vmx: Fix injection of #DB traps following XSA-156
    
    Most #DB exceptions are traps rather than faults, meaning that the instruction
    pointer in the exception frame points after the instruction rather than at it.
    
    However, VMX intercepts all have fault semantics, even when intercepting a
    trap.  Re-injecting an intercepted trap as a fault causes an infinite loop in
    the guest, by re-executing the same trapping instruction repeatedly.  This
    breaks debugging inside the guest.
    
    Introduce a helper which copies VM_EXIT_INTR_INTO to VM_ENTRY_INTR_INFO, and
    use it to mirror the intercepted interrupt back to the guest.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 0747bc8b4d85f3fc0ee1e58418418fa0229e8ff8
    master date: 2016-01-05 11:28:56 +0000
---
 xen/arch/x86/hvm/vmx/vmx.c |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index bfc6465..97b834d 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2586,6 +2586,33 @@ static int vmx_handle_eoi_write(void)
     return 0;
 }
 
+/*
+ * Propagate VM_EXIT_INTR_INFO to VM_ENTRY_INTR_INFO.  Used to mirror an
+ * intercepted exception back to the guest as if Xen hadn't intercepted it.
+ *
+ * It is the callers responsibility to ensure that this function is only used
+ * in the context of an appropriate vmexit.
+ */
+static void vmx_propagate_intr(void)
+{
+    unsigned long intr, tmp;
+
+    __vmread(VM_EXIT_INTR_INFO, &intr);
+
+    ASSERT(intr & INTR_INFO_VALID_MASK);
+
+    __vmwrite(VM_ENTRY_INTR_INFO, intr);
+
+    if ( intr & INTR_INFO_DELIVER_CODE_MASK )
+    {
+        __vmread(VM_EXIT_INTR_ERROR_CODE, &tmp);
+        __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, tmp);
+    }
+
+    __vmread(VM_EXIT_INSTRUCTION_LEN, &tmp);
+    __vmwrite(VM_ENTRY_INSTRUCTION_LEN, tmp);
+}
+
 static void vmx_idtv_reinject(unsigned long idtv_info)
 {
 
@@ -2808,7 +2835,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | 0xffff0ff0);
             if ( !v->domain->debugger_attached )
-                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+                vmx_propagate_intr();
             else
                 domain_pause_for_debugger();
             break;
@@ -2877,8 +2904,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             break;
         case TRAP_alignment_check:
             HVMTRACE_1D(TRAP, vector);
-            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
-            hvm_inject_hw_exception(vector, ecode);
+            vmx_propagate_intr();
             break;
         case TRAP_nmi:
             if ( (intr_info & INTR_INFO_INTR_TYPE_MASK) !=
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 22:33:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 22: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 1aMkGm-0000Pn-6t; Fri, 22 Jan 2016 22:33: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 1aMkGl-0000Pe-Fi
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:27 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	6F/FC-31122-63EA2A65; Fri, 22 Jan 2016 22:33:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1453502005!11644514!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12618 invoked from network); 22 Jan 2016 22:33:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 22:33:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkHQ-0005zR-4B
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:34:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkGj-0006J1-1s
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:25 +0000
Date: Fri, 22 Jan 2016 22:33:25 +0000
Message-Id: <E1aMkGj-0006J1-1s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/vmx: Fix injection of #DB
	traps following XSA-156
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a1acb6a9e76a96ce7c63d230884ba9fb3265504
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 20 14:05:48 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:05:48 2016 +0100

    x86/vmx: Fix injection of #DB traps following XSA-156
    
    Most #DB exceptions are traps rather than faults, meaning that the instruction
    pointer in the exception frame points after the instruction rather than at it.
    
    However, VMX intercepts all have fault semantics, even when intercepting a
    trap.  Re-injecting an intercepted trap as a fault causes an infinite loop in
    the guest, by re-executing the same trapping instruction repeatedly.  This
    breaks debugging inside the guest.
    
    Introduce a helper which copies VM_EXIT_INTR_INTO to VM_ENTRY_INTR_INFO, and
    use it to mirror the intercepted interrupt back to the guest.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 0747bc8b4d85f3fc0ee1e58418418fa0229e8ff8
    master date: 2016-01-05 11:28:56 +0000
---
 xen/arch/x86/hvm/vmx/vmx.c |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index bfc6465..97b834d 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2586,6 +2586,33 @@ static int vmx_handle_eoi_write(void)
     return 0;
 }
 
+/*
+ * Propagate VM_EXIT_INTR_INFO to VM_ENTRY_INTR_INFO.  Used to mirror an
+ * intercepted exception back to the guest as if Xen hadn't intercepted it.
+ *
+ * It is the callers responsibility to ensure that this function is only used
+ * in the context of an appropriate vmexit.
+ */
+static void vmx_propagate_intr(void)
+{
+    unsigned long intr, tmp;
+
+    __vmread(VM_EXIT_INTR_INFO, &intr);
+
+    ASSERT(intr & INTR_INFO_VALID_MASK);
+
+    __vmwrite(VM_ENTRY_INTR_INFO, intr);
+
+    if ( intr & INTR_INFO_DELIVER_CODE_MASK )
+    {
+        __vmread(VM_EXIT_INTR_ERROR_CODE, &tmp);
+        __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, tmp);
+    }
+
+    __vmread(VM_EXIT_INSTRUCTION_LEN, &tmp);
+    __vmwrite(VM_ENTRY_INSTRUCTION_LEN, tmp);
+}
+
 static void vmx_idtv_reinject(unsigned long idtv_info)
 {
 
@@ -2808,7 +2835,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | 0xffff0ff0);
             if ( !v->domain->debugger_attached )
-                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+                vmx_propagate_intr();
             else
                 domain_pause_for_debugger();
             break;
@@ -2877,8 +2904,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             break;
         case TRAP_alignment_check:
             HVMTRACE_1D(TRAP, vector);
-            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
-            hvm_inject_hw_exception(vector, ecode);
+            vmx_propagate_intr();
             break;
         case TRAP_nmi:
             if ( (intr_info & INTR_INFO_INTR_TYPE_MASK) !=
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 22:33:40 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 22: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 1aMkGy-0000Rf-Bb; Fri, 22 Jan 2016 22:33:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkGx-0000RU-J9
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:39 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	FC/1E-30270-24EA2A65; Fri, 22 Jan 2016 22:33:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1453502015!17322918!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58316 invoked from network); 22 Jan 2016 22:33:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 22:33:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkHa-000609-E9
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:34:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkGt-0006JW-AQ
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:35 +0000
Date: Fri, 22 Jan 2016 22:33:35 +0000
Message-Id: <E1aMkGt-0006JW-AQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] docs: correct descriptions of
	gnttab_max_{, maptrack}_frames
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7afddd3b945b11a7f5162d1355283b6b9ae7aba3
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jan 20 14:06:22 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:06:22 2016 +0100

    docs: correct descriptions of gnttab_max_{, maptrack}_frames
    
    gnttab_max_frames incorrectly referred to numbers of grant tab
    operations and gnttab_max_maptrack_frames was confusingly worded.
    
    Add the default for gnttab_max_frames while here (it's currently the
    same on all arches since no arch uses the available arch override) and
    adjust the default for gnttab_max_maptrack_frames to match the normal
    form.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ef17887d848dae0ca46231b47bf30d3c1d4aa87d
    master date: 2016-01-19 16:24:44 +0000
---
 docs/misc/xen-command-line.markdown |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index b634361..e5a7642 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -665,13 +665,18 @@ Specify the serial parameters for the GDB stub.
 ### gnttab\_max\_frames
 > `= <integer>`
 
-Specify the maximum number of frames per grant table operation.
+> Default: `32`
+
+Specify the maximum number of frames which any domain may use as part
+of its grant table.
 
 ### gnttab\_max\_maptrack\_frames
 > `= <integer>`
 
-Specify the maximum number of maptrack frames domain.
-The default value is 8 times **gnttab\_max\_frames**.
+> Default: `8 * gnttab_max_frames`
+
+Specify the maximum number of frames to use as part of a domains
+maptrack array.
 
 ### gnttab\_max\_nr\_frames
 > `= <integer>`
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Jan 22 22:33:40 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 Jan 2016 22: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 1aMkGy-0000Rf-Bb; Fri, 22 Jan 2016 22:33:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkGx-0000RU-J9
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:39 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	FC/1E-30270-24EA2A65; Fri, 22 Jan 2016 22:33:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1453502015!17322918!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58316 invoked from network); 22 Jan 2016 22:33:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jan 2016 22:33:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkHa-000609-E9
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:34:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aMkGt-0006JW-AQ
	for xen-changelog@lists.xensource.com; Fri, 22 Jan 2016 22:33:35 +0000
Date: Fri, 22 Jan 2016 22:33:35 +0000
Message-Id: <E1aMkGt-0006JW-AQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] docs: correct descriptions of
	gnttab_max_{, maptrack}_frames
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7afddd3b945b11a7f5162d1355283b6b9ae7aba3
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jan 20 14:06:22 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 14:06:22 2016 +0100

    docs: correct descriptions of gnttab_max_{, maptrack}_frames
    
    gnttab_max_frames incorrectly referred to numbers of grant tab
    operations and gnttab_max_maptrack_frames was confusingly worded.
    
    Add the default for gnttab_max_frames while here (it's currently the
    same on all arches since no arch uses the available arch override) and
    adjust the default for gnttab_max_maptrack_frames to match the normal
    form.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: ef17887d848dae0ca46231b47bf30d3c1d4aa87d
    master date: 2016-01-19 16:24:44 +0000
---
 docs/misc/xen-command-line.markdown |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index b634361..e5a7642 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -665,13 +665,18 @@ Specify the serial parameters for the GDB stub.
 ### gnttab\_max\_frames
 > `= <integer>`
 
-Specify the maximum number of frames per grant table operation.
+> Default: `32`
+
+Specify the maximum number of frames which any domain may use as part
+of its grant table.
 
 ### gnttab\_max\_maptrack\_frames
 > `= <integer>`
 
-Specify the maximum number of maptrack frames domain.
-The default value is 8 times **gnttab\_max\_frames**.
+> Default: `8 * gnttab_max_frames`
+
+Specify the maximum number of frames to use as part of a domains
+maptrack array.
 
 ### gnttab\_max\_nr\_frames
 > `= <integer>`
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Mon Jan 25 06:22:17 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 25 Jan 2016 06: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 1aNaXT-0001i7-0h; Mon, 25 Jan 2016 06:22: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 1aNaXS-0001i2-4P
	for xen-changelog@lists.xensource.com; Mon, 25 Jan 2016 06:22:10 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	B7/DD-31122-11FB5A65; Mon, 25 Jan 2016 06:22:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1453702924!11882064!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10346 invoked from network); 25 Jan 2016 06:22:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2016 06:22:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aNaY8-0001bX-Pu
	for xen-changelog@lists.xensource.com; Mon, 25 Jan 2016 06:22:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aNaXL-0001RA-DK
	for xen-changelog@lists.xensource.com; Mon, 25 Jan 2016 06:22:03 +0000
Date: Mon, 25 Jan 2016 06:22:03 +0000
Message-Id: <E1aNaXL-0001RA-DK@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.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 a611ed5d040a764e01edcc8b6d99342c393589d9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 21 13:38:50 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 13:38:50 2016 +0100

    update Xen version to 4.4.4
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 554bcd6..bc024fd 100644
--- a/Config.mk
+++ b/Config.mk
@@ -234,7 +234,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.3
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.4
 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.
@@ -246,7 +246,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 2bbe49494f5e910c6fb49f6800d143cae9eb5758
+QEMU_TAG ?= xen-4.4.4
 # Mon Jan 4 15:34:29 2016 +0000
 # MSI-X: avoid array overrun upon MSI-X table writes
 
diff --git a/xen/Makefile b/xen/Makefile
index 8071927..6cf6ccd 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 ?= .4-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4$(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 Mon Jan 25 06:22:17 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 25 Jan 2016 06: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 1aNaXT-0001i7-0h; Mon, 25 Jan 2016 06:22: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 1aNaXS-0001i2-4P
	for xen-changelog@lists.xensource.com; Mon, 25 Jan 2016 06:22:10 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	B7/DD-31122-11FB5A65; Mon, 25 Jan 2016 06:22:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1453702924!11882064!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10346 invoked from network); 25 Jan 2016 06:22:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2016 06:22:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aNaY8-0001bX-Pu
	for xen-changelog@lists.xensource.com; Mon, 25 Jan 2016 06:22:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aNaXL-0001RA-DK
	for xen-changelog@lists.xensource.com; Mon, 25 Jan 2016 06:22:03 +0000
Date: Mon, 25 Jan 2016 06:22:03 +0000
Message-Id: <E1aNaXL-0001RA-DK@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.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 a611ed5d040a764e01edcc8b6d99342c393589d9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 21 13:38:50 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 13:38:50 2016 +0100

    update Xen version to 4.4.4
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 554bcd6..bc024fd 100644
--- a/Config.mk
+++ b/Config.mk
@@ -234,7 +234,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.3
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.4
 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.
@@ -246,7 +246,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 2bbe49494f5e910c6fb49f6800d143cae9eb5758
+QEMU_TAG ?= xen-4.4.4
 # Mon Jan 4 15:34:29 2016 +0000
 # MSI-X: avoid array overrun upon MSI-X table writes
 
diff --git a/xen/Makefile b/xen/Makefile
index 8071927..6cf6ccd 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 ?= .4-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4$(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 Mon Jan 25 08:22:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 25 Jan 2016 08:22: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 1aNcPY-0007vC-5q; Mon, 25 Jan 2016 08:22: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 1aNcPX-0007v7-0X
	for xen-changelog@lists.xensource.com; Mon, 25 Jan 2016 08:22:07 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	B1/CB-32641-D2BD5A65; Mon, 25 Jan 2016 08:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1453710124!17313428!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44007 invoked from network); 25 Jan 2016 08:22:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2016 08:22:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aNcQH-0004Z8-10
	for xen-changelog@lists.xensource.com; Mon, 25 Jan 2016 08:22:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aNcPT-0007M7-9I
	for xen-changelog@lists.xensource.com; Mon, 25 Jan 2016 08:22:03 +0000
Date: Mon, 25 Jan 2016 08:22:03 +0000
Message-Id: <E1aNcPT-0007M7-9I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] xenfb.c: avoid expensive loops
	when prod <= out_cons
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2ce1d30ef2858dfed72a281872579e5a26b090dd
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed Jan 6 16:32:22 2016 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Jan 22 15:31:38 2016 +0000

    xenfb.c: avoid expensive loops when prod <= out_cons
    
    If the frontend sets out_cons to a value higher than out_prod, it will
    cause xenfb_handle_events to loop about 2^32 times. Avoid that by using
    better checks at the beginning of the function.
    
    upstream-commit-id: ac0487e1d2ae811cd4d035741a109a4ecfb013f1
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reported-by: Ling Liu <liuling-it@360.cn>
---
 hw/display/xenfb.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 4e2a27a..8eb3046 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -789,8 +789,9 @@ static void xenfb_handle_events(struct XenFB *xenfb)
 
     prod = page->out_prod;
     out_cons = page->out_cons;
-    if (prod == out_cons)
-	return;
+    if (prod - out_cons >= XENFB_OUT_RING_LEN) {
+        return;
+    }
     xen_rmb();		/* ensure we see ring contents up to prod */
     for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Jan 25 08:22:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 25 Jan 2016 08:22: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 1aNcPY-0007vC-5q; Mon, 25 Jan 2016 08:22: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 1aNcPX-0007v7-0X
	for xen-changelog@lists.xensource.com; Mon, 25 Jan 2016 08:22:07 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	B1/CB-32641-D2BD5A65; Mon, 25 Jan 2016 08:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1453710124!17313428!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44007 invoked from network); 25 Jan 2016 08:22:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jan 2016 08:22:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aNcQH-0004Z8-10
	for xen-changelog@lists.xensource.com; Mon, 25 Jan 2016 08:22:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aNcPT-0007M7-9I
	for xen-changelog@lists.xensource.com; Mon, 25 Jan 2016 08:22:03 +0000
Date: Mon, 25 Jan 2016 08:22:03 +0000
Message-Id: <E1aNcPT-0007M7-9I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] xenfb.c: avoid expensive loops
	when prod <= out_cons
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2ce1d30ef2858dfed72a281872579e5a26b090dd
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed Jan 6 16:32:22 2016 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Jan 22 15:31:38 2016 +0000

    xenfb.c: avoid expensive loops when prod <= out_cons
    
    If the frontend sets out_cons to a value higher than out_prod, it will
    cause xenfb_handle_events to loop about 2^32 times. Avoid that by using
    better checks at the beginning of the function.
    
    upstream-commit-id: ac0487e1d2ae811cd4d035741a109a4ecfb013f1
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reported-by: Ling Liu <liuling-it@360.cn>
---
 hw/display/xenfb.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 4e2a27a..8eb3046 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -789,8 +789,9 @@ static void xenfb_handle_events(struct XenFB *xenfb)
 
     prod = page->out_prod;
     out_cons = page->out_cons;
-    if (prod == out_cons)
-	return;
+    if (prod - out_cons >= XENFB_OUT_RING_LEN) {
+        return;
+    }
     xen_rmb();		/* ensure we see ring contents up to prod */
     for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
--
generated by git-patchbot for /home/xen/git/qemu-xen.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 Jan 27 10:11:21 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aON4I-0008GP-Ax; Wed, 27 Jan 2016 10:11: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 1aON4H-0008GJ-3B
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:17 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	95/6A-12635-4C798A65; Wed, 27 Jan 2016 10:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1453889473!18138195!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20539 invoked from network); 27 Jan 2016 10:11:14 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:11:14 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON55-0001p5-LO
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON4A-00014h-07
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:11 +0000
Date: Wed, 27 Jan 2016 10:11:10 +0000
Message-Id: <E1aON4A-00014h-07@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: PV superpage handling lacks
	sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 47abf29a9255b2e7b94e56d66b455d0a584b68b8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 13:49:23 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:49:23 2016 +0100

    x86/mm: PV superpage handling lacks sanity checks
    
    MMUEXT_{,UN}MARK_SUPER fail to check the input MFN for validity before
    dereferencing pointers into the superpage frame table.
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    
    get_superpage() has a similar issue.
    
    This is CVE-2016-1570 / XSA-167.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/mm.c |   35 +++++++++++------------------------
 1 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 3056869..b81d1fd 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2635,6 +2635,9 @@ int get_superpage(unsigned long mfn, struct domain *d)
 
     ASSERT(opt_allow_superpage);
 
+    if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+        return -EINVAL;
+
     spage = mfn_to_spage(mfn);
     y = spage->type_info;
     do {
@@ -3432,42 +3435,26 @@ long do_mmuext_op(
         }
 
         case MMUEXT_MARK_SUPER:
+        case MMUEXT_UNMARK_SUPER:
         {
             unsigned long mfn = op.arg1.mfn;
 
-            if ( unlikely(d != pg_owner) )
-                rc = -EPERM;
-            else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
-            {
-                MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                rc = -EINVAL;
-            }
-            else if ( !opt_allow_superpage )
+            if ( !opt_allow_superpage )
             {
                 MEM_LOG("Superpages disallowed");
                 rc = -ENOSYS;
             }
-            else
-                rc = mark_superpage(mfn_to_spage(mfn), d);
-            break;
-        }
-
-        case MMUEXT_UNMARK_SUPER:
-        {
-            unsigned long mfn = op.arg1.mfn;
-
-            if ( unlikely(d != pg_owner) )
+            else if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
-            else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
+            else if ( mfn & (L1_PAGETABLE_ENTRIES - 1) )
             {
                 MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
                 rc = -EINVAL;
             }
-            else if ( !opt_allow_superpage )
-            {
-                MEM_LOG("Superpages disallowed");
-                rc = -ENOSYS;
-            }
+            else if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+                rc = -EINVAL;
+            else if ( op.cmd == MMUEXT_MARK_SUPER )
+                rc = mark_superpage(mfn_to_spage(mfn), d);
             else
                 rc = unmark_superpage(mfn_to_spage(mfn));
             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 Wed Jan 27 10:11:21 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aON4I-0008GP-Ax; Wed, 27 Jan 2016 10:11: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 1aON4H-0008GJ-3B
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:17 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	95/6A-12635-4C798A65; Wed, 27 Jan 2016 10:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1453889473!18138195!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20539 invoked from network); 27 Jan 2016 10:11:14 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:11:14 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON55-0001p5-LO
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON4A-00014h-07
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:11 +0000
Date: Wed, 27 Jan 2016 10:11:10 +0000
Message-Id: <E1aON4A-00014h-07@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: PV superpage handling lacks
	sanity checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 47abf29a9255b2e7b94e56d66b455d0a584b68b8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 13:49:23 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:49:23 2016 +0100

    x86/mm: PV superpage handling lacks sanity checks
    
    MMUEXT_{,UN}MARK_SUPER fail to check the input MFN for validity before
    dereferencing pointers into the superpage frame table.
    
    Reported-by: Qinghao Tang <luodalongde@gmail.com>
    
    get_superpage() has a similar issue.
    
    This is CVE-2016-1570 / XSA-167.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/mm.c |   35 +++++++++++------------------------
 1 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 3056869..b81d1fd 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2635,6 +2635,9 @@ int get_superpage(unsigned long mfn, struct domain *d)
 
     ASSERT(opt_allow_superpage);
 
+    if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+        return -EINVAL;
+
     spage = mfn_to_spage(mfn);
     y = spage->type_info;
     do {
@@ -3432,42 +3435,26 @@ long do_mmuext_op(
         }
 
         case MMUEXT_MARK_SUPER:
+        case MMUEXT_UNMARK_SUPER:
         {
             unsigned long mfn = op.arg1.mfn;
 
-            if ( unlikely(d != pg_owner) )
-                rc = -EPERM;
-            else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
-            {
-                MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
-                rc = -EINVAL;
-            }
-            else if ( !opt_allow_superpage )
+            if ( !opt_allow_superpage )
             {
                 MEM_LOG("Superpages disallowed");
                 rc = -ENOSYS;
             }
-            else
-                rc = mark_superpage(mfn_to_spage(mfn), d);
-            break;
-        }
-
-        case MMUEXT_UNMARK_SUPER:
-        {
-            unsigned long mfn = op.arg1.mfn;
-
-            if ( unlikely(d != pg_owner) )
+            else if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
-            else if ( mfn & (L1_PAGETABLE_ENTRIES-1) )
+            else if ( mfn & (L1_PAGETABLE_ENTRIES - 1) )
             {
                 MEM_LOG("Unaligned superpage reference mfn %lx", mfn);
                 rc = -EINVAL;
             }
-            else if ( !opt_allow_superpage )
-            {
-                MEM_LOG("Superpages disallowed");
-                rc = -ENOSYS;
-            }
+            else if ( !mfn_valid(mfn | (L1_PAGETABLE_ENTRIES - 1)) )
+                rc = -EINVAL;
+            else if ( op.cmd == MMUEXT_MARK_SUPER )
+                rc = mark_superpage(mfn_to_spage(mfn), d);
             else
                 rc = unmark_superpage(mfn_to_spage(mfn));
             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 Wed Jan 27 10:11:29 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10: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 1aON4T-0008HJ-GP; Wed, 27 Jan 2016 10:11: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 1aON4R-0008H4-OQ
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:27 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	C6/F2-21594-EC798A65; Wed, 27 Jan 2016 10:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1453889485!18446257!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30901 invoked from network); 27 Jan 2016 10:11:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:11:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5G-0001p9-Ax
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON4O-00015a-3e
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:24 +0000
Date: Wed, 27 Jan 2016 10:11:24 +0000
Message-Id: <E1aON4O-00015a-3e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VMX: prevent INVVPID failure due
	to non-canonical guest 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 bf05e88ed7342a91cceba050b6c622accb809842
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 13:50:10 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:50:10 2016 +0100

    x86/VMX: prevent INVVPID failure due to non-canonical guest address
    
    While INVLPG (and on SVM INVLPGA) don't fault on non-canonical
    addresses, INVVPID fails (in the "individual address" case) when passed
    such an address.
    
    Since such intercepted INVLPG are effectively no-ops anyway, don't fix
    this in vmx_invlpg_intercept(), but instead have paging_invlpg() never
    return true in such a case.
    
    This is CVE-2016-1571 / XSA-168.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-x86/paging.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 483b2d7..6215f57 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -245,7 +245,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
  * or 0 if it's safe not to do so. */
 static inline int paging_invlpg(struct vcpu *v, unsigned long va)
 {
-    return paging_get_hostmode(v)->invlpg(v, va);
+    return is_canonical_address(va) && paging_get_hostmode(v)->invlpg(v, va);
 }
 
 /* Translate a guest virtual address to the frame number that 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 Wed Jan 27 10:11:29 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10: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 1aON4T-0008HJ-GP; Wed, 27 Jan 2016 10:11: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 1aON4R-0008H4-OQ
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:27 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	C6/F2-21594-EC798A65; Wed, 27 Jan 2016 10:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1453889485!18446257!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30901 invoked from network); 27 Jan 2016 10:11:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:11:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5G-0001p9-Ax
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON4O-00015a-3e
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:24 +0000
Date: Wed, 27 Jan 2016 10:11:24 +0000
Message-Id: <E1aON4O-00015a-3e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VMX: prevent INVVPID failure due
	to non-canonical guest 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 bf05e88ed7342a91cceba050b6c622accb809842
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jan 20 13:50:10 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jan 20 13:50:10 2016 +0100

    x86/VMX: prevent INVVPID failure due to non-canonical guest address
    
    While INVLPG (and on SVM INVLPGA) don't fault on non-canonical
    addresses, INVVPID fails (in the "individual address" case) when passed
    such an address.
    
    Since such intercepted INVLPG are effectively no-ops anyway, don't fix
    this in vmx_invlpg_intercept(), but instead have paging_invlpg() never
    return true in such a case.
    
    This is CVE-2016-1571 / XSA-168.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-x86/paging.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 483b2d7..6215f57 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -245,7 +245,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
  * or 0 if it's safe not to do so. */
 static inline int paging_invlpg(struct vcpu *v, unsigned long va)
 {
-    return paging_get_hostmode(v)->invlpg(v, va);
+    return is_canonical_address(va) && paging_get_hostmode(v)->invlpg(v, va);
 }
 
 /* Translate a guest virtual address to the frame number that 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 Wed Jan 27 10:11:40 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10: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 1aON4e-0008Ih-KZ; Wed, 27 Jan 2016 10: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 1aON4c-0008IS-Sc
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:39 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	A2/6D-08479-AD798A65; Wed, 27 Jan 2016 10:11:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1453889495!18449218!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42277 invoked from network); 27 Jan 2016 10:11:37 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:11:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5Q-0001pL-U2
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON4Y-00016O-Ji
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:34 +0000
Date: Wed, 27 Jan 2016 10:11:34 +0000
Message-Id: <E1aON4Y-00016O-Ji@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remus: don't do failover if we don't
	have a consistent state
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 794347f5e3b5ce5b94a886f107cb04647aaac281
Author:     Wen Congyang <wency@cn.fujitsu.com>
AuthorDate: Tue Jan 19 15:17:37 2016 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 17:08:36 2016 +0000

    remus: don't do failover if we don't have a consistent state
    
    We will have a consistent state when a CHECKPOINT_END record
    is received. After the first CHECKPOINT_END record is received,
    we will buffer all records until the next CHECKPOINT_END record
    is received. So if the checkpoint() callback returns XGR_CHECKPOINT_FAILOVER,
    we only can do failover if ctx->restore.buffer_all_records is
    true.
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxc/xc_sr_restore.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index 05159bb..6ccdab9 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -493,7 +493,11 @@ static int handle_checkpoint(struct xc_sr_context *ctx)
         break;
 
     case XGR_CHECKPOINT_FAILOVER:
-        rc = BROKEN_CHANNEL;
+        if ( ctx->restore.buffer_all_records )
+            rc = BROKEN_CHANNEL;
+        else
+            /* We don't have a consistent state */
+            rc = -1;
         goto err;
 
     default: /* Other fatal error */
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:11:40 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10: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 1aON4e-0008Ih-KZ; Wed, 27 Jan 2016 10: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 1aON4c-0008IS-Sc
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:39 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	A2/6D-08479-AD798A65; Wed, 27 Jan 2016 10:11:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1453889495!18449218!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42277 invoked from network); 27 Jan 2016 10:11:37 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:11:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5Q-0001pL-U2
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON4Y-00016O-Ji
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:34 +0000
Date: Wed, 27 Jan 2016 10:11:34 +0000
Message-Id: <E1aON4Y-00016O-Ji@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remus: don't do failover if we don't
	have a consistent state
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 794347f5e3b5ce5b94a886f107cb04647aaac281
Author:     Wen Congyang <wency@cn.fujitsu.com>
AuthorDate: Tue Jan 19 15:17:37 2016 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 17:08:36 2016 +0000

    remus: don't do failover if we don't have a consistent state
    
    We will have a consistent state when a CHECKPOINT_END record
    is received. After the first CHECKPOINT_END record is received,
    we will buffer all records until the next CHECKPOINT_END record
    is received. So if the checkpoint() callback returns XGR_CHECKPOINT_FAILOVER,
    we only can do failover if ctx->restore.buffer_all_records is
    true.
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxc/xc_sr_restore.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index 05159bb..6ccdab9 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -493,7 +493,11 @@ static int handle_checkpoint(struct xc_sr_context *ctx)
         break;
 
     case XGR_CHECKPOINT_FAILOVER:
-        rc = BROKEN_CHANNEL;
+        if ( ctx->restore.buffer_all_records )
+            rc = BROKEN_CHANNEL;
+        else
+            /* We don't have a consistent state */
+            rc = -1;
         goto err;
 
     default: /* Other fatal error */
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:11:55 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:11: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 1aON4t-0008LD-PP; Wed, 27 Jan 2016 10:11: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 1aON4s-0008L3-8C
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:54 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	D3/59-08977-9E798A65; Wed, 27 Jan 2016 10:11:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1453889509!12391165!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39501 invoked from network); 27 Jan 2016 10:11:52 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:11:52 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5b-0001pP-BZ
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON4j-000175-42
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:45 +0000
Date: Wed, 27 Jan 2016 10:11:45 +0000
Message-Id: <E1aON4j-000175-42@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remus: don't call stream_continue()
	when doing failover
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 974af7db71fadb8456f17ae5a6ab40b80c48b3be
Author:     Wen Congyang <wency@cn.fujitsu.com>
AuthorDate: Tue Jan 19 15:17:38 2016 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 17:08:55 2016 +0000

    remus: don't call stream_continue() when doing failover
    
    stream_continue() is used for migration to read emulator
    xenstore data and emulator context. For remus, if we do
    failover, we have read it in the checkpoint cycle, and
    we only need to complete the stream.
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_stream_read.c |   36 +++++++++++++++++++++++++++++++-----
 1 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 258dec4..dac134e 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -104,6 +104,20 @@
  * Depending on the contents of the stream, there are likely to be several
  * parallel tasks being managed.  check_all_finished() is used to join all
  * tasks in both success and error cases.
+ *
+ * Failover for remus
+ *  - We buffer all records until a CHECKPOINT_END record is received
+ *  - We will consume the buffered records when a CHECKPOINT_END record
+ *    is received
+ *  - If we find some internal error, then rc or retval is not 0 in
+ *    libxl__xc_domain_restore_done(). In this case, we don't resume the
+ *    guest
+ *  - If we need to do failover from primary, then rc and retval are both
+ *    0 in libxl__xc_domain_restore_done(). In this case, the buffered
+ *    state will be dropped, because we haven't received a CHECKPOINT_END
+ *    record, and therefore the buffered state is inconsistent. In
+ *    libxl__xc_domain_restore_done(), we just complete the stream and
+ *    stream->completion_callback() will be called to resume the guest
  */
 
 /* Success/error/cleanup handling. */
@@ -758,6 +772,9 @@ void libxl__xc_domain_restore_done(libxl__egc *egc, void *dcs_void,
     libxl__stream_read_state *stream = &dcs->srs;
     STATE_AO_GC(dcs->ao);
 
+    /* convenience aliases */
+    const int checkpointed_stream = dcs->restore_params.checkpointed_stream;
+
     if (rc)
         goto err;
 
@@ -777,11 +794,20 @@ void libxl__xc_domain_restore_done(libxl__egc *egc, void *dcs_void,
      * If the stream is not still alive, we must not continue any work.
      */
     if (libxl__stream_read_inuse(stream)) {
-        /*
-         * Libxc has indicated that it is done with the stream.  Resume reading
-         * libxl records from it.
-         */
-        stream_continue(egc, stream);
+        if (checkpointed_stream) {
+            /*
+             * Failover from primary. Domain state is currently at a
+             * consistent checkpoint, complete the stream, and call
+             * stream->completion_callback() to resume the guest.
+             */
+            stream_complete(egc, stream, 0);
+        } else {
+            /*
+             * Libxc has indicated that it is done with the stream.
+             * Resume reading libxl records from it.
+             */
+            stream_continue(egc, stream);
+        }
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:11:55 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:11: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 1aON4t-0008LD-PP; Wed, 27 Jan 2016 10:11: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 1aON4s-0008L3-8C
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:54 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	D3/59-08977-9E798A65; Wed, 27 Jan 2016 10:11:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1453889509!12391165!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39501 invoked from network); 27 Jan 2016 10:11:52 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:11:52 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5b-0001pP-BZ
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON4j-000175-42
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:45 +0000
Date: Wed, 27 Jan 2016 10:11:45 +0000
Message-Id: <E1aON4j-000175-42@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remus: don't call stream_continue()
	when doing failover
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 974af7db71fadb8456f17ae5a6ab40b80c48b3be
Author:     Wen Congyang <wency@cn.fujitsu.com>
AuthorDate: Tue Jan 19 15:17:38 2016 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 17:08:55 2016 +0000

    remus: don't call stream_continue() when doing failover
    
    stream_continue() is used for migration to read emulator
    xenstore data and emulator context. For remus, if we do
    failover, we have read it in the checkpoint cycle, and
    we only need to complete the stream.
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_stream_read.c |   36 +++++++++++++++++++++++++++++++-----
 1 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c
index 258dec4..dac134e 100644
--- a/tools/libxl/libxl_stream_read.c
+++ b/tools/libxl/libxl_stream_read.c
@@ -104,6 +104,20 @@
  * Depending on the contents of the stream, there are likely to be several
  * parallel tasks being managed.  check_all_finished() is used to join all
  * tasks in both success and error cases.
+ *
+ * Failover for remus
+ *  - We buffer all records until a CHECKPOINT_END record is received
+ *  - We will consume the buffered records when a CHECKPOINT_END record
+ *    is received
+ *  - If we find some internal error, then rc or retval is not 0 in
+ *    libxl__xc_domain_restore_done(). In this case, we don't resume the
+ *    guest
+ *  - If we need to do failover from primary, then rc and retval are both
+ *    0 in libxl__xc_domain_restore_done(). In this case, the buffered
+ *    state will be dropped, because we haven't received a CHECKPOINT_END
+ *    record, and therefore the buffered state is inconsistent. In
+ *    libxl__xc_domain_restore_done(), we just complete the stream and
+ *    stream->completion_callback() will be called to resume the guest
  */
 
 /* Success/error/cleanup handling. */
@@ -758,6 +772,9 @@ void libxl__xc_domain_restore_done(libxl__egc *egc, void *dcs_void,
     libxl__stream_read_state *stream = &dcs->srs;
     STATE_AO_GC(dcs->ao);
 
+    /* convenience aliases */
+    const int checkpointed_stream = dcs->restore_params.checkpointed_stream;
+
     if (rc)
         goto err;
 
@@ -777,11 +794,20 @@ void libxl__xc_domain_restore_done(libxl__egc *egc, void *dcs_void,
      * If the stream is not still alive, we must not continue any work.
      */
     if (libxl__stream_read_inuse(stream)) {
-        /*
-         * Libxc has indicated that it is done with the stream.  Resume reading
-         * libxl records from it.
-         */
-        stream_continue(egc, stream);
+        if (checkpointed_stream) {
+            /*
+             * Failover from primary. Domain state is currently at a
+             * consistent checkpoint, complete the stream, and call
+             * stream->completion_callback() to resume the guest.
+             */
+            stream_complete(egc, stream, 0);
+        } else {
+            /*
+             * Libxc has indicated that it is done with the stream.
+             * Resume reading libxl records from it.
+             */
+            stream_continue(egc, stream);
+        }
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:11:59 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:11:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aON4x-0008MD-Tw; Wed, 27 Jan 2016 10:11: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 1aON4v-0008Ln-Uq
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:58 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	99/EE-21901-DE798A65; Wed, 27 Jan 2016 10:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1453889515!18156139!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23475 invoked from network); 27 Jan 2016 10:11:56 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:11:56 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5l-0001qC-Nk
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON4t-00017q-H7
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:55 +0000
Date: Wed, 27 Jan 2016 10:11:55 +0000
Message-Id: <E1aON4t-00017q-H7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remus: resume immediately if
	libxl__xc_domain_save_done() completes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e73a85e0b45880b98406827d8478a20227977403
Author:     Wen Congyang <wency@cn.fujitsu.com>
AuthorDate: Tue Jan 19 15:17:39 2016 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 17:09:48 2016 +0000

    remus: resume immediately if libxl__xc_domain_save_done() completes
    
    For example: if the secondary host is down, and we fail to send the data to
    the secondary host. xc_domain_save() returns 0. So in the function
    libxl__xc_domain_save_done(), rc is 0 (the helper program exits normally),
    and retval is 0 (it is xc_domain_save()'s return value). In such case, we
    just need to complete the stream.
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- updated wording of comment as discussed ]
---
 tools/libxl/libxl.h              |    5 +++++
 tools/libxl/libxl_stream_write.c |   14 ++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 7114491..156c0d5 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -1215,6 +1215,11 @@ int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid, int suspend_cancel,
                         const libxl_asyncop_how *ao_how)
                         LIBXL_EXTERNAL_CALLERS_ONLY;
 
+/*
+ * This function doesn't return unless something has gone wrong with
+ * the replication to the secondary. If this function returns then the
+ * caller should resume the (primary) domain.
+ */
 int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
                              uint32_t domid, int send_fd, int recv_fd,
                              const libxl_asyncop_how *ao_how)
diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c
index 80d9208..21b4b51 100644
--- a/tools/libxl/libxl_stream_write.c
+++ b/tools/libxl/libxl_stream_write.c
@@ -354,8 +354,18 @@ void libxl__xc_domain_save_done(libxl__egc *egc, void *dss_void,
      * alive, and check_all_finished() may have torn it down around us.
      * If the stream is not still alive, we must not continue any work.
      */
-    if (libxl__stream_write_inuse(stream))
-        write_emulator_xenstore_record(egc, stream);
+    if (libxl__stream_write_inuse(stream)) {
+        if (dss->remus)
+            /*
+             * For remus, if libxl__xc_domain_save_done() completes,
+             * there was an error sending data to the secondary.
+             * Resume the primary ASAP. The caller doesn't care of the
+             * return value (Please refer to libxl__remus_teardown())
+             */
+            stream_complete(egc, stream, 0);
+        else
+            write_emulator_xenstore_record(egc, stream);
+    }
 }
 
 static void write_emulator_xenstore_record(libxl__egc *egc,
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:11:59 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:11:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aON4x-0008MD-Tw; Wed, 27 Jan 2016 10:11: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 1aON4v-0008Ln-Uq
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:58 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	99/EE-21901-DE798A65; Wed, 27 Jan 2016 10:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1453889515!18156139!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23475 invoked from network); 27 Jan 2016 10:11:56 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:11:56 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5l-0001qC-Nk
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON4t-00017q-H7
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:11:55 +0000
Date: Wed, 27 Jan 2016 10:11:55 +0000
Message-Id: <E1aON4t-00017q-H7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remus: resume immediately if
	libxl__xc_domain_save_done() completes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e73a85e0b45880b98406827d8478a20227977403
Author:     Wen Congyang <wency@cn.fujitsu.com>
AuthorDate: Tue Jan 19 15:17:39 2016 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 17:09:48 2016 +0000

    remus: resume immediately if libxl__xc_domain_save_done() completes
    
    For example: if the secondary host is down, and we fail to send the data to
    the secondary host. xc_domain_save() returns 0. So in the function
    libxl__xc_domain_save_done(), rc is 0 (the helper program exits normally),
    and retval is 0 (it is xc_domain_save()'s return value). In such case, we
    just need to complete the stream.
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- updated wording of comment as discussed ]
---
 tools/libxl/libxl.h              |    5 +++++
 tools/libxl/libxl_stream_write.c |   14 ++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 7114491..156c0d5 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -1215,6 +1215,11 @@ int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid, int suspend_cancel,
                         const libxl_asyncop_how *ao_how)
                         LIBXL_EXTERNAL_CALLERS_ONLY;
 
+/*
+ * This function doesn't return unless something has gone wrong with
+ * the replication to the secondary. If this function returns then the
+ * caller should resume the (primary) domain.
+ */
 int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
                              uint32_t domid, int send_fd, int recv_fd,
                              const libxl_asyncop_how *ao_how)
diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c
index 80d9208..21b4b51 100644
--- a/tools/libxl/libxl_stream_write.c
+++ b/tools/libxl/libxl_stream_write.c
@@ -354,8 +354,18 @@ void libxl__xc_domain_save_done(libxl__egc *egc, void *dss_void,
      * alive, and check_all_finished() may have torn it down around us.
      * If the stream is not still alive, we must not continue any work.
      */
-    if (libxl__stream_write_inuse(stream))
-        write_emulator_xenstore_record(egc, stream);
+    if (libxl__stream_write_inuse(stream)) {
+        if (dss->remus)
+            /*
+             * For remus, if libxl__xc_domain_save_done() completes,
+             * there was an error sending data to the secondary.
+             * Resume the primary ASAP. The caller doesn't care of the
+             * return value (Please refer to libxl__remus_teardown())
+             */
+            stream_complete(egc, stream, 0);
+        else
+            write_emulator_xenstore_record(egc, stream);
+    }
 }
 
 static void write_emulator_xenstore_record(libxl__egc *egc,
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:12:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10: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 1aON57-0008OH-JJ; Wed, 27 Jan 2016 10: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 1aON56-0008Nk-Mh
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:08 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	6E/35-18633-7F798A65; Wed, 27 Jan 2016 10:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1453889526!18177038!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41918 invoked from network); 27 Jan 2016 10:12:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:12:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5w-0001qN-54
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON53-00018X-SH
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:05 +0000
Date: Wed, 27 Jan 2016 10:12:05 +0000
Message-Id: <E1aON53-00018X-SH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: don't send end record if
	remus fails
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ea9d6304ac02fba7f55ef295d92b5d3fae94ad4
Author:     Wen Congyang <wency@cn.fujitsu.com>
AuthorDate: Tue Jan 19 15:17:40 2016 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 17:10:30 2016 +0000

    tools/libxc: don't send end record if remus fails
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_sr_save.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index 88d85ef..e532168 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -795,7 +795,7 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type)
 
             rc = ctx->save.callbacks->checkpoint(ctx->save.callbacks->data);
             if ( rc <= 0 )
-                ctx->save.checkpointed = false;
+                goto err;
         }
     } while ( ctx->save.checkpointed );
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:12:09 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10: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 1aON57-0008OH-JJ; Wed, 27 Jan 2016 10: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 1aON56-0008Nk-Mh
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:08 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	6E/35-18633-7F798A65; Wed, 27 Jan 2016 10:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1453889526!18177038!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41918 invoked from network); 27 Jan 2016 10:12:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:12:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5w-0001qN-54
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON53-00018X-SH
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:05 +0000
Date: Wed, 27 Jan 2016 10:12:05 +0000
Message-Id: <E1aON53-00018X-SH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: don't send end record if
	remus fails
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ea9d6304ac02fba7f55ef295d92b5d3fae94ad4
Author:     Wen Congyang <wency@cn.fujitsu.com>
AuthorDate: Tue Jan 19 15:17:40 2016 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 17:10:30 2016 +0000

    tools/libxc: don't send end record if remus fails
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_sr_save.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index 88d85ef..e532168 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -795,7 +795,7 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type)
 
             rc = ctx->save.callbacks->checkpoint(ctx->save.callbacks->data);
             if ( rc <= 0 )
-                ctx->save.checkpointed = false;
+                goto err;
         }
     } while ( ctx->save.checkpointed );
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:12:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:12:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aON5I-0008R8-Nn; Wed, 27 Jan 2016 10:12: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 1aON5G-0008Qe-To
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:19 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	3C/37-03225-20898A65; Wed, 27 Jan 2016 10:12:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1453889536!18462144!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39563 invoked from network); 27 Jan 2016 10:12:17 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:12:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON66-0001r2-FF
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5E-00019Z-9A
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:16 +0000
Date: Wed, 27 Jan 2016 10:12:16 +0000
Message-Id: <E1aON5E-00019Z-9A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: error handling for the
	postcopy() 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 8bb1c7abdaa2a5654a44a76da60d5bd233026919
Author:     Wen Congyang <wency@cn.fujitsu.com>
AuthorDate: Tue Jan 19 15:17:41 2016 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 17:10:30 2016 +0000

    tools/libxc: error handling for the postcopy() callback
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_sr_save.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index e532168..e4ba560 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -791,7 +791,9 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type)
             if ( rc )
                 goto err;
 
-            ctx->save.callbacks->postcopy(ctx->save.callbacks->data);
+            rc = ctx->save.callbacks->postcopy(ctx->save.callbacks->data);
+            if ( rc <= 0 )
+                goto err;
 
             rc = ctx->save.callbacks->checkpoint(ctx->save.callbacks->data);
             if ( rc <= 0 )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:12:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:12:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aON5I-0008R8-Nn; Wed, 27 Jan 2016 10:12: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 1aON5G-0008Qe-To
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:19 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	3C/37-03225-20898A65; Wed, 27 Jan 2016 10:12:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1453889536!18462144!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39563 invoked from network); 27 Jan 2016 10:12:17 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:12:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON66-0001r2-FF
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5E-00019Z-9A
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:16 +0000
Date: Wed, 27 Jan 2016 10:12:16 +0000
Message-Id: <E1aON5E-00019Z-9A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: error handling for the
	postcopy() 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 8bb1c7abdaa2a5654a44a76da60d5bd233026919
Author:     Wen Congyang <wency@cn.fujitsu.com>
AuthorDate: Tue Jan 19 15:17:41 2016 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 17:10:30 2016 +0000

    tools/libxc: error handling for the postcopy() callback
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_sr_save.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index e532168..e4ba560 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -791,7 +791,9 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type)
             if ( rc )
                 goto err;
 
-            ctx->save.callbacks->postcopy(ctx->save.callbacks->data);
+            rc = ctx->save.callbacks->postcopy(ctx->save.callbacks->data);
+            if ( rc <= 0 )
+                goto err;
 
             rc = ctx->save.callbacks->checkpoint(ctx->save.callbacks->data);
             if ( rc <= 0 )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:12:47 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:12: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 1aON5i-0008Ut-T8; Wed, 27 Jan 2016 10:12: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 1aON5h-0008Ul-Gn
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:45 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	61/51-31122-C1898A65; Wed, 27 Jan 2016 10:12:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1453889550!12353881!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48401 invoked from network); 27 Jan 2016 10:12:43 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:12:43 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6G-0001rA-Vp
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5O-0001A4-O7
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:26 +0000
Date: Wed, 27 Jan 2016 10:12:26 +0000
Message-Id: <E1aON5O-0001A4-O7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: remove unused function
	libxl__domain_save_device_model()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fa86649c4800bac92c7ba69ec8a16475df3e76f7
Author:     Wen Congyang <wency@cn.fujitsu.com>
AuthorDate: Tue Jan 19 15:17:42 2016 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 17:10:30 2016 +0000

    tools/libxl: remove unused function libxl__domain_save_device_model()
    
    After the commit d77570e7, libxl__domain_save_device_model() is
    completely unused and can be dropped.
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c          |    4 --
 tools/libxl/libxl_dom.c      |   91 ------------------------------------------
 tools/libxl/libxl_internal.h |    6 ---
 3 files changed, 0 insertions(+), 101 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index a8718b0..901e8eb 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1550,10 +1550,6 @@ static void stubdom_destroy_callback(libxl__egc *egc,
     dds->stubdom_finished = 1;
     savefile = libxl__device_model_savefile(gc, dis->domid);
     rc = libxl__remove_file(gc, savefile);
-    /*
-     * On suspend libxl__domain_save_device_model will have already
-     * unlinked the save file.
-     */
     if (rc) {
         LOG(ERROR, "failed to remove device-model savefile %s", savefile);
     }
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 47971a9..2269998 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1785,97 +1785,6 @@ static void stream_done(libxl__egc *egc,
     domain_save_done(egc, sws->dss, rc);
 }
 
-static void save_device_model_datacopier_done(libxl__egc *egc,
-     libxl__datacopier_state *dc, int rc, int onwrite, int errnoval);
-
-void libxl__domain_save_device_model(libxl__egc *egc,
-                                     libxl__domain_suspend_state *dss,
-                                     libxl__save_device_model_cb *callback)
-{
-    STATE_AO_GC(dss->ao);
-    struct stat st;
-    uint32_t qemu_state_len;
-    int rc;
-
-    dss->save_dm_callback = callback;
-
-    /* Convenience aliases */
-    const char *const filename = dss->dm_savefile;
-    const int fd = dss->fd;
-
-    libxl__datacopier_state *dc = &dss->save_dm_datacopier;
-    memset(dc, 0, sizeof(*dc));
-    dc->readwhat = GCSPRINTF("qemu save file %s", filename);
-    dc->ao = ao;
-    dc->readfd = -1;
-    dc->writefd = fd;
-    dc->maxsz = INT_MAX;
-    dc->bytes_to_read = -1;
-    dc->copywhat = GCSPRINTF("qemu save file for domain %"PRIu32, dss->domid);
-    dc->writewhat = "save/migration stream";
-    dc->callback = save_device_model_datacopier_done;
-
-    dc->readfd = open(filename, O_RDONLY);
-    if (dc->readfd < 0) {
-        LOGE(ERROR, "unable to open %s", dc->readwhat);
-        rc = ERROR_FAIL;
-        goto out;
-    }
-
-    if (fstat(dc->readfd, &st))
-    {
-        LOGE(ERROR, "unable to fstat %s", dc->readwhat);
-        rc = ERROR_FAIL;
-        goto out;
-    }
-
-    if (!S_ISREG(st.st_mode)) {
-        LOG(ERROR, "%s is not a plain file!", dc->readwhat);
-        rc = ERROR_FAIL;
-        goto out;
-    }
-
-    qemu_state_len = st.st_size;
-    LOG(DEBUG, "%s is %d bytes", dc->readwhat, qemu_state_len);
-
-    rc = libxl__datacopier_start(dc);
-    if (rc) goto out;
-
-    libxl__datacopier_prefixdata(egc, dc,
-                                 QEMU_SIGNATURE, strlen(QEMU_SIGNATURE));
-
-    libxl__datacopier_prefixdata(egc, dc,
-                                 &qemu_state_len, sizeof(qemu_state_len));
-    return;
-
- out:
-    save_device_model_datacopier_done(egc, dc, rc, -1, EIO);
-}
-
-static void save_device_model_datacopier_done(libxl__egc *egc,
-     libxl__datacopier_state *dc, int our_rc, int onwrite, int errnoval)
-{
-    libxl__domain_suspend_state *dss =
-        CONTAINER_OF(dc, *dss, save_dm_datacopier);
-    STATE_AO_GC(dss->ao);
-
-    /* Convenience aliases */
-    const char *const filename = dss->dm_savefile;
-    int rc;
-
-    libxl__datacopier_kill(dc);
-
-    if (dc->readfd >= 0) {
-        close(dc->readfd);
-        dc->readfd = -1;
-    }
-
-    rc = libxl__remove_file(gc, filename);
-    if (!our_rc) our_rc = rc;
-
-    dss->save_dm_callback(egc, dss, our_rc);
-}
-
 static void libxl__remus_teardown(libxl__egc *egc,
                                   libxl__domain_suspend_state *dss,
                                   int rc);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index a556a38..233d44a 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3103,9 +3103,6 @@ struct libxl__domain_suspend_state {
     libxl__logdirty_switch logdirty;
     void (*callback_common_done)(libxl__egc*,
                                  struct libxl__domain_suspend_state*, int ok);
-    /* private for libxl__domain_save_device_model */
-    libxl__save_device_model_cb *save_dm_callback;
-    libxl__datacopier_state save_dm_datacopier;
 };
 
 
@@ -3498,9 +3495,6 @@ static inline bool libxl__save_helper_inuse(const libxl__save_helper_state *shs)
 /* Each time the dm needs to be saved, we must call suspend and then save */
 _hidden int libxl__domain_suspend_device_model(libxl__gc *gc,
                                            libxl__domain_suspend_state *dss);
-_hidden void libxl__domain_save_device_model(libxl__egc *egc,
-                                     libxl__domain_suspend_state *dss,
-                                     libxl__save_device_model_cb *callback);
 
 _hidden const char *libxl__device_model_savefile(libxl__gc *gc, uint32_t domid);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:12:47 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:12: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 1aON5i-0008Ut-T8; Wed, 27 Jan 2016 10:12: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 1aON5h-0008Ul-Gn
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:45 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	61/51-31122-C1898A65; Wed, 27 Jan 2016 10:12:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1453889550!12353881!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48401 invoked from network); 27 Jan 2016 10:12:43 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:12:43 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6G-0001rA-Vp
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5O-0001A4-O7
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:26 +0000
Date: Wed, 27 Jan 2016 10:12:26 +0000
Message-Id: <E1aON5O-0001A4-O7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: remove unused function
	libxl__domain_save_device_model()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fa86649c4800bac92c7ba69ec8a16475df3e76f7
Author:     Wen Congyang <wency@cn.fujitsu.com>
AuthorDate: Tue Jan 19 15:17:42 2016 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jan 20 17:10:30 2016 +0000

    tools/libxl: remove unused function libxl__domain_save_device_model()
    
    After the commit d77570e7, libxl__domain_save_device_model() is
    completely unused and can be dropped.
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c          |    4 --
 tools/libxl/libxl_dom.c      |   91 ------------------------------------------
 tools/libxl/libxl_internal.h |    6 ---
 3 files changed, 0 insertions(+), 101 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index a8718b0..901e8eb 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1550,10 +1550,6 @@ static void stubdom_destroy_callback(libxl__egc *egc,
     dds->stubdom_finished = 1;
     savefile = libxl__device_model_savefile(gc, dis->domid);
     rc = libxl__remove_file(gc, savefile);
-    /*
-     * On suspend libxl__domain_save_device_model will have already
-     * unlinked the save file.
-     */
     if (rc) {
         LOG(ERROR, "failed to remove device-model savefile %s", savefile);
     }
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 47971a9..2269998 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1785,97 +1785,6 @@ static void stream_done(libxl__egc *egc,
     domain_save_done(egc, sws->dss, rc);
 }
 
-static void save_device_model_datacopier_done(libxl__egc *egc,
-     libxl__datacopier_state *dc, int rc, int onwrite, int errnoval);
-
-void libxl__domain_save_device_model(libxl__egc *egc,
-                                     libxl__domain_suspend_state *dss,
-                                     libxl__save_device_model_cb *callback)
-{
-    STATE_AO_GC(dss->ao);
-    struct stat st;
-    uint32_t qemu_state_len;
-    int rc;
-
-    dss->save_dm_callback = callback;
-
-    /* Convenience aliases */
-    const char *const filename = dss->dm_savefile;
-    const int fd = dss->fd;
-
-    libxl__datacopier_state *dc = &dss->save_dm_datacopier;
-    memset(dc, 0, sizeof(*dc));
-    dc->readwhat = GCSPRINTF("qemu save file %s", filename);
-    dc->ao = ao;
-    dc->readfd = -1;
-    dc->writefd = fd;
-    dc->maxsz = INT_MAX;
-    dc->bytes_to_read = -1;
-    dc->copywhat = GCSPRINTF("qemu save file for domain %"PRIu32, dss->domid);
-    dc->writewhat = "save/migration stream";
-    dc->callback = save_device_model_datacopier_done;
-
-    dc->readfd = open(filename, O_RDONLY);
-    if (dc->readfd < 0) {
-        LOGE(ERROR, "unable to open %s", dc->readwhat);
-        rc = ERROR_FAIL;
-        goto out;
-    }
-
-    if (fstat(dc->readfd, &st))
-    {
-        LOGE(ERROR, "unable to fstat %s", dc->readwhat);
-        rc = ERROR_FAIL;
-        goto out;
-    }
-
-    if (!S_ISREG(st.st_mode)) {
-        LOG(ERROR, "%s is not a plain file!", dc->readwhat);
-        rc = ERROR_FAIL;
-        goto out;
-    }
-
-    qemu_state_len = st.st_size;
-    LOG(DEBUG, "%s is %d bytes", dc->readwhat, qemu_state_len);
-
-    rc = libxl__datacopier_start(dc);
-    if (rc) goto out;
-
-    libxl__datacopier_prefixdata(egc, dc,
-                                 QEMU_SIGNATURE, strlen(QEMU_SIGNATURE));
-
-    libxl__datacopier_prefixdata(egc, dc,
-                                 &qemu_state_len, sizeof(qemu_state_len));
-    return;
-
- out:
-    save_device_model_datacopier_done(egc, dc, rc, -1, EIO);
-}
-
-static void save_device_model_datacopier_done(libxl__egc *egc,
-     libxl__datacopier_state *dc, int our_rc, int onwrite, int errnoval)
-{
-    libxl__domain_suspend_state *dss =
-        CONTAINER_OF(dc, *dss, save_dm_datacopier);
-    STATE_AO_GC(dss->ao);
-
-    /* Convenience aliases */
-    const char *const filename = dss->dm_savefile;
-    int rc;
-
-    libxl__datacopier_kill(dc);
-
-    if (dc->readfd >= 0) {
-        close(dc->readfd);
-        dc->readfd = -1;
-    }
-
-    rc = libxl__remove_file(gc, filename);
-    if (!our_rc) our_rc = rc;
-
-    dss->save_dm_callback(egc, dss, our_rc);
-}
-
 static void libxl__remus_teardown(libxl__egc *egc,
                                   libxl__domain_suspend_state *dss,
                                   int rc);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index a556a38..233d44a 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3103,9 +3103,6 @@ struct libxl__domain_suspend_state {
     libxl__logdirty_switch logdirty;
     void (*callback_common_done)(libxl__egc*,
                                  struct libxl__domain_suspend_state*, int ok);
-    /* private for libxl__domain_save_device_model */
-    libxl__save_device_model_cb *save_dm_callback;
-    libxl__datacopier_state save_dm_datacopier;
 };
 
 
@@ -3498,9 +3495,6 @@ static inline bool libxl__save_helper_inuse(const libxl__save_helper_state *shs)
 /* Each time the dm needs to be saved, we must call suspend and then save */
 _hidden int libxl__domain_suspend_device_model(libxl__gc *gc,
                                            libxl__domain_suspend_state *dss);
-_hidden void libxl__domain_save_device_model(libxl__egc *egc,
-                                     libxl__domain_suspend_state *dss,
-                                     libxl__save_device_model_cb *callback);
 
 _hidden const char *libxl__device_model_savefile(libxl__gc *gc, uint32_t domid);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:12:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:12:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aON5l-0008Vk-3Z; Wed, 27 Jan 2016 10:12: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 1aON5j-0008Ul-GU
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:47 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	61/61-31122-F1898A65; Wed, 27 Jan 2016 10:12:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1453889559!12358393!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23914 invoked from network); 27 Jan 2016 10:12:45 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:12:45 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6R-0001rE-Bh
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5Z-0001AT-58
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:37 +0000
Date: Wed, 27 Jan 2016 10:12:37 +0000
Message-Id: <E1aON5Z-0001AT-58@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: hook the schedulers into Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f3187f83d3e74fa5cfa40f790f08d564c219e124
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Thu Jan 21 16:05:35 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:05:35 2016 +0100

    build: hook the schedulers into Kconfig
    
    Allow the schedulers to be independently enabled or disabled at
    compile-time. To match existing behavior, all four schedulers are
    compiled in by default, although the Credit2, RTDS, and ARINC653 are
    marked EXPERIMENTAL to match their not currently supported status.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 xen/common/Kconfig    |   55 +++++++++++++++++++++++++++++++++++++++++++++++++
 xen/common/Makefile   |    8 +++---
 xen/common/schedule.c |   12 +++++++++-
 3 files changed, 69 insertions(+), 6 deletions(-)

diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index eadfc3b..6f404b4 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -97,4 +97,59 @@ config XSM
 
 	  If unsure, say N.
 
+# Enable schedulers
+menu "Schedulers"
+	visible if EXPERT = "y"
+
+config SCHED_CREDIT
+	def_bool y
+	---help---
+	  The traditional credit scheduler is a general purpose scheduler.
+
+config SCHED_CREDIT2
+	bool "Credit2 scheduler support (EXPERIMENTAL)"
+	default y
+	---help---
+	  The credit2 scheduler is a general purpose scheduler that is
+	  optimized for lower latency and higher VM density.
+
+config SCHED_RTDS
+	bool "RTDS scheduler support (EXPERIMENTAL)"
+	default y
+	---help---
+	  The RTDS scheduler is a soft and firm real-time scheduler for
+	  multicore, targeted for embedded, automotive, graphics and gaming
+	  in the cloud, and general low-latency workloads.
+
+config SCHED_ARINC653
+	bool "ARINC653 scheduler support (EXPERIMENTAL)"
+	default y
+	---help---
+	  The ARINC653 scheduler is a hard real-time scheduler for single
+	  cores, targeted for avionics, drones, and medical devices.
+
+choice
+	prompt "Default Scheduler?"
+	default SCHED_CREDIT_DEFAULT 
+
+	config SCHED_CREDIT_DEFAULT
+		bool "Credit Scheduler" if SCHED_CREDIT
+	config SCHED_CREDIT2_DEFAULT
+		bool "Credit2 Scheduler" if SCHED_CREDIT2
+	config SCHED_RTDS_DEFAULT
+		bool "RT Scheduler" if SCHED_RTDS
+	config SCHED_ARINC653_DEFAULT
+		bool "ARINC653 Scheduler" if SCHED_ARINC653
+endchoice
+
+config SCHED_DEFAULT
+	string
+	default "credit" if SCHED_CREDIT_DEFAULT
+	default "credit2" if SCHED_CREDIT2_DEFAULT
+	default "rtds" if SCHED_RTDS_DEFAULT
+	default "arinc653" if SCHED_ARINC653_DEFAULT
+	default "credit"
+
+endmenu
+
 endmenu
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 9f8b214..4df71ee 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -30,10 +30,10 @@ obj-y += rangeset.o
 obj-y += radix-tree.o
 obj-y += rbtree.o
 obj-y += rcupdate.o
-obj-y += sched_credit.o
-obj-y += sched_credit2.o
-obj-y += sched_arinc653.o
-obj-y += sched_rt.o
+obj-$(CONFIG_SCHED_ARINC653) += sched_arinc653.o
+obj-$(CONFIG_SCHED_CREDIT) += sched_credit.o
+obj-$(CONFIG_SCHED_CREDIT2) += sched_credit2.o
+obj-$(CONFIG_SCHED_RTDS) += sched_rt.o
 obj-y += schedule.o
 obj-y += shutdown.o
 obj-y += softirq.o
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index d121896..2f98a48 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -38,8 +38,8 @@
 #include <public/sched.h>
 #include <xsm/xsm.h>
 
-/* opt_sched: scheduler - default to credit */
-static char __initdata opt_sched[10] = "credit";
+/* opt_sched: scheduler - default to configured value */
+static char __initdata opt_sched[10] = CONFIG_SCHED_DEFAULT;
 string_param("sched", opt_sched);
 
 /* if sched_smt_power_savings is set,
@@ -65,10 +65,18 @@ DEFINE_PER_CPU(struct schedule_data, schedule_data);
 DEFINE_PER_CPU(struct scheduler *, scheduler);
 
 static const struct scheduler *schedulers[] = {
+#ifdef CONFIG_SCHED_CREDIT
     &sched_credit_def,
+#endif
+#ifdef CONFIG_SCHED_CREDIT2
     &sched_credit2_def,
+#endif
+#ifdef CONFIG_SCHED_ARINC653
     &sched_arinc653_def,
+#endif
+#ifdef CONFIG_SCHED_RTDS
     &sched_rtds_def,
+#endif
 };
 
 static struct scheduler __read_mostly ops;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:12:49 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:12:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aON5l-0008Vk-3Z; Wed, 27 Jan 2016 10:12: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 1aON5j-0008Ul-GU
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:47 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	61/61-31122-F1898A65; Wed, 27 Jan 2016 10:12:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1453889559!12358393!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23914 invoked from network); 27 Jan 2016 10:12:45 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:12:45 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6R-0001rE-Bh
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5Z-0001AT-58
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:37 +0000
Date: Wed, 27 Jan 2016 10:12:37 +0000
Message-Id: <E1aON5Z-0001AT-58@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: hook the schedulers into Kconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f3187f83d3e74fa5cfa40f790f08d564c219e124
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Thu Jan 21 16:05:35 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:05:35 2016 +0100

    build: hook the schedulers into Kconfig
    
    Allow the schedulers to be independently enabled or disabled at
    compile-time. To match existing behavior, all four schedulers are
    compiled in by default, although the Credit2, RTDS, and ARINC653 are
    marked EXPERIMENTAL to match their not currently supported status.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 xen/common/Kconfig    |   55 +++++++++++++++++++++++++++++++++++++++++++++++++
 xen/common/Makefile   |    8 +++---
 xen/common/schedule.c |   12 +++++++++-
 3 files changed, 69 insertions(+), 6 deletions(-)

diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index eadfc3b..6f404b4 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -97,4 +97,59 @@ config XSM
 
 	  If unsure, say N.
 
+# Enable schedulers
+menu "Schedulers"
+	visible if EXPERT = "y"
+
+config SCHED_CREDIT
+	def_bool y
+	---help---
+	  The traditional credit scheduler is a general purpose scheduler.
+
+config SCHED_CREDIT2
+	bool "Credit2 scheduler support (EXPERIMENTAL)"
+	default y
+	---help---
+	  The credit2 scheduler is a general purpose scheduler that is
+	  optimized for lower latency and higher VM density.
+
+config SCHED_RTDS
+	bool "RTDS scheduler support (EXPERIMENTAL)"
+	default y
+	---help---
+	  The RTDS scheduler is a soft and firm real-time scheduler for
+	  multicore, targeted for embedded, automotive, graphics and gaming
+	  in the cloud, and general low-latency workloads.
+
+config SCHED_ARINC653
+	bool "ARINC653 scheduler support (EXPERIMENTAL)"
+	default y
+	---help---
+	  The ARINC653 scheduler is a hard real-time scheduler for single
+	  cores, targeted for avionics, drones, and medical devices.
+
+choice
+	prompt "Default Scheduler?"
+	default SCHED_CREDIT_DEFAULT 
+
+	config SCHED_CREDIT_DEFAULT
+		bool "Credit Scheduler" if SCHED_CREDIT
+	config SCHED_CREDIT2_DEFAULT
+		bool "Credit2 Scheduler" if SCHED_CREDIT2
+	config SCHED_RTDS_DEFAULT
+		bool "RT Scheduler" if SCHED_RTDS
+	config SCHED_ARINC653_DEFAULT
+		bool "ARINC653 Scheduler" if SCHED_ARINC653
+endchoice
+
+config SCHED_DEFAULT
+	string
+	default "credit" if SCHED_CREDIT_DEFAULT
+	default "credit2" if SCHED_CREDIT2_DEFAULT
+	default "rtds" if SCHED_RTDS_DEFAULT
+	default "arinc653" if SCHED_ARINC653_DEFAULT
+	default "credit"
+
+endmenu
+
 endmenu
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 9f8b214..4df71ee 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -30,10 +30,10 @@ obj-y += rangeset.o
 obj-y += radix-tree.o
 obj-y += rbtree.o
 obj-y += rcupdate.o
-obj-y += sched_credit.o
-obj-y += sched_credit2.o
-obj-y += sched_arinc653.o
-obj-y += sched_rt.o
+obj-$(CONFIG_SCHED_ARINC653) += sched_arinc653.o
+obj-$(CONFIG_SCHED_CREDIT) += sched_credit.o
+obj-$(CONFIG_SCHED_CREDIT2) += sched_credit2.o
+obj-$(CONFIG_SCHED_RTDS) += sched_rt.o
 obj-y += schedule.o
 obj-y += shutdown.o
 obj-y += softirq.o
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index d121896..2f98a48 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -38,8 +38,8 @@
 #include <public/sched.h>
 #include <xsm/xsm.h>
 
-/* opt_sched: scheduler - default to credit */
-static char __initdata opt_sched[10] = "credit";
+/* opt_sched: scheduler - default to configured value */
+static char __initdata opt_sched[10] = CONFIG_SCHED_DEFAULT;
 string_param("sched", opt_sched);
 
 /* if sched_smt_power_savings is set,
@@ -65,10 +65,18 @@ DEFINE_PER_CPU(struct schedule_data, schedule_data);
 DEFINE_PER_CPU(struct scheduler *, scheduler);
 
 static const struct scheduler *schedulers[] = {
+#ifdef CONFIG_SCHED_CREDIT
     &sched_credit_def,
+#endif
+#ifdef CONFIG_SCHED_CREDIT2
     &sched_credit2_def,
+#endif
+#ifdef CONFIG_SCHED_ARINC653
     &sched_arinc653_def,
+#endif
+#ifdef CONFIG_SCHED_RTDS
     &sched_rtds_def,
+#endif
 };
 
 static struct scheduler __read_mostly ops;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:12:55 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:12: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 1aON5r-00005O-7d; Wed, 27 Jan 2016 10:12:55 +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 1aON5p-00004w-Ar
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:53 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	BF/A1-21901-42898A65; Wed, 27 Jan 2016 10:12:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453889567!18191815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56178 invoked from network); 27 Jan 2016 10:12:48 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:12:48 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6b-0001rI-Lb
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5j-0001B1-FL
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:47 +0000
Date: Wed, 27 Jan 2016 10:12:47 +0000
Message-Id: <E1aON5j-0001B1-FL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: alloc space for sched list in
	the link 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 2c94cd917de72d4ea82ea40b95b1b8ccc8557282
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Thu Jan 21 16:06:10 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:06:10 2016 +0100

    build: alloc space for sched list in the link file
    
    Creates a section to contain scheduler entry pointers that are gathered
    together into an array. This will allow, in a follow-on patch, scheduler
    entries to be automatically gathered together into the array for
    automatic parsing.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/xen.lds.S |    4 ++++
 xen/arch/x86/xen.lds.S |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 0488f37..f501a2f 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -57,6 +57,10 @@ SECTIONS
        . = ALIGN(PAGE_SIZE);
        *(.data.page_aligned)
        *(.data)
+       . = ALIGN(8);
+       __start_schedulers_array = .;
+       *(.data.schedulers)
+       __end_schedulers_array = .;
        *(.data.rel)
        *(.data.rel.*)
        CONSTRUCTORS
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index e18e08f..c1ce027 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -80,6 +80,10 @@ SECTIONS
        __stop___pre_ex_table = .;
 
        *(.data.read_mostly)
+       . = ALIGN(8);
+       __start_schedulers_array = .;
+       *(.data.schedulers)
+       __end_schedulers_array = .;
        *(.data.rel.ro)
        *(.data.rel.ro.*)
   } :text
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:12:55 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:12: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 1aON5r-00005O-7d; Wed, 27 Jan 2016 10:12:55 +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 1aON5p-00004w-Ar
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:53 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	BF/A1-21901-42898A65; Wed, 27 Jan 2016 10:12:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453889567!18191815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56178 invoked from network); 27 Jan 2016 10:12:48 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:12:48 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6b-0001rI-Lb
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5j-0001B1-FL
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:47 +0000
Date: Wed, 27 Jan 2016 10:12:47 +0000
Message-Id: <E1aON5j-0001B1-FL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: alloc space for sched list in
	the link 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 2c94cd917de72d4ea82ea40b95b1b8ccc8557282
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Thu Jan 21 16:06:10 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:06:10 2016 +0100

    build: alloc space for sched list in the link file
    
    Creates a section to contain scheduler entry pointers that are gathered
    together into an array. This will allow, in a follow-on patch, scheduler
    entries to be automatically gathered together into the array for
    automatic parsing.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/xen.lds.S |    4 ++++
 xen/arch/x86/xen.lds.S |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 0488f37..f501a2f 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -57,6 +57,10 @@ SECTIONS
        . = ALIGN(PAGE_SIZE);
        *(.data.page_aligned)
        *(.data)
+       . = ALIGN(8);
+       __start_schedulers_array = .;
+       *(.data.schedulers)
+       __end_schedulers_array = .;
        *(.data.rel)
        *(.data.rel.*)
        CONSTRUCTORS
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index e18e08f..c1ce027 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -80,6 +80,10 @@ SECTIONS
        __stop___pre_ex_table = .;
 
        *(.data.read_mostly)
+       . = ALIGN(8);
+       __start_schedulers_array = .;
+       *(.data.schedulers)
+       __end_schedulers_array = .;
        *(.data.rel.ro)
        *(.data.rel.ro.*)
   } :text
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:13:17 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:13: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 1aON6D-00008d-Bt; Wed, 27 Jan 2016 10:13: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 1aON6B-00008Q-HY
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:15 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	1C/42-09708-A3898A65; Wed, 27 Jan 2016 10:13:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1453889578!12354020!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52192 invoked from network); 27 Jan 2016 10:13:08 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:13:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6m-0001rx-5O
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5t-0001BV-Uj
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:57 +0000
Date: Wed, 27 Jan 2016 10:12:57 +0000
Message-Id: <E1aON5t-0001BV-Uj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: register the schedulers into
	the list
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18c8d613aa8d8d6dc0da1a70d55249ddd78e28f4
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Thu Jan 21 16:06:36 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:06:36 2016 +0100

    sched: register the schedulers into the list
    
    Adds a simple macro to place a pointer to a scheduler into an array
    section at compile time. Also, goes ahead and generates the array
    entries with each of the schedulers.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/common/sched_arinc653.c |    2 ++
 xen/common/sched_credit.c   |    2 ++
 xen/common/sched_credit2.c  |    2 ++
 xen/common/sched_rt.c       |    2 ++
 xen/include/xen/sched-if.h  |    2 ++
 5 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index dbe02ed..3b59514 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -767,6 +767,8 @@ const struct scheduler sched_arinc653_def = {
     .tick_resume    = NULL,
 };
 
+REGISTER_SCHEDULER(sched_arinc653_def);
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 02afddf..1645f9c 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -2027,3 +2027,5 @@ const struct scheduler sched_credit_def = {
     .tick_suspend   = csched_tick_suspend,
     .tick_resume    = csched_tick_resume,
 };
+
+REGISTER_SCHEDULER(sched_credit_def);
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 3c49ffa..38b02d0 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -2228,3 +2228,5 @@ const struct scheduler sched_credit2_def = {
     .alloc_domdata  = csched2_alloc_domdata,
     .free_domdata   = csched2_free_domdata,
 };
+
+REGISTER_SCHEDULER(sched_credit2_def);
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 3f1d047..7640cd0 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -1199,3 +1199,5 @@ const struct scheduler sched_rtds_def = {
     .wake           = rt_vcpu_wake,
     .context_saved  = rt_context_saved,
 };
+
+REGISTER_SCHEDULER(sched_rtds_def);
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 493d43f..9c6e0f5 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -170,6 +170,8 @@ extern const struct scheduler sched_credit2_def;
 extern const struct scheduler sched_arinc653_def;
 extern const struct scheduler sched_rtds_def;
 
+#define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \
+  __used_section(".data.schedulers") = &x;
 
 struct cpupool
 {
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:13:17 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:13: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 1aON6D-00008d-Bt; Wed, 27 Jan 2016 10:13: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 1aON6B-00008Q-HY
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:15 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	1C/42-09708-A3898A65; Wed, 27 Jan 2016 10:13:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1453889578!12354020!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52192 invoked from network); 27 Jan 2016 10:13:08 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:13:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6m-0001rx-5O
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON5t-0001BV-Uj
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:12:57 +0000
Date: Wed, 27 Jan 2016 10:12:57 +0000
Message-Id: <E1aON5t-0001BV-Uj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: register the schedulers into
	the list
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18c8d613aa8d8d6dc0da1a70d55249ddd78e28f4
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Thu Jan 21 16:06:36 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:06:36 2016 +0100

    sched: register the schedulers into the list
    
    Adds a simple macro to place a pointer to a scheduler into an array
    section at compile time. Also, goes ahead and generates the array
    entries with each of the schedulers.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/common/sched_arinc653.c |    2 ++
 xen/common/sched_credit.c   |    2 ++
 xen/common/sched_credit2.c  |    2 ++
 xen/common/sched_rt.c       |    2 ++
 xen/include/xen/sched-if.h  |    2 ++
 5 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index dbe02ed..3b59514 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -767,6 +767,8 @@ const struct scheduler sched_arinc653_def = {
     .tick_resume    = NULL,
 };
 
+REGISTER_SCHEDULER(sched_arinc653_def);
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 02afddf..1645f9c 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -2027,3 +2027,5 @@ const struct scheduler sched_credit_def = {
     .tick_suspend   = csched_tick_suspend,
     .tick_resume    = csched_tick_resume,
 };
+
+REGISTER_SCHEDULER(sched_credit_def);
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 3c49ffa..38b02d0 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -2228,3 +2228,5 @@ const struct scheduler sched_credit2_def = {
     .alloc_domdata  = csched2_alloc_domdata,
     .free_domdata   = csched2_free_domdata,
 };
+
+REGISTER_SCHEDULER(sched_credit2_def);
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 3f1d047..7640cd0 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -1199,3 +1199,5 @@ const struct scheduler sched_rtds_def = {
     .wake           = rt_vcpu_wake,
     .context_saved  = rt_context_saved,
 };
+
+REGISTER_SCHEDULER(sched_rtds_def);
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 493d43f..9c6e0f5 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -170,6 +170,8 @@ extern const struct scheduler sched_credit2_def;
 extern const struct scheduler sched_arinc653_def;
 extern const struct scheduler sched_rtds_def;
 
+#define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \
+  __used_section(".data.schedulers") = &x;
 
 struct cpupool
 {
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:13:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:13: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 1aON6O-0000AK-HR; Wed, 27 Jan 2016 10:13: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 1aON6N-0000AA-MA
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:27 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	F9/EB-08977-74898A65; Wed, 27 Jan 2016 10:13:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1453889589!12365548!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12625 invoked from network); 27 Jan 2016 10:13:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:13:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6w-0001sY-Hr
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON64-0001D2-AT
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:08 +0000
Date: Wed, 27 Jan 2016 10:13:08 +0000
Message-Id: <E1aON64-0001D2-AT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: use the auto-generated list of
	schedulers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 666aca08175bfee69aee6bc9542bb0c51fa6a8ae
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Thu Jan 21 16:07:02 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:07:02 2016 +0100

    sched: use the auto-generated list of schedulers
    
    Instead of having a manually-curated list of schedulers, use the array
    that was auto-generated simply by compiling in the scheduler files as
    the sole source of truth of the available schedulers.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/common/sched_arinc653.c |    2 +-
 xen/common/sched_credit.c   |    2 +-
 xen/common/sched_credit2.c  |    2 +-
 xen/common/sched_rt.c       |    2 +-
 xen/common/schedule.c       |   23 ++++++-----------------
 xen/include/xen/sched-if.h  |    5 -----
 6 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index 3b59514..0606988 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -724,7 +724,7 @@ a653sched_adjust_global(const struct scheduler *ops,
  * callback functions.
  * The symbol must be visible to the rest of Xen at link time.
  */
-const struct scheduler sched_arinc653_def = {
+static const struct scheduler sched_arinc653_def = {
     .name           = "ARINC 653 Scheduler",
     .opt_name       = "arinc653",
     .sched_id       = XEN_SCHEDULER_ARINC653,
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 1645f9c..03fb2c2 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1991,7 +1991,7 @@ static void csched_tick_resume(const struct scheduler *ops, unsigned int cpu)
 
 static struct csched_private _csched_priv;
 
-const struct scheduler sched_credit_def = {
+static const struct scheduler sched_credit_def = {
     .name           = "SMP Credit Scheduler",
     .opt_name       = "credit",
     .sched_id       = XEN_SCHEDULER_CREDIT,
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 38b02d0..78220a7 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -2194,7 +2194,7 @@ csched2_deinit(const struct scheduler *ops)
 
 static struct csched2_private _csched2_priv;
 
-const struct scheduler sched_credit2_def = {
+static const struct scheduler sched_credit2_def = {
     .name           = "SMP Credit Scheduler rev2",
     .opt_name       = "credit2",
     .sched_id       = XEN_SCHEDULER_CREDIT2,
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 7640cd0..2e5430f 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -1170,7 +1170,7 @@ rt_dom_cntl(
 
 static struct rt_private _rt_priv;
 
-const struct scheduler sched_rtds_def = {
+static const struct scheduler sched_rtds_def = {
     .name           = "SMP RTDS Scheduler",
     .opt_name       = "rtds",
     .sched_id       = XEN_SCHEDULER_RTDS,
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 2f98a48..7306d71 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -64,20 +64,9 @@ static void poll_timer_fn(void *data);
 DEFINE_PER_CPU(struct schedule_data, schedule_data);
 DEFINE_PER_CPU(struct scheduler *, scheduler);
 
-static const struct scheduler *schedulers[] = {
-#ifdef CONFIG_SCHED_CREDIT
-    &sched_credit_def,
-#endif
-#ifdef CONFIG_SCHED_CREDIT2
-    &sched_credit2_def,
-#endif
-#ifdef CONFIG_SCHED_ARINC653
-    &sched_arinc653_def,
-#endif
-#ifdef CONFIG_SCHED_RTDS
-    &sched_rtds_def,
-#endif
-};
+extern const struct scheduler *__start_schedulers_array[], *__end_schedulers_array[];
+#define NUM_SCHEDULERS (__end_schedulers_array - __start_schedulers_array)
+#define schedulers __start_schedulers_array
 
 static struct scheduler __read_mostly ops;
 
@@ -1468,7 +1457,7 @@ void __init scheduler_init(void)
 
     open_softirq(SCHEDULE_SOFTIRQ, schedule);
 
-    for ( i = 0; i < ARRAY_SIZE(schedulers); i++ )
+    for ( i = 0; i < NUM_SCHEDULERS; i++)
     {
         if ( schedulers[i]->global_init && schedulers[i]->global_init() < 0 )
             schedulers[i] = NULL;
@@ -1479,7 +1468,7 @@ void __init scheduler_init(void)
     if ( !ops.name )
     {
         printk("Could not find scheduler: %s\n", opt_sched);
-        for ( i = 0; i < ARRAY_SIZE(schedulers); i++ )
+        for ( i = 0; i < NUM_SCHEDULERS; i++ )
             if ( schedulers[i] )
             {
                 ops = *schedulers[i];
@@ -1599,7 +1588,7 @@ struct scheduler *scheduler_alloc(unsigned int sched_id, int *perr)
     int i;
     struct scheduler *sched;
 
-    for ( i = 0; i < ARRAY_SIZE(schedulers); i++ )
+    for ( i = 0; i < NUM_SCHEDULERS; i++ )
         if ( schedulers[i] && schedulers[i]->sched_id == sched_id )
             goto found;
     *perr = -ENOENT;
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 9c6e0f5..66dc9c8 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -165,11 +165,6 @@ struct scheduler {
     void         (*tick_resume)     (const struct scheduler *, unsigned int);
 };
 
-extern const struct scheduler sched_credit_def;
-extern const struct scheduler sched_credit2_def;
-extern const struct scheduler sched_arinc653_def;
-extern const struct scheduler sched_rtds_def;
-
 #define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \
   __used_section(".data.schedulers") = &x;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:13:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:13: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 1aON6O-0000AK-HR; Wed, 27 Jan 2016 10:13: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 1aON6N-0000AA-MA
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:27 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	F9/EB-08977-74898A65; Wed, 27 Jan 2016 10:13:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1453889589!12365548!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12625 invoked from network); 27 Jan 2016 10:13:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:13:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6w-0001sY-Hr
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON64-0001D2-AT
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:08 +0000
Date: Wed, 27 Jan 2016 10:13:08 +0000
Message-Id: <E1aON64-0001D2-AT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: use the auto-generated list of
	schedulers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 666aca08175bfee69aee6bc9542bb0c51fa6a8ae
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Thu Jan 21 16:07:02 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:07:02 2016 +0100

    sched: use the auto-generated list of schedulers
    
    Instead of having a manually-curated list of schedulers, use the array
    that was auto-generated simply by compiling in the scheduler files as
    the sole source of truth of the available schedulers.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/common/sched_arinc653.c |    2 +-
 xen/common/sched_credit.c   |    2 +-
 xen/common/sched_credit2.c  |    2 +-
 xen/common/sched_rt.c       |    2 +-
 xen/common/schedule.c       |   23 ++++++-----------------
 xen/include/xen/sched-if.h  |    5 -----
 6 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index 3b59514..0606988 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -724,7 +724,7 @@ a653sched_adjust_global(const struct scheduler *ops,
  * callback functions.
  * The symbol must be visible to the rest of Xen at link time.
  */
-const struct scheduler sched_arinc653_def = {
+static const struct scheduler sched_arinc653_def = {
     .name           = "ARINC 653 Scheduler",
     .opt_name       = "arinc653",
     .sched_id       = XEN_SCHEDULER_ARINC653,
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 1645f9c..03fb2c2 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1991,7 +1991,7 @@ static void csched_tick_resume(const struct scheduler *ops, unsigned int cpu)
 
 static struct csched_private _csched_priv;
 
-const struct scheduler sched_credit_def = {
+static const struct scheduler sched_credit_def = {
     .name           = "SMP Credit Scheduler",
     .opt_name       = "credit",
     .sched_id       = XEN_SCHEDULER_CREDIT,
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 38b02d0..78220a7 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -2194,7 +2194,7 @@ csched2_deinit(const struct scheduler *ops)
 
 static struct csched2_private _csched2_priv;
 
-const struct scheduler sched_credit2_def = {
+static const struct scheduler sched_credit2_def = {
     .name           = "SMP Credit Scheduler rev2",
     .opt_name       = "credit2",
     .sched_id       = XEN_SCHEDULER_CREDIT2,
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 7640cd0..2e5430f 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -1170,7 +1170,7 @@ rt_dom_cntl(
 
 static struct rt_private _rt_priv;
 
-const struct scheduler sched_rtds_def = {
+static const struct scheduler sched_rtds_def = {
     .name           = "SMP RTDS Scheduler",
     .opt_name       = "rtds",
     .sched_id       = XEN_SCHEDULER_RTDS,
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 2f98a48..7306d71 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -64,20 +64,9 @@ static void poll_timer_fn(void *data);
 DEFINE_PER_CPU(struct schedule_data, schedule_data);
 DEFINE_PER_CPU(struct scheduler *, scheduler);
 
-static const struct scheduler *schedulers[] = {
-#ifdef CONFIG_SCHED_CREDIT
-    &sched_credit_def,
-#endif
-#ifdef CONFIG_SCHED_CREDIT2
-    &sched_credit2_def,
-#endif
-#ifdef CONFIG_SCHED_ARINC653
-    &sched_arinc653_def,
-#endif
-#ifdef CONFIG_SCHED_RTDS
-    &sched_rtds_def,
-#endif
-};
+extern const struct scheduler *__start_schedulers_array[], *__end_schedulers_array[];
+#define NUM_SCHEDULERS (__end_schedulers_array - __start_schedulers_array)
+#define schedulers __start_schedulers_array
 
 static struct scheduler __read_mostly ops;
 
@@ -1468,7 +1457,7 @@ void __init scheduler_init(void)
 
     open_softirq(SCHEDULE_SOFTIRQ, schedule);
 
-    for ( i = 0; i < ARRAY_SIZE(schedulers); i++ )
+    for ( i = 0; i < NUM_SCHEDULERS; i++)
     {
         if ( schedulers[i]->global_init && schedulers[i]->global_init() < 0 )
             schedulers[i] = NULL;
@@ -1479,7 +1468,7 @@ void __init scheduler_init(void)
     if ( !ops.name )
     {
         printk("Could not find scheduler: %s\n", opt_sched);
-        for ( i = 0; i < ARRAY_SIZE(schedulers); i++ )
+        for ( i = 0; i < NUM_SCHEDULERS; i++ )
             if ( schedulers[i] )
             {
                 ops = *schedulers[i];
@@ -1599,7 +1588,7 @@ struct scheduler *scheduler_alloc(unsigned int sched_id, int *perr)
     int i;
     struct scheduler *sched;
 
-    for ( i = 0; i < ARRAY_SIZE(schedulers); i++ )
+    for ( i = 0; i < NUM_SCHEDULERS; i++ )
         if ( schedulers[i] && schedulers[i]->sched_id == sched_id )
             goto found;
     *perr = -ENOENT;
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 9c6e0f5..66dc9c8 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -165,11 +165,6 @@ struct scheduler {
     void         (*tick_resume)     (const struct scheduler *, unsigned int);
 };
 
-extern const struct scheduler sched_credit_def;
-extern const struct scheduler sched_credit2_def;
-extern const struct scheduler sched_arinc653_def;
-extern const struct scheduler sched_rtds_def;
-
 #define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \
   __used_section(".data.schedulers") = &x;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:13:33 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:13: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 1aON6T-0000Bx-BD; Wed, 27 Jan 2016 10:13: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 1aON6R-0000BI-NH
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:31 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	65/67-13487-A4898A65; Wed, 27 Jan 2016 10:13:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1453889609!10039452!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38982 invoked from network); 27 Jan 2016 10:13:30 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:13:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7H-0001sw-Ap
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6P-0001EG-4i
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:29 +0000
Date: Wed, 27 Jan 2016 10:13:29 +0000
Message-Id: <E1aON6P-0001EG-4i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PV: relax LDT address check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f289b9a4a7b2337288253671a12b9519fd275b8d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 21 16:09:58 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:09:58 2016 +0100

    x86/PV: relax LDT address check
    
    There's no point placing restrictions on its address when the LDT size
    is zero.
    
    Also convert a local variable to a slightly more efficient type.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b5d0ebc..f5b89de 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3348,8 +3348,8 @@ long do_mmuext_op(
 
         case MMUEXT_SET_LDT:
         {
-            unsigned long ptr  = op.arg1.linear_addr;
-            unsigned long ents = op.arg2.nr_ents;
+            unsigned int ents = op.arg2.nr_ents;
+            unsigned long ptr = ents ? op.arg1.linear_addr : 0;
 
             if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
@@ -3361,7 +3361,7 @@ long do_mmuext_op(
             else if ( ((ptr & (PAGE_SIZE - 1)) != 0) || !__addr_ok(ptr) ||
                       (ents > 8192) )
             {
-                MEM_LOG("Bad args to SET_LDT: ptr=%lx, ents=%lx", ptr, ents);
+                MEM_LOG("Bad args to SET_LDT: ptr=%lx, ents=%x", ptr, ents);
                 rc = -EINVAL;
             }
             else if ( (curr->arch.pv_vcpu.ldt_ents != ents) ||
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:13:33 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:13: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 1aON6T-0000Bx-BD; Wed, 27 Jan 2016 10:13: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 1aON6R-0000BI-NH
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:31 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	65/67-13487-A4898A65; Wed, 27 Jan 2016 10:13:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1453889609!10039452!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38982 invoked from network); 27 Jan 2016 10:13:30 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:13:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7H-0001sw-Ap
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6P-0001EG-4i
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:29 +0000
Date: Wed, 27 Jan 2016 10:13:29 +0000
Message-Id: <E1aON6P-0001EG-4i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PV: relax LDT address check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f289b9a4a7b2337288253671a12b9519fd275b8d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 21 16:09:58 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:09:58 2016 +0100

    x86/PV: relax LDT address check
    
    There's no point placing restrictions on its address when the LDT size
    is zero.
    
    Also convert a local variable to a slightly more efficient type.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b5d0ebc..f5b89de 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3348,8 +3348,8 @@ long do_mmuext_op(
 
         case MMUEXT_SET_LDT:
         {
-            unsigned long ptr  = op.arg1.linear_addr;
-            unsigned long ents = op.arg2.nr_ents;
+            unsigned int ents = op.arg2.nr_ents;
+            unsigned long ptr = ents ? op.arg1.linear_addr : 0;
 
             if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
@@ -3361,7 +3361,7 @@ long do_mmuext_op(
             else if ( ((ptr & (PAGE_SIZE - 1)) != 0) || !__addr_ok(ptr) ||
                       (ents > 8192) )
             {
-                MEM_LOG("Bad args to SET_LDT: ptr=%lx, ents=%lx", ptr, ents);
+                MEM_LOG("Bad args to SET_LDT: ptr=%lx, ents=%x", ptr, ents);
                 rc = -EINVAL;
             }
             else if ( (curr->arch.pv_vcpu.ldt_ents != ents) ||
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:13:43 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:13: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 1aON6d-0000Fh-Fr; Wed, 27 Jan 2016 10:13:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6c-0000Ec-7B
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:42 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	20/E5-22089-55898A65; Wed, 27 Jan 2016 10:13:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1453889619!10039518!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41508 invoked from network); 27 Jan 2016 10:13:40 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:13:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7R-0001t0-NI
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6Z-0001F8-GP
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:39 +0000
Date: Wed, 27 Jan 2016 10:13:39 +0000
Message-Id: <E1aON6Z-0001F8-GP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/paging: invlpg() hook returns
	boolean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 344e852bf0866dfa9886c8328b23a2563aca8a32
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 21 16:10:19 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:10:19 2016 +0100

    x86/paging: invlpg() hook returns boolean
    
    ... so make its return type reflect this.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm.c              |    3 +--
 xen/arch/x86/mm/hap/hap.c      |    2 +-
 xen/arch/x86/mm/shadow/multi.c |    9 +++++----
 xen/arch/x86/mm/shadow/none.c  |    4 ++--
 xen/include/asm-x86/paging.h   |    4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f5b89de..fcf6577 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4392,8 +4392,7 @@ static int __do_update_va_mapping(
         switch ( (bmap_ptr = flags & ~UVMF_FLUSHTYPE_MASK) )
         {
         case UVMF_LOCAL:
-            if ( !paging_mode_enabled(d) ||
-                 (paging_invlpg(v, va) != 0) ) 
+            if ( !paging_mode_enabled(d) || paging_invlpg(v, va) )
                 flush_tlb_one_local(va);
             break;
         case UVMF_ALL:
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 17a380f..ee87825 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -680,7 +680,7 @@ static int hap_page_fault(struct vcpu *v, unsigned long va,
  * HAP guests can handle invlpg without needing any action from Xen, so
  * should not be intercepting it.
  */
-static int hap_invlpg(struct vcpu *v, unsigned long va)
+static bool_t hap_invlpg(struct vcpu *v, unsigned long va)
 {
     if (nestedhvm_enabled(v->domain)) {
         /* Emulate INVLPGA:
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 58f7e72..162c06f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3510,11 +3510,12 @@ propagate:
 }
 
 
-static int
-sh_invlpg(struct vcpu *v, unsigned long va)
-/* Called when the guest requests an invlpg.  Returns 1 if the invlpg
+/*
+ * Called when the guest requests an invlpg.  Returns 1 if the invlpg
  * instruction should be issued on the hardware, or 0 if it's safe not
- * to do so. */
+ * to do so.
+ */
+static bool_t sh_invlpg(struct vcpu *v, unsigned long va)
 {
     mfn_t sl1mfn;
     shadow_l2e_t sl2e;
diff --git a/xen/arch/x86/mm/shadow/none.c b/xen/arch/x86/mm/shadow/none.c
index 9526443..38bdf92 100644
--- a/xen/arch/x86/mm/shadow/none.c
+++ b/xen/arch/x86/mm/shadow/none.c
@@ -32,10 +32,10 @@ static int _page_fault(struct vcpu *v, unsigned long va,
     return 0;
 }
 
-static int _invlpg(struct vcpu *v, unsigned long va)
+static bool_t _invlpg(struct vcpu *v, unsigned long va)
 {
     ASSERT_UNREACHABLE();
-    return -EOPNOTSUPP;
+    return 1;
 }
 
 static unsigned long _gva_to_gfn(struct vcpu *v, struct p2m_domain *p2m,
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index c412953..9a8653d 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -104,7 +104,7 @@ struct shadow_paging_mode {
 struct paging_mode {
     int           (*page_fault            )(struct vcpu *v, unsigned long va,
                                             struct cpu_user_regs *regs);
-    int           (*invlpg                )(struct vcpu *v, unsigned long va);
+    bool_t        (*invlpg                )(struct vcpu *v, unsigned long va);
     unsigned long (*gva_to_gfn            )(struct vcpu *v,
                                             struct p2m_domain *p2m,
                                             unsigned long va,
@@ -243,7 +243,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
 /* Handle invlpg requests on vcpus.
  * Returns 1 if the invlpg instruction should be issued on the hardware,
  * or 0 if it's safe not to do so. */
-static inline int paging_invlpg(struct vcpu *v, unsigned long va)
+static inline bool_t paging_invlpg(struct vcpu *v, unsigned long va)
 {
     return (paging_mode_external(v->domain) ? is_canonical_address(va)
                                             : __addr_ok(va)) &&
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:13:43 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:13: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 1aON6d-0000Fh-Fr; Wed, 27 Jan 2016 10:13:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6c-0000Ec-7B
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:42 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	20/E5-22089-55898A65; Wed, 27 Jan 2016 10:13:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1453889619!10039518!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41508 invoked from network); 27 Jan 2016 10:13:40 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:13:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7R-0001t0-NI
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6Z-0001F8-GP
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:39 +0000
Date: Wed, 27 Jan 2016 10:13:39 +0000
Message-Id: <E1aON6Z-0001F8-GP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/paging: invlpg() hook returns
	boolean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 344e852bf0866dfa9886c8328b23a2563aca8a32
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 21 16:10:19 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:10:19 2016 +0100

    x86/paging: invlpg() hook returns boolean
    
    ... so make its return type reflect this.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm.c              |    3 +--
 xen/arch/x86/mm/hap/hap.c      |    2 +-
 xen/arch/x86/mm/shadow/multi.c |    9 +++++----
 xen/arch/x86/mm/shadow/none.c  |    4 ++--
 xen/include/asm-x86/paging.h   |    4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f5b89de..fcf6577 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4392,8 +4392,7 @@ static int __do_update_va_mapping(
         switch ( (bmap_ptr = flags & ~UVMF_FLUSHTYPE_MASK) )
         {
         case UVMF_LOCAL:
-            if ( !paging_mode_enabled(d) ||
-                 (paging_invlpg(v, va) != 0) ) 
+            if ( !paging_mode_enabled(d) || paging_invlpg(v, va) )
                 flush_tlb_one_local(va);
             break;
         case UVMF_ALL:
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 17a380f..ee87825 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -680,7 +680,7 @@ static int hap_page_fault(struct vcpu *v, unsigned long va,
  * HAP guests can handle invlpg without needing any action from Xen, so
  * should not be intercepting it.
  */
-static int hap_invlpg(struct vcpu *v, unsigned long va)
+static bool_t hap_invlpg(struct vcpu *v, unsigned long va)
 {
     if (nestedhvm_enabled(v->domain)) {
         /* Emulate INVLPGA:
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 58f7e72..162c06f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3510,11 +3510,12 @@ propagate:
 }
 
 
-static int
-sh_invlpg(struct vcpu *v, unsigned long va)
-/* Called when the guest requests an invlpg.  Returns 1 if the invlpg
+/*
+ * Called when the guest requests an invlpg.  Returns 1 if the invlpg
  * instruction should be issued on the hardware, or 0 if it's safe not
- * to do so. */
+ * to do so.
+ */
+static bool_t sh_invlpg(struct vcpu *v, unsigned long va)
 {
     mfn_t sl1mfn;
     shadow_l2e_t sl2e;
diff --git a/xen/arch/x86/mm/shadow/none.c b/xen/arch/x86/mm/shadow/none.c
index 9526443..38bdf92 100644
--- a/xen/arch/x86/mm/shadow/none.c
+++ b/xen/arch/x86/mm/shadow/none.c
@@ -32,10 +32,10 @@ static int _page_fault(struct vcpu *v, unsigned long va,
     return 0;
 }
 
-static int _invlpg(struct vcpu *v, unsigned long va)
+static bool_t _invlpg(struct vcpu *v, unsigned long va)
 {
     ASSERT_UNREACHABLE();
-    return -EOPNOTSUPP;
+    return 1;
 }
 
 static unsigned long _gva_to_gfn(struct vcpu *v, struct p2m_domain *p2m,
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index c412953..9a8653d 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -104,7 +104,7 @@ struct shadow_paging_mode {
 struct paging_mode {
     int           (*page_fault            )(struct vcpu *v, unsigned long va,
                                             struct cpu_user_regs *regs);
-    int           (*invlpg                )(struct vcpu *v, unsigned long va);
+    bool_t        (*invlpg                )(struct vcpu *v, unsigned long va);
     unsigned long (*gva_to_gfn            )(struct vcpu *v,
                                             struct p2m_domain *p2m,
                                             unsigned long va,
@@ -243,7 +243,7 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
 /* Handle invlpg requests on vcpus.
  * Returns 1 if the invlpg instruction should be issued on the hardware,
  * or 0 if it's safe not to do so. */
-static inline int paging_invlpg(struct vcpu *v, unsigned long va)
+static inline bool_t paging_invlpg(struct vcpu *v, unsigned long va)
 {
     return (paging_mode_external(v->domain) ? is_canonical_address(va)
                                             : __addr_ok(va)) &&
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:13:45 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:13: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 1aON6f-0000Gt-ME; Wed, 27 Jan 2016 10:13:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6e-0000G5-1c
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:44 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	A7/6C-08977-75898A65; Wed, 27 Jan 2016 10:13:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1453889599!12365596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15131 invoked from network); 27 Jan 2016 10:13:41 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:13:41 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON76-0001sg-Uu
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6E-0001Da-OL
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:18 +0000
Date: Wed, 27 Jan 2016 10:13:18 +0000
Message-Id: <E1aON6E-0001Da-OL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mmuext: tighten TLB flush address
	checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 828e114f7cdd9910483783ab0563b178325e579a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 21 16:09:22 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:09:22 2016 +0100

    x86/mmuext: tighten TLB flush address checks
    
    Addresses passed by PV guests should be subjected to __addr_ok(),
    avoiding undue TLB flushes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm.c            |   13 +++++++------
 xen/include/asm-x86/paging.h |    4 +++-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b81d1fd..b5d0ebc 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3268,8 +3268,9 @@ long do_mmuext_op(
         case MMUEXT_INVLPG_LOCAL:
             if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
-            else if ( !paging_mode_enabled(d) ||
-                      paging_invlpg(curr, op.arg1.linear_addr) != 0 )
+            else if ( !paging_mode_enabled(d)
+                      ? __addr_ok(op.arg1.linear_addr)
+                      : paging_invlpg(curr, op.arg1.linear_addr) )
                 flush_tlb_one_local(op.arg1.linear_addr);
             break;
 
@@ -3290,7 +3291,7 @@ long do_mmuext_op(
 
             if ( op.cmd == MMUEXT_TLB_FLUSH_MULTI )
                 flush_tlb_mask(&pmask);
-            else
+            else if ( __addr_ok(op.arg1.linear_addr) )
                 flush_tlb_one_mask(&pmask, op.arg1.linear_addr);
             break;
         }
@@ -3303,10 +3304,10 @@ long do_mmuext_op(
             break;
     
         case MMUEXT_INVLPG_ALL:
-            if ( likely(d == pg_owner) )
-                flush_tlb_one_mask(d->domain_dirty_cpumask, op.arg1.linear_addr);
-            else
+            if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
+            else if ( __addr_ok(op.arg1.linear_addr) )
+                flush_tlb_one_mask(d->domain_dirty_cpumask, op.arg1.linear_addr);
             break;
 
         case MMUEXT_FLUSH_CACHE:
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 6215f57..c412953 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -245,7 +245,9 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
  * or 0 if it's safe not to do so. */
 static inline int paging_invlpg(struct vcpu *v, unsigned long va)
 {
-    return is_canonical_address(va) && paging_get_hostmode(v)->invlpg(v, va);
+    return (paging_mode_external(v->domain) ? is_canonical_address(va)
+                                            : __addr_ok(va)) &&
+           paging_get_hostmode(v)->invlpg(v, va);
 }
 
 /* Translate a guest virtual address to the frame number that 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 Wed Jan 27 10:13:45 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:13: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 1aON6f-0000Gt-ME; Wed, 27 Jan 2016 10:13:45 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6e-0000G5-1c
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:44 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	A7/6C-08977-75898A65; Wed, 27 Jan 2016 10:13:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1453889599!12365596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15131 invoked from network); 27 Jan 2016 10:13:41 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:13:41 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON76-0001sg-Uu
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6E-0001Da-OL
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:18 +0000
Date: Wed, 27 Jan 2016 10:13:18 +0000
Message-Id: <E1aON6E-0001Da-OL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mmuext: tighten TLB flush address
	checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 828e114f7cdd9910483783ab0563b178325e579a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 21 16:09:22 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:09:22 2016 +0100

    x86/mmuext: tighten TLB flush address checks
    
    Addresses passed by PV guests should be subjected to __addr_ok(),
    avoiding undue TLB flushes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm.c            |   13 +++++++------
 xen/include/asm-x86/paging.h |    4 +++-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b81d1fd..b5d0ebc 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3268,8 +3268,9 @@ long do_mmuext_op(
         case MMUEXT_INVLPG_LOCAL:
             if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
-            else if ( !paging_mode_enabled(d) ||
-                      paging_invlpg(curr, op.arg1.linear_addr) != 0 )
+            else if ( !paging_mode_enabled(d)
+                      ? __addr_ok(op.arg1.linear_addr)
+                      : paging_invlpg(curr, op.arg1.linear_addr) )
                 flush_tlb_one_local(op.arg1.linear_addr);
             break;
 
@@ -3290,7 +3291,7 @@ long do_mmuext_op(
 
             if ( op.cmd == MMUEXT_TLB_FLUSH_MULTI )
                 flush_tlb_mask(&pmask);
-            else
+            else if ( __addr_ok(op.arg1.linear_addr) )
                 flush_tlb_one_mask(&pmask, op.arg1.linear_addr);
             break;
         }
@@ -3303,10 +3304,10 @@ long do_mmuext_op(
             break;
     
         case MMUEXT_INVLPG_ALL:
-            if ( likely(d == pg_owner) )
-                flush_tlb_one_mask(d->domain_dirty_cpumask, op.arg1.linear_addr);
-            else
+            if ( unlikely(d != pg_owner) )
                 rc = -EPERM;
+            else if ( __addr_ok(op.arg1.linear_addr) )
+                flush_tlb_one_mask(d->domain_dirty_cpumask, op.arg1.linear_addr);
             break;
 
         case MMUEXT_FLUSH_CACHE:
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 6215f57..c412953 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -245,7 +245,9 @@ paging_fault(unsigned long va, struct cpu_user_regs *regs)
  * or 0 if it's safe not to do so. */
 static inline int paging_invlpg(struct vcpu *v, unsigned long va)
 {
-    return is_canonical_address(va) && paging_get_hostmode(v)->invlpg(v, va);
+    return (paging_mode_external(v->domain) ? is_canonical_address(va)
+                                            : __addr_ok(va)) &&
+           paging_get_hostmode(v)->invlpg(v, va);
 }
 
 /* Translate a guest virtual address to the frame number that 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 Wed Jan 27 10:14:05 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:14: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 1aON6y-0000LO-RL; Wed, 27 Jan 2016 10:14:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6w-0000Kl-SP
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:03 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	E2/E4-12635-A6898A65; Wed, 27 Jan 2016 10:14:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1453889640!10039643!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46047 invoked from network); 27 Jan 2016 10:14:01 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:14:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7m-0001uH-AE
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6u-0001GP-4n
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:00 +0000
Date: Wed, 27 Jan 2016 10:14:00 +0000
Message-Id: <E1aON6u-0001GP-4n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix (and simplify) MTRR overlap
	checking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3272230848f36eb5bbb660216898a90048a81d9f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 21 16:11:04 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:11:04 2016 +0100

    x86: fix (and simplify) MTRR overlap checking
    
    Obtaining one individual range per variable range register (via
    get_mtrr_range()) was bogus from the beginning, as these registers may
    cover multiple disjoint ranges. Do away with that, in favor of simply
    comparing masked addresses.
    
    Also, for is_var_mtrr_overlapped()'s result to be correct when called
    from mtrr_wrmsr(), generic_set_mtrr() must update saved state first.
    
    As minor cleanup changes, constify is_var_mtrr_overlapped()'s parameter
    and make mtrr_wrmsr() static.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/mtrr/generic.c |    4 +-
 xen/arch/x86/cpu/mtrr/mtrr.h    |    1 -
 xen/arch/x86/hvm/mtrr.c         |   61 +++++++-------------------------------
 xen/include/asm-x86/mtrr.h      |    2 +-
 4 files changed, 15 insertions(+), 53 deletions(-)

diff --git a/xen/arch/x86/cpu/mtrr/generic.c b/xen/arch/x86/cpu/mtrr/generic.c
index 935f0a0..ea0efe2 100644
--- a/xen/arch/x86/cpu/mtrr/generic.c
+++ b/xen/arch/x86/cpu/mtrr/generic.c
@@ -220,7 +220,7 @@ void __init mtrr_state_warn(void)
 /* Doesn't attempt to pass an error out to MTRR users
    because it's quite complicated in some cases and probably not
    worth it because the best error handling is to ignore it. */
-void mtrr_wrmsr(unsigned int msr, uint64_t msr_content)
+static void mtrr_wrmsr(unsigned int msr, uint64_t msr_content)
 {
 	if (wrmsr_safe(msr, msr_content) < 0)
 		printk(KERN_ERR
@@ -495,8 +495,8 @@ static void generic_set_mtrr(unsigned int reg, unsigned long base,
 	if (size == 0) {
 		/* The invalid bit is kept in the mask, so we simply clear the
 		   relevant mask register to disable a range. */
+		memset(vr, 0, sizeof(*vr));
 		mtrr_wrmsr(MSR_IA32_MTRR_PHYSMASK(reg), 0);
-		memset(vr, 0, sizeof(struct mtrr_var_range));
 	} else {
 		uint32_t base_lo, base_hi, mask_lo, mask_hi;
 
diff --git a/xen/arch/x86/cpu/mtrr/mtrr.h b/xen/arch/x86/cpu/mtrr/mtrr.h
index a9d6dcd..b41eb58 100644
--- a/xen/arch/x86/cpu/mtrr/mtrr.h
+++ b/xen/arch/x86/cpu/mtrr/mtrr.h
@@ -63,7 +63,6 @@ extern const struct mtrr_ops *mtrr_if;
 extern unsigned int num_var_ranges;
 
 void mtrr_state_warn(void);
-void mtrr_wrmsr(unsigned int msr, uint64_t msr_content);
 
 extern int amd_init_mtrr(void);
 extern int cyrix_init_mtrr(void);
diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index aa7adcf..595134c 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -26,8 +26,6 @@
 #include <asm/hvm/support.h>
 #include <asm/hvm/cacheattr.h>
 
-static uint32_t size_or_mask;
-
 /* Get page attribute fields (PAn) from PAT MSR. */
 #define pat_cr_2_paf(pat_cr,n)  ((((uint64_t)pat_cr) >> ((n)<<3)) & 0xff)
 
@@ -77,61 +75,28 @@ static uint8_t __read_mostly mtrr_epat_tbl[MTRR_NUM_TYPES][MEMORY_NUM_TYPES] =
 static uint8_t __read_mostly pat_entry_tbl[PAT_TYPE_NUMS] =
     { [0 ... PAT_TYPE_NUMS-1] = INVALID_MEM_TYPE };
 
-static void get_mtrr_range(uint64_t base_msr, uint64_t mask_msr,
-                           uint64_t *base, uint64_t *end)
-{
-    uint32_t mask_lo = (uint32_t)mask_msr;
-    uint32_t mask_hi = (uint32_t)(mask_msr >> 32);
-    uint32_t base_lo = (uint32_t)base_msr;
-    uint32_t base_hi = (uint32_t)(base_msr >> 32);
-    uint32_t size;
-
-    if ( !(mask_lo & MTRR_PHYSMASK_VALID) )
-    {
-        /* Invalid (i.e. free) range */
-        *base = 0;
-        *end = 0;
-        return;
-    }
-
-    /* Work out the shifted address mask. */
-    mask_lo = (size_or_mask | (mask_hi << (32 - PAGE_SHIFT)) |
-               (mask_lo >> PAGE_SHIFT));
-
-    /* This works correctly if size is a power of two (a contiguous range). */
-    size = -mask_lo;
-    *base = base_hi << (32 - PAGE_SHIFT) | base_lo >> PAGE_SHIFT;
-    *end = *base + size - 1;
-}
-
-bool_t is_var_mtrr_overlapped(struct mtrr_state *m)
+bool_t is_var_mtrr_overlapped(const struct mtrr_state *m)
 {
-    int32_t seg, i;
-    uint64_t phys_base, phys_mask, phys_base_pre, phys_mask_pre;
-    uint64_t base_pre, end_pre, base, end;
-    uint8_t num_var_ranges = (uint8_t)m->mtrr_cap;
+    unsigned int seg, i;
+    unsigned int num_var_ranges = (uint8_t)m->mtrr_cap;
 
     for ( i = 0; i < num_var_ranges; i++ )
     {
-        phys_base_pre = ((uint64_t*)m->var_ranges)[i*2];
-        phys_mask_pre = ((uint64_t*)m->var_ranges)[i*2 + 1];
+        uint64_t base1 = m->var_ranges[i].base >> PAGE_SHIFT;
+        uint64_t mask1 = m->var_ranges[i].mask >> PAGE_SHIFT;
 
-        get_mtrr_range(phys_base_pre, phys_mask_pre,
-                        &base_pre, &end_pre);
+        if ( !(m->var_ranges[i].mask & MTRR_PHYSMASK_VALID) )
+            continue;
 
         for ( seg = i + 1; seg < num_var_ranges; seg ++ )
         {
-            phys_base = ((uint64_t*)m->var_ranges)[seg*2];
-            phys_mask = ((uint64_t*)m->var_ranges)[seg*2 + 1];
+            uint64_t base2 = m->var_ranges[seg].base >> PAGE_SHIFT;
+            uint64_t mask2 = m->var_ranges[seg].mask >> PAGE_SHIFT;
 
-            get_mtrr_range(phys_base, phys_mask,
-                            &base, &end);
+            if ( !(m->var_ranges[seg].mask & MTRR_PHYSMASK_VALID) )
+                continue;
 
-            if ( ((base_pre != end_pre) && (base != end))
-                 || ((base >= base_pre) && (base <= end_pre))
-                 || ((end >= base_pre) && (end <= end_pre))
-                 || ((base_pre >= base) && (base_pre <= end))
-                 || ((end_pre >= base) && (end_pre <= end)) )
+            if ( (base1 & mask1 & mask2) == (base2 & mask2 & mask1) )
             {
                 /* MTRR is overlapped. */
                 return 1;
@@ -168,8 +133,6 @@ static int __init hvm_mtrr_pat_init(void)
         }
     }
 
-    size_or_mask = ~((1 << (paddr_bits - PAGE_SHIFT)) - 1);
-
     return 0;
 }
 __initcall(hvm_mtrr_pat_init);
diff --git a/xen/include/asm-x86/mtrr.h b/xen/include/asm-x86/mtrr.h
index 0569db6..69cf68c 100644
--- a/xen/include/asm-x86/mtrr.h
+++ b/xen/include/asm-x86/mtrr.h
@@ -91,7 +91,7 @@ extern bool_t mtrr_def_type_msr_set(struct domain *, struct mtrr_state *,
 extern void memory_type_changed(struct domain *);
 extern bool_t pat_msr_set(uint64_t *pat, uint64_t msr);
 
-bool_t is_var_mtrr_overlapped(struct mtrr_state *m);
+bool_t is_var_mtrr_overlapped(const struct mtrr_state *m);
 bool_t mtrr_pat_not_equal(struct vcpu *vd, struct vcpu *vs);
 
 #endif /* __ASM_X86_MTRR_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 Wed Jan 27 10:14:05 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:14: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 1aON6y-0000LO-RL; Wed, 27 Jan 2016 10:14:04 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6w-0000Kl-SP
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:03 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	E2/E4-12635-A6898A65; Wed, 27 Jan 2016 10:14:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1453889640!10039643!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46047 invoked from network); 27 Jan 2016 10:14:01 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:14:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7m-0001uH-AE
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6u-0001GP-4n
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:00 +0000
Date: Wed, 27 Jan 2016 10:14:00 +0000
Message-Id: <E1aON6u-0001GP-4n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix (and simplify) MTRR overlap
	checking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3272230848f36eb5bbb660216898a90048a81d9f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 21 16:11:04 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:11:04 2016 +0100

    x86: fix (and simplify) MTRR overlap checking
    
    Obtaining one individual range per variable range register (via
    get_mtrr_range()) was bogus from the beginning, as these registers may
    cover multiple disjoint ranges. Do away with that, in favor of simply
    comparing masked addresses.
    
    Also, for is_var_mtrr_overlapped()'s result to be correct when called
    from mtrr_wrmsr(), generic_set_mtrr() must update saved state first.
    
    As minor cleanup changes, constify is_var_mtrr_overlapped()'s parameter
    and make mtrr_wrmsr() static.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/mtrr/generic.c |    4 +-
 xen/arch/x86/cpu/mtrr/mtrr.h    |    1 -
 xen/arch/x86/hvm/mtrr.c         |   61 +++++++-------------------------------
 xen/include/asm-x86/mtrr.h      |    2 +-
 4 files changed, 15 insertions(+), 53 deletions(-)

diff --git a/xen/arch/x86/cpu/mtrr/generic.c b/xen/arch/x86/cpu/mtrr/generic.c
index 935f0a0..ea0efe2 100644
--- a/xen/arch/x86/cpu/mtrr/generic.c
+++ b/xen/arch/x86/cpu/mtrr/generic.c
@@ -220,7 +220,7 @@ void __init mtrr_state_warn(void)
 /* Doesn't attempt to pass an error out to MTRR users
    because it's quite complicated in some cases and probably not
    worth it because the best error handling is to ignore it. */
-void mtrr_wrmsr(unsigned int msr, uint64_t msr_content)
+static void mtrr_wrmsr(unsigned int msr, uint64_t msr_content)
 {
 	if (wrmsr_safe(msr, msr_content) < 0)
 		printk(KERN_ERR
@@ -495,8 +495,8 @@ static void generic_set_mtrr(unsigned int reg, unsigned long base,
 	if (size == 0) {
 		/* The invalid bit is kept in the mask, so we simply clear the
 		   relevant mask register to disable a range. */
+		memset(vr, 0, sizeof(*vr));
 		mtrr_wrmsr(MSR_IA32_MTRR_PHYSMASK(reg), 0);
-		memset(vr, 0, sizeof(struct mtrr_var_range));
 	} else {
 		uint32_t base_lo, base_hi, mask_lo, mask_hi;
 
diff --git a/xen/arch/x86/cpu/mtrr/mtrr.h b/xen/arch/x86/cpu/mtrr/mtrr.h
index a9d6dcd..b41eb58 100644
--- a/xen/arch/x86/cpu/mtrr/mtrr.h
+++ b/xen/arch/x86/cpu/mtrr/mtrr.h
@@ -63,7 +63,6 @@ extern const struct mtrr_ops *mtrr_if;
 extern unsigned int num_var_ranges;
 
 void mtrr_state_warn(void);
-void mtrr_wrmsr(unsigned int msr, uint64_t msr_content);
 
 extern int amd_init_mtrr(void);
 extern int cyrix_init_mtrr(void);
diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index aa7adcf..595134c 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -26,8 +26,6 @@
 #include <asm/hvm/support.h>
 #include <asm/hvm/cacheattr.h>
 
-static uint32_t size_or_mask;
-
 /* Get page attribute fields (PAn) from PAT MSR. */
 #define pat_cr_2_paf(pat_cr,n)  ((((uint64_t)pat_cr) >> ((n)<<3)) & 0xff)
 
@@ -77,61 +75,28 @@ static uint8_t __read_mostly mtrr_epat_tbl[MTRR_NUM_TYPES][MEMORY_NUM_TYPES] =
 static uint8_t __read_mostly pat_entry_tbl[PAT_TYPE_NUMS] =
     { [0 ... PAT_TYPE_NUMS-1] = INVALID_MEM_TYPE };
 
-static void get_mtrr_range(uint64_t base_msr, uint64_t mask_msr,
-                           uint64_t *base, uint64_t *end)
-{
-    uint32_t mask_lo = (uint32_t)mask_msr;
-    uint32_t mask_hi = (uint32_t)(mask_msr >> 32);
-    uint32_t base_lo = (uint32_t)base_msr;
-    uint32_t base_hi = (uint32_t)(base_msr >> 32);
-    uint32_t size;
-
-    if ( !(mask_lo & MTRR_PHYSMASK_VALID) )
-    {
-        /* Invalid (i.e. free) range */
-        *base = 0;
-        *end = 0;
-        return;
-    }
-
-    /* Work out the shifted address mask. */
-    mask_lo = (size_or_mask | (mask_hi << (32 - PAGE_SHIFT)) |
-               (mask_lo >> PAGE_SHIFT));
-
-    /* This works correctly if size is a power of two (a contiguous range). */
-    size = -mask_lo;
-    *base = base_hi << (32 - PAGE_SHIFT) | base_lo >> PAGE_SHIFT;
-    *end = *base + size - 1;
-}
-
-bool_t is_var_mtrr_overlapped(struct mtrr_state *m)
+bool_t is_var_mtrr_overlapped(const struct mtrr_state *m)
 {
-    int32_t seg, i;
-    uint64_t phys_base, phys_mask, phys_base_pre, phys_mask_pre;
-    uint64_t base_pre, end_pre, base, end;
-    uint8_t num_var_ranges = (uint8_t)m->mtrr_cap;
+    unsigned int seg, i;
+    unsigned int num_var_ranges = (uint8_t)m->mtrr_cap;
 
     for ( i = 0; i < num_var_ranges; i++ )
     {
-        phys_base_pre = ((uint64_t*)m->var_ranges)[i*2];
-        phys_mask_pre = ((uint64_t*)m->var_ranges)[i*2 + 1];
+        uint64_t base1 = m->var_ranges[i].base >> PAGE_SHIFT;
+        uint64_t mask1 = m->var_ranges[i].mask >> PAGE_SHIFT;
 
-        get_mtrr_range(phys_base_pre, phys_mask_pre,
-                        &base_pre, &end_pre);
+        if ( !(m->var_ranges[i].mask & MTRR_PHYSMASK_VALID) )
+            continue;
 
         for ( seg = i + 1; seg < num_var_ranges; seg ++ )
         {
-            phys_base = ((uint64_t*)m->var_ranges)[seg*2];
-            phys_mask = ((uint64_t*)m->var_ranges)[seg*2 + 1];
+            uint64_t base2 = m->var_ranges[seg].base >> PAGE_SHIFT;
+            uint64_t mask2 = m->var_ranges[seg].mask >> PAGE_SHIFT;
 
-            get_mtrr_range(phys_base, phys_mask,
-                            &base, &end);
+            if ( !(m->var_ranges[seg].mask & MTRR_PHYSMASK_VALID) )
+                continue;
 
-            if ( ((base_pre != end_pre) && (base != end))
-                 || ((base >= base_pre) && (base <= end_pre))
-                 || ((end >= base_pre) && (end <= end_pre))
-                 || ((base_pre >= base) && (base_pre <= end))
-                 || ((end_pre >= base) && (end_pre <= end)) )
+            if ( (base1 & mask1 & mask2) == (base2 & mask2 & mask1) )
             {
                 /* MTRR is overlapped. */
                 return 1;
@@ -168,8 +133,6 @@ static int __init hvm_mtrr_pat_init(void)
         }
     }
 
-    size_or_mask = ~((1 << (paddr_bits - PAGE_SHIFT)) - 1);
-
     return 0;
 }
 __initcall(hvm_mtrr_pat_init);
diff --git a/xen/include/asm-x86/mtrr.h b/xen/include/asm-x86/mtrr.h
index 0569db6..69cf68c 100644
--- a/xen/include/asm-x86/mtrr.h
+++ b/xen/include/asm-x86/mtrr.h
@@ -91,7 +91,7 @@ extern bool_t mtrr_def_type_msr_set(struct domain *, struct mtrr_state *,
 extern void memory_type_changed(struct domain *);
 extern bool_t pat_msr_set(uint64_t *pat, uint64_t msr);
 
-bool_t is_var_mtrr_overlapped(struct mtrr_state *m);
+bool_t is_var_mtrr_overlapped(const struct mtrr_state *m);
 bool_t mtrr_pat_not_equal(struct vcpu *vd, struct vcpu *vs);
 
 #endif /* __ASM_X86_MTRR_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 Wed Jan 27 10:14:06 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:14: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 1aON6z-0000Lu-VL; Wed, 27 Jan 2016 10:14:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6x-0000Kz-MP
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:03 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	CE/A3-09708-B6898A65; Wed, 27 Jan 2016 10:14:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1453889630!11938644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44090 invoked from network); 27 Jan 2016 10:14:02 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:14:02 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7c-0001tG-3a
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6j-0001Fn-TE
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:49 +0000
Date: Wed, 27 Jan 2016 10:13:49 +0000
Message-Id: <E1aON6j-0001Fn-TE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: constrain MFN range Dom0 may
	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 53de839fb40936c074213a0c400e3c959e4ec461
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 21 16:10:42 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:10:42 2016 +0100

    x86: constrain MFN range Dom0 may access
    
    ... to that covered by the physical address width supported by the
    processor. This implicitly avoids Dom0 (accidentally or due to some
    kind of abuse) passing out of range addresses to a guest, which in
    turn eliminates this only possibility for PV guests to create PTEs
    with one or more reserved bits set.
    
    Note that this is not a security issue due to XSA-77.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain_build.c |    2 +-
 xen/arch/x86/mm.c           |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index d02dc4b..cb287f0 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1533,7 +1533,7 @@ int __init construct_dom0(
 
     /* The hardware domain is initially permitted full I/O capabilities. */
     rc |= ioports_permit_access(d, 0, 0xFFFF);
-    rc |= iomem_permit_access(d, 0UL, ~0UL);
+    rc |= iomem_permit_access(d, 0UL, (1UL << (paddr_bits - PAGE_SHIFT)) - 1);
     rc |= irqs_permit_access(d, 1, nr_irqs_gsi - 1);
 
     /*
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fcf6577..83f82b8 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4604,7 +4604,7 @@ struct memory_map_context
 static int _handle_iomem_range(unsigned long s, unsigned long e,
                                struct memory_map_context *ctxt)
 {
-    if ( s > ctxt->s )
+    if ( s > ctxt->s && !(s >> (paddr_bits - PAGE_SHIFT)) )
     {
         e820entry_t ent;
         XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:14:06 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:14: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 1aON6z-0000Lu-VL; Wed, 27 Jan 2016 10:14:05 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6x-0000Kz-MP
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:03 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	CE/A3-09708-B6898A65; Wed, 27 Jan 2016 10:14:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1453889630!11938644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44090 invoked from network); 27 Jan 2016 10:14:02 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:14:02 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7c-0001tG-3a
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON6j-0001Fn-TE
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:13:49 +0000
Date: Wed, 27 Jan 2016 10:13:49 +0000
Message-Id: <E1aON6j-0001Fn-TE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: constrain MFN range Dom0 may
	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 53de839fb40936c074213a0c400e3c959e4ec461
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 21 16:10:42 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 21 16:10:42 2016 +0100

    x86: constrain MFN range Dom0 may access
    
    ... to that covered by the physical address width supported by the
    processor. This implicitly avoids Dom0 (accidentally or due to some
    kind of abuse) passing out of range addresses to a guest, which in
    turn eliminates this only possibility for PV guests to create PTEs
    with one or more reserved bits set.
    
    Note that this is not a security issue due to XSA-77.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain_build.c |    2 +-
 xen/arch/x86/mm.c           |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index d02dc4b..cb287f0 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1533,7 +1533,7 @@ int __init construct_dom0(
 
     /* The hardware domain is initially permitted full I/O capabilities. */
     rc |= ioports_permit_access(d, 0, 0xFFFF);
-    rc |= iomem_permit_access(d, 0UL, ~0UL);
+    rc |= iomem_permit_access(d, 0UL, (1UL << (paddr_bits - PAGE_SHIFT)) - 1);
     rc |= irqs_permit_access(d, 1, nr_irqs_gsi - 1);
 
     /*
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fcf6577..83f82b8 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4604,7 +4604,7 @@ struct memory_map_context
 static int _handle_iomem_range(unsigned long s, unsigned long e,
                                struct memory_map_context *ctxt)
 {
-    if ( s > ctxt->s )
+    if ( s > ctxt->s && !(s >> (paddr_bits - PAGE_SHIFT)) )
     {
         e820entry_t ent;
         XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_param;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:14:19 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:14: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 1aON7D-0000OQ-44; Wed, 27 Jan 2016 10:14: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 1aON7B-0000O1-6M
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:17 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	AB/E8-13487-87898A65; Wed, 27 Jan 2016 10:14:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1453889651!18156990!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49092 invoked from network); 27 Jan 2016 10:14:11 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:14:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7w-0001vJ-Va
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON74-0001Hj-Nf
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:10 +0000
Date: Wed, 27 Jan 2016 10:14:10 +0000
Message-Id: <E1aON74-0001Hj-Nf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Remove osdep indirection
	for xc_evtchn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 97d9bc6ca610b9b3a3306fe25344deb88dff189f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jun 9 13:54:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:19:02 2016 +0000

    tools/libxc: Remove osdep indirection for xc_evtchn
    
    The alternative backend (a xen-api/xapi shim) is no longer around and
    so this stuff is now just baggage which is getting in the way of
    refactoring libxenctrl.
    
    Note that the intention is to move this into a separate library
    shortly.
    
    Nested virt probably suffices for this use case now.
    
    One incorrect instance of using xc_interface where xc_evtchn (in ocaml
    stubs) is removed, this used to work because they were typedefs to the
    same struct, but is no longer permitted.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xenctrl.h                 |    2 +-
 tools/libxc/include/xenctrlosdep.h            |   16 -----
 tools/libxc/xc_evtchn.c                       |   45 -------------
 tools/libxc/xc_freebsd_osdep.c                |   79 +++++++---------------
 tools/libxc/xc_linux_osdep.c                  |   76 ++++++++--------------
 tools/libxc/xc_minios.c                       |   63 +++++++-----------
 tools/libxc/xc_netbsd.c                       |   72 +++++++-------------
 tools/libxc/xc_private.c                      |   37 +++++++++--
 tools/libxc/xc_private.h                      |   17 +++++
 tools/libxc/xc_solaris.c                      |   71 +++++++-------------
 tools/libxc/xenctrl_osdep_ENOSYS.c            |   87 -------------------------
 tools/ocaml/libs/eventchn/xeneventchn_stubs.c |    4 +-
 12 files changed, 180 insertions(+), 389 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 079cad0..1bf70f9 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -117,7 +117,7 @@
  */
 
 typedef struct xc_interface_core xc_interface;
-typedef struct xc_interface_core xc_evtchn;
+typedef struct xenevtchn_handle xc_evtchn;
 typedef struct xc_interface_core xc_gnttab;
 typedef struct xc_interface_core xc_gntshr;
 
diff --git a/tools/libxc/include/xenctrlosdep.h b/tools/libxc/include/xenctrlosdep.h
index 5121d9b..89564e1 100644
--- a/tools/libxc/include/xenctrlosdep.h
+++ b/tools/libxc/include/xenctrlosdep.h
@@ -51,7 +51,6 @@
 
 enum xc_osdep_type {
     XC_OSDEP_PRIVCMD,
-    XC_OSDEP_EVTCHN,
     XC_OSDEP_GNTTAB,
     XC_OSDEP_GNTSHR,
 };
@@ -90,21 +89,6 @@ struct xc_osdep_ops
                                         int nentries);
         } privcmd;
         struct {
-            int (*fd)(xc_evtchn *xce, xc_osdep_handle h);
-
-            int (*notify)(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port);
-
-            evtchn_port_or_error_t (*bind_unbound_port)(xc_evtchn *xce, xc_osdep_handle h, int domid);
-            evtchn_port_or_error_t (*bind_interdomain)(xc_evtchn *xce, xc_osdep_handle h, int domid,
-                                                       evtchn_port_t remote_port);
-            evtchn_port_or_error_t (*bind_virq)(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq);
-
-            int (*unbind)(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port);
-
-            evtchn_port_or_error_t (*pending)(xc_evtchn *xce, xc_osdep_handle h);
-            int (*unmask)(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port);
-        } evtchn;
-        struct {
 #define XC_GRANT_MAP_SINGLE_DOMAIN 0x1
             void *(*grant_map)(xc_gnttab *xcg, xc_osdep_handle h,
                                uint32_t count, int flags, int prot,
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index 15f0580..ae2fe1a 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -77,51 +77,6 @@ int xc_evtchn_status(xc_interface *xch, xc_evtchn_status_t *status)
                         sizeof(*status), 1);
 }
 
-int xc_evtchn_fd(xc_evtchn *xce)
-{
-    return xce->ops->u.evtchn.fd(xce, xce->ops_handle);
-}
-
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
-{
-    return xce->ops->u.evtchn.notify(xce, xce->ops_handle, port);
-}
-
-evtchn_port_or_error_t
-xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
-{
-    return xce->ops->u.evtchn.bind_unbound_port(xce, xce->ops_handle, domid);
-}
-
-evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
-                           evtchn_port_t remote_port)
-{
-    return xce->ops->u.evtchn.bind_interdomain(xce, xce->ops_handle, domid, remote_port);
-}
-
-evtchn_port_or_error_t
-xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
-    return xce->ops->u.evtchn.bind_virq(xce, xce->ops_handle, virq);
-}
-
-int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
-{
-    return xce->ops->u.evtchn.unbind(xce, xce->ops_handle, port);
-}
-
-evtchn_port_or_error_t
-xc_evtchn_pending(xc_evtchn *xce)
-{
-    return xce->ops->u.evtchn.pending(xce, xce->ops_handle);
-}
-
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
-{
-    return xce->ops->u.evtchn.unmask(xce, xce->ops_handle, port);
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
index 4d31a1e..4323e16 100644
--- a/tools/libxc/xc_freebsd_osdep.c
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -252,34 +252,32 @@ static struct xc_osdep_ops freebsd_privcmd_ops = {
 };
 
 /*-------------------------- Evtchn device interface -------------------------*/
-static xc_osdep_handle
-freebsd_evtchn_open(xc_evtchn *xce)
+int osdep_evtchn_open(xc_evtchn *xce)
 {
     int fd = open(EVTCHN_DEV, O_RDWR);
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
-
-    return (xc_osdep_handle)fd;
+        return -1;
+    xce->fd = fd;
+    return 0;
 }
 
-static int
-freebsd_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
+int osdep_evtchn_close(xc_evtchn *xce)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xce->fd == -1 )
+        return 0;
+
+    return close(xce->fd);
 }
 
-static int
-freebsd_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
+int xc_evtchn_fd(xc_evtchn *xce)
 {
-    return (int)h;
+    return xce->fd;
 }
 
 /*------------------------------ Evtchn interface ----------------------------*/
-static int
-freebsd_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_notify notify;
 
     notify.port = port;
@@ -287,10 +285,9 @@ freebsd_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t 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)
+evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
 {
-    int ret, fd = (int)h;
+    int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
 
     bind.remote_domain = domid;
@@ -299,11 +296,10 @@ freebsd_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
     return ( ret == 0 ) ? 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)
+evtchn_port_or_error_t
+xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid, evtchn_port_t remote_port)
 {
-    int ret, fd = (int)h;
+    int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
 
     bind.remote_domain = domid;
@@ -313,10 +309,9 @@ freebsd_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
     return ( ret == 0 ) ? bind.port : ret;
 }
 
-static evtchn_port_or_error_t
-freebsd_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
 {
-    int ret, fd = (int)h;
+    int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_virq bind;
 
     bind.virq = virq;
@@ -325,10 +320,9 @@ freebsd_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
     return ( ret == 0 ) ? bind.port : ret;
 }
 
-static int
-freebsd_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_unbind unbind;
 
     unbind.port = port;
@@ -336,10 +330,9 @@ freebsd_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
     return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
 }
 
-static evtchn_port_or_error_t
-freebsd_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
+evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     evtchn_port_t port;
 
     if ( read(fd, &port, sizeof(port)) != sizeof(port) )
@@ -348,33 +341,15 @@ freebsd_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
     return port;
 }
 
-static int
-freebsd_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
 
     if ( write(fd, &port, sizeof(port)) != sizeof(port) )
         return -1;
     return 0;
 }
 
-/*----------------------------- Evtchn handlers ------------------------------*/
-static struct xc_osdep_ops freebsd_evtchn_ops = {
-    .open = &freebsd_evtchn_open,
-    .close = &freebsd_evtchn_close,
-
-    .u.evtchn = {
-        .fd = &freebsd_evtchn_fd,
-        .notify = &freebsd_evtchn_notify,
-        .bind_unbound_port = &freebsd_evtchn_bind_unbound_port,
-        .bind_interdomain = &freebsd_evtchn_bind_interdomain,
-        .bind_virq = &freebsd_evtchn_bind_virq,
-        .unbind = &freebsd_evtchn_unbind,
-        .pending = &freebsd_evtchn_pending,
-        .unmask = &freebsd_evtchn_unmask,
-    },
-};
-
 /*---------------------------- FreeBSD interface -----------------------------*/
 static struct xc_osdep_ops *
 freebsd_osdep_init(xc_interface *xch, enum xc_osdep_type type)
@@ -383,8 +358,6 @@ freebsd_osdep_init(xc_interface *xch, enum xc_osdep_type type)
     {
     case XC_OSDEP_PRIVCMD:
         return &freebsd_privcmd_ops;
-    case XC_OSDEP_EVTCHN:
-        return &freebsd_evtchn_ops;
     default:
         return NULL;
     }
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index c3a3a14..90544fb 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -38,10 +38,9 @@
 #include "xenctrl.h"
 #include "xenctrlosdep.h"
 
+#include "xc_private.h"
+
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
-#define ERROR(_m, _a...)  xc_osdep_log(xch,XTL_ERROR,XC_INTERNAL_ERROR,_m , ## _a )
-#define PERROR(_m, _a...) xc_osdep_log(xch,XTL_ERROR,XC_INTERNAL_ERROR,_m \
-                  " (%d = %s)", ## _a , errno, xc_strerror(xch, errno))
 
 static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
 {
@@ -462,29 +461,31 @@ static struct xc_osdep_ops linux_privcmd_ops = {
 
 #define DEVXEN "/dev/xen/"
 
-static xc_osdep_handle linux_evtchn_open(xc_evtchn *xce)
+int osdep_evtchn_open(xc_evtchn *xce)
 {
     int fd = open(DEVXEN "evtchn", O_RDWR);
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
-
-    return (xc_osdep_handle)fd;
+        return -1;
+    xce->fd = fd;
+    return 0;
 }
 
-static int linux_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
+int osdep_evtchn_close(xc_evtchn *xce)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xce->fd == -1 )
+        return 0;
+
+    return close(xce->fd);
 }
 
-static int linux_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
+int xc_evtchn_fd(xc_evtchn *xce)
 {
-    return (int)h;
+    return xce->fd;
 }
 
-static int linux_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_notify notify;
 
     notify.port = port;
@@ -492,10 +493,9 @@ static int linux_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t
     return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
-static evtchn_port_or_error_t
-linux_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
+evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
 
     bind.remote_domain = domid;
@@ -503,11 +503,10 @@ linux_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
     return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
 }
 
-static evtchn_port_or_error_t
-linux_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
-                              evtchn_port_t remote_port)
+evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+                                                  evtchn_port_t remote_port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
 
     bind.remote_domain = domid;
@@ -516,10 +515,9 @@ linux_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
     return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
 }
 
-static evtchn_port_or_error_t
-linux_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_virq bind;
 
     bind.virq = virq;
@@ -527,9 +525,9 @@ linux_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
     return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
 }
 
-static int linux_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_unbind unbind;
 
     unbind.port = port;
@@ -537,9 +535,9 @@ static int linux_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t
     return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
 }
 
-static evtchn_port_or_error_t linux_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
+evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     evtchn_port_t port;
 
     if ( read(fd, &port, sizeof(port)) != sizeof(port) )
@@ -548,31 +546,15 @@ static evtchn_port_or_error_t linux_evtchn_pending(xc_evtchn *xce, xc_osdep_hand
     return port;
 }
 
-static int linux_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
 
     if ( write(fd, &port, sizeof(port)) != sizeof(port) )
         return -1;
     return 0;
 }
 
-static struct xc_osdep_ops linux_evtchn_ops = {
-    .open = &linux_evtchn_open,
-    .close = &linux_evtchn_close,
-
-    .u.evtchn = {
-        .fd = &linux_evtchn_fd,
-        .notify = &linux_evtchn_notify,
-        .bind_unbound_port = &linux_evtchn_bind_unbound_port,
-        .bind_interdomain = &linux_evtchn_bind_interdomain,
-        .bind_virq = &linux_evtchn_bind_virq,
-        .unbind = &linux_evtchn_unbind,
-        .pending = &linux_evtchn_pending,
-        .unmask = &linux_evtchn_unmask,
-    },
-};
-
 static xc_osdep_handle linux_gnttab_open(xc_gnttab *xcg)
 {
     int fd = open(DEVXEN "gntdev", O_RDWR);
@@ -876,8 +858,6 @@ static struct xc_osdep_ops *linux_osdep_init(xc_interface *xch, enum xc_osdep_ty
     {
     case XC_OSDEP_PRIVCMD:
         return &linux_privcmd_ops;
-    case XC_OSDEP_EVTCHN:
-        return &linux_evtchn_ops;
     case XC_OSDEP_GNTTAB:
         return &linux_gnttab_ops;
     case XC_OSDEP_GNTSHR:
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index 4f6498f..4ace1b5 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -219,20 +219,23 @@ static void port_dealloc(struct evtchn_port_info *port_info) {
     free(port_info);
 }
 
-static xc_osdep_handle minios_evtchn_open(xc_evtchn *xce)
+int osdep_evtchn_open(xc_evtchn *xce)
 {
     int fd = alloc_fd(FTYPE_EVTCHN);
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
     LIST_INIT(&files[fd].evtchn.ports);
+    xce->fd = fd;
     printf("evtchn_open() -> %d\n", fd);
-    return (xc_osdep_handle)fd;
+    return 0;
 }
 
-static int minios_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
+int osdep_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xce->fd == -1 )
+        return 0;
+
+    return close(xce->fd);
 }
 
 void minios_evtchn_close_fd(int fd)
@@ -244,12 +247,12 @@ void minios_evtchn_close_fd(int fd)
     files[fd].type = FTYPE_NONE;
 }
 
-static int minios_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
+int xc_evtchn_fd(xc_evtchn *xce)
 {
-    return (int)h;
+    return xce->fd;
 }
 
-static int minios_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
 {
     int ret;
 
@@ -281,9 +284,9 @@ static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
     wake_up(&event_queue);
 }
 
-static evtchn_port_or_error_t minios_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
+evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct evtchn_port_info *port_info;
     int ret;
     evtchn_port_t port;
@@ -308,10 +311,10 @@ static evtchn_port_or_error_t minios_evtchn_bind_unbound_port(xc_evtchn *xce, xc
     return port;
 }
 
-static evtchn_port_or_error_t minios_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
-    evtchn_port_t remote_port)
+evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+                                                  evtchn_port_t remote_port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct evtchn_port_info *port_info;
     evtchn_port_t local_port;
     int ret;
@@ -336,9 +339,9 @@ static evtchn_port_or_error_t minios_evtchn_bind_interdomain(xc_evtchn *xce, xc_
     return local_port;
 }
 
-static int minios_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct evtchn_port_info *port_info;
 
     LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
@@ -352,9 +355,9 @@ static int minios_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t
     return -1;
 }
 
-static evtchn_port_or_error_t minios_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct evtchn_port_info *port_info;
     evtchn_port_t port;
 
@@ -377,9 +380,9 @@ static evtchn_port_or_error_t minios_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_h
     return port;
 }
 
-static evtchn_port_or_error_t minios_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
+evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct evtchn_port_info *port_info;
     unsigned long flags;
     evtchn_port_t ret = -1;
@@ -402,28 +405,12 @@ static evtchn_port_or_error_t minios_evtchn_pending(xc_evtchn *xce, xc_osdep_han
     return ret;
 }
 
-static int minios_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
 {
     unmask_evtchn(port);
     return 0;
 }
 
-static struct xc_osdep_ops minios_evtchn_ops = {
-    .open = &minios_evtchn_open,
-    .close = &minios_evtchn_close,
-
-    .u.evtchn = {
-        .fd = &minios_evtchn_fd,
-        .notify = &minios_evtchn_notify,
-        .bind_unbound_port = &minios_evtchn_bind_unbound_port,
-        .bind_interdomain = &minios_evtchn_bind_interdomain,
-        .bind_virq = &minios_evtchn_bind_virq,
-        .unbind = &minios_evtchn_unbind,
-        .pending = &minios_evtchn_pending,
-        .unmask = &minios_evtchn_unmask,
-   },
-};
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush)
 {
@@ -523,8 +510,6 @@ static struct xc_osdep_ops *minios_osdep_init(xc_interface *xch, enum xc_osdep_t
     {
     case XC_OSDEP_PRIVCMD:
         return &minios_privcmd_ops;
-    case XC_OSDEP_EVTCHN:
-        return &minios_evtchn_ops;
     case XC_OSDEP_GNTTAB:
         return &minios_gnttab_ops;
     default:
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 54f1d7b..b1b828f 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -225,29 +225,31 @@ static struct xc_osdep_ops netbsd_privcmd_ops = {
 
 #define EVTCHN_DEV_NAME  "/dev/xenevt"
 
-static xc_osdep_handle netbsd_evtchn_open(xc_evtchn *xce)
+int osdep_evtchn_open(xc_evtchn *xce)
 {
     int fd = open(EVTCHN_DEV_NAME, O_NONBLOCK|O_RDWR);
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
-
-    return (xc_osdep_handle)fd;
+        return -1;
+    xce->fd = fd;
+    return 0;
 }
 
-static int netbsd_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
+int osdep_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xce->fd == -1 )
+        return 0;
+
+    return close(xce->fd);
 }
 
-static int netbsd_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
+int xc_evtchn_fd(xc_evtchn *xce)
 {
-    return (int)h;
+    return xce->fd;
 }
 
-static int netbsd_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_notify notify;
 
     notify.port = port;
@@ -255,10 +257,9 @@ static int netbsd_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t
     return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
-static evtchn_port_or_error_t
-netbsd_evtchn_bind_unbound_port(xc_evtchn * xce, xc_osdep_handle h, int domid)
+evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn * xce, int domid)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
     int ret;
 
@@ -271,11 +272,10 @@ netbsd_evtchn_bind_unbound_port(xc_evtchn * xce, xc_osdep_handle h, int domid)
 	return -1;
 }
 
-static evtchn_port_or_error_t
-netbsd_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
-                               evtchn_port_t remote_port)
+evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+                                                  evtchn_port_t remote_port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
     int ret;
 
@@ -289,9 +289,9 @@ netbsd_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
 	return -1;
 }
 
-static int netbsd_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_unbind unbind;
 
     unbind.port = port;
@@ -299,10 +299,9 @@ static int netbsd_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t
     return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
 }
 
-static evtchn_port_or_error_t
-netbsd_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_virq bind;
     int err;
 
@@ -315,10 +314,9 @@ netbsd_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
 	return bind.port;
 }
 
-static evtchn_port_or_error_t
-netbsd_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
+evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     evtchn_port_t port;
 
     if ( read_exact(fd, (char *)&port, sizeof(port)) == -1 )
@@ -327,28 +325,12 @@ netbsd_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
     return port;
 }
 
-static int netbsd_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     return write_exact(fd, (char *)&port, sizeof(port));
 }
 
-static struct xc_osdep_ops netbsd_evtchn_ops = {
-    .open = &netbsd_evtchn_open,
-    .close = &netbsd_evtchn_close,
-
-    .u.evtchn = {
-         .fd = &netbsd_evtchn_fd,
-         .notify = &netbsd_evtchn_notify,
-         .bind_unbound_port = &netbsd_evtchn_bind_unbound_port,
-         .bind_interdomain = &netbsd_evtchn_bind_interdomain,
-         .bind_virq = &netbsd_evtchn_bind_virq,
-         .unbind = &netbsd_evtchn_unbind,
-         .pending = &netbsd_evtchn_pending,
-         .unmask = &netbsd_evtchn_unmask,
-    },
-};
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
@@ -395,8 +377,6 @@ static struct xc_osdep_ops *netbsd_osdep_init(xc_interface *xch, enum xc_osdep_t
     {
     case XC_OSDEP_PRIVCMD:
         return &netbsd_privcmd_ops;
-    case XC_OSDEP_EVTCHN:
-        return &netbsd_evtchn_ops;
     default:
         return NULL;
     }
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 6c0c0d6..cb79f22 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -119,7 +119,6 @@ static const char *xc_osdep_type_name(enum xc_osdep_type type)
     switch ( type )
     {
     case XC_OSDEP_PRIVCMD: return "privcmd";
-    case XC_OSDEP_EVTCHN:  return "evtchn";
     case XC_OSDEP_GNTTAB:  return "gnttab";
     case XC_OSDEP_GNTSHR:  return "gntshr";
     }
@@ -252,20 +251,44 @@ int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
     return xch->ops->u.privcmd.hypercall(xch, xch->ops_handle, hypercall);
 }
 
-xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
-                             unsigned open_flags)
+xc_evtchn *xc_evtchn_open(xentoollog_logger *logger, unsigned open_flags)
 {
-    xc_evtchn *xce;
+    xc_evtchn *xce = malloc(sizeof(*xce));
+    int rc;
+
+    if (!xce) return NULL;
+
+    xce->fd = -1;
+    xce->logger = logger;
+    xce->logger_tofree  = NULL;
 
-    xce = xc_interface_open_common(logger, NULL, open_flags,
-                                   XC_OSDEP_EVTCHN);
+    if (!xce->logger) {
+        xce->logger = xce->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xce->logger) goto err;
+    }
+
+    rc = osdep_evtchn_open(xce);
+    if ( rc  < 0 ) goto err;
 
     return xce;
+
+err:
+    osdep_evtchn_close(xce);
+    xtl_logger_destroy(xce->logger_tofree);
+    free(xce);
+    return NULL;
 }
 
 int xc_evtchn_close(xc_evtchn *xce)
 {
-    return xc_interface_close_common(xce);
+    int rc;
+
+    rc = osdep_evtchn_close(xce);
+    xtl_logger_destroy(xce->logger_tofree);
+    free(xce);
+    return rc;
 }
 
 xc_gnttab *xc_gnttab_open(xentoollog_logger *logger,
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index f603c15..f4d155a 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -123,6 +123,13 @@ struct xc_interface_core {
     xc_osdep_handle  ops_handle; /* opaque data for xc_osdep_ops */
 };
 
+struct xenevtchn_handle {
+    xentoollog_logger *logger, *logger_tofree;
+    int fd;
+};
+int osdep_evtchn_open(xc_evtchn *xce);
+int osdep_evtchn_close(xc_evtchn *xce);
+
 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,
@@ -446,3 +453,13 @@ void *xc_vm_event_enable(xc_interface *xch, domid_t domain_id, int param,
                          uint32_t *port);
 
 #endif /* __XC_PRIVATE_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/xc_solaris.c b/tools/libxc/xc_solaris.c
index 7e5d847..088228a 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -194,33 +194,36 @@ static struct xc_osdep_ops solaris_privcmd_ops = {
     },
 };
 
-static xc_osdep_handle solaris_evtchn_open(xc_evtchn *xce)
+int osdep_evtchn_open(xc_evtchn *xce)
 {
     int fd;
 
     if ( (fd = open("/dev/xen/evtchn", O_RDWR)) == -1 )
     {
         PERROR("Could not open event channel interface");
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
     }
 
-    return (xc_osdep_handle)fd;
+    xce->fd = fd;
+    return 0;
 }
 
-static int solaris_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
+int osdep_evtchn_close(xc_evtchn *xce)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xce->fd == -1 )
+        return 0;
+
+    return close(xce->fd);
 }
 
-static int solaris_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
+int xc_evtchn_fd(xc_evtchn *xce)
 {
-    return (int)h;
+    return xce->fd;
 }
 
-static int solaris_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_notify notify;
 
     notify.port = port;
@@ -228,10 +231,9 @@ static int solaris_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_
     return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
-static evtchn_port_or_error_t
-solaris_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
+evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
 
     bind.remote_domain = domid;
@@ -239,11 +241,10 @@ solaris_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
     return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
 }
 
-evtchn_port_or_error_t
-solaris_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
-                           evtchn_port_t remote_port)
+evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+                                                  evtchn_port_t remote_port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
 
     bind.remote_domain = domid;
@@ -252,10 +253,9 @@ solaris_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
     return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
 }
 
-static evtchn_port_or_error_t
-solaris_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_virq bind;
 
     bind.virq = virq;
@@ -263,9 +263,9 @@ solaris_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
     return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
 }
 
-static int solaris_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_unbind unbind;
 
     unbind.port = port;
@@ -273,10 +273,9 @@ static int solaris_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_
     return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
 }
 
-static evtchn_port_or_error_t
-solaris_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
+evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     evtchn_port_t port;
 
     if ( read_exact(fd, (char *)&port, sizeof(port)) == -1 )
@@ -285,28 +284,12 @@ solaris_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
     return port;
 }
 
-static int solaris_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h,evtchn_port_t port)
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     return write_exact(fd, (char *)&port, sizeof(port));
 }
 
-static struct xc_osdep_ops solaris_evtchn_ops = {
-    .open = &solaris_evtchn_open,
-    .close = &solaris_evtchn_close,
-
-    .u.evtchn = {
-        .fd = &solaris_evtchn_fd,
-        .notify = &solaris_evtchn_notify,
-        .bind_unbound_port = &solaris_evtchn_bind_unbound_port,
-        .bind_interdomain = &solaris_evtchn_bind_interdomain,
-        .bind_virq = &solaris_evtchn_bind_virq,
-        .unbind = &solaris_evtchn_unbind,
-        .pending = &solaris_evtchn_pending,
-        .unmask = &solaris_evtchn_unmask,
-    },
-};
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
@@ -324,8 +307,6 @@ static struct xc_osdep_ops *solaris_osdep_init(xc_interface *xch, enum xc_osdep_
     {
     case XC_OSDEP_PRIVCMD:
         return &solaris_privcmd_ops;
-    case XC_OSDEP_EVTCHN:
-        return &solaris_evtchn_ops;
     default:
         return NULL;
     }
diff --git a/tools/libxc/xenctrl_osdep_ENOSYS.c b/tools/libxc/xenctrl_osdep_ENOSYS.c
index dd59dcd..5182532 100644
--- a/tools/libxc/xenctrl_osdep_ENOSYS.c
+++ b/tools/libxc/xenctrl_osdep_ENOSYS.c
@@ -81,90 +81,6 @@ static struct xc_osdep_ops ENOSYS_privcmd_ops =
     }
 };
 
-static xc_osdep_handle ENOSYS_evtchn_open(xc_interface *xce)
-{
-    IPRINTF(xce, "ENOSYS_evtchn: opening handle %p\n", (void *)1);
-    return (xc_osdep_handle)2; /*dummy*/
-}
-
-static int ENOSYS_evtchn_close(xc_interface *xce, xc_osdep_handle 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 %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 %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 %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 %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 %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 %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 %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 %lx unmask: %d\n", h, port);
-    return -ENOSYS;
-}
-
-static struct xc_osdep_ops ENOSYS_evtchn_ops = {
-    .open = &ENOSYS_evtchn_open,
-    .close = &ENOSYS_evtchn_close,
-
-    .u.evtchn = {
-        .fd = &ENOSYS_evtchn_fd,
-
-        .notify = &ENOSYS_evtchn_notify,
-
-        .bind_unbound_port = &ENOSYS_evtchn_bind_unbound_port,
-        .bind_interdomain = &ENOSYS_evtchn_bind_interdomain,
-        .bind_virq = &ENOSYS_evtchn_bind_virq,
-
-        .unbind = &ENOSYS_evtchn_unbind,
-
-        .pending = &ENOSYS_evtchn_pending,
-        .unmask = &ENOSYS_evtchn_unmask,
-    },
-};
-
 static struct xc_osdep_ops * ENOSYS_osdep_init(xc_interface *xch, enum xc_osdep_type type)
 {
     struct xc_osdep_ops *ops;
@@ -180,9 +96,6 @@ static struct xc_osdep_ops * ENOSYS_osdep_init(xc_interface *xch, enum xc_osdep_
     case XC_OSDEP_PRIVCMD:
         ops = &ENOSYS_privcmd_ops;
         break;
-    case XC_OSDEP_EVTCHN:
-        ops = &ENOSYS_evtchn_ops;
-        break;
     default:
         ops = NULL;
         break;
diff --git a/tools/ocaml/libs/eventchn/xeneventchn_stubs.c b/tools/ocaml/libs/eventchn/xeneventchn_stubs.c
index abefd6b..5939e7c 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn_stubs.c
+++ b/tools/ocaml/libs/eventchn/xeneventchn_stubs.c
@@ -34,14 +34,14 @@
 #include <caml/callback.h>
 #include <caml/fail.h>
 
-#define _H(__h) ((xc_interface *)(__h))
+#define _H(__h) ((xc_evtchn *)(__h))
 
 CAMLprim value stub_eventchn_init(void)
 {
 	CAMLparam0();
 	CAMLlocal1(result);
 
-	xc_interface *xce = xc_evtchn_open(NULL, XC_OPENFLAG_NON_REENTRANT);
+	xc_evtchn *xce = xc_evtchn_open(NULL, XC_OPENFLAG_NON_REENTRANT);
 	if (xce == NULL)
 		caml_failwith("open failed");
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:14:19 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:14: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 1aON7D-0000OQ-44; Wed, 27 Jan 2016 10:14: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 1aON7B-0000O1-6M
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:17 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	AB/E8-13487-87898A65; Wed, 27 Jan 2016 10:14:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1453889651!18156990!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49092 invoked from network); 27 Jan 2016 10:14:11 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:14:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7w-0001vJ-Va
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON74-0001Hj-Nf
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:10 +0000
Date: Wed, 27 Jan 2016 10:14:10 +0000
Message-Id: <E1aON74-0001Hj-Nf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Remove osdep indirection
	for xc_evtchn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 97d9bc6ca610b9b3a3306fe25344deb88dff189f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jun 9 13:54:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:19:02 2016 +0000

    tools/libxc: Remove osdep indirection for xc_evtchn
    
    The alternative backend (a xen-api/xapi shim) is no longer around and
    so this stuff is now just baggage which is getting in the way of
    refactoring libxenctrl.
    
    Note that the intention is to move this into a separate library
    shortly.
    
    Nested virt probably suffices for this use case now.
    
    One incorrect instance of using xc_interface where xc_evtchn (in ocaml
    stubs) is removed, this used to work because they were typedefs to the
    same struct, but is no longer permitted.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xenctrl.h                 |    2 +-
 tools/libxc/include/xenctrlosdep.h            |   16 -----
 tools/libxc/xc_evtchn.c                       |   45 -------------
 tools/libxc/xc_freebsd_osdep.c                |   79 +++++++---------------
 tools/libxc/xc_linux_osdep.c                  |   76 ++++++++--------------
 tools/libxc/xc_minios.c                       |   63 +++++++-----------
 tools/libxc/xc_netbsd.c                       |   72 +++++++-------------
 tools/libxc/xc_private.c                      |   37 +++++++++--
 tools/libxc/xc_private.h                      |   17 +++++
 tools/libxc/xc_solaris.c                      |   71 +++++++-------------
 tools/libxc/xenctrl_osdep_ENOSYS.c            |   87 -------------------------
 tools/ocaml/libs/eventchn/xeneventchn_stubs.c |    4 +-
 12 files changed, 180 insertions(+), 389 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 079cad0..1bf70f9 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -117,7 +117,7 @@
  */
 
 typedef struct xc_interface_core xc_interface;
-typedef struct xc_interface_core xc_evtchn;
+typedef struct xenevtchn_handle xc_evtchn;
 typedef struct xc_interface_core xc_gnttab;
 typedef struct xc_interface_core xc_gntshr;
 
diff --git a/tools/libxc/include/xenctrlosdep.h b/tools/libxc/include/xenctrlosdep.h
index 5121d9b..89564e1 100644
--- a/tools/libxc/include/xenctrlosdep.h
+++ b/tools/libxc/include/xenctrlosdep.h
@@ -51,7 +51,6 @@
 
 enum xc_osdep_type {
     XC_OSDEP_PRIVCMD,
-    XC_OSDEP_EVTCHN,
     XC_OSDEP_GNTTAB,
     XC_OSDEP_GNTSHR,
 };
@@ -90,21 +89,6 @@ struct xc_osdep_ops
                                         int nentries);
         } privcmd;
         struct {
-            int (*fd)(xc_evtchn *xce, xc_osdep_handle h);
-
-            int (*notify)(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port);
-
-            evtchn_port_or_error_t (*bind_unbound_port)(xc_evtchn *xce, xc_osdep_handle h, int domid);
-            evtchn_port_or_error_t (*bind_interdomain)(xc_evtchn *xce, xc_osdep_handle h, int domid,
-                                                       evtchn_port_t remote_port);
-            evtchn_port_or_error_t (*bind_virq)(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq);
-
-            int (*unbind)(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port);
-
-            evtchn_port_or_error_t (*pending)(xc_evtchn *xce, xc_osdep_handle h);
-            int (*unmask)(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port);
-        } evtchn;
-        struct {
 #define XC_GRANT_MAP_SINGLE_DOMAIN 0x1
             void *(*grant_map)(xc_gnttab *xcg, xc_osdep_handle h,
                                uint32_t count, int flags, int prot,
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index 15f0580..ae2fe1a 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -77,51 +77,6 @@ int xc_evtchn_status(xc_interface *xch, xc_evtchn_status_t *status)
                         sizeof(*status), 1);
 }
 
-int xc_evtchn_fd(xc_evtchn *xce)
-{
-    return xce->ops->u.evtchn.fd(xce, xce->ops_handle);
-}
-
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
-{
-    return xce->ops->u.evtchn.notify(xce, xce->ops_handle, port);
-}
-
-evtchn_port_or_error_t
-xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
-{
-    return xce->ops->u.evtchn.bind_unbound_port(xce, xce->ops_handle, domid);
-}
-
-evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
-                           evtchn_port_t remote_port)
-{
-    return xce->ops->u.evtchn.bind_interdomain(xce, xce->ops_handle, domid, remote_port);
-}
-
-evtchn_port_or_error_t
-xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
-    return xce->ops->u.evtchn.bind_virq(xce, xce->ops_handle, virq);
-}
-
-int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
-{
-    return xce->ops->u.evtchn.unbind(xce, xce->ops_handle, port);
-}
-
-evtchn_port_or_error_t
-xc_evtchn_pending(xc_evtchn *xce)
-{
-    return xce->ops->u.evtchn.pending(xce, xce->ops_handle);
-}
-
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
-{
-    return xce->ops->u.evtchn.unmask(xce, xce->ops_handle, port);
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
index 4d31a1e..4323e16 100644
--- a/tools/libxc/xc_freebsd_osdep.c
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -252,34 +252,32 @@ static struct xc_osdep_ops freebsd_privcmd_ops = {
 };
 
 /*-------------------------- Evtchn device interface -------------------------*/
-static xc_osdep_handle
-freebsd_evtchn_open(xc_evtchn *xce)
+int osdep_evtchn_open(xc_evtchn *xce)
 {
     int fd = open(EVTCHN_DEV, O_RDWR);
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
-
-    return (xc_osdep_handle)fd;
+        return -1;
+    xce->fd = fd;
+    return 0;
 }
 
-static int
-freebsd_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
+int osdep_evtchn_close(xc_evtchn *xce)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xce->fd == -1 )
+        return 0;
+
+    return close(xce->fd);
 }
 
-static int
-freebsd_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
+int xc_evtchn_fd(xc_evtchn *xce)
 {
-    return (int)h;
+    return xce->fd;
 }
 
 /*------------------------------ Evtchn interface ----------------------------*/
-static int
-freebsd_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_notify notify;
 
     notify.port = port;
@@ -287,10 +285,9 @@ freebsd_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t 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)
+evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
 {
-    int ret, fd = (int)h;
+    int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
 
     bind.remote_domain = domid;
@@ -299,11 +296,10 @@ freebsd_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
     return ( ret == 0 ) ? 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)
+evtchn_port_or_error_t
+xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid, evtchn_port_t remote_port)
 {
-    int ret, fd = (int)h;
+    int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
 
     bind.remote_domain = domid;
@@ -313,10 +309,9 @@ freebsd_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
     return ( ret == 0 ) ? bind.port : ret;
 }
 
-static evtchn_port_or_error_t
-freebsd_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
 {
-    int ret, fd = (int)h;
+    int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_virq bind;
 
     bind.virq = virq;
@@ -325,10 +320,9 @@ freebsd_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
     return ( ret == 0 ) ? bind.port : ret;
 }
 
-static int
-freebsd_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_unbind unbind;
 
     unbind.port = port;
@@ -336,10 +330,9 @@ freebsd_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
     return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
 }
 
-static evtchn_port_or_error_t
-freebsd_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
+evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     evtchn_port_t port;
 
     if ( read(fd, &port, sizeof(port)) != sizeof(port) )
@@ -348,33 +341,15 @@ freebsd_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
     return port;
 }
 
-static int
-freebsd_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
 
     if ( write(fd, &port, sizeof(port)) != sizeof(port) )
         return -1;
     return 0;
 }
 
-/*----------------------------- Evtchn handlers ------------------------------*/
-static struct xc_osdep_ops freebsd_evtchn_ops = {
-    .open = &freebsd_evtchn_open,
-    .close = &freebsd_evtchn_close,
-
-    .u.evtchn = {
-        .fd = &freebsd_evtchn_fd,
-        .notify = &freebsd_evtchn_notify,
-        .bind_unbound_port = &freebsd_evtchn_bind_unbound_port,
-        .bind_interdomain = &freebsd_evtchn_bind_interdomain,
-        .bind_virq = &freebsd_evtchn_bind_virq,
-        .unbind = &freebsd_evtchn_unbind,
-        .pending = &freebsd_evtchn_pending,
-        .unmask = &freebsd_evtchn_unmask,
-    },
-};
-
 /*---------------------------- FreeBSD interface -----------------------------*/
 static struct xc_osdep_ops *
 freebsd_osdep_init(xc_interface *xch, enum xc_osdep_type type)
@@ -383,8 +358,6 @@ freebsd_osdep_init(xc_interface *xch, enum xc_osdep_type type)
     {
     case XC_OSDEP_PRIVCMD:
         return &freebsd_privcmd_ops;
-    case XC_OSDEP_EVTCHN:
-        return &freebsd_evtchn_ops;
     default:
         return NULL;
     }
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index c3a3a14..90544fb 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -38,10 +38,9 @@
 #include "xenctrl.h"
 #include "xenctrlosdep.h"
 
+#include "xc_private.h"
+
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
-#define ERROR(_m, _a...)  xc_osdep_log(xch,XTL_ERROR,XC_INTERNAL_ERROR,_m , ## _a )
-#define PERROR(_m, _a...) xc_osdep_log(xch,XTL_ERROR,XC_INTERNAL_ERROR,_m \
-                  " (%d = %s)", ## _a , errno, xc_strerror(xch, errno))
 
 static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
 {
@@ -462,29 +461,31 @@ static struct xc_osdep_ops linux_privcmd_ops = {
 
 #define DEVXEN "/dev/xen/"
 
-static xc_osdep_handle linux_evtchn_open(xc_evtchn *xce)
+int osdep_evtchn_open(xc_evtchn *xce)
 {
     int fd = open(DEVXEN "evtchn", O_RDWR);
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
-
-    return (xc_osdep_handle)fd;
+        return -1;
+    xce->fd = fd;
+    return 0;
 }
 
-static int linux_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
+int osdep_evtchn_close(xc_evtchn *xce)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xce->fd == -1 )
+        return 0;
+
+    return close(xce->fd);
 }
 
-static int linux_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
+int xc_evtchn_fd(xc_evtchn *xce)
 {
-    return (int)h;
+    return xce->fd;
 }
 
-static int linux_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_notify notify;
 
     notify.port = port;
@@ -492,10 +493,9 @@ static int linux_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t
     return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
-static evtchn_port_or_error_t
-linux_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
+evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
 
     bind.remote_domain = domid;
@@ -503,11 +503,10 @@ linux_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
     return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
 }
 
-static evtchn_port_or_error_t
-linux_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
-                              evtchn_port_t remote_port)
+evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+                                                  evtchn_port_t remote_port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
 
     bind.remote_domain = domid;
@@ -516,10 +515,9 @@ linux_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
     return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
 }
 
-static evtchn_port_or_error_t
-linux_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_virq bind;
 
     bind.virq = virq;
@@ -527,9 +525,9 @@ linux_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
     return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
 }
 
-static int linux_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_unbind unbind;
 
     unbind.port = port;
@@ -537,9 +535,9 @@ static int linux_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t
     return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
 }
 
-static evtchn_port_or_error_t linux_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
+evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     evtchn_port_t port;
 
     if ( read(fd, &port, sizeof(port)) != sizeof(port) )
@@ -548,31 +546,15 @@ static evtchn_port_or_error_t linux_evtchn_pending(xc_evtchn *xce, xc_osdep_hand
     return port;
 }
 
-static int linux_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
 
     if ( write(fd, &port, sizeof(port)) != sizeof(port) )
         return -1;
     return 0;
 }
 
-static struct xc_osdep_ops linux_evtchn_ops = {
-    .open = &linux_evtchn_open,
-    .close = &linux_evtchn_close,
-
-    .u.evtchn = {
-        .fd = &linux_evtchn_fd,
-        .notify = &linux_evtchn_notify,
-        .bind_unbound_port = &linux_evtchn_bind_unbound_port,
-        .bind_interdomain = &linux_evtchn_bind_interdomain,
-        .bind_virq = &linux_evtchn_bind_virq,
-        .unbind = &linux_evtchn_unbind,
-        .pending = &linux_evtchn_pending,
-        .unmask = &linux_evtchn_unmask,
-    },
-};
-
 static xc_osdep_handle linux_gnttab_open(xc_gnttab *xcg)
 {
     int fd = open(DEVXEN "gntdev", O_RDWR);
@@ -876,8 +858,6 @@ static struct xc_osdep_ops *linux_osdep_init(xc_interface *xch, enum xc_osdep_ty
     {
     case XC_OSDEP_PRIVCMD:
         return &linux_privcmd_ops;
-    case XC_OSDEP_EVTCHN:
-        return &linux_evtchn_ops;
     case XC_OSDEP_GNTTAB:
         return &linux_gnttab_ops;
     case XC_OSDEP_GNTSHR:
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index 4f6498f..4ace1b5 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -219,20 +219,23 @@ static void port_dealloc(struct evtchn_port_info *port_info) {
     free(port_info);
 }
 
-static xc_osdep_handle minios_evtchn_open(xc_evtchn *xce)
+int osdep_evtchn_open(xc_evtchn *xce)
 {
     int fd = alloc_fd(FTYPE_EVTCHN);
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
     LIST_INIT(&files[fd].evtchn.ports);
+    xce->fd = fd;
     printf("evtchn_open() -> %d\n", fd);
-    return (xc_osdep_handle)fd;
+    return 0;
 }
 
-static int minios_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
+int osdep_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xce->fd == -1 )
+        return 0;
+
+    return close(xce->fd);
 }
 
 void minios_evtchn_close_fd(int fd)
@@ -244,12 +247,12 @@ void minios_evtchn_close_fd(int fd)
     files[fd].type = FTYPE_NONE;
 }
 
-static int minios_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
+int xc_evtchn_fd(xc_evtchn *xce)
 {
-    return (int)h;
+    return xce->fd;
 }
 
-static int minios_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
 {
     int ret;
 
@@ -281,9 +284,9 @@ static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
     wake_up(&event_queue);
 }
 
-static evtchn_port_or_error_t minios_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
+evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct evtchn_port_info *port_info;
     int ret;
     evtchn_port_t port;
@@ -308,10 +311,10 @@ static evtchn_port_or_error_t minios_evtchn_bind_unbound_port(xc_evtchn *xce, xc
     return port;
 }
 
-static evtchn_port_or_error_t minios_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
-    evtchn_port_t remote_port)
+evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+                                                  evtchn_port_t remote_port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct evtchn_port_info *port_info;
     evtchn_port_t local_port;
     int ret;
@@ -336,9 +339,9 @@ static evtchn_port_or_error_t minios_evtchn_bind_interdomain(xc_evtchn *xce, xc_
     return local_port;
 }
 
-static int minios_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct evtchn_port_info *port_info;
 
     LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
@@ -352,9 +355,9 @@ static int minios_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t
     return -1;
 }
 
-static evtchn_port_or_error_t minios_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct evtchn_port_info *port_info;
     evtchn_port_t port;
 
@@ -377,9 +380,9 @@ static evtchn_port_or_error_t minios_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_h
     return port;
 }
 
-static evtchn_port_or_error_t minios_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
+evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct evtchn_port_info *port_info;
     unsigned long flags;
     evtchn_port_t ret = -1;
@@ -402,28 +405,12 @@ static evtchn_port_or_error_t minios_evtchn_pending(xc_evtchn *xce, xc_osdep_han
     return ret;
 }
 
-static int minios_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
 {
     unmask_evtchn(port);
     return 0;
 }
 
-static struct xc_osdep_ops minios_evtchn_ops = {
-    .open = &minios_evtchn_open,
-    .close = &minios_evtchn_close,
-
-    .u.evtchn = {
-        .fd = &minios_evtchn_fd,
-        .notify = &minios_evtchn_notify,
-        .bind_unbound_port = &minios_evtchn_bind_unbound_port,
-        .bind_interdomain = &minios_evtchn_bind_interdomain,
-        .bind_virq = &minios_evtchn_bind_virq,
-        .unbind = &minios_evtchn_unbind,
-        .pending = &minios_evtchn_pending,
-        .unmask = &minios_evtchn_unmask,
-   },
-};
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush)
 {
@@ -523,8 +510,6 @@ static struct xc_osdep_ops *minios_osdep_init(xc_interface *xch, enum xc_osdep_t
     {
     case XC_OSDEP_PRIVCMD:
         return &minios_privcmd_ops;
-    case XC_OSDEP_EVTCHN:
-        return &minios_evtchn_ops;
     case XC_OSDEP_GNTTAB:
         return &minios_gnttab_ops;
     default:
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 54f1d7b..b1b828f 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -225,29 +225,31 @@ static struct xc_osdep_ops netbsd_privcmd_ops = {
 
 #define EVTCHN_DEV_NAME  "/dev/xenevt"
 
-static xc_osdep_handle netbsd_evtchn_open(xc_evtchn *xce)
+int osdep_evtchn_open(xc_evtchn *xce)
 {
     int fd = open(EVTCHN_DEV_NAME, O_NONBLOCK|O_RDWR);
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
-
-    return (xc_osdep_handle)fd;
+        return -1;
+    xce->fd = fd;
+    return 0;
 }
 
-static int netbsd_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
+int osdep_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xce->fd == -1 )
+        return 0;
+
+    return close(xce->fd);
 }
 
-static int netbsd_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
+int xc_evtchn_fd(xc_evtchn *xce)
 {
-    return (int)h;
+    return xce->fd;
 }
 
-static int netbsd_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_notify notify;
 
     notify.port = port;
@@ -255,10 +257,9 @@ static int netbsd_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t
     return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
-static evtchn_port_or_error_t
-netbsd_evtchn_bind_unbound_port(xc_evtchn * xce, xc_osdep_handle h, int domid)
+evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn * xce, int domid)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
     int ret;
 
@@ -271,11 +272,10 @@ netbsd_evtchn_bind_unbound_port(xc_evtchn * xce, xc_osdep_handle h, int domid)
 	return -1;
 }
 
-static evtchn_port_or_error_t
-netbsd_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
-                               evtchn_port_t remote_port)
+evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+                                                  evtchn_port_t remote_port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
     int ret;
 
@@ -289,9 +289,9 @@ netbsd_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
 	return -1;
 }
 
-static int netbsd_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_unbind unbind;
 
     unbind.port = port;
@@ -299,10 +299,9 @@ static int netbsd_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t
     return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
 }
 
-static evtchn_port_or_error_t
-netbsd_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_virq bind;
     int err;
 
@@ -315,10 +314,9 @@ netbsd_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
 	return bind.port;
 }
 
-static evtchn_port_or_error_t
-netbsd_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
+evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     evtchn_port_t port;
 
     if ( read_exact(fd, (char *)&port, sizeof(port)) == -1 )
@@ -327,28 +325,12 @@ netbsd_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
     return port;
 }
 
-static int netbsd_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     return write_exact(fd, (char *)&port, sizeof(port));
 }
 
-static struct xc_osdep_ops netbsd_evtchn_ops = {
-    .open = &netbsd_evtchn_open,
-    .close = &netbsd_evtchn_close,
-
-    .u.evtchn = {
-         .fd = &netbsd_evtchn_fd,
-         .notify = &netbsd_evtchn_notify,
-         .bind_unbound_port = &netbsd_evtchn_bind_unbound_port,
-         .bind_interdomain = &netbsd_evtchn_bind_interdomain,
-         .bind_virq = &netbsd_evtchn_bind_virq,
-         .unbind = &netbsd_evtchn_unbind,
-         .pending = &netbsd_evtchn_pending,
-         .unmask = &netbsd_evtchn_unmask,
-    },
-};
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
@@ -395,8 +377,6 @@ static struct xc_osdep_ops *netbsd_osdep_init(xc_interface *xch, enum xc_osdep_t
     {
     case XC_OSDEP_PRIVCMD:
         return &netbsd_privcmd_ops;
-    case XC_OSDEP_EVTCHN:
-        return &netbsd_evtchn_ops;
     default:
         return NULL;
     }
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 6c0c0d6..cb79f22 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -119,7 +119,6 @@ static const char *xc_osdep_type_name(enum xc_osdep_type type)
     switch ( type )
     {
     case XC_OSDEP_PRIVCMD: return "privcmd";
-    case XC_OSDEP_EVTCHN:  return "evtchn";
     case XC_OSDEP_GNTTAB:  return "gnttab";
     case XC_OSDEP_GNTSHR:  return "gntshr";
     }
@@ -252,20 +251,44 @@ int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
     return xch->ops->u.privcmd.hypercall(xch, xch->ops_handle, hypercall);
 }
 
-xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
-                             unsigned open_flags)
+xc_evtchn *xc_evtchn_open(xentoollog_logger *logger, unsigned open_flags)
 {
-    xc_evtchn *xce;
+    xc_evtchn *xce = malloc(sizeof(*xce));
+    int rc;
+
+    if (!xce) return NULL;
+
+    xce->fd = -1;
+    xce->logger = logger;
+    xce->logger_tofree  = NULL;
 
-    xce = xc_interface_open_common(logger, NULL, open_flags,
-                                   XC_OSDEP_EVTCHN);
+    if (!xce->logger) {
+        xce->logger = xce->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xce->logger) goto err;
+    }
+
+    rc = osdep_evtchn_open(xce);
+    if ( rc  < 0 ) goto err;
 
     return xce;
+
+err:
+    osdep_evtchn_close(xce);
+    xtl_logger_destroy(xce->logger_tofree);
+    free(xce);
+    return NULL;
 }
 
 int xc_evtchn_close(xc_evtchn *xce)
 {
-    return xc_interface_close_common(xce);
+    int rc;
+
+    rc = osdep_evtchn_close(xce);
+    xtl_logger_destroy(xce->logger_tofree);
+    free(xce);
+    return rc;
 }
 
 xc_gnttab *xc_gnttab_open(xentoollog_logger *logger,
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index f603c15..f4d155a 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -123,6 +123,13 @@ struct xc_interface_core {
     xc_osdep_handle  ops_handle; /* opaque data for xc_osdep_ops */
 };
 
+struct xenevtchn_handle {
+    xentoollog_logger *logger, *logger_tofree;
+    int fd;
+};
+int osdep_evtchn_open(xc_evtchn *xce);
+int osdep_evtchn_close(xc_evtchn *xce);
+
 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,
@@ -446,3 +453,13 @@ void *xc_vm_event_enable(xc_interface *xch, domid_t domain_id, int param,
                          uint32_t *port);
 
 #endif /* __XC_PRIVATE_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/xc_solaris.c b/tools/libxc/xc_solaris.c
index 7e5d847..088228a 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -194,33 +194,36 @@ static struct xc_osdep_ops solaris_privcmd_ops = {
     },
 };
 
-static xc_osdep_handle solaris_evtchn_open(xc_evtchn *xce)
+int osdep_evtchn_open(xc_evtchn *xce)
 {
     int fd;
 
     if ( (fd = open("/dev/xen/evtchn", O_RDWR)) == -1 )
     {
         PERROR("Could not open event channel interface");
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
     }
 
-    return (xc_osdep_handle)fd;
+    xce->fd = fd;
+    return 0;
 }
 
-static int solaris_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
+int osdep_evtchn_close(xc_evtchn *xce)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xce->fd == -1 )
+        return 0;
+
+    return close(xce->fd);
 }
 
-static int solaris_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
+int xc_evtchn_fd(xc_evtchn *xce)
 {
-    return (int)h;
+    return xce->fd;
 }
 
-static int solaris_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_notify notify;
 
     notify.port = port;
@@ -228,10 +231,9 @@ static int solaris_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_
     return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
-static evtchn_port_or_error_t
-solaris_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
+evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
 
     bind.remote_domain = domid;
@@ -239,11 +241,10 @@ solaris_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
     return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
 }
 
-evtchn_port_or_error_t
-solaris_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
-                           evtchn_port_t remote_port)
+evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+                                                  evtchn_port_t remote_port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
 
     bind.remote_domain = domid;
@@ -252,10 +253,9 @@ solaris_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
     return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
 }
 
-static evtchn_port_or_error_t
-solaris_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_bind_virq bind;
 
     bind.virq = virq;
@@ -263,9 +263,9 @@ solaris_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
     return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
 }
 
-static int solaris_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     struct ioctl_evtchn_unbind unbind;
 
     unbind.port = port;
@@ -273,10 +273,9 @@ static int solaris_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_
     return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
 }
 
-static evtchn_port_or_error_t
-solaris_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
+evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     evtchn_port_t port;
 
     if ( read_exact(fd, (char *)&port, sizeof(port)) == -1 )
@@ -285,28 +284,12 @@ solaris_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
     return port;
 }
 
-static int solaris_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h,evtchn_port_t port)
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
 {
-    int fd = (int)h;
+    int fd = xce->fd;
     return write_exact(fd, (char *)&port, sizeof(port));
 }
 
-static struct xc_osdep_ops solaris_evtchn_ops = {
-    .open = &solaris_evtchn_open,
-    .close = &solaris_evtchn_close,
-
-    .u.evtchn = {
-        .fd = &solaris_evtchn_fd,
-        .notify = &solaris_evtchn_notify,
-        .bind_unbound_port = &solaris_evtchn_bind_unbound_port,
-        .bind_interdomain = &solaris_evtchn_bind_interdomain,
-        .bind_virq = &solaris_evtchn_bind_virq,
-        .unbind = &solaris_evtchn_unbind,
-        .pending = &solaris_evtchn_pending,
-        .unmask = &solaris_evtchn_unmask,
-    },
-};
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
@@ -324,8 +307,6 @@ static struct xc_osdep_ops *solaris_osdep_init(xc_interface *xch, enum xc_osdep_
     {
     case XC_OSDEP_PRIVCMD:
         return &solaris_privcmd_ops;
-    case XC_OSDEP_EVTCHN:
-        return &solaris_evtchn_ops;
     default:
         return NULL;
     }
diff --git a/tools/libxc/xenctrl_osdep_ENOSYS.c b/tools/libxc/xenctrl_osdep_ENOSYS.c
index dd59dcd..5182532 100644
--- a/tools/libxc/xenctrl_osdep_ENOSYS.c
+++ b/tools/libxc/xenctrl_osdep_ENOSYS.c
@@ -81,90 +81,6 @@ static struct xc_osdep_ops ENOSYS_privcmd_ops =
     }
 };
 
-static xc_osdep_handle ENOSYS_evtchn_open(xc_interface *xce)
-{
-    IPRINTF(xce, "ENOSYS_evtchn: opening handle %p\n", (void *)1);
-    return (xc_osdep_handle)2; /*dummy*/
-}
-
-static int ENOSYS_evtchn_close(xc_interface *xce, xc_osdep_handle 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 %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 %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 %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 %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 %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 %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 %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 %lx unmask: %d\n", h, port);
-    return -ENOSYS;
-}
-
-static struct xc_osdep_ops ENOSYS_evtchn_ops = {
-    .open = &ENOSYS_evtchn_open,
-    .close = &ENOSYS_evtchn_close,
-
-    .u.evtchn = {
-        .fd = &ENOSYS_evtchn_fd,
-
-        .notify = &ENOSYS_evtchn_notify,
-
-        .bind_unbound_port = &ENOSYS_evtchn_bind_unbound_port,
-        .bind_interdomain = &ENOSYS_evtchn_bind_interdomain,
-        .bind_virq = &ENOSYS_evtchn_bind_virq,
-
-        .unbind = &ENOSYS_evtchn_unbind,
-
-        .pending = &ENOSYS_evtchn_pending,
-        .unmask = &ENOSYS_evtchn_unmask,
-    },
-};
-
 static struct xc_osdep_ops * ENOSYS_osdep_init(xc_interface *xch, enum xc_osdep_type type)
 {
     struct xc_osdep_ops *ops;
@@ -180,9 +96,6 @@ static struct xc_osdep_ops * ENOSYS_osdep_init(xc_interface *xch, enum xc_osdep_
     case XC_OSDEP_PRIVCMD:
         ops = &ENOSYS_privcmd_ops;
         break;
-    case XC_OSDEP_EVTCHN:
-        ops = &ENOSYS_evtchn_ops;
-        break;
     default:
         ops = NULL;
         break;
diff --git a/tools/ocaml/libs/eventchn/xeneventchn_stubs.c b/tools/ocaml/libs/eventchn/xeneventchn_stubs.c
index abefd6b..5939e7c 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn_stubs.c
+++ b/tools/ocaml/libs/eventchn/xeneventchn_stubs.c
@@ -34,14 +34,14 @@
 #include <caml/callback.h>
 #include <caml/fail.h>
 
-#define _H(__h) ((xc_interface *)(__h))
+#define _H(__h) ((xc_evtchn *)(__h))
 
 CAMLprim value stub_eventchn_init(void)
 {
 	CAMLparam0();
 	CAMLlocal1(result);
 
-	xc_interface *xce = xc_evtchn_open(NULL, XC_OPENFLAG_NON_REENTRANT);
+	xc_evtchn *xce = xc_evtchn_open(NULL, XC_OPENFLAG_NON_REENTRANT);
 	if (xce == NULL)
 		caml_failwith("open failed");
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:14:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:14:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aON7P-0000R4-ED; Wed, 27 Jan 2016 10:14: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 1aON7N-0000Ql-LK
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:30 +0000
Content-Length: 88643
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	10/72-24375-48898A65; Wed, 27 Jan 2016 10:14:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1453889662!1225062!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12782 invoked from network); 27 Jan 2016 10:14:23 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:14:23 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON88-0001vR-Fv
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7G-0001IR-0g
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:22 +0000
Date: Wed, 27 Jan 2016 10:14:22 +0000
Message-Id: <E1aON7G-0001IR-0g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Refactor /dev/xen/evtchn
	wrappers into libxenevtchn.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============3444415792178667480=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3444415792178667480==
Content-Length: 91185
Content-Transfer-Encoding: quoted-printable

commit b7f76a699dcfadc0a52ab45b33cc72dbf3a69e7b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 16:20:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:21:07 2016 +0000

    tools: Refactor /dev/xen/evtchn wrappers into libxenevtchn.
    
    libxenevtchn will provide a stable API and ABI for accessing the
    evtchn device.
    
    The functions are moved into the xenevtchn namespace to make a clean
    break from libxc and avoid ambiguity regarding which interfaces are
    stable.
    
    All in-tree users are updated to use the new names.
    
    Upon request (via #define XC_WANT_COMPAT_EVTCHN_API) libxenctrl will
    provide a compat API for the old names. This is used by qemu-xen for
    the time being. qemu-xen-traditional is updated in lockstep.
    
    This leaves a few event channel related functions which go via privcmd
    (EVTCHNOP) rather than ioctls on the /dev/xen/evtchn device in
    libxenctrl. Specifically:
    
     - xc_evtchn_alloc_unbound
     - xc_evtchn_reset
     - xc_evtchn_status
    
    Note that xc_evtchn_alloc_unbound's functionality is also provided by
    xenevtchn_bind_unbound_port() (n=C3=A9e xc_evtchn_bind_unbound_port) and is
    probably redundant.
    
    These functions do not appear to be needed by qemu-dm, qemu-pv
    (provision of device model to HVM guests and PV backends respectively)
    or by libvchan suggesting they are not needed by non-toolstack uses of
    event channels. QEMU does use these in hw/xenpv/xen_domainbuild.c but
    that is a "toolstack use".
    
    The new library uses a version script to ensure that only expected
    symbols are exported and to version them such that ABI guarantees can
    be kept in the future.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    [ ijc -- updated MINIOS_UPSTREAM_REVISION and QEMU_TRADITIONAL_REVISION ]
---
 .gitignore                                    |    1 +
 Config.mk                                     |   12 +-
 stubdom/Makefile                              |   17 ++-
 tools/Makefile                                |    5 +-
 tools/Rules.mk                                |   14 +-
 tools/console/Makefile                        |    2 +
 tools/console/daemon/io.c                     |   43 ++--
 tools/libs/Makefile                           |    1 +
 tools/libs/evtchn/Makefile                    |   69 +++++++
 tools/libs/evtchn/core.c                      |   72 +++++++
 tools/libs/evtchn/freebsd.c                   |  138 +++++++++++++
 tools/libs/evtchn/include/xenevtchn.h         |  150 ++++++++++++++
 tools/libs/evtchn/libxenevtchn.map            |   19 ++
 tools/libs/evtchn/linux.c                     |  136 +++++++++++++
 tools/libs/evtchn/minios.c                    |  269 +++++++++++++++++++++++++
 tools/libs/evtchn/netbsd.c                    |  147 ++++++++++++++
 tools/libs/evtchn/private.h                   |   25 +++
 tools/libs/evtchn/solaris.c                   |  135 +++++++++++++
 tools/libs/toollog/include/xentoollog.h       |   10 +
 tools/libs/toollog/xtl_core.c                 |   10 +
 tools/libs/toollog/xtl_logger_stdio.c         |   10 +
 tools/libvchan/Makefile                       |    6 +-
 tools/libvchan/init.c                         |   20 +-
 tools/libvchan/io.c                           |   12 +-
 tools/libvchan/libxenvchan.h                  |    3 +-
 tools/libxc/Makefile                          |    8 +-
 tools/libxc/include/xenctrl.h                 |   99 +---------
 tools/libxc/include/xenctrl_compat.h          |   48 +++++
 tools/libxc/include/xenguest.h                |   14 +-
 tools/libxc/xc_evtchn_compat.c                |   75 +++++++
 tools/libxc/xc_freebsd_osdep.c                |  101 ---------
 tools/libxc/xc_linux_osdep.c                  |   95 ---------
 tools/libxc/xc_minios.c                       |  221 --------------------
 tools/libxc/xc_netbsd.c                       |  109 ----------
 tools/libxc/xc_private.c                      |   40 ----
 tools/libxc/xc_private.h                      |    7 -
 tools/libxc/xc_solaris.c                      |   97 ---------
 tools/libxc/xc_suspend.c                      |   18 +-
 tools/libxl/Makefile                          |    5 +-
 tools/libxl/libxl.c                           |    2 +-
 tools/libxl/libxl_dom_suspend.c               |    4 +-
 tools/libxl/libxl_event.c                     |   14 +-
 tools/libxl/libxl_internal.h                  |    5 +-
 tools/misc/Makefile                           |    7 +-
 tools/misc/xen-hptool.c                       |   13 +-
 tools/misc/xen-lowmemd.c                      |   15 +-
 tools/ocaml/libs/eventchn/Makefile            |    4 +-
 tools/ocaml/libs/eventchn/xeneventchn_stubs.c |   20 +-
 tools/python/setup.py                         |    7 +-
 tools/tests/xen-access/Makefile               |    3 +-
 tools/tests/xen-access/xen-access.c           |   21 +-
 tools/xcutils/Makefile                        |    4 +-
 tools/xenmon/Makefile                         |    2 +
 tools/xenmon/xenbaked.c                       |   13 +-
 tools/xenpaging/Makefile                      |    4 +-
 tools/xenpaging/xenpaging.c                   |   18 +-
 tools/xenpaging/xenpaging.h                   |    3 +-
 tools/xenstore/Makefile                       |    3 +-
 tools/xenstore/xenstored_core.c               |    6 +-
 tools/xenstore/xenstored_domain.c             |   25 ++-
 tools/xentrace/Makefile                       |    5 +-
 tools/xentrace/xentrace.c                     |   13 +-
 62 files changed, 1544 insertions(+), 930 deletions(-)

diff --git a/.gitignore b/.gitignore
index 141c2be..e7af9f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,6 +62,7 @@ stubdom/ioemu
 stubdom/ioemu/
 stubdom/libs-*
 stubdom/libxc-*
+stubdom/libxenevtchn-*
 stubdom/libxentoollog-*
 stubdom/lwip-*
 stubdom/lwip/
diff --git a/Config.mk b/Config.mk
index d654af8..e202d3f 100644
--- a/Config.mk
+++ b/Config.mk
@@ -251,9 +251,9 @@ MINIOS_UPSTREAM_URL =3F=3D git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION =3F=3D 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION =3F=3D master
-MINIOS_UPSTREAM_REVISION =3F=3D d25773c8afa2f4dbbb466116daeb60159ddd22bd
-# Thu Dec 3 11:23:25 2015 +0000
-# mini-os: Include libxentoollog with libxc
+MINIOS_UPSTREAM_REVISION =3F=3D fb66c855c983aa07644cb179fd9bfe96d55f317d
+# Fri Jan 15 13:24:00 2016 +0000
+# mini-os: Include libxenevtchn with libxc
 
 SEABIOS_UPSTREAM_REVISION =3F=3D 3403ac4313812752be6e6aac35239ca6888a8cab
 # Mon Dec 28 13:50:41 2015 +0100
@@ -262,9 +262,9 @@ SEABIOS_UPSTREAM_REVISION =3F=3D 3403ac4313812752be6e6aac35239ca6888a8cab
 ETHERBOOT_NICS =3F=3D rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION =3F=3D 569eac99e8ddccd15fe78e8a3af5622afe780e3b
-# Mon Jan 4 15:34:29 2016 +0000
-# MSI-X: avoid array overrun upon MSI-X table writes
+QEMU_TRADITIONAL_REVISION =3F=3D ca2ff968de42d47dcda8973aa1528a14f99992d3
+# Fri Jan 15 13:23:53 2016 +0000
+# qemu-xen-traditional: Use libxenevtchn
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 9c77205..702d66b 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -319,6 +319,12 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
 	  ln -sf $(XEN_ROOT)/tools/libs/toollog/include/*.h . && \
 	  ln -sf $(XEN_ROOT)/tools/libs/toollog/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/libs/toollog/Makefile . )
+	mkdir -p libs-$(XEN_TARGET_ARCH)/evtchn/include
+	[ -h libs-$(XEN_TARGET_ARCH)/evtchn/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/evtchn && \
+	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/*.h . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/include/*.h include/ && \
+	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/*.c . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/Makefile . )
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
@@ -351,12 +357,21 @@ libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_ARCH) $
 	CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTDIR=3D -C libs-$(XEN_TARGET_ARCH)/toollog
 
 #######
+# libxenevtchn
+#######
+
+.PHONY: libxenevtchn
+libxenevtchn: libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a
+libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+	CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTDIR=3D -C libs-$(XEN_TARGET_ARCH)/evtchn
+
+#######
 # libxc
 #######
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn cross-zlib
 	CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTDIR=3D CONFIG_LIBXC_MINIOS=3Dy -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
diff --git a/tools/Makefile b/tools/Makefile
index ccd0ae7..55b5d44 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -249,8 +249,10 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--libdir=3D$(LIBEXEC_LIB) \
 		--includedir=3D$(LIBEXEC_INC) \
 		--source-path=3D$$source \
-		--extra-cflags=3D"-I$(XEN_ROOT)/tools/include \
+		--extra-cflags=3D"-DXC_WANT_COMPAT_EVTCHN_API=3D1 \
+		-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libs/toollog/include \
+		-I$(XEN_ROOT)/tools/libs/evtchn/include \
 		-I$(XEN_ROOT)/tools/libxc/include \
 		-I$(XEN_ROOT)/tools/xenstore/include \
 		-I$(XEN_ROOT)/tools/xenstore/compat/include \
@@ -258,6 +260,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--extra-ldflags=3D"-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore \
 		-Wl,-rpath-link=3D$(XEN_ROOT)/tools/libs/toollog \
+		-Wl,-rpath-link=3D$(XEN_ROOT)/tools/libs/evtchn \
 		$(QEMU_UPSTREAM_RPATH)" \
 		--bindir=3D$(LIBEXEC_BIN) \
 		--datadir=3D$(SHAREDIR)/qemu-xen \
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 0652e4b..75d02c4 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -11,6 +11,7 @@ INSTALL =3D $(XEN_ROOT)/tools/cross-install
 
 XEN_INCLUDE        =3D $(XEN_ROOT)/tools/include
 XEN_LIBXENTOOLLOG  =3D $(XEN_ROOT)/tools/libs/toollog
+XEN_LIBXENEVTCHN   =3D $(XEN_ROOT)/tools/libs/evtchn
 XEN_LIBXC          =3D $(XEN_ROOT)/tools/libxc
 XEN_XENLIGHT       =3D $(XEN_ROOT)/tools/libxl
 XEN_XENSTORE       =3D $(XEN_ROOT)/tools/xenstore
@@ -82,13 +83,18 @@ SHDEPS_libxentoollog =3D
 LDLIBS_libxentoollog =3D $(XEN_LIBXENTOOLLOG)/libxentoollog$(libextension)
 SHLIB_libxentoollog  =3D -Wl,-rpath-link=3D$(XEN_LIBXENTOOLLOG)
 
+CFLAGS_libxenevtchn =3D -I$(XEN_LIBXENEVTCHN)/include $(CFLAGS_xeninclude)
+SHDEPS_libxenevtchn =3D
+LDLIBS_libxenevtchn =3D $(XEN_LIBXENEVTCHN)/libxenevtchn$(libextension)
+SHLIB_libxenevtchn  =3D -Wl,-rpath-link=3D$(XEN_LIBXENEVTCHN)
+
 CFLAGS_libxenctrl =3D -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_xeninclude)
-SHDEPS_libxenctrl =3D $(SHLIB_libxentoollog)
+SHDEPS_libxenctrl =3D $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn)
 LDLIBS_libxenctrl =3D $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libextension)
 SHLIB_libxenctrl  =3D $(SHDEPS_libxenctrl) -Wl,-rpath-link=3D$(XEN_LIBXC)
 
-CFLAGS_libxenguest =3D -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
-SHDEPS_libxenguest =3D
+CFLAGS_libxenguest =3D -I$(XEN_LIBXC)/include $(CFLAGS_libxenevtchn) $(CFLAGS_xeninclude)
+SHDEPS_libxenguest =3D $(SHLIB_libxenevtchn)
 LDLIBS_libxenguest =3D $(SHDEPS_libxenguest) $(XEN_LIBXC)/libxenguest$(libextension)
 SHLIB_libxenguest  =3D $(SHDEPS_libxenguest) -Wl,-rpath-link=3D$(XEN_LIBXC)
 
@@ -103,7 +109,7 @@ LDLIBS_libxenstat  =3D $(SHDEPS_libxenstat) $(XEN_LIBXENSTAT)/libxenstat$(libexten
 SHLIB_libxenstat   =3D $(SHDEPS_libxenstat) -Wl,-rpath-link=3D$(XEN_LIBXENSTAT)
 
 CFLAGS_libxenvchan =3D -I$(XEN_LIBVCHAN)
-SHDEPS_libxenvchan =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore)
+SHDEPS_libxenvchan =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenevtchn)
 LDLIBS_libxenvchan =3D $(SHDEPS_libxenvchan) $(XEN_LIBVCHAN)/libxenvchan$(libextension)
 SHLIB_libxenvchan  =3D $(SHDEPS_libxenvchan) -Wl,-rpath-link=3D$(XEN_LIBVCHAN)
 
diff --git a/tools/console/Makefile b/tools/console/Makefile
index 77e8f29..4b3a492 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -3,8 +3,10 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 CFLAGS  +=3D -Werror
 
+CFLAGS  +=3D $(CFLAGS_libxenevtchn)
 CFLAGS  +=3D $(CFLAGS_libxenctrl)
 CFLAGS  +=3D $(CFLAGS_libxenstore)
+LDLIBS +=3D $(LDLIBS_libxenevtchn)
 LDLIBS +=3D $(LDLIBS_libxenctrl)
 LDLIBS +=3D $(LDLIBS_libxenstore)
 LDLIBS +=3D $(SOCKET_LIBS)
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index cafc7b7..2f2e9c5 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -21,6 +21,7 @@
 
 #include "utils.h"
 #include "io.h"
+#include <xenevtchn.h>
 #include <xenstore.h>
 #include <xen/io/console.h>
 #include <xen/grant_table.h>
@@ -101,7 +102,7 @@ struct domain {
 	int ring_ref;
 	evtchn_port_or_error_t local_port;
 	evtchn_port_or_error_t remote_port;
-	xc_evtchn *xce_handle;
+	xenevtchn_handle *xce_handle;
 	int xce_pollfd_idx;
 	struct xencons_interface *interface;
 	int event_count;
@@ -185,7 +186,7 @@ static void buffer_append(struct domain *dom)
 
 	xen_mb();
 	intf->out_cons =3D cons;
-	xc_evtchn_notify(dom->xce_handle, dom->local_port);
+	xenevtchn_notify(dom->xce_handle, dom->local_port);
 
 	/* Get the data to the logfile as early as possible because if
 	 * no one is listening on the console pty then it will fill up
@@ -584,22 +585,22 @@ static int domain_create_ring(struct domain *dom)
 	dom->local_port =3D -1;
 	dom->remote_port =3D -1;
 	if (dom->xce_handle !=3D NULL)
-		xc_evtchn_close(dom->xce_handle);
+		xenevtchn_close(dom->xce_handle);
 
 	/* Opening evtchn independently for each console is a bit
 	 * wasteful, but that's how the code is structured... */
-	dom->xce_handle =3D xc_evtchn_open(NULL, 0);
+	dom->xce_handle =3D xenevtchn_open(NULL, 0);
 	if (dom->xce_handle =3D=3D NULL) {
 		err =3D errno;
 		goto out;
 	}
  
-	rc =3D xc_evtchn_bind_interdomain(dom->xce_handle,
+	rc =3D xenevtchn_bind_interdomain(dom->xce_handle,
 		dom->domid, remote_port);
 
 	if (rc =3D=3D -1) {
 		err =3D errno;
-		xc_evtchn_close(dom->xce_handle);
+		xenevtchn_close(dom->xce_handle);
 		dom->xce_handle =3D NULL;
 		goto out;
 	}
@@ -609,7 +610,7 @@ static int domain_create_ring(struct domain *dom)
 	if (dom->master_fd =3D=3D -1) {
 		if (!domain_create_tty(dom)) {
 			err =3D errno;
-			xc_evtchn_close(dom->xce_handle);
+			xenevtchn_close(dom->xce_handle);
 			dom->xce_handle =3D NULL;
 			dom->local_port =3D -1;
 			dom->remote_port =3D -1;
@@ -749,7 +750,7 @@ static void shutdown_domain(struct domain *d)
 	watch_domain(d, false);
 	domain_unmap_interface(d);
 	if (d->xce_handle !=3D NULL)
-		xc_evtchn_close(d->xce_handle);
+		xenevtchn_close(d->xce_handle);
 	d->xce_handle =3D NULL;
 }
 
@@ -839,7 +840,7 @@ static void handle_tty_read(struct domain *dom)
 		}
 		xen_wmb();
 		intf->in_prod =3D prod;
-		xc_evtchn_notify(dom->xce_handle, dom->local_port);
+		xenevtchn_notify(dom->xce_handle, dom->local_port);
 	} else {
 		domain_close_tty(dom);
 		shutdown_domain(dom);
@@ -871,7 +872,7 @@ static void handle_ring_read(struct domain *dom)
 	if (dom->is_dead)
 		return;
 
-	if ((port =3D xc_evtchn_pending(dom->xce_handle)) =3D=3D -1)
+	if ((port =3D xenevtchn_pending(dom->xce_handle)) =3D=3D -1)
 		return;
 
 	dom->event_count++;
@@ -879,7 +880,7 @@ static void handle_ring_read(struct domain *dom)
 	buffer_append(dom);
 
 	if (dom->event_count < RATE_LIMIT_ALLOWANCE)
-		(void)xc_evtchn_unmask(dom->xce_handle, port);
+		(void)xenevtchn_unmask(dom->xce_handle, port);
 }
 
 static void handle_xs(void)
@@ -906,7 +907,7 @@ static void handle_xs(void)
 	free(vec);
 }
 
-static void handle_hv_logs(xc_evtchn *xce_handle, bool force)
+static void handle_hv_logs(xenevtchn_handle *xce_handle, bool force)
 {
 	static char buffer[1024*16];
 	char *bufptr =3D buffer;
@@ -914,7 +915,7 @@ static void handle_hv_logs(xc_evtchn *xce_handle, bool force)
 	static uint32_t index =3D 0;
 	evtchn_port_or_error_t port =3D -1;
 
-	if (!force && ((port =3D xc_evtchn_pending(xce_handle)) =3D=3D -1))
+	if (!force && ((port =3D xenevtchn_pending(xce_handle)) =3D=3D -1))
 		return;
 
 	do
@@ -938,7 +939,7 @@ static void handle_hv_logs(xc_evtchn *xce_handle, bool force)
 	} while (size =3D=3D sizeof(buffer));
 
 	if (port !=3D -1)
-		(void)xc_evtchn_unmask(xce_handle, port);
+		(void)xenevtchn_unmask(xce_handle, port);
 }
 
 static void handle_log_reload(void)
@@ -1006,10 +1007,10 @@ void handle_io(void)
 	evtchn_port_or_error_t log_hv_evtchn =3D -1;
 	int xce_pollfd_idx =3D -1;
 	int xs_pollfd_idx =3D -1;
-	xc_evtchn *xce_handle =3D NULL;
+	xenevtchn_handle *xce_handle =3D NULL;
 
 	if (log_hv) {
-		xce_handle =3D xc_evtchn_open(NULL, 0);
+		xce_handle =3D xenevtchn_open(NULL, 0);
 		if (xce_handle =3D=3D NULL) {
 			dolog(LOG_ERR, "Failed to open xce handle: %d (%s)",
 			      errno, strerror(errno));
@@ -1018,7 +1019,7 @@ void handle_io(void)
 		log_hv_fd =3D create_hv_log();
 		if (log_hv_fd =3D=3D -1)
 			goto out;
-		log_hv_evtchn =3D xc_evtchn_bind_virq(xce_handle, VIRQ_CON_RING);
+		log_hv_evtchn =3D xenevtchn_bind_virq(xce_handle, VIRQ_CON_RING);
 		if (log_hv_evtchn =3D=3D -1) {
 			dolog(LOG_ERR, "Failed to bind to VIRQ_CON_RING: "
 			      "%d (%s)", errno, strerror(errno));
@@ -1047,7 +1048,7 @@ void handle_io(void)
 		xs_pollfd_idx =3D set_fds(xs_fileno(xs), POLLIN|POLLPRI);
 
 		if (log_hv)
-			xce_pollfd_idx =3D set_fds(xc_evtchn_fd(xce_handle),
+			xce_pollfd_idx =3D set_fds(xenevtchn_fd(xce_handle),
 						 POLLIN|POLLPRI);
 
 		if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0)
@@ -1066,7 +1067,7 @@ void handle_io(void)
 			if ((now+5) > d->next_period) {
 				d->next_period =3D now + RATE_LIMIT_PERIOD;
 				if (d->event_count >=3D RATE_LIMIT_ALLOWANCE) {
-					(void)xc_evtchn_unmask(d->xce_handle, d->local_port);
+					(void)xenevtchn_unmask(d->xce_handle, d->local_port);
 				}
 				d->event_count =3D 0;
 			}
@@ -1082,7 +1083,7 @@ void handle_io(void)
 				if (discard_overflowed_data ||
 				    !d->buffer.max_capacity ||
 				    d->buffer.size < d->buffer.max_capacity) {
-					int evtchn_fd =3D xc_evtchn_fd(d->xce_handle);
+					int evtchn_fd =3D xenevtchn_fd(d->xce_handle);
 					d->xce_pollfd_idx =3D set_fds(evtchn_fd,
 								    POLLIN|POLLPRI);
 				}
@@ -1202,7 +1203,7 @@ void handle_io(void)
 		log_hv_fd =3D -1;
 	}
 	if (xce_handle !=3D NULL) {
-		xc_evtchn_close(xce_handle);
+		xenevtchn_close(xce_handle);
 		xce_handle =3D NULL;
 	}
 	if (xcg_handle !=3D NULL) {
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index 73be500..0e3f523 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -3,5 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 SUBDIRS-y :=3D
 SUBDIRS-y +=3D toollog
+SUBDIRS-y +=3D evtchn
 
 all clean install distclean: %: subdirs-%
diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile
new file mode 100644
index 0000000..46a807f
--- /dev/null
+++ b/tools/libs/evtchn/Makefile
@@ -0,0 +1,69 @@
+XEN_ROOT =3D $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR    =3D 1
+MINOR    =3D 0
+SHLIB_LDFLAGS +=3D -Wl,--version-script=3Dlibxenevtchn.map
+
+CFLAGS   +=3D -Werror -Wmissing-prototypes
+CFLAGS   +=3D -I./include $(CFLAGS_xeninclude)
+CFLAGS   +=3D $(CFLAGS_libxentoollog)
+
+SRCS-y                 +=3D core.c
+SRCS-$(CONFIG_Linux)   +=3D linux.c
+SRCS-$(CONFIG_FreeBSD) +=3D freebsd.c
+SRCS-$(CONFIG_SunOS)   +=3D solaris.c
+SRCS-$(CONFIG_NetBSD)  +=3D netbsd.c
+SRCS-$(CONFIG_MiniOS)  +=3D minios.c
+
+LIB_OBJS :=3D $(patsubst %.c,%.o,$(SRCS-y))
+PIC_OBJS :=3D $(patsubst %.c,%.opic,$(SRCS-y))
+
+LIB :=3D libxenevtchn.a
+ifneq ($(nosharedlibs),y)
+LIB +=3D libxenevtchn.so
+endif
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build:
+	$(MAKE) libs
+
+.PHONY: libs
+libs: $(LIB)
+
+
+libxenevtchn.a: $(LIB_OBJS)
+	$(AR) rc $@ $^
+
+libxenevtchn.so: libxenevtchn.so.$(MAJOR)
+	$(SYMLINK_SHLIB) $< $@
+libxenevtchn.so.$(MAJOR): libxenevtchn.so.$(MAJOR).$(MINOR)
+	$(SYMLINK_SHLIB) $< $@
+
+libxenevtchn.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxenevtchn.map
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenevtchn.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: build
+	$(INSTALL_DIR) $(DESTDIR)$(libdir)
+	$(INSTALL_DIR) $(DESTDIR)$(includedir)
+	$(INSTALL_SHLIB) libxenevtchn.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) libxenevtchn.a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) libxenevtchn.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenevtchn.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxenevtchn.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenevtchn.so
+	$(INSTALL_DATA) include/xenevtchn.h $(DESTDIR)$(includedir)
+
+.PHONY: TAGS
+TAGS:
+	etags -t *.c *.h
+
+.PHONY: clean
+clean:
+	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -f libxenevtchn.so.$(MAJOR).$(MINOR) libxenevtchn.so.$(MAJOR)
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/libs/evtchn/core.c b/tools/libs/evtchn/core.c
new file mode 100644
index 0000000..c31e08c
--- /dev/null
+++ b/tools/libs/evtchn/core.c
@@ -0,0 +1,72 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "private.h"
+
+xenevtchn_handle *xenevtchn_open(xentoollog_logger *logger, unsigned open_flags)
+{
+    xenevtchn_handle *xce =3D malloc(sizeof(*xce));
+    int rc;
+
+    if (!xce) return NULL;
+
+    xce->fd =3D -1;
+    xce->logger =3D logger;
+    xce->logger_tofree  =3D NULL;
+
+    if (!xce->logger) {
+        xce->logger =3D xce->logger_tofree =3D
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xce->logger) goto err;
+    }
+
+    rc =3D osdep_evtchn_open(xce);
+    if ( rc  < 0 ) goto err;
+
+    return xce;
+
+err:
+    osdep_evtchn_close(xce);
+    xtl_logger_destroy(xce->logger_tofree);
+    free(xce);
+    return NULL;
+}
+
+int xenevtchn_close(xenevtchn_handle *xce)
+{
+    int rc;
+
+    if ( !xce )
+        return 0;
+
+    rc =3D osdep_evtchn_close(xce);
+    xtl_logger_destroy(xce->logger_tofree);
+    free(xce);
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/freebsd.c b/tools/libs/evtchn/freebsd.c
new file mode 100644
index 0000000..636f052
--- /dev/null
+++ b/tools/libs/evtchn/freebsd.c
@@ -0,0 +1,138 @@
+ /******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split off from xc_freebsd_osdep.c
+ */
+
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+
+#include <xen/sys/evtchn.h>
+
+#include "private.h"
+
+#define EVTCHN_DEV      "/dev/xen/evtchn"
+
+int osdep_evtchn_open(xenevtchn_handle *xce)
+{
+    int fd =3D open(EVTCHN_DEV, O_RDWR);
+    if ( fd =3D=3D -1 )
+        return -1;
+    xce->fd =3D fd;
+    return 0;
+}
+
+int osdep_evtchn_close(xenevtchn_handle *xce)
+{
+    if ( xce->fd =3D=3D -1 )
+        return 0;
+
+    return close(xce->fd);
+}
+
+int xenevtchn_fd(xenevtchn_handle *xce)
+{
+    return xce->fd;
+}
+
+int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_notify notify;
+
+    notify.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid)
+{
+    int ret, fd =3D xce->fd;
+    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;
+}
+
+evtchn_port_or_error_t
+xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid, evtchn_port_t remote_port)
+{
+    int ret, fd =3D xce->fd;
+    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;
+}
+
+evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int virq)
+{
+    int ret, fd =3D xce->fd;
+    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;
+}
+
+int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_unbind unbind;
+
+    unbind.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
+}
+
+evtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
+{
+    int fd =3D xce->fd;
+    evtchn_port_t port;
+
+    if ( read(fd, &port, sizeof(port)) !=3D sizeof(port) )
+        return -1;
+
+    return port;
+}
+
+int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+
+    if ( write(fd, &port, sizeof(port)) !=3D sizeof(port) )
+        return -1;
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/include/xenevtchn.h b/tools/libs/evtchn/include/xenevtchn.h
new file mode 100644
index 0000000..3380fa3
--- /dev/null
+++ b/tools/libs/evtchn/include/xenevtchn.h
@@ -0,0 +1,150 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split off from:
+ * xenctrl.h
+ *
+ * A library for low-level access to the Xen control interfaces.
+ *
+ * Copyright (c) 2003-2004, K A Fraser.
+ */
+
+#ifndef XENEVTCHN_H
+#define XENEVTCHN_H
+
+#include <stdint.h>
+
+#include <xen/event_channel.h>
+
+/* A port identifier is guaranteed to fit in 31 bits. */
+typedef int evtchn_port_or_error_t;
+
+typedef struct xenevtchn_handle xenevtchn_handle;
+
+/* Callers who don't care don't need to #include <xentoollog.h> */
+typedef struct xentoollog_logger xentoollog_logger;
+
+/*
+ * EVENT CHANNEL FUNCTIONS
+ *
+ * None of these do any logging.
+ */
+
+/*
+ * Return a handle to the event channel driver, or NULL on failure, in
+ * which case errno will be set appropriately.
+ *
+ * Note:
+ * After fork a child process must not use any opened xc evtchn
+ * handle inherited from their parent. They must open a new handle if
+ * they want to interact with xc.
+ *
+ * Before Xen pre-4.1 this function would sometimes report errors with perror.
+ */
+/* Currently no flags are defined */
+xenevtchn_handle *xenevtchn_open(xentoollog_logger *logger, unsigned open_flags);
+
+/*
+ * Close a handle previously allocated with xenevtchn_open().
+ */
+int xenevtchn_close(xenevtchn_handle *xce);
+
+/*
+ * Return an fd that can be select()ed on.
+ *
+ * Note that due to bugs, setting this fd to non blocking may not
+ * work: you would hope that it would result in xenevtchn_pending
+ * failing with EWOULDBLOCK if there are no events signaled, but in
+ * fact it may block.  (Bug is present in at least Linux 3.12, and
+ * perhaps on other platforms or later version.)
+ *
+ * To be safe, you must use poll() or select() before each call to
+ * xenevtchn_pending.  If you have multiple threads (or processes)
+ * sharing a single xce handle this will not work, and there is no
+ * straightforward workaround.  Please design your program some other
+ * way.
+ */
+int xenevtchn_fd(xenevtchn_handle *xce);
+
+/*
+ * Notify the given event channel. Returns -1 on failure, in which case
+ * errno will be set appropriately.
+ */
+int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port);
+
+/*
+ * Returns a new event port awaiting interdomain connection from the given
+ * domain ID, or -1 on failure, in which case errno will be set appropriately.
+ */
+evtchn_port_or_error_t
+xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid);
+
+/*
+ * Returns a new event port bound to the remote port for the given domain ID,
+ * or -1 on failure, in which case errno will be set appropriately.
+ */
+evtchn_port_or_error_t
+xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+                           evtchn_port_t remote_port);
+
+/*
+ * Bind an event channel to the given VIRQ. Returns the event channel bound to
+ * the VIRQ, or -1 on failure, in which case errno will be set appropriately.
+ */
+evtchn_port_or_error_t
+xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int virq);
+
+/*
+ * Unbind the given event channel. Returns -1 on failure, in which case errno
+ * will be set appropriately.
+ */
+int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port);
+
+/*
+ * Return the next event channel to become pending, or -1 on failure, in which
+ * case errno will be set appropriately.
+ *
+ * At the hypervisor level the event channel will have been masked,
+ * and then cleared, by the underlying machinery (evtchn kernel
+ * driver, or equivalent).  So if the event channel is signaled again
+ * after it is returned here, it will be queued up, and delivered
+ * again after you unmask it.  (See the documentation in the Xen
+ * public header event_channel.h.)
+ *
+ * On receiving the notification from xenevtchn_pending, you should
+ * normally: check (by other means) what work needs doing; do the
+ * necessary work (if any); unmask the event channel with
+ * xenevtchn_unmask (if you want to receive any further
+ * notifications).
+ */
+evtchn_port_or_error_t
+xenevtchn_pending(xenevtchn_handle *xce);
+
+/*
+ * Unmask the given event channel. Returns -1 on failure, in which case errno
+ * will be set appropriately.
+ */
+int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/libxenevtchn.map b/tools/libs/evtchn/libxenevtchn.map
new file mode 100644
index 0000000..625a1e2
--- /dev/null
+++ b/tools/libs/evtchn/libxenevtchn.map
@@ -0,0 +1,19 @@
+VERS_1.0 {
+	global:
+		xenevtchn_open;
+		xenevtchn_close;
+
+		xenevtchn_fd;
+
+		xenevtchn_bind_unbound_port;
+		xenevtchn_bind_interdomain;
+		xenevtchn_bind_virq;
+
+		xenevtchn_notify;
+
+		xenevtchn_unbind;
+		xenevtchn_unmask;
+
+		xenevtchn_pending;
+	local: *; /* Do not expose anything by default */
+};
diff --git a/tools/libs/evtchn/linux.c b/tools/libs/evtchn/linux.c
new file mode 100644
index 0000000..27fd6e9
--- /dev/null
+++ b/tools/libs/evtchn/linux.c
@@ -0,0 +1,136 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_linus_osdep.c:
+ *
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include <sys/ioctl.h>
+
+#include <xen/sys/evtchn.h>
+
+#include "private.h"
+
+int osdep_evtchn_open(xenevtchn_handle *xce)
+{
+    int fd =3D open("/dev/xen/evtchn", O_RDWR);
+    if ( fd =3D=3D -1 )
+        return -1;
+    xce->fd =3D fd;
+    return 0;
+}
+
+int osdep_evtchn_close(xenevtchn_handle *xce)
+{
+    if ( xce->fd =3D=3D -1 )
+        return 0;
+
+    return close(xce->fd);
+}
+
+int xenevtchn_fd(xenevtchn_handle *xce)
+{
+    return xce->fd;
+}
+
+int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_notify notify;
+
+    notify.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce,
+                                                   int domid)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_unbound_port bind;
+
+    bind.remote_domain =3D domid;
+
+    return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce,
+                                                  int domid,
+                                                  evtchn_port_t remote_port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_interdomain bind;
+
+    bind.remote_domain =3D domid;
+    bind.remote_port =3D remote_port;
+
+    return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce,
+                                           unsigned int virq)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_virq bind;
+
+    bind.virq =3D virq;
+
+    return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+}
+
+int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_unbind unbind;
+
+    unbind.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
+}
+
+evtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
+{
+    int fd =3D xce->fd;
+    evtchn_port_t port;
+
+    if ( read(fd, &port, sizeof(port)) !=3D sizeof(port) )
+        return -1;
+
+    return port;
+}
+
+int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+
+    if ( write(fd, &port, sizeof(port)) !=3D sizeof(port) )
+        return -1;
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
new file mode 100644
index 0000000..fb913a2
--- /dev/null
+++ b/tools/libs/evtchn/minios.c
@@ -0,0 +1,269 @@
+/******************************************************************************
+ *
+ * Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.com>.
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split off from xc_minios.c
+ */
+
+#include "xen-external/bsd-sys-queue.h"
+#include <mini-os/types.h>
+#include <mini-os/os.h>
+#include <mini-os/lib.h>
+#include <mini-os/events.h>
+#include <mini-os/wait.h>
+
+#include <sys/socket.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <malloc.h>
+
+#include "private.h"
+
+extern void minios_evtchn_close_fd(int fd);
+
+extern struct wait_queue_head event_queue;
+
+//void minios_evtchn_close_fd(int fd);
+
+/* XXX Note: This is not threadsafe */
+static struct evtchn_port_info* port_alloc(int fd) {
+    struct evtchn_port_info *port_info;
+    port_info =3D malloc(sizeof(struct evtchn_port_info));
+    if (port_info =3D=3D NULL)
+        return NULL;
+    port_info->pending =3D 0;
+    port_info->port =3D -1;
+    port_info->bound =3D 0;
+
+    LIST_INSERT_HEAD(&files[fd].evtchn.ports, port_info, list);
+    return port_info;
+}
+
+static void port_dealloc(struct evtchn_port_info *port_info) {
+    if (port_info->bound)
+        unbind_evtchn(port_info->port);
+    LIST_REMOVE(port_info, list);
+    free(port_info);
+}
+
+int osdep_evtchn_open(xenevtchn_handle *xce)
+{
+    int fd =3D alloc_fd(FTYPE_EVTCHN);
+    if ( fd =3D=3D -1 )
+        return -1;
+    LIST_INIT(&files[fd].evtchn.ports);
+    xce->fd =3D fd;
+    printf("evtchn_open() -> %d\n", fd);
+    return 0;
+}
+
+int osdep_evtchn_close(xenevtchn_handle *xce)
+{
+    if ( xce->fd =3D=3D -1 )
+        return 0;
+
+    return close(xce->fd);
+}
+
+void minios_evtchn_close_fd(int fd)
+{
+    struct evtchn_port_info *port_info, *tmp;
+    LIST_FOREACH_SAFE(port_info, &files[fd].evtchn.ports, list, tmp)
+        port_dealloc(port_info);
+
+    files[fd].type =3D FTYPE_NONE;
+}
+
+int xenevtchn_fd(xenevtchn_handle *xce)
+{
+    return xce->fd;
+}
+
+int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int ret;
+
+    ret =3D notify_remote_via_evtchn(port);
+
+    if (ret < 0) {
+	errno =3D -ret;
+	ret =3D -1;
+    }
+    return ret;
+}
+
+static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
+{
+    int fd =3D (int)(intptr_t)data;
+    struct evtchn_port_info *port_info;
+    assert(files[fd].type =3D=3D FTYPE_EVTCHN);
+    mask_evtchn(port);
+    LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
+        if (port_info->port =3D=3D port)
+            goto found;
+    }
+    printk("Unknown port for handle %d\n", fd);
+    return;
+
+ found:
+    port_info->pending =3D 1;
+    files[fd].read =3D 1;
+    wake_up(&event_queue);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid)
+{
+    int fd =3D xce->fd;
+    struct evtchn_port_info *port_info;
+    int ret;
+    evtchn_port_t port;
+
+    assert(get_current() =3D=3D main_thread);
+    port_info =3D port_alloc(fd);
+    if (port_info =3D=3D NULL)
+	return -1;
+
+    printf("xenevtchn_bind_unbound_port(%d)", domid);
+    ret =3D evtchn_alloc_unbound(domid, evtchn_handler, (void*)(intptr_t)fd, &port);
+    printf(" =3D %d\n", ret);
+
+    if (ret < 0) {
+	port_dealloc(port_info);
+	errno =3D -ret;
+	return -1;
+    }
+    port_info->bound =3D 1;
+    port_info->port =3D port;
+    unmask_evtchn(port);
+    return port;
+}
+
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+                                                  evtchn_port_t remote_port)
+{
+    int fd =3D xce->fd;
+    struct evtchn_port_info *port_info;
+    evtchn_port_t local_port;
+    int ret;
+
+    assert(get_current() =3D=3D main_thread);
+    port_info =3D port_alloc(fd);
+    if (port_info =3D=3D NULL)
+	return -1;
+
+    printf("xenevtchn_bind_interdomain(%d, %"PRId32")", domid, remote_port);
+    ret =3D evtchn_bind_interdomain(domid, remote_port, evtchn_handler, (void*)(intptr_t)fd, &local_port);
+    printf(" =3D %d\n", ret);
+
+    if (ret < 0) {
+	port_dealloc(port_info);
+	errno =3D -ret;
+	return -1;
+    }
+    port_info->bound =3D 1;
+    port_info->port =3D local_port;
+    unmask_evtchn(local_port);
+    return local_port;
+}
+
+int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct evtchn_port_info *port_info;
+
+    LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
+        if (port_info->port =3D=3D port) {
+            port_dealloc(port_info);
+            return 0;
+        }
+    }
+    printf("Warning: couldn't find port %"PRId32" for xc handle %x\n", port, fd);
+    errno =3D EINVAL;
+    return -1;
+}
+
+evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int virq)
+{
+    int fd =3D xce->fd;
+    struct evtchn_port_info *port_info;
+    evtchn_port_t port;
+
+    assert(get_current() =3D=3D main_thread);
+    port_info =3D port_alloc(fd);
+    if (port_info =3D=3D NULL)
+	return -1;
+
+    printf("xenevtchn_bind_virq(%d)", virq);
+    port =3D bind_virq(virq, evtchn_handler, (void*)(intptr_t)fd);
+
+    if (port < 0) {
+	port_dealloc(port_info);
+	errno =3D -port;
+	return -1;
+    }
+    port_info->bound =3D 1;
+    port_info->port =3D port;
+    unmask_evtchn(port);
+    return port;
+}
+
+evtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
+{
+    int fd =3D xce->fd;
+    struct evtchn_port_info *port_info;
+    unsigned long flags;
+    evtchn_port_t ret =3D -1;
+
+    local_irq_save(flags);
+    files[fd].read =3D 0;
+
+    LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
+        if (port_info->port !=3D -1 && port_info->pending) {
+            if (ret =3D=3D -1) {
+                ret =3D port_info->port;
+                port_info->pending =3D 0;
+            } else {
+                files[fd].read =3D 1;
+                break;
+            }
+        }
+    }
+    local_irq_restore(flags);
+    return ret;
+}
+
+int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    unmask_evtchn(port);
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/netbsd.c b/tools/libs/evtchn/netbsd.c
new file mode 100644
index 0000000..c4123fe
--- /dev/null
+++ b/tools/libs/evtchn/netbsd.c
@@ -0,0 +1,147 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_netbsd.c
+ */
+
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+
+#include <xen/sys/evtchn.h>
+
+#include "private.h"
+
+#define EVTCHN_DEV_NAME  "/dev/xenevt"
+
+int osdep_evtchn_open(xenevtchn_handle *xce)
+{
+    int fd =3D open(EVTCHN_DEV_NAME, O_NONBLOCK|O_RDWR);
+    if ( fd =3D=3D -1 )
+        return -1;
+    xce->fd =3D fd;
+    return 0;
+}
+
+int osdep_evtchn_close(xenevtchn_handle *xce)
+{
+    if ( xce->fd =3D=3D -1 )
+        return 0;
+
+    return close(xce->fd);
+}
+
+int xenevtchn_fd(xenevtchn_handle *xce)
+{
+    return xce->fd;
+}
+
+int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_notify notify;
+
+    notify.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle * xce, int domid)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_unbound_port bind;
+    int ret;
+
+    bind.remote_domain =3D domid;
+
+    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+    if (ret =3D=3D 0)
+	return bind.port;
+    else
+	return -1;
+}
+
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+                                                  evtchn_port_t remote_port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_interdomain bind;
+    int ret;
+
+    bind.remote_domain =3D domid;
+    bind.remote_port =3D remote_port;
+
+    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+    if (ret =3D=3D 0)
+	return bind.port;
+    else
+	return -1;
+}
+
+int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_unbind unbind;
+
+    unbind.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int virq)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_virq bind;
+    int err;
+
+    bind.virq =3D virq;
+
+    err =3D ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+    if (err)
+	return -1;
+    else
+	return bind.port;
+}
+
+evtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
+{
+    int fd =3D xce->fd;
+    evtchn_port_t port;
+
+    if ( read_exact(fd, (char *)&port, sizeof(port)) =3D=3D -1 )
+        return -1;
+
+    return port;
+}
+
+int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    return write_exact(fd, (char *)&port, sizeof(port));
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/private.h b/tools/libs/evtchn/private.h
new file mode 100644
index 0000000..fcd0e96
--- /dev/null
+++ b/tools/libs/evtchn/private.h
@@ -0,0 +1,25 @@
+#ifndef XENEVTCHN_PRIVATE_H
+#define XENEVTCHN_PRIVATE_H
+
+#include <xentoollog.h>
+#include <xenevtchn.h>
+
+struct xenevtchn_handle {
+    xentoollog_logger *logger, *logger_tofree;
+    int fd;
+};
+
+int osdep_evtchn_open(xenevtchn_handle *xce);
+int osdep_evtchn_close(xenevtchn_handle *xce);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/solaris.c b/tools/libs/evtchn/solaris.c
new file mode 100644
index 0000000..114cefb
--- /dev/null
+++ b/tools/libs/evtchn/solaris.c
@@ -0,0 +1,135 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_solaris.c
+ */
+
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+
+#include <xen/sys/evtchn.h>
+
+#include "private.h"
+
+int osdep_evtchn_open(xenevtchn_handle *xce)
+{
+    int fd;
+
+    if ( (fd =3D open("/dev/xen/evtchn", O_RDWR)) =3D=3D -1 )
+    {
+        PERROR("Could not open event channel interface");
+        return -1;
+    }
+
+    xce->fd =3D fd;
+    return 0;
+}
+
+int osdep_evtchn_close(xenevtchn_handle *xce)
+{
+    if ( xce->fd =3D=3D -1 )
+        return 0;
+
+    return close(xce->fd);
+}
+
+int xenevtchn_fd(xenevtchn_handle *xce)
+{
+    return xce->fd;
+}
+
+int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_notify notify;
+
+    notify.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_unbound_port bind;
+
+    bind.remote_domain =3D domid;
+
+    return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+                                                  evtchn_port_t remote_port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_interdomain bind;
+
+    bind.remote_domain =3D domid;
+    bind.remote_port =3D remote_port;
+
+    return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int virq)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_virq bind;
+
+    bind.virq =3D virq;
+
+    return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+}
+
+int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_unbind unbind;
+
+    unbind.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
+}
+
+evtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
+{
+    int fd =3D xce->fd;
+    evtchn_port_t port;
+
+    if ( read_exact(fd, (char *)&port, sizeof(port)) =3D=3D -1 )
+        return -1;
+
+    return port;
+}
+
+int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    return write_exact(fd, (char *)&port, sizeof(port));
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/toollog/include/xentoollog.h b/tools/libs/toollog/include/xentoollog.h
index 853e9c7..76f17fe 100644
--- a/tools/libs/toollog/include/xentoollog.h
+++ b/tools/libs/toollog/include/xentoollog.h
@@ -134,3 +134,13 @@ const char *xtl_level_to_string(xentoollog_level); /* never fails */
 
 
 #endif /* XENTOOLLOG_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/libs/toollog/xtl_core.c b/tools/libs/toollog/xtl_core.c
index c4724a0..099d2f3 100644
--- a/tools/libs/toollog/xtl_core.c
+++ b/tools/libs/toollog/xtl_core.c
@@ -81,3 +81,13 @@ void xtl_logger_destroy(struct xentoollog_logger *logger) {
     if (!logger) return;
     logger->destroy(logger);
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/toollog/xtl_logger_stdio.c b/tools/libs/toollog/xtl_logger_stdio.c
index 0cd9206..f9c5bd8 100644
--- a/tools/libs/toollog/xtl_logger_stdio.c
+++ b/tools/libs/toollog/xtl_logger_stdio.c
@@ -190,3 +190,13 @@ xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
 
     return XTL_NEW_LOGGER(stdiostream, newlogger);
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libvchan/Makefile b/tools/libvchan/Makefile
index 3c50fe6..84128a3 100644
--- a/tools/libvchan/Makefile
+++ b/tools/libvchan/Makefile
@@ -10,9 +10,9 @@ NODE_OBJS =3D node.o
 NODE2_OBJS =3D node-select.o
 
 LIBVCHAN_PIC_OBJS =3D $(patsubst %.o,%.opic,$(LIBVCHAN_OBJS))
-LIBVCHAN_LIBS =3D $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl)
-$(LIBVCHAN_OBJS) $(LIBVCHAN_PIC_OBJS): CFLAGS +=3D $(CFLAGS_libxenstore) $(CFLAGS_libxenctrl)
-$(NODE_OBJS) $(NODE2_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl)
+LIBVCHAN_LIBS =3D $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenevtchn)
+$(LIBVCHAN_OBJS) $(LIBVCHAN_PIC_OBJS): CFLAGS +=3D $(CFLAGS_libxenstore) $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn)
+$(NODE_OBJS) $(NODE2_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn)
 
 MAJOR =3D 1.0
 MINOR =3D 0
diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c
index 77be4e7..66cb103 100644
--- a/tools/libvchan/init.c
+++ b/tools/libvchan/init.c
@@ -216,25 +216,25 @@ static int init_evt_srv(struct libxenvchan *ctrl, int domain, xentoollog_logger
 {
 	evtchn_port_or_error_t port;
 
-	ctrl->event =3D xc_evtchn_open(logger, 0);
+	ctrl->event =3D xenevtchn_open(logger, 0);
 	if (!ctrl->event)
 		return -1;
 
-	port =3D xc_evtchn_bind_unbound_port(ctrl->event, domain);
+	port =3D xenevtchn_bind_unbound_port(ctrl->event, domain);
 	if (port < 0)
 		goto fail;
 	ctrl->event_port =3D port;
 
-	if (xc_evtchn_unmask(ctrl->event, ctrl->event_port))
+	if (xenevtchn_unmask(ctrl->event, ctrl->event_port))
 		goto fail;
 
 	return 0;
 
 fail:
 	if (port >=3D 0)
-		xc_evtchn_unbind(ctrl->event, port);
+		xenevtchn_unbind(ctrl->event, port);
 
-	xc_evtchn_close(ctrl->event);
+	xenevtchn_close(ctrl->event);
 	ctrl->event =3D NULL;
 
 	return -1;
@@ -346,26 +346,26 @@ static int init_evt_cli(struct libxenvchan *ctrl, int domain, xentoollog_logger
 {
 	evtchn_port_or_error_t port;
 
-	ctrl->event =3D xc_evtchn_open(logger, 0);
+	ctrl->event =3D xenevtchn_open(logger, 0);
 	if (!ctrl->event)
 		return -1;
 
-	port =3D xc_evtchn_bind_interdomain(ctrl->event,
+	port =3D xenevtchn_bind_interdomain(ctrl->event,
 		domain, ctrl->event_port);
 	if (port < 0)
 		goto fail;
 	ctrl->event_port =3D port;
 
-	if (xc_evtchn_unmask(ctrl->event, ctrl->event_port))
+	if (xenevtchn_unmask(ctrl->event, ctrl->event_port))
 		goto fail;
 
 	return 0;
 
 fail:
 	if (port >=3D 0)
-		xc_evtchn_unbind(ctrl->event, port);
+		xenevtchn_unbind(ctrl->event, port);
 
-	xc_evtchn_close(ctrl->event);
+	xenevtchn_close(ctrl->event);
 	ctrl->event =3D NULL;
 
 	return -1;
diff --git a/tools/libvchan/io.c b/tools/libvchan/io.c
index 381cc05..53393a5 100644
--- a/tools/libvchan/io.c
+++ b/tools/libvchan/io.c
@@ -105,7 +105,7 @@ static inline int send_notify(struct libxenvchan *ctrl, uint8_t bit)
 	notify =3D ctrl->is_server =3F &ctrl->ring->srv_notify : &ctrl->ring->cli_notify;
 	prev =3D __sync_fetch_and_and(notify, ~bit);
 	if (prev & bit)
-		return xc_evtchn_notify(ctrl->event, ctrl->event_port);
+		return xenevtchn_notify(ctrl->event, ctrl->event_port);
 	else
 		return 0;
 }
@@ -196,10 +196,10 @@ int libxenvchan_buffer_space(struct libxenvchan *ctrl)
 
 int libxenvchan_wait(struct libxenvchan *ctrl)
 {
-	int ret =3D xc_evtchn_pending(ctrl->event);
+	int ret =3D xenevtchn_pending(ctrl->event);
 	if (ret < 0)
 		return -1;
-	xc_evtchn_unmask(ctrl->event, ret);
+	xenevtchn_unmask(ctrl->event, ret);
 	return 0;
 }
 
@@ -352,7 +352,7 @@ int libxenvchan_is_open(struct libxenvchan* ctrl)
 
 int libxenvchan_fd_for_select(struct libxenvchan *ctrl)
 {
-	return xc_evtchn_fd(ctrl->event);
+	return xenevtchn_fd(ctrl->event);
 }
 
 void libxenvchan_close(struct libxenvchan *ctrl)
@@ -374,8 +374,8 @@ void libxenvchan_close(struct libxenvchan *ctrl)
 	}
 	if (ctrl->event) {
 		if (ctrl->ring)
-			xc_evtchn_notify(ctrl->event, ctrl->event_port);
-		xc_evtchn_close(ctrl->event);
+			xenevtchn_notify(ctrl->event, ctrl->event_port);
+		xenevtchn_close(ctrl->event);
 	}
 	if (ctrl->is_server) {
 		if (ctrl->gntshr)
diff --git a/tools/libvchan/libxenvchan.h b/tools/libvchan/libxenvchan.h
index 0944a0e..1544378 100644
--- a/tools/libvchan/libxenvchan.h
+++ b/tools/libvchan/libxenvchan.h
@@ -44,6 +44,7 @@
 
 #include <xen/io/libxenvchan.h>
 #include <xen/sys/evtchn.h>
+#include <xenevtchn.h>
 #include <xenctrl.h>
 
 struct libxenvchan_ring {
@@ -71,7 +72,7 @@ struct libxenvchan {
 	/* Pointer to shared ring page */
 	struct vchan_interface *ring;
 	/* event channel interface */
-	xc_evtchn *event;
+	xenevtchn_handle *event;
 	uint32_t event_port;
 	/* informative flags: are we acting as server=3F */
 	int is_server:1;
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 940708f..b8fc6a5 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -48,6 +48,7 @@ CTRL_SRCS-$(CONFIG_SunOS) +=3D xc_solaris.c
 CTRL_SRCS-$(CONFIG_NetBSD) +=3D xc_netbsd.c
 CTRL_SRCS-$(CONFIG_NetBSDRump) +=3D xc_netbsd.c
 CTRL_SRCS-$(CONFIG_MiniOS) +=3D xc_minios.c
+CTRL_SRCS-y       +=3D xc_evtchn_compat.c
 
 GUEST_SRCS-y :=3D
 GUEST_SRCS-y +=3D xg_private.c xc_suspend.c
@@ -111,6 +112,7 @@ CFLAGS-$(CONFIG_Linux) +=3D -D_GNU_SOURCE
 
 CFLAGS	+=3D $(PTHREAD_CFLAGS)
 CFLAGS	+=3D $(CFLAGS_libxentoollog)
+CFLAGS	+=3D $(CFLAGS_libxenevtchn)
 
 CTRL_LIB_OBJS :=3D $(patsubst %.c,%.o,$(CTRL_SRCS-y))
 CTRL_PIC_OBJS :=3D $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
@@ -164,7 +166,7 @@ install: build
 	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenctrl.so
-	$(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h $(DESTDIR)$(includedir)
+	$(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h include/xenctrlosdep.h $(DESTDIR)$(includedir)
 	$(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
 	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR)
@@ -207,7 +209,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
@@ -230,7 +232,7 @@ xc_dom_bzimageloader.opic: CFLAGS +=3D $(call zlib-options,D)
 
 libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS =3D $(call zlib-options,l)
 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
-	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 xenctrl_osdep_ENOSYS.so: $(OSDEP_PIC_OBJS) libxenctrl.so
 	$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 1bf70f9..53f3033 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -117,7 +117,6 @@
  */
 
 typedef struct xc_interface_core xc_interface;
-typedef struct xenevtchn_handle xc_evtchn;
 typedef struct xc_interface_core xc_gnttab;
 typedef struct xc_interface_core xc_gntshr;
 
@@ -1085,7 +1084,6 @@ int xc_cpupool_movedomain(xc_interface *xch,
  */
 xc_cpumap_t xc_cpupool_freeinfo(xc_interface *xch);
 
-
 /*
  * EVENT CHANNEL FUNCTIONS
  *
@@ -1120,101 +1118,7 @@ int xc_evtchn_reset(xc_interface *xch,
 typedef struct evtchn_status xc_evtchn_status_t;
 int xc_evtchn_status(xc_interface *xch, xc_evtchn_status_t *status);
 
-/*
- * Return a handle to the event channel driver, or NULL on failure, in
- * which case errno will be set appropriately.
- *
- * Note:
- * After fork a child process must not use any opened xc evtchn
- * handle inherited from their parent. They must open a new handle if
- * they want to interact with xc.
- *
- * Before Xen pre-4.1 this function would sometimes report errors with perror.
- */
-xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
-                             unsigned open_flags);
 
-/*
- * Close a handle previously allocated with xc_evtchn_open().
- */
-int xc_evtchn_close(xc_evtchn *xce);
-
-/*
- * Return an fd that can be select()ed on.
- *
- * Note that due to bugs, setting this fd to non blocking may not
- * work: you would hope that it would result in xc_evtchn_pending
- * failing with EWOULDBLOCK if there are no events signaled, but in
- * fact it may block.  (Bug is present in at least Linux 3.12, and
- * perhaps on other platforms or later version.)
- *
- * To be safe, you must use poll() or select() before each call to
- * xc_evtchn_pending.  If you have multiple threads (or processes)
- * sharing a single xce handle this will not work, and there is no
- * straightforward workaround.  Please design your program some other
- * way.
- */
-int xc_evtchn_fd(xc_evtchn *xce);
-
-/*
- * Notify the given event channel. Returns -1 on failure, in which case
- * errno will be set appropriately.
- */
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port);
-
-/*
- * Returns a new event port awaiting interdomain connection from the given
- * domain ID, or -1 on failure, in which case errno will be set appropriately.
- */
-evtchn_port_or_error_t
-xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid);
-
-/*
- * Returns a new event port bound to the remote port for the given domain ID,
- * or -1 on failure, in which case errno will be set appropriately.
- */
-evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
-                           evtchn_port_t remote_port);
-
-/*
- * Bind an event channel to the given VIRQ. Returns the event channel bound to
- * the VIRQ, or -1 on failure, in which case errno will be set appropriately.
- */
-evtchn_port_or_error_t
-xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq);
-
-/*
- * Unbind the given event channel. Returns -1 on failure, in which case errno
- * will be set appropriately.
- */
-int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port);
-
-/*
- * Return the next event channel to become pending, or -1 on failure, in which
- * case errno will be set appropriately.
- *
- * At the hypervisor level the event channel will have been masked,
- * and then cleared, by the underlying machinery (evtchn kernel
- * driver, or equivalent).  So if the event channel is signaled again
- * after it is returned here, it will be queued up, and delivered
- * again after you unmask it.  (See the documentation in the Xen
- * public header event_channel.h.)
- *
- * On receiving the notification from xc_evtchn_pending, you should
- * normally: check (by other means) what work needs doing; do the
- * necessary work (if any); unmask the event channel with
- * xc_evtchn_unmask (if you want to receive any further
- * notifications).
- */
-evtchn_port_or_error_t
-xc_evtchn_pending(xc_evtchn *xce);
-
-/*
- * Unmask the given event channel. Returns -1 on failure, in which case errno
- * will be set appropriately.
- */
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port);
 
 int xc_physdev_pci_access_modify(xc_interface *xch,
                                  uint32_t domid,
@@ -2851,6 +2755,9 @@ int xc_psr_cat_get_l3_info(xc_interface *xch, uint32_t socket,
                            bool *cdp_enabled);
 #endif
 
+/* Compat shims */
+#include "xenctrl_compat.h"
+
 #endif /* XENCTRL_H */
 
 /*
diff --git a/tools/libxc/include/xenctrl_compat.h b/tools/libxc/include/xenctrl_compat.h
new file mode 100644
index 0000000..48daeb2
--- /dev/null
+++ b/tools/libxc/include/xenctrl_compat.h
@@ -0,0 +1,48 @@
+/*
+ * Compat shims for use of 3rd party consumers of libxenctrl
+ * functionality which has been split into separate libraries.
+ *
+ * New code should use the separate libraries.
+ *
+ * Each interface must be opted-into separately by defining:
+ *
+ * XC_WANT_COMPAT_EVTCHN_API
+ *  - Functions relating to /dev/xen/evtchn
+ */
+#ifndef XENCTRL_COMPAT_H
+#define XENCTRL_COMPAT_H
+
+#ifdef XC_WANT_COMPAT_EVTCHN_API
+
+typedef struct xenevtchn_handle xc_evtchn;
+
+xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
+                             unsigned open_flags);
+int xc_evtchn_close(xc_evtchn *xce);
+int xc_evtchn_fd(xc_evtchn *xce);
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port);
+evtchn_port_or_error_t
+xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid);
+evtchn_port_or_error_t
+xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+                           evtchn_port_t remote_port);
+evtchn_port_or_error_t
+xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq);
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port);
+evtchn_port_or_error_t
+xc_evtchn_pending(xc_evtchn *xce);
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port);
+
+#endif /* XC_WANT_COMPAT_EVTCHN_API */
+
+#endif
+
+/*
+ * 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/include/xenguest.h b/tools/libxc/include/xenguest.h
index 8f918b1..050a537 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -34,6 +34,12 @@
 #define X86_64_B_SIZE   64 
 #define X86_32_B_SIZE   32
 
+/*
+ * User not using xc_suspend_* / xc_await_suspent may not want to
+ * include the full libxenevtchn API here.
+ */
+typedef struct xenevtchn_handle xenevtchn_handle;
+
 /* callbacks provided by xc_domain_save */
 struct save_callbacks {
     /* Called after expiration of checkpoint interval,
@@ -161,18 +167,18 @@ struct xc_hvm_firmware_module {
  * Sets *lockfd to -1.
  * Has deallocated everything even on error.
  */
-int xc_suspend_evtchn_release(xc_interface *xch, xc_evtchn *xce, int domid, int suspend_evtchn, int *lockfd);
+int xc_suspend_evtchn_release(xc_interface *xch, xenevtchn_handle *xce, int domid, int suspend_evtchn, int *lockfd);
 
 /**
  * This function eats the initial notification.
  * xce must not be used for anything else
  * See xc_suspend_evtchn_init_sane re lockfd.
  */
-int xc_suspend_evtchn_init_exclusive(xc_interface *xch, xc_evtchn *xce,
+int xc_suspend_evtchn_init_exclusive(xc_interface *xch, xenevtchn_handle *xce,
                                      int domid, int port, int *lockfd);
 
 /* xce must not be used for anything else */
-int xc_await_suspend(xc_interface *xch, xc_evtchn *xce, int suspend_evtchn);
+int xc_await_suspend(xc_interface *xch, xenevtchn_handle *xce, int suspend_evtchn);
 
 /**
  * The port will be signaled immediately after this call
@@ -181,7 +187,7 @@ int xc_await_suspend(xc_interface *xch, xc_evtchn *xce, int suspend_evtchn);
  * and fed to xc_suspend_evtchn_release.  (On error *lockfd is
  * undefined and xc_suspend_evtchn_release is not allowed.)
  */
-int xc_suspend_evtchn_init_sane(xc_interface *xch, xc_evtchn *xce,
+int xc_suspend_evtchn_init_sane(xc_interface *xch, xenevtchn_handle *xce,
                                 int domid, int port, int *lockfd);
 
 int xc_mark_page_online(xc_interface *xch, unsigned long start,
diff --git a/tools/libxc/xc_evtchn_compat.c b/tools/libxc/xc_evtchn_compat.c
new file mode 100644
index 0000000..5d3e4ba
--- /dev/null
+++ b/tools/libxc/xc_evtchn_compat.c
@@ -0,0 +1,75 @@
+/*
+ * Compat shims for use of 3rd party consumers of libxenctrl xc_evtchn
+ * functionality which has been split into separate libraries.
+ */
+
+#include <xenevtchn.h>
+
+#define XC_WANT_COMPAT_EVTCHN_API
+#include "xenctrl.h"
+
+xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
+                          unsigned open_flags)
+{
+    return xenevtchn_open(logger, open_flags);
+}
+
+int xc_evtchn_close(xc_evtchn *xce)
+{
+    return xenevtchn_close(xce);
+}
+
+int xc_evtchn_fd(xc_evtchn *xce)
+{
+    return xenevtchn_fd(xce);
+}
+
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
+{
+    return xenevtchn_notify(xce, port);
+}
+
+evtchn_port_or_error_t
+xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
+{
+    return xenevtchn_bind_unbound_port(xce, domid);
+}
+
+evtchn_port_or_error_t
+xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+                           evtchn_port_t remote_port)
+{
+    return xenevtchn_bind_interdomain(xce, domid, remote_port);
+}
+
+evtchn_port_or_error_t
+xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
+{
+    return xenevtchn_bind_virq(xce, virq);
+}
+
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
+{
+    return xenevtchn_unbind(xce, port);
+}
+
+evtchn_port_or_error_t
+xc_evtchn_pending(xc_evtchn *xce)
+{
+    return xenevtchn_pending(xce);
+}
+
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
+{
+    return xenevtchn_unmask(xce, port);
+}
+
+/*
+ * 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
index 4323e16..339997c 100644
--- a/tools/libxc/xc_freebsd_osdep.c
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -31,13 +31,11 @@
 #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))
@@ -251,105 +249,6 @@ static struct xc_osdep_ops freebsd_privcmd_ops =3D {
     },
 };
 
-/*-------------------------- Evtchn device interface -------------------------*/
-int osdep_evtchn_open(xc_evtchn *xce)
-{
-    int fd =3D open(EVTCHN_DEV, O_RDWR);
-    if ( fd =3D=3D -1 )
-        return -1;
-    xce->fd =3D fd;
-    return 0;
-}
-
-int osdep_evtchn_close(xc_evtchn *xce)
-{
-    if ( xce->fd =3D=3D -1 )
-        return 0;
-
-    return close(xce->fd);
-}
-
-int xc_evtchn_fd(xc_evtchn *xce)
-{
-    return xce->fd;
-}
-
-/*------------------------------ Evtchn interface ----------------------------*/
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_notify notify;
-
-    notify.port =3D port;
-
-    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
-{
-    int ret, fd =3D xce->fd;
-    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;
-}
-
-evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid, evtchn_port_t remote_port)
-{
-    int ret, fd =3D xce->fd;
-    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;
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
-    int ret, fd =3D xce->fd;
-    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;
-}
-
-int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_unbind unbind;
-
-    unbind.port =3D port;
-
-    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
-}
-
-evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
-{
-    int fd =3D xce->fd;
-    evtchn_port_t port;
-
-    if ( read(fd, &port, sizeof(port)) !=3D sizeof(port) )
-        return -1;
-
-    return port;
-}
-
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-
-    if ( write(fd, &port, sizeof(port)) !=3D sizeof(port) )
-        return -1;
-    return 0;
-}
-
 /*---------------------------- FreeBSD interface -----------------------------*/
 static struct xc_osdep_ops *
 freebsd_osdep_init(xc_interface *xch, enum xc_osdep_type type)
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 90544fb..65299d0 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -31,7 +31,6 @@
 #include <sys/ioctl.h>
 
 #include <xen/memory.h>
-#include <xen/sys/evtchn.h>
 #include <xen/sys/gntdev.h>
 #include <xen/sys/gntalloc.h>
 
@@ -461,100 +460,6 @@ static struct xc_osdep_ops linux_privcmd_ops =3D {
 
 #define DEVXEN "/dev/xen/"
 
-int osdep_evtchn_open(xc_evtchn *xce)
-{
-    int fd =3D open(DEVXEN "evtchn", O_RDWR);
-    if ( fd =3D=3D -1 )
-        return -1;
-    xce->fd =3D fd;
-    return 0;
-}
-
-int osdep_evtchn_close(xc_evtchn *xce)
-{
-    if ( xce->fd =3D=3D -1 )
-        return 0;
-
-    return close(xce->fd);
-}
-
-int xc_evtchn_fd(xc_evtchn *xce)
-{
-    return xce->fd;
-}
-
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_notify notify;
-
-    notify.port =3D port;
-
-    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_bind_unbound_port bind;
-
-    bind.remote_domain =3D domid;
-
-    return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
-                                                  evtchn_port_t remote_port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_bind_interdomain bind;
-
-    bind.remote_domain =3D domid;
-    bind.remote_port =3D remote_port;
-
-    return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_bind_virq bind;
-
-    bind.virq =3D virq;
-
-    return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
-}
-
-int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_unbind unbind;
-
-    unbind.port =3D port;
-
-    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
-}
-
-evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
-{
-    int fd =3D xce->fd;
-    evtchn_port_t port;
-
-    if ( read(fd, &port, sizeof(port)) !=3D sizeof(port) )
-        return -1;
-
-    return port;
-}
-
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-
-    if ( write(fd, &port, sizeof(port)) !=3D sizeof(port) )
-        return -1;
-    return 0;
-}
-
 static xc_osdep_handle linux_gnttab_open(xc_gnttab *xcg)
 {
     int fd =3D open(DEVXEN "gntdev", O_RDWR);
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index 4ace1b5..db7b344 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -19,14 +19,11 @@
  */
 
 #undef NDEBUG
-#include "xen-external/bsd-sys-queue.h"
 #include <mini-os/types.h>
 #include <mini-os/os.h>
 #include <mini-os/mm.h>
 #include <mini-os/lib.h>
 #include <mini-os/gntmap.h>
-#include <mini-os/events.h>
-#include <mini-os/wait.h>
 #include <sys/mman.h>
 
 #include <xen/memory.h>
@@ -41,13 +38,9 @@
 #include "xc_private.h"
 
 void minios_interface_close_fd(int fd);
-void minios_evtchn_close_fd(int fd);
 void minios_gnttab_close_fd(int fd);
 
 extern void minios_interface_close_fd(int fd);
-extern void minios_evtchn_close_fd(int fd);
-
-extern struct wait_queue_head event_queue;
 
 static xc_osdep_handle minios_privcmd_open(xc_interface *xch)
 {
@@ -197,220 +190,6 @@ static struct xc_osdep_ops minios_privcmd_ops =3D {
     },
 };
 
-
-/* XXX Note: This is not threadsafe */
-static struct evtchn_port_info* port_alloc(int fd) {
-    struct evtchn_port_info *port_info;
-    port_info =3D malloc(sizeof(struct evtchn_port_info));
-    if (port_info =3D=3D NULL)
-        return NULL;
-    port_info->pending =3D 0;
-    port_info->port =3D -1;
-    port_info->bound =3D 0;
-
-    LIST_INSERT_HEAD(&files[fd].evtchn.ports, port_info, list);
-    return port_info;
-}
-
-static void port_dealloc(struct evtchn_port_info *port_info) {
-    if (port_info->bound)
-        unbind_evtchn(port_info->port);
-    LIST_REMOVE(port_info, list);
-    free(port_info);
-}
-
-int osdep_evtchn_open(xc_evtchn *xce)
-{
-    int fd =3D alloc_fd(FTYPE_EVTCHN);
-    if ( fd =3D=3D -1 )
-        return -1;
-    LIST_INIT(&files[fd].evtchn.ports);
-    xce->fd =3D fd;
-    printf("evtchn_open() -> %d\n", fd);
-    return 0;
-}
-
-int osdep_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
-{
-    if ( xce->fd =3D=3D -1 )
-        return 0;
-
-    return close(xce->fd);
-}
-
-void minios_evtchn_close_fd(int fd)
-{
-    struct evtchn_port_info *port_info, *tmp;
-    LIST_FOREACH_SAFE(port_info, &files[fd].evtchn.ports, list, tmp)
-        port_dealloc(port_info);
-
-    files[fd].type =3D FTYPE_NONE;
-}
-
-int xc_evtchn_fd(xc_evtchn *xce)
-{
-    return xce->fd;
-}
-
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
-{
-    int ret;
-
-    ret =3D notify_remote_via_evtchn(port);
-
-    if (ret < 0) {
-	errno =3D -ret;
-	ret =3D -1;
-    }
-    return ret;
-}
-
-static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
-{
-    int fd =3D (int)(intptr_t)data;
-    struct evtchn_port_info *port_info;
-    assert(files[fd].type =3D=3D FTYPE_EVTCHN);
-    mask_evtchn(port);
-    LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
-        if (port_info->port =3D=3D port)
-            goto found;
-    }
-    printk("Unknown port for handle %d\n", fd);
-    return;
-
- found:
-    port_info->pending =3D 1;
-    files[fd].read =3D 1;
-    wake_up(&event_queue);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
-{
-    int fd =3D xce->fd;
-    struct evtchn_port_info *port_info;
-    int ret;
-    evtchn_port_t port;
-
-    assert(get_current() =3D=3D main_thread);
-    port_info =3D port_alloc(fd);
-    if (port_info =3D=3D NULL)
-	return -1;
-
-    printf("xc_evtchn_bind_unbound_port(%d)", domid);
-    ret =3D evtchn_alloc_unbound(domid, evtchn_handler, (void*)(intptr_t)fd, &port);
-    printf(" =3D %d\n", ret);
-
-    if (ret < 0) {
-	port_dealloc(port_info);
-	errno =3D -ret;
-	return -1;
-    }
-    port_info->bound =3D 1;
-    port_info->port =3D port;
-    unmask_evtchn(port);
-    return port;
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
-                                                  evtchn_port_t remote_port)
-{
-    int fd =3D xce->fd;
-    struct evtchn_port_info *port_info;
-    evtchn_port_t local_port;
-    int ret;
-
-    assert(get_current() =3D=3D main_thread);
-    port_info =3D port_alloc(fd);
-    if (port_info =3D=3D NULL)
-	return -1;
-
-    printf("xc_evtchn_bind_interdomain(%d, %"PRId32")", domid, remote_port);
-    ret =3D evtchn_bind_interdomain(domid, remote_port, evtchn_handler, (void*)(intptr_t)fd, &local_port);
-    printf(" =3D %d\n", ret);
-
-    if (ret < 0) {
-	port_dealloc(port_info);
-	errno =3D -ret;
-	return -1;
-    }
-    port_info->bound =3D 1;
-    port_info->port =3D local_port;
-    unmask_evtchn(local_port);
-    return local_port;
-}
-
-int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct evtchn_port_info *port_info;
-
-    LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
-        if (port_info->port =3D=3D port) {
-            port_dealloc(port_info);
-            return 0;
-        }
-    }
-    printf("Warning: couldn't find port %"PRId32" for xc handle %x\n", port, fd);
-    errno =3D EINVAL;
-    return -1;
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
-    int fd =3D xce->fd;
-    struct evtchn_port_info *port_info;
-    evtchn_port_t port;
-
-    assert(get_current() =3D=3D main_thread);
-    port_info =3D port_alloc(fd);
-    if (port_info =3D=3D NULL)
-	return -1;
-
-    printf("xc_evtchn_bind_virq(%d)", virq);
-    port =3D bind_virq(virq, evtchn_handler, (void*)(intptr_t)fd);
-
-    if (port < 0) {
-	port_dealloc(port_info);
-	errno =3D -port;
-	return -1;
-    }
-    port_info->bound =3D 1;
-    port_info->port =3D port;
-    unmask_evtchn(port);
-    return port;
-}
-
-evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
-{
-    int fd =3D xce->fd;
-    struct evtchn_port_info *port_info;
-    unsigned long flags;
-    evtchn_port_t ret =3D -1;
-
-    local_irq_save(flags);
-    files[fd].read =3D 0;
-
-    LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
-        if (port_info->port !=3D -1 && port_info->pending) {
-            if (ret =3D=3D -1) {
-                ret =3D port_info->port;
-                port_info->pending =3D 0;
-            } else {
-                files[fd].read =3D 1;
-                break;
-            }
-        }
-    }
-    local_irq_restore(flags);
-    return ret;
-}
-
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
-{
-    unmask_evtchn(port);
-    return 0;
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush)
 {
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index b1b828f..fe4f0a1 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -19,7 +19,6 @@
 
 #include "xc_private.h"
 
-#include <xen/sys/evtchn.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <malloc.h>
@@ -223,114 +222,6 @@ static struct xc_osdep_ops netbsd_privcmd_ops =3D {
     },
 };
 
-#define EVTCHN_DEV_NAME  "/dev/xenevt"
-
-int osdep_evtchn_open(xc_evtchn *xce)
-{
-    int fd =3D open(EVTCHN_DEV_NAME, O_NONBLOCK|O_RDWR);
-    if ( fd =3D=3D -1 )
-        return -1;
-    xce->fd =3D fd;
-    return 0;
-}
-
-int osdep_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
-{
-    if ( xce->fd =3D=3D -1 )
-        return 0;
-
-    return close(xce->fd);
-}
-
-int xc_evtchn_fd(xc_evtchn *xce)
-{
-    return xce->fd;
-}
-
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_notify notify;
-
-    notify.port =3D port;
-
-    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn * xce, int domid)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_bind_unbound_port bind;
-    int ret;
-
-    bind.remote_domain =3D domid;
-
-    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
-    if (ret =3D=3D 0)
-	return bind.port;
-    else
-	return -1;
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
-                                                  evtchn_port_t remote_port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_bind_interdomain bind;
-    int ret;
-
-    bind.remote_domain =3D domid;
-    bind.remote_port =3D remote_port;
-
-    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
-    if (ret =3D=3D 0)
-	return bind.port;
-    else
-	return -1;
-}
-
-int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_unbind unbind;
-
-    unbind.port =3D port;
-
-    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_bind_virq bind;
-    int err;
-
-    bind.virq =3D virq;
-
-    err =3D ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
-    if (err)
-	return -1;
-    else
-	return bind.port;
-}
-
-evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
-{
-    int fd =3D xce->fd;
-    evtchn_port_t port;
-
-    if ( read_exact(fd, (char *)&port, sizeof(port)) =3D=3D -1 )
-        return -1;
-
-    return port;
-}
-
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    return write_exact(fd, (char *)&port, sizeof(port));
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index cb79f22..56d54b6 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -251,46 +251,6 @@ int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
     return xch->ops->u.privcmd.hypercall(xch, xch->ops_handle, hypercall);
 }
 
-xc_evtchn *xc_evtchn_open(xentoollog_logger *logger, unsigned open_flags)
-{
-    xc_evtchn *xce =3D malloc(sizeof(*xce));
-    int rc;
-
-    if (!xce) return NULL;
-
-    xce->fd =3D -1;
-    xce->logger =3D logger;
-    xce->logger_tofree  =3D NULL;
-
-    if (!xce->logger) {
-        xce->logger =3D xce->logger_tofree =3D
-            (xentoollog_logger*)
-            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
-        if (!xce->logger) goto err;
-    }
-
-    rc =3D osdep_evtchn_open(xce);
-    if ( rc  < 0 ) goto err;
-
-    return xce;
-
-err:
-    osdep_evtchn_close(xce);
-    xtl_logger_destroy(xce->logger_tofree);
-    free(xce);
-    return NULL;
-}
-
-int xc_evtchn_close(xc_evtchn *xce)
-{
-    int rc;
-
-    rc =3D osdep_evtchn_close(xce);
-    xtl_logger_destroy(xce->logger_tofree);
-    free(xce);
-    return rc;
-}
-
 xc_gnttab *xc_gnttab_open(xentoollog_logger *logger,
                              unsigned open_flags)
 {
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index f4d155a..a32accb 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -123,13 +123,6 @@ struct xc_interface_core {
     xc_osdep_handle  ops_handle; /* opaque data for xc_osdep_ops */
 };
 
-struct xenevtchn_handle {
-    xentoollog_logger *logger, *logger_tofree;
-    int fd;
-};
-int osdep_evtchn_open(xc_evtchn *xce);
-int osdep_evtchn_close(xc_evtchn *xce);
-
 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,
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index 088228a..ed7987c 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -20,7 +20,6 @@
 #include "xc_private.h"
 
 #include <xen/memory.h>
-#include <xen/sys/evtchn.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <malloc.h>
@@ -194,102 +193,6 @@ static struct xc_osdep_ops solaris_privcmd_ops =3D {
     },
 };
 
-int osdep_evtchn_open(xc_evtchn *xce)
-{
-    int fd;
-
-    if ( (fd =3D open("/dev/xen/evtchn", O_RDWR)) =3D=3D -1 )
-    {
-        PERROR("Could not open event channel interface");
-        return -1;
-    }
-
-    xce->fd =3D fd;
-    return 0;
-}
-
-int osdep_evtchn_close(xc_evtchn *xce)
-{
-    if ( xce->fd =3D=3D -1 )
-        return 0;
-
-    return close(xce->fd);
-}
-
-int xc_evtchn_fd(xc_evtchn *xce)
-{
-    return xce->fd;
-}
-
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_notify notify;


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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:14:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:14:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aON7P-0000R4-ED; Wed, 27 Jan 2016 10:14: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 1aON7N-0000Ql-LK
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:30 +0000
Content-Length: 88643
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	10/72-24375-48898A65; Wed, 27 Jan 2016 10:14:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1453889662!1225062!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12782 invoked from network); 27 Jan 2016 10:14:23 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:14:23 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON88-0001vR-Fv
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7G-0001IR-0g
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:22 +0000
Date: Wed, 27 Jan 2016 10:14:22 +0000
Message-Id: <E1aON7G-0001IR-0g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Refactor /dev/xen/evtchn
	wrappers into libxenevtchn.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============3444415792178667480=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3444415792178667480==
Content-Length: 91185
Content-Transfer-Encoding: quoted-printable

commit b7f76a699dcfadc0a52ab45b33cc72dbf3a69e7b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 16:20:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:21:07 2016 +0000

    tools: Refactor /dev/xen/evtchn wrappers into libxenevtchn.
    
    libxenevtchn will provide a stable API and ABI for accessing the
    evtchn device.
    
    The functions are moved into the xenevtchn namespace to make a clean
    break from libxc and avoid ambiguity regarding which interfaces are
    stable.
    
    All in-tree users are updated to use the new names.
    
    Upon request (via #define XC_WANT_COMPAT_EVTCHN_API) libxenctrl will
    provide a compat API for the old names. This is used by qemu-xen for
    the time being. qemu-xen-traditional is updated in lockstep.
    
    This leaves a few event channel related functions which go via privcmd
    (EVTCHNOP) rather than ioctls on the /dev/xen/evtchn device in
    libxenctrl. Specifically:
    
     - xc_evtchn_alloc_unbound
     - xc_evtchn_reset
     - xc_evtchn_status
    
    Note that xc_evtchn_alloc_unbound's functionality is also provided by
    xenevtchn_bind_unbound_port() (n=C3=A9e xc_evtchn_bind_unbound_port) and is
    probably redundant.
    
    These functions do not appear to be needed by qemu-dm, qemu-pv
    (provision of device model to HVM guests and PV backends respectively)
    or by libvchan suggesting they are not needed by non-toolstack uses of
    event channels. QEMU does use these in hw/xenpv/xen_domainbuild.c but
    that is a "toolstack use".
    
    The new library uses a version script to ensure that only expected
    symbols are exported and to version them such that ABI guarantees can
    be kept in the future.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    [ ijc -- updated MINIOS_UPSTREAM_REVISION and QEMU_TRADITIONAL_REVISION ]
---
 .gitignore                                    |    1 +
 Config.mk                                     |   12 +-
 stubdom/Makefile                              |   17 ++-
 tools/Makefile                                |    5 +-
 tools/Rules.mk                                |   14 +-
 tools/console/Makefile                        |    2 +
 tools/console/daemon/io.c                     |   43 ++--
 tools/libs/Makefile                           |    1 +
 tools/libs/evtchn/Makefile                    |   69 +++++++
 tools/libs/evtchn/core.c                      |   72 +++++++
 tools/libs/evtchn/freebsd.c                   |  138 +++++++++++++
 tools/libs/evtchn/include/xenevtchn.h         |  150 ++++++++++++++
 tools/libs/evtchn/libxenevtchn.map            |   19 ++
 tools/libs/evtchn/linux.c                     |  136 +++++++++++++
 tools/libs/evtchn/minios.c                    |  269 +++++++++++++++++++++++++
 tools/libs/evtchn/netbsd.c                    |  147 ++++++++++++++
 tools/libs/evtchn/private.h                   |   25 +++
 tools/libs/evtchn/solaris.c                   |  135 +++++++++++++
 tools/libs/toollog/include/xentoollog.h       |   10 +
 tools/libs/toollog/xtl_core.c                 |   10 +
 tools/libs/toollog/xtl_logger_stdio.c         |   10 +
 tools/libvchan/Makefile                       |    6 +-
 tools/libvchan/init.c                         |   20 +-
 tools/libvchan/io.c                           |   12 +-
 tools/libvchan/libxenvchan.h                  |    3 +-
 tools/libxc/Makefile                          |    8 +-
 tools/libxc/include/xenctrl.h                 |   99 +---------
 tools/libxc/include/xenctrl_compat.h          |   48 +++++
 tools/libxc/include/xenguest.h                |   14 +-
 tools/libxc/xc_evtchn_compat.c                |   75 +++++++
 tools/libxc/xc_freebsd_osdep.c                |  101 ---------
 tools/libxc/xc_linux_osdep.c                  |   95 ---------
 tools/libxc/xc_minios.c                       |  221 --------------------
 tools/libxc/xc_netbsd.c                       |  109 ----------
 tools/libxc/xc_private.c                      |   40 ----
 tools/libxc/xc_private.h                      |    7 -
 tools/libxc/xc_solaris.c                      |   97 ---------
 tools/libxc/xc_suspend.c                      |   18 +-
 tools/libxl/Makefile                          |    5 +-
 tools/libxl/libxl.c                           |    2 +-
 tools/libxl/libxl_dom_suspend.c               |    4 +-
 tools/libxl/libxl_event.c                     |   14 +-
 tools/libxl/libxl_internal.h                  |    5 +-
 tools/misc/Makefile                           |    7 +-
 tools/misc/xen-hptool.c                       |   13 +-
 tools/misc/xen-lowmemd.c                      |   15 +-
 tools/ocaml/libs/eventchn/Makefile            |    4 +-
 tools/ocaml/libs/eventchn/xeneventchn_stubs.c |   20 +-
 tools/python/setup.py                         |    7 +-
 tools/tests/xen-access/Makefile               |    3 +-
 tools/tests/xen-access/xen-access.c           |   21 +-
 tools/xcutils/Makefile                        |    4 +-
 tools/xenmon/Makefile                         |    2 +
 tools/xenmon/xenbaked.c                       |   13 +-
 tools/xenpaging/Makefile                      |    4 +-
 tools/xenpaging/xenpaging.c                   |   18 +-
 tools/xenpaging/xenpaging.h                   |    3 +-
 tools/xenstore/Makefile                       |    3 +-
 tools/xenstore/xenstored_core.c               |    6 +-
 tools/xenstore/xenstored_domain.c             |   25 ++-
 tools/xentrace/Makefile                       |    5 +-
 tools/xentrace/xentrace.c                     |   13 +-
 62 files changed, 1544 insertions(+), 930 deletions(-)

diff --git a/.gitignore b/.gitignore
index 141c2be..e7af9f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,6 +62,7 @@ stubdom/ioemu
 stubdom/ioemu/
 stubdom/libs-*
 stubdom/libxc-*
+stubdom/libxenevtchn-*
 stubdom/libxentoollog-*
 stubdom/lwip-*
 stubdom/lwip/
diff --git a/Config.mk b/Config.mk
index d654af8..e202d3f 100644
--- a/Config.mk
+++ b/Config.mk
@@ -251,9 +251,9 @@ MINIOS_UPSTREAM_URL =3F=3D git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION =3F=3D 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION =3F=3D master
-MINIOS_UPSTREAM_REVISION =3F=3D d25773c8afa2f4dbbb466116daeb60159ddd22bd
-# Thu Dec 3 11:23:25 2015 +0000
-# mini-os: Include libxentoollog with libxc
+MINIOS_UPSTREAM_REVISION =3F=3D fb66c855c983aa07644cb179fd9bfe96d55f317d
+# Fri Jan 15 13:24:00 2016 +0000
+# mini-os: Include libxenevtchn with libxc
 
 SEABIOS_UPSTREAM_REVISION =3F=3D 3403ac4313812752be6e6aac35239ca6888a8cab
 # Mon Dec 28 13:50:41 2015 +0100
@@ -262,9 +262,9 @@ SEABIOS_UPSTREAM_REVISION =3F=3D 3403ac4313812752be6e6aac35239ca6888a8cab
 ETHERBOOT_NICS =3F=3D rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION =3F=3D 569eac99e8ddccd15fe78e8a3af5622afe780e3b
-# Mon Jan 4 15:34:29 2016 +0000
-# MSI-X: avoid array overrun upon MSI-X table writes
+QEMU_TRADITIONAL_REVISION =3F=3D ca2ff968de42d47dcda8973aa1528a14f99992d3
+# Fri Jan 15 13:23:53 2016 +0000
+# qemu-xen-traditional: Use libxenevtchn
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 9c77205..702d66b 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -319,6 +319,12 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
 	  ln -sf $(XEN_ROOT)/tools/libs/toollog/include/*.h . && \
 	  ln -sf $(XEN_ROOT)/tools/libs/toollog/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/libs/toollog/Makefile . )
+	mkdir -p libs-$(XEN_TARGET_ARCH)/evtchn/include
+	[ -h libs-$(XEN_TARGET_ARCH)/evtchn/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/evtchn && \
+	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/*.h . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/include/*.h include/ && \
+	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/*.c . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/Makefile . )
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
@@ -351,12 +357,21 @@ libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_ARCH) $
 	CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTDIR=3D -C libs-$(XEN_TARGET_ARCH)/toollog
 
 #######
+# libxenevtchn
+#######
+
+.PHONY: libxenevtchn
+libxenevtchn: libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a
+libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+	CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTDIR=3D -C libs-$(XEN_TARGET_ARCH)/evtchn
+
+#######
 # libxc
 #######
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn cross-zlib
 	CPPFLAGS=3D"$(TARGET_CPPFLAGS)" CFLAGS=3D"$(TARGET_CFLAGS)" $(MAKE) DESTDIR=3D CONFIG_LIBXC_MINIOS=3Dy -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
diff --git a/tools/Makefile b/tools/Makefile
index ccd0ae7..55b5d44 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -249,8 +249,10 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--libdir=3D$(LIBEXEC_LIB) \
 		--includedir=3D$(LIBEXEC_INC) \
 		--source-path=3D$$source \
-		--extra-cflags=3D"-I$(XEN_ROOT)/tools/include \
+		--extra-cflags=3D"-DXC_WANT_COMPAT_EVTCHN_API=3D1 \
+		-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libs/toollog/include \
+		-I$(XEN_ROOT)/tools/libs/evtchn/include \
 		-I$(XEN_ROOT)/tools/libxc/include \
 		-I$(XEN_ROOT)/tools/xenstore/include \
 		-I$(XEN_ROOT)/tools/xenstore/compat/include \
@@ -258,6 +260,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--extra-ldflags=3D"-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore \
 		-Wl,-rpath-link=3D$(XEN_ROOT)/tools/libs/toollog \
+		-Wl,-rpath-link=3D$(XEN_ROOT)/tools/libs/evtchn \
 		$(QEMU_UPSTREAM_RPATH)" \
 		--bindir=3D$(LIBEXEC_BIN) \
 		--datadir=3D$(SHAREDIR)/qemu-xen \
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 0652e4b..75d02c4 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -11,6 +11,7 @@ INSTALL =3D $(XEN_ROOT)/tools/cross-install
 
 XEN_INCLUDE        =3D $(XEN_ROOT)/tools/include
 XEN_LIBXENTOOLLOG  =3D $(XEN_ROOT)/tools/libs/toollog
+XEN_LIBXENEVTCHN   =3D $(XEN_ROOT)/tools/libs/evtchn
 XEN_LIBXC          =3D $(XEN_ROOT)/tools/libxc
 XEN_XENLIGHT       =3D $(XEN_ROOT)/tools/libxl
 XEN_XENSTORE       =3D $(XEN_ROOT)/tools/xenstore
@@ -82,13 +83,18 @@ SHDEPS_libxentoollog =3D
 LDLIBS_libxentoollog =3D $(XEN_LIBXENTOOLLOG)/libxentoollog$(libextension)
 SHLIB_libxentoollog  =3D -Wl,-rpath-link=3D$(XEN_LIBXENTOOLLOG)
 
+CFLAGS_libxenevtchn =3D -I$(XEN_LIBXENEVTCHN)/include $(CFLAGS_xeninclude)
+SHDEPS_libxenevtchn =3D
+LDLIBS_libxenevtchn =3D $(XEN_LIBXENEVTCHN)/libxenevtchn$(libextension)
+SHLIB_libxenevtchn  =3D -Wl,-rpath-link=3D$(XEN_LIBXENEVTCHN)
+
 CFLAGS_libxenctrl =3D -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_xeninclude)
-SHDEPS_libxenctrl =3D $(SHLIB_libxentoollog)
+SHDEPS_libxenctrl =3D $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn)
 LDLIBS_libxenctrl =3D $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libextension)
 SHLIB_libxenctrl  =3D $(SHDEPS_libxenctrl) -Wl,-rpath-link=3D$(XEN_LIBXC)
 
-CFLAGS_libxenguest =3D -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
-SHDEPS_libxenguest =3D
+CFLAGS_libxenguest =3D -I$(XEN_LIBXC)/include $(CFLAGS_libxenevtchn) $(CFLAGS_xeninclude)
+SHDEPS_libxenguest =3D $(SHLIB_libxenevtchn)
 LDLIBS_libxenguest =3D $(SHDEPS_libxenguest) $(XEN_LIBXC)/libxenguest$(libextension)
 SHLIB_libxenguest  =3D $(SHDEPS_libxenguest) -Wl,-rpath-link=3D$(XEN_LIBXC)
 
@@ -103,7 +109,7 @@ LDLIBS_libxenstat  =3D $(SHDEPS_libxenstat) $(XEN_LIBXENSTAT)/libxenstat$(libexten
 SHLIB_libxenstat   =3D $(SHDEPS_libxenstat) -Wl,-rpath-link=3D$(XEN_LIBXENSTAT)
 
 CFLAGS_libxenvchan =3D -I$(XEN_LIBVCHAN)
-SHDEPS_libxenvchan =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore)
+SHDEPS_libxenvchan =3D $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenevtchn)
 LDLIBS_libxenvchan =3D $(SHDEPS_libxenvchan) $(XEN_LIBVCHAN)/libxenvchan$(libextension)
 SHLIB_libxenvchan  =3D $(SHDEPS_libxenvchan) -Wl,-rpath-link=3D$(XEN_LIBVCHAN)
 
diff --git a/tools/console/Makefile b/tools/console/Makefile
index 77e8f29..4b3a492 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -3,8 +3,10 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 CFLAGS  +=3D -Werror
 
+CFLAGS  +=3D $(CFLAGS_libxenevtchn)
 CFLAGS  +=3D $(CFLAGS_libxenctrl)
 CFLAGS  +=3D $(CFLAGS_libxenstore)
+LDLIBS +=3D $(LDLIBS_libxenevtchn)
 LDLIBS +=3D $(LDLIBS_libxenctrl)
 LDLIBS +=3D $(LDLIBS_libxenstore)
 LDLIBS +=3D $(SOCKET_LIBS)
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index cafc7b7..2f2e9c5 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -21,6 +21,7 @@
 
 #include "utils.h"
 #include "io.h"
+#include <xenevtchn.h>
 #include <xenstore.h>
 #include <xen/io/console.h>
 #include <xen/grant_table.h>
@@ -101,7 +102,7 @@ struct domain {
 	int ring_ref;
 	evtchn_port_or_error_t local_port;
 	evtchn_port_or_error_t remote_port;
-	xc_evtchn *xce_handle;
+	xenevtchn_handle *xce_handle;
 	int xce_pollfd_idx;
 	struct xencons_interface *interface;
 	int event_count;
@@ -185,7 +186,7 @@ static void buffer_append(struct domain *dom)
 
 	xen_mb();
 	intf->out_cons =3D cons;
-	xc_evtchn_notify(dom->xce_handle, dom->local_port);
+	xenevtchn_notify(dom->xce_handle, dom->local_port);
 
 	/* Get the data to the logfile as early as possible because if
 	 * no one is listening on the console pty then it will fill up
@@ -584,22 +585,22 @@ static int domain_create_ring(struct domain *dom)
 	dom->local_port =3D -1;
 	dom->remote_port =3D -1;
 	if (dom->xce_handle !=3D NULL)
-		xc_evtchn_close(dom->xce_handle);
+		xenevtchn_close(dom->xce_handle);
 
 	/* Opening evtchn independently for each console is a bit
 	 * wasteful, but that's how the code is structured... */
-	dom->xce_handle =3D xc_evtchn_open(NULL, 0);
+	dom->xce_handle =3D xenevtchn_open(NULL, 0);
 	if (dom->xce_handle =3D=3D NULL) {
 		err =3D errno;
 		goto out;
 	}
  
-	rc =3D xc_evtchn_bind_interdomain(dom->xce_handle,
+	rc =3D xenevtchn_bind_interdomain(dom->xce_handle,
 		dom->domid, remote_port);
 
 	if (rc =3D=3D -1) {
 		err =3D errno;
-		xc_evtchn_close(dom->xce_handle);
+		xenevtchn_close(dom->xce_handle);
 		dom->xce_handle =3D NULL;
 		goto out;
 	}
@@ -609,7 +610,7 @@ static int domain_create_ring(struct domain *dom)
 	if (dom->master_fd =3D=3D -1) {
 		if (!domain_create_tty(dom)) {
 			err =3D errno;
-			xc_evtchn_close(dom->xce_handle);
+			xenevtchn_close(dom->xce_handle);
 			dom->xce_handle =3D NULL;
 			dom->local_port =3D -1;
 			dom->remote_port =3D -1;
@@ -749,7 +750,7 @@ static void shutdown_domain(struct domain *d)
 	watch_domain(d, false);
 	domain_unmap_interface(d);
 	if (d->xce_handle !=3D NULL)
-		xc_evtchn_close(d->xce_handle);
+		xenevtchn_close(d->xce_handle);
 	d->xce_handle =3D NULL;
 }
 
@@ -839,7 +840,7 @@ static void handle_tty_read(struct domain *dom)
 		}
 		xen_wmb();
 		intf->in_prod =3D prod;
-		xc_evtchn_notify(dom->xce_handle, dom->local_port);
+		xenevtchn_notify(dom->xce_handle, dom->local_port);
 	} else {
 		domain_close_tty(dom);
 		shutdown_domain(dom);
@@ -871,7 +872,7 @@ static void handle_ring_read(struct domain *dom)
 	if (dom->is_dead)
 		return;
 
-	if ((port =3D xc_evtchn_pending(dom->xce_handle)) =3D=3D -1)
+	if ((port =3D xenevtchn_pending(dom->xce_handle)) =3D=3D -1)
 		return;
 
 	dom->event_count++;
@@ -879,7 +880,7 @@ static void handle_ring_read(struct domain *dom)
 	buffer_append(dom);
 
 	if (dom->event_count < RATE_LIMIT_ALLOWANCE)
-		(void)xc_evtchn_unmask(dom->xce_handle, port);
+		(void)xenevtchn_unmask(dom->xce_handle, port);
 }
 
 static void handle_xs(void)
@@ -906,7 +907,7 @@ static void handle_xs(void)
 	free(vec);
 }
 
-static void handle_hv_logs(xc_evtchn *xce_handle, bool force)
+static void handle_hv_logs(xenevtchn_handle *xce_handle, bool force)
 {
 	static char buffer[1024*16];
 	char *bufptr =3D buffer;
@@ -914,7 +915,7 @@ static void handle_hv_logs(xc_evtchn *xce_handle, bool force)
 	static uint32_t index =3D 0;
 	evtchn_port_or_error_t port =3D -1;
 
-	if (!force && ((port =3D xc_evtchn_pending(xce_handle)) =3D=3D -1))
+	if (!force && ((port =3D xenevtchn_pending(xce_handle)) =3D=3D -1))
 		return;
 
 	do
@@ -938,7 +939,7 @@ static void handle_hv_logs(xc_evtchn *xce_handle, bool force)
 	} while (size =3D=3D sizeof(buffer));
 
 	if (port !=3D -1)
-		(void)xc_evtchn_unmask(xce_handle, port);
+		(void)xenevtchn_unmask(xce_handle, port);
 }
 
 static void handle_log_reload(void)
@@ -1006,10 +1007,10 @@ void handle_io(void)
 	evtchn_port_or_error_t log_hv_evtchn =3D -1;
 	int xce_pollfd_idx =3D -1;
 	int xs_pollfd_idx =3D -1;
-	xc_evtchn *xce_handle =3D NULL;
+	xenevtchn_handle *xce_handle =3D NULL;
 
 	if (log_hv) {
-		xce_handle =3D xc_evtchn_open(NULL, 0);
+		xce_handle =3D xenevtchn_open(NULL, 0);
 		if (xce_handle =3D=3D NULL) {
 			dolog(LOG_ERR, "Failed to open xce handle: %d (%s)",
 			      errno, strerror(errno));
@@ -1018,7 +1019,7 @@ void handle_io(void)
 		log_hv_fd =3D create_hv_log();
 		if (log_hv_fd =3D=3D -1)
 			goto out;
-		log_hv_evtchn =3D xc_evtchn_bind_virq(xce_handle, VIRQ_CON_RING);
+		log_hv_evtchn =3D xenevtchn_bind_virq(xce_handle, VIRQ_CON_RING);
 		if (log_hv_evtchn =3D=3D -1) {
 			dolog(LOG_ERR, "Failed to bind to VIRQ_CON_RING: "
 			      "%d (%s)", errno, strerror(errno));
@@ -1047,7 +1048,7 @@ void handle_io(void)
 		xs_pollfd_idx =3D set_fds(xs_fileno(xs), POLLIN|POLLPRI);
 
 		if (log_hv)
-			xce_pollfd_idx =3D set_fds(xc_evtchn_fd(xce_handle),
+			xce_pollfd_idx =3D set_fds(xenevtchn_fd(xce_handle),
 						 POLLIN|POLLPRI);
 
 		if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0)
@@ -1066,7 +1067,7 @@ void handle_io(void)
 			if ((now+5) > d->next_period) {
 				d->next_period =3D now + RATE_LIMIT_PERIOD;
 				if (d->event_count >=3D RATE_LIMIT_ALLOWANCE) {
-					(void)xc_evtchn_unmask(d->xce_handle, d->local_port);
+					(void)xenevtchn_unmask(d->xce_handle, d->local_port);
 				}
 				d->event_count =3D 0;
 			}
@@ -1082,7 +1083,7 @@ void handle_io(void)
 				if (discard_overflowed_data ||
 				    !d->buffer.max_capacity ||
 				    d->buffer.size < d->buffer.max_capacity) {
-					int evtchn_fd =3D xc_evtchn_fd(d->xce_handle);
+					int evtchn_fd =3D xenevtchn_fd(d->xce_handle);
 					d->xce_pollfd_idx =3D set_fds(evtchn_fd,
 								    POLLIN|POLLPRI);
 				}
@@ -1202,7 +1203,7 @@ void handle_io(void)
 		log_hv_fd =3D -1;
 	}
 	if (xce_handle !=3D NULL) {
-		xc_evtchn_close(xce_handle);
+		xenevtchn_close(xce_handle);
 		xce_handle =3D NULL;
 	}
 	if (xcg_handle !=3D NULL) {
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index 73be500..0e3f523 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -3,5 +3,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 SUBDIRS-y :=3D
 SUBDIRS-y +=3D toollog
+SUBDIRS-y +=3D evtchn
 
 all clean install distclean: %: subdirs-%
diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile
new file mode 100644
index 0000000..46a807f
--- /dev/null
+++ b/tools/libs/evtchn/Makefile
@@ -0,0 +1,69 @@
+XEN_ROOT =3D $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR    =3D 1
+MINOR    =3D 0
+SHLIB_LDFLAGS +=3D -Wl,--version-script=3Dlibxenevtchn.map
+
+CFLAGS   +=3D -Werror -Wmissing-prototypes
+CFLAGS   +=3D -I./include $(CFLAGS_xeninclude)
+CFLAGS   +=3D $(CFLAGS_libxentoollog)
+
+SRCS-y                 +=3D core.c
+SRCS-$(CONFIG_Linux)   +=3D linux.c
+SRCS-$(CONFIG_FreeBSD) +=3D freebsd.c
+SRCS-$(CONFIG_SunOS)   +=3D solaris.c
+SRCS-$(CONFIG_NetBSD)  +=3D netbsd.c
+SRCS-$(CONFIG_MiniOS)  +=3D minios.c
+
+LIB_OBJS :=3D $(patsubst %.c,%.o,$(SRCS-y))
+PIC_OBJS :=3D $(patsubst %.c,%.opic,$(SRCS-y))
+
+LIB :=3D libxenevtchn.a
+ifneq ($(nosharedlibs),y)
+LIB +=3D libxenevtchn.so
+endif
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build:
+	$(MAKE) libs
+
+.PHONY: libs
+libs: $(LIB)
+
+
+libxenevtchn.a: $(LIB_OBJS)
+	$(AR) rc $@ $^
+
+libxenevtchn.so: libxenevtchn.so.$(MAJOR)
+	$(SYMLINK_SHLIB) $< $@
+libxenevtchn.so.$(MAJOR): libxenevtchn.so.$(MAJOR).$(MINOR)
+	$(SYMLINK_SHLIB) $< $@
+
+libxenevtchn.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxenevtchn.map
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenevtchn.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: build
+	$(INSTALL_DIR) $(DESTDIR)$(libdir)
+	$(INSTALL_DIR) $(DESTDIR)$(includedir)
+	$(INSTALL_SHLIB) libxenevtchn.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) libxenevtchn.a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) libxenevtchn.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenevtchn.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxenevtchn.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenevtchn.so
+	$(INSTALL_DATA) include/xenevtchn.h $(DESTDIR)$(includedir)
+
+.PHONY: TAGS
+TAGS:
+	etags -t *.c *.h
+
+.PHONY: clean
+clean:
+	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -f libxenevtchn.so.$(MAJOR).$(MINOR) libxenevtchn.so.$(MAJOR)
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/libs/evtchn/core.c b/tools/libs/evtchn/core.c
new file mode 100644
index 0000000..c31e08c
--- /dev/null
+++ b/tools/libs/evtchn/core.c
@@ -0,0 +1,72 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "private.h"
+
+xenevtchn_handle *xenevtchn_open(xentoollog_logger *logger, unsigned open_flags)
+{
+    xenevtchn_handle *xce =3D malloc(sizeof(*xce));
+    int rc;
+
+    if (!xce) return NULL;
+
+    xce->fd =3D -1;
+    xce->logger =3D logger;
+    xce->logger_tofree  =3D NULL;
+
+    if (!xce->logger) {
+        xce->logger =3D xce->logger_tofree =3D
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xce->logger) goto err;
+    }
+
+    rc =3D osdep_evtchn_open(xce);
+    if ( rc  < 0 ) goto err;
+
+    return xce;
+
+err:
+    osdep_evtchn_close(xce);
+    xtl_logger_destroy(xce->logger_tofree);
+    free(xce);
+    return NULL;
+}
+
+int xenevtchn_close(xenevtchn_handle *xce)
+{
+    int rc;
+
+    if ( !xce )
+        return 0;
+
+    rc =3D osdep_evtchn_close(xce);
+    xtl_logger_destroy(xce->logger_tofree);
+    free(xce);
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/freebsd.c b/tools/libs/evtchn/freebsd.c
new file mode 100644
index 0000000..636f052
--- /dev/null
+++ b/tools/libs/evtchn/freebsd.c
@@ -0,0 +1,138 @@
+ /******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split off from xc_freebsd_osdep.c
+ */
+
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+
+#include <xen/sys/evtchn.h>
+
+#include "private.h"
+
+#define EVTCHN_DEV      "/dev/xen/evtchn"
+
+int osdep_evtchn_open(xenevtchn_handle *xce)
+{
+    int fd =3D open(EVTCHN_DEV, O_RDWR);
+    if ( fd =3D=3D -1 )
+        return -1;
+    xce->fd =3D fd;
+    return 0;
+}
+
+int osdep_evtchn_close(xenevtchn_handle *xce)
+{
+    if ( xce->fd =3D=3D -1 )
+        return 0;
+
+    return close(xce->fd);
+}
+
+int xenevtchn_fd(xenevtchn_handle *xce)
+{
+    return xce->fd;
+}
+
+int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_notify notify;
+
+    notify.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid)
+{
+    int ret, fd =3D xce->fd;
+    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;
+}
+
+evtchn_port_or_error_t
+xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid, evtchn_port_t remote_port)
+{
+    int ret, fd =3D xce->fd;
+    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;
+}
+
+evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int virq)
+{
+    int ret, fd =3D xce->fd;
+    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;
+}
+
+int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_unbind unbind;
+
+    unbind.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
+}
+
+evtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
+{
+    int fd =3D xce->fd;
+    evtchn_port_t port;
+
+    if ( read(fd, &port, sizeof(port)) !=3D sizeof(port) )
+        return -1;
+
+    return port;
+}
+
+int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+
+    if ( write(fd, &port, sizeof(port)) !=3D sizeof(port) )
+        return -1;
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/include/xenevtchn.h b/tools/libs/evtchn/include/xenevtchn.h
new file mode 100644
index 0000000..3380fa3
--- /dev/null
+++ b/tools/libs/evtchn/include/xenevtchn.h
@@ -0,0 +1,150 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split off from:
+ * xenctrl.h
+ *
+ * A library for low-level access to the Xen control interfaces.
+ *
+ * Copyright (c) 2003-2004, K A Fraser.
+ */
+
+#ifndef XENEVTCHN_H
+#define XENEVTCHN_H
+
+#include <stdint.h>
+
+#include <xen/event_channel.h>
+
+/* A port identifier is guaranteed to fit in 31 bits. */
+typedef int evtchn_port_or_error_t;
+
+typedef struct xenevtchn_handle xenevtchn_handle;
+
+/* Callers who don't care don't need to #include <xentoollog.h> */
+typedef struct xentoollog_logger xentoollog_logger;
+
+/*
+ * EVENT CHANNEL FUNCTIONS
+ *
+ * None of these do any logging.
+ */
+
+/*
+ * Return a handle to the event channel driver, or NULL on failure, in
+ * which case errno will be set appropriately.
+ *
+ * Note:
+ * After fork a child process must not use any opened xc evtchn
+ * handle inherited from their parent. They must open a new handle if
+ * they want to interact with xc.
+ *
+ * Before Xen pre-4.1 this function would sometimes report errors with perror.
+ */
+/* Currently no flags are defined */
+xenevtchn_handle *xenevtchn_open(xentoollog_logger *logger, unsigned open_flags);
+
+/*
+ * Close a handle previously allocated with xenevtchn_open().
+ */
+int xenevtchn_close(xenevtchn_handle *xce);
+
+/*
+ * Return an fd that can be select()ed on.
+ *
+ * Note that due to bugs, setting this fd to non blocking may not
+ * work: you would hope that it would result in xenevtchn_pending
+ * failing with EWOULDBLOCK if there are no events signaled, but in
+ * fact it may block.  (Bug is present in at least Linux 3.12, and
+ * perhaps on other platforms or later version.)
+ *
+ * To be safe, you must use poll() or select() before each call to
+ * xenevtchn_pending.  If you have multiple threads (or processes)
+ * sharing a single xce handle this will not work, and there is no
+ * straightforward workaround.  Please design your program some other
+ * way.
+ */
+int xenevtchn_fd(xenevtchn_handle *xce);
+
+/*
+ * Notify the given event channel. Returns -1 on failure, in which case
+ * errno will be set appropriately.
+ */
+int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port);
+
+/*
+ * Returns a new event port awaiting interdomain connection from the given
+ * domain ID, or -1 on failure, in which case errno will be set appropriately.
+ */
+evtchn_port_or_error_t
+xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid);
+
+/*
+ * Returns a new event port bound to the remote port for the given domain ID,
+ * or -1 on failure, in which case errno will be set appropriately.
+ */
+evtchn_port_or_error_t
+xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+                           evtchn_port_t remote_port);
+
+/*
+ * Bind an event channel to the given VIRQ. Returns the event channel bound to
+ * the VIRQ, or -1 on failure, in which case errno will be set appropriately.
+ */
+evtchn_port_or_error_t
+xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int virq);
+
+/*
+ * Unbind the given event channel. Returns -1 on failure, in which case errno
+ * will be set appropriately.
+ */
+int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port);
+
+/*
+ * Return the next event channel to become pending, or -1 on failure, in which
+ * case errno will be set appropriately.
+ *
+ * At the hypervisor level the event channel will have been masked,
+ * and then cleared, by the underlying machinery (evtchn kernel
+ * driver, or equivalent).  So if the event channel is signaled again
+ * after it is returned here, it will be queued up, and delivered
+ * again after you unmask it.  (See the documentation in the Xen
+ * public header event_channel.h.)
+ *
+ * On receiving the notification from xenevtchn_pending, you should
+ * normally: check (by other means) what work needs doing; do the
+ * necessary work (if any); unmask the event channel with
+ * xenevtchn_unmask (if you want to receive any further
+ * notifications).
+ */
+evtchn_port_or_error_t
+xenevtchn_pending(xenevtchn_handle *xce);
+
+/*
+ * Unmask the given event channel. Returns -1 on failure, in which case errno
+ * will be set appropriately.
+ */
+int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/libxenevtchn.map b/tools/libs/evtchn/libxenevtchn.map
new file mode 100644
index 0000000..625a1e2
--- /dev/null
+++ b/tools/libs/evtchn/libxenevtchn.map
@@ -0,0 +1,19 @@
+VERS_1.0 {
+	global:
+		xenevtchn_open;
+		xenevtchn_close;
+
+		xenevtchn_fd;
+
+		xenevtchn_bind_unbound_port;
+		xenevtchn_bind_interdomain;
+		xenevtchn_bind_virq;
+
+		xenevtchn_notify;
+
+		xenevtchn_unbind;
+		xenevtchn_unmask;
+
+		xenevtchn_pending;
+	local: *; /* Do not expose anything by default */
+};
diff --git a/tools/libs/evtchn/linux.c b/tools/libs/evtchn/linux.c
new file mode 100644
index 0000000..27fd6e9
--- /dev/null
+++ b/tools/libs/evtchn/linux.c
@@ -0,0 +1,136 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_linus_osdep.c:
+ *
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include <sys/ioctl.h>
+
+#include <xen/sys/evtchn.h>
+
+#include "private.h"
+
+int osdep_evtchn_open(xenevtchn_handle *xce)
+{
+    int fd =3D open("/dev/xen/evtchn", O_RDWR);
+    if ( fd =3D=3D -1 )
+        return -1;
+    xce->fd =3D fd;
+    return 0;
+}
+
+int osdep_evtchn_close(xenevtchn_handle *xce)
+{
+    if ( xce->fd =3D=3D -1 )
+        return 0;
+
+    return close(xce->fd);
+}
+
+int xenevtchn_fd(xenevtchn_handle *xce)
+{
+    return xce->fd;
+}
+
+int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_notify notify;
+
+    notify.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce,
+                                                   int domid)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_unbound_port bind;
+
+    bind.remote_domain =3D domid;
+
+    return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce,
+                                                  int domid,
+                                                  evtchn_port_t remote_port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_interdomain bind;
+
+    bind.remote_domain =3D domid;
+    bind.remote_port =3D remote_port;
+
+    return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce,
+                                           unsigned int virq)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_virq bind;
+
+    bind.virq =3D virq;
+
+    return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+}
+
+int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_unbind unbind;
+
+    unbind.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
+}
+
+evtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
+{
+    int fd =3D xce->fd;
+    evtchn_port_t port;
+
+    if ( read(fd, &port, sizeof(port)) !=3D sizeof(port) )
+        return -1;
+
+    return port;
+}
+
+int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+
+    if ( write(fd, &port, sizeof(port)) !=3D sizeof(port) )
+        return -1;
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
new file mode 100644
index 0000000..fb913a2
--- /dev/null
+++ b/tools/libs/evtchn/minios.c
@@ -0,0 +1,269 @@
+/******************************************************************************
+ *
+ * Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.com>.
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split off from xc_minios.c
+ */
+
+#include "xen-external/bsd-sys-queue.h"
+#include <mini-os/types.h>
+#include <mini-os/os.h>
+#include <mini-os/lib.h>
+#include <mini-os/events.h>
+#include <mini-os/wait.h>
+
+#include <sys/socket.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <malloc.h>
+
+#include "private.h"
+
+extern void minios_evtchn_close_fd(int fd);
+
+extern struct wait_queue_head event_queue;
+
+//void minios_evtchn_close_fd(int fd);
+
+/* XXX Note: This is not threadsafe */
+static struct evtchn_port_info* port_alloc(int fd) {
+    struct evtchn_port_info *port_info;
+    port_info =3D malloc(sizeof(struct evtchn_port_info));
+    if (port_info =3D=3D NULL)
+        return NULL;
+    port_info->pending =3D 0;
+    port_info->port =3D -1;
+    port_info->bound =3D 0;
+
+    LIST_INSERT_HEAD(&files[fd].evtchn.ports, port_info, list);
+    return port_info;
+}
+
+static void port_dealloc(struct evtchn_port_info *port_info) {
+    if (port_info->bound)
+        unbind_evtchn(port_info->port);
+    LIST_REMOVE(port_info, list);
+    free(port_info);
+}
+
+int osdep_evtchn_open(xenevtchn_handle *xce)
+{
+    int fd =3D alloc_fd(FTYPE_EVTCHN);
+    if ( fd =3D=3D -1 )
+        return -1;
+    LIST_INIT(&files[fd].evtchn.ports);
+    xce->fd =3D fd;
+    printf("evtchn_open() -> %d\n", fd);
+    return 0;
+}
+
+int osdep_evtchn_close(xenevtchn_handle *xce)
+{
+    if ( xce->fd =3D=3D -1 )
+        return 0;
+
+    return close(xce->fd);
+}
+
+void minios_evtchn_close_fd(int fd)
+{
+    struct evtchn_port_info *port_info, *tmp;
+    LIST_FOREACH_SAFE(port_info, &files[fd].evtchn.ports, list, tmp)
+        port_dealloc(port_info);
+
+    files[fd].type =3D FTYPE_NONE;
+}
+
+int xenevtchn_fd(xenevtchn_handle *xce)
+{
+    return xce->fd;
+}
+
+int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int ret;
+
+    ret =3D notify_remote_via_evtchn(port);
+
+    if (ret < 0) {
+	errno =3D -ret;
+	ret =3D -1;
+    }
+    return ret;
+}
+
+static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
+{
+    int fd =3D (int)(intptr_t)data;
+    struct evtchn_port_info *port_info;
+    assert(files[fd].type =3D=3D FTYPE_EVTCHN);
+    mask_evtchn(port);
+    LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
+        if (port_info->port =3D=3D port)
+            goto found;
+    }
+    printk("Unknown port for handle %d\n", fd);
+    return;
+
+ found:
+    port_info->pending =3D 1;
+    files[fd].read =3D 1;
+    wake_up(&event_queue);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid)
+{
+    int fd =3D xce->fd;
+    struct evtchn_port_info *port_info;
+    int ret;
+    evtchn_port_t port;
+
+    assert(get_current() =3D=3D main_thread);
+    port_info =3D port_alloc(fd);
+    if (port_info =3D=3D NULL)
+	return -1;
+
+    printf("xenevtchn_bind_unbound_port(%d)", domid);
+    ret =3D evtchn_alloc_unbound(domid, evtchn_handler, (void*)(intptr_t)fd, &port);
+    printf(" =3D %d\n", ret);
+
+    if (ret < 0) {
+	port_dealloc(port_info);
+	errno =3D -ret;
+	return -1;
+    }
+    port_info->bound =3D 1;
+    port_info->port =3D port;
+    unmask_evtchn(port);
+    return port;
+}
+
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+                                                  evtchn_port_t remote_port)
+{
+    int fd =3D xce->fd;
+    struct evtchn_port_info *port_info;
+    evtchn_port_t local_port;
+    int ret;
+
+    assert(get_current() =3D=3D main_thread);
+    port_info =3D port_alloc(fd);
+    if (port_info =3D=3D NULL)
+	return -1;
+
+    printf("xenevtchn_bind_interdomain(%d, %"PRId32")", domid, remote_port);
+    ret =3D evtchn_bind_interdomain(domid, remote_port, evtchn_handler, (void*)(intptr_t)fd, &local_port);
+    printf(" =3D %d\n", ret);
+
+    if (ret < 0) {
+	port_dealloc(port_info);
+	errno =3D -ret;
+	return -1;
+    }
+    port_info->bound =3D 1;
+    port_info->port =3D local_port;
+    unmask_evtchn(local_port);
+    return local_port;
+}
+
+int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct evtchn_port_info *port_info;
+
+    LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
+        if (port_info->port =3D=3D port) {
+            port_dealloc(port_info);
+            return 0;
+        }
+    }
+    printf("Warning: couldn't find port %"PRId32" for xc handle %x\n", port, fd);
+    errno =3D EINVAL;
+    return -1;
+}
+
+evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int virq)
+{
+    int fd =3D xce->fd;
+    struct evtchn_port_info *port_info;
+    evtchn_port_t port;
+
+    assert(get_current() =3D=3D main_thread);
+    port_info =3D port_alloc(fd);
+    if (port_info =3D=3D NULL)
+	return -1;
+
+    printf("xenevtchn_bind_virq(%d)", virq);
+    port =3D bind_virq(virq, evtchn_handler, (void*)(intptr_t)fd);
+
+    if (port < 0) {
+	port_dealloc(port_info);
+	errno =3D -port;
+	return -1;
+    }
+    port_info->bound =3D 1;
+    port_info->port =3D port;
+    unmask_evtchn(port);
+    return port;
+}
+
+evtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
+{
+    int fd =3D xce->fd;
+    struct evtchn_port_info *port_info;
+    unsigned long flags;
+    evtchn_port_t ret =3D -1;
+
+    local_irq_save(flags);
+    files[fd].read =3D 0;
+
+    LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
+        if (port_info->port !=3D -1 && port_info->pending) {
+            if (ret =3D=3D -1) {
+                ret =3D port_info->port;
+                port_info->pending =3D 0;
+            } else {
+                files[fd].read =3D 1;
+                break;
+            }
+        }
+    }
+    local_irq_restore(flags);
+    return ret;
+}
+
+int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    unmask_evtchn(port);
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/netbsd.c b/tools/libs/evtchn/netbsd.c
new file mode 100644
index 0000000..c4123fe
--- /dev/null
+++ b/tools/libs/evtchn/netbsd.c
@@ -0,0 +1,147 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_netbsd.c
+ */
+
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+
+#include <xen/sys/evtchn.h>
+
+#include "private.h"
+
+#define EVTCHN_DEV_NAME  "/dev/xenevt"
+
+int osdep_evtchn_open(xenevtchn_handle *xce)
+{
+    int fd =3D open(EVTCHN_DEV_NAME, O_NONBLOCK|O_RDWR);
+    if ( fd =3D=3D -1 )
+        return -1;
+    xce->fd =3D fd;
+    return 0;
+}
+
+int osdep_evtchn_close(xenevtchn_handle *xce)
+{
+    if ( xce->fd =3D=3D -1 )
+        return 0;
+
+    return close(xce->fd);
+}
+
+int xenevtchn_fd(xenevtchn_handle *xce)
+{
+    return xce->fd;
+}
+
+int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_notify notify;
+
+    notify.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle * xce, int domid)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_unbound_port bind;
+    int ret;
+
+    bind.remote_domain =3D domid;
+
+    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+    if (ret =3D=3D 0)
+	return bind.port;
+    else
+	return -1;
+}
+
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+                                                  evtchn_port_t remote_port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_interdomain bind;
+    int ret;
+
+    bind.remote_domain =3D domid;
+    bind.remote_port =3D remote_port;
+
+    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+    if (ret =3D=3D 0)
+	return bind.port;
+    else
+	return -1;
+}
+
+int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_unbind unbind;
+
+    unbind.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int virq)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_virq bind;
+    int err;
+
+    bind.virq =3D virq;
+
+    err =3D ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+    if (err)
+	return -1;
+    else
+	return bind.port;
+}
+
+evtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
+{
+    int fd =3D xce->fd;
+    evtchn_port_t port;
+
+    if ( read_exact(fd, (char *)&port, sizeof(port)) =3D=3D -1 )
+        return -1;
+
+    return port;
+}
+
+int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    return write_exact(fd, (char *)&port, sizeof(port));
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/private.h b/tools/libs/evtchn/private.h
new file mode 100644
index 0000000..fcd0e96
--- /dev/null
+++ b/tools/libs/evtchn/private.h
@@ -0,0 +1,25 @@
+#ifndef XENEVTCHN_PRIVATE_H
+#define XENEVTCHN_PRIVATE_H
+
+#include <xentoollog.h>
+#include <xenevtchn.h>
+
+struct xenevtchn_handle {
+    xentoollog_logger *logger, *logger_tofree;
+    int fd;
+};
+
+int osdep_evtchn_open(xenevtchn_handle *xce);
+int osdep_evtchn_close(xenevtchn_handle *xce);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/evtchn/solaris.c b/tools/libs/evtchn/solaris.c
new file mode 100644
index 0000000..114cefb
--- /dev/null
+++ b/tools/libs/evtchn/solaris.c
@@ -0,0 +1,135 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_solaris.c
+ */
+
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+
+#include <xen/sys/evtchn.h>
+
+#include "private.h"
+
+int osdep_evtchn_open(xenevtchn_handle *xce)
+{
+    int fd;
+
+    if ( (fd =3D open("/dev/xen/evtchn", O_RDWR)) =3D=3D -1 )
+    {
+        PERROR("Could not open event channel interface");
+        return -1;
+    }
+
+    xce->fd =3D fd;
+    return 0;
+}
+
+int osdep_evtchn_close(xenevtchn_handle *xce)
+{
+    if ( xce->fd =3D=3D -1 )
+        return 0;
+
+    return close(xce->fd);
+}
+
+int xenevtchn_fd(xenevtchn_handle *xce)
+{
+    return xce->fd;
+}
+
+int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_notify notify;
+
+    notify.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_unbound_port bind;
+
+    bind.remote_domain =3D domid;
+
+    return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+                                                  evtchn_port_t remote_port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_interdomain bind;
+
+    bind.remote_domain =3D domid;
+    bind.remote_port =3D remote_port;
+
+    return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+}
+
+evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int virq)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_bind_virq bind;
+
+    bind.virq =3D virq;
+
+    return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+}
+
+int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    struct ioctl_evtchn_unbind unbind;
+
+    unbind.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
+}
+
+evtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
+{
+    int fd =3D xce->fd;
+    evtchn_port_t port;
+
+    if ( read_exact(fd, (char *)&port, sizeof(port)) =3D=3D -1 )
+        return -1;
+
+    return port;
+}
+
+int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port)
+{
+    int fd =3D xce->fd;
+    return write_exact(fd, (char *)&port, sizeof(port));
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/toollog/include/xentoollog.h b/tools/libs/toollog/include/xentoollog.h
index 853e9c7..76f17fe 100644
--- a/tools/libs/toollog/include/xentoollog.h
+++ b/tools/libs/toollog/include/xentoollog.h
@@ -134,3 +134,13 @@ const char *xtl_level_to_string(xentoollog_level); /* never fails */
 
 
 #endif /* XENTOOLLOG_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/libs/toollog/xtl_core.c b/tools/libs/toollog/xtl_core.c
index c4724a0..099d2f3 100644
--- a/tools/libs/toollog/xtl_core.c
+++ b/tools/libs/toollog/xtl_core.c
@@ -81,3 +81,13 @@ void xtl_logger_destroy(struct xentoollog_logger *logger) {
     if (!logger) return;
     logger->destroy(logger);
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/toollog/xtl_logger_stdio.c b/tools/libs/toollog/xtl_logger_stdio.c
index 0cd9206..f9c5bd8 100644
--- a/tools/libs/toollog/xtl_logger_stdio.c
+++ b/tools/libs/toollog/xtl_logger_stdio.c
@@ -190,3 +190,13 @@ xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
 
     return XTL_NEW_LOGGER(stdiostream, newlogger);
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libvchan/Makefile b/tools/libvchan/Makefile
index 3c50fe6..84128a3 100644
--- a/tools/libvchan/Makefile
+++ b/tools/libvchan/Makefile
@@ -10,9 +10,9 @@ NODE_OBJS =3D node.o
 NODE2_OBJS =3D node-select.o
 
 LIBVCHAN_PIC_OBJS =3D $(patsubst %.o,%.opic,$(LIBVCHAN_OBJS))
-LIBVCHAN_LIBS =3D $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl)
-$(LIBVCHAN_OBJS) $(LIBVCHAN_PIC_OBJS): CFLAGS +=3D $(CFLAGS_libxenstore) $(CFLAGS_libxenctrl)
-$(NODE_OBJS) $(NODE2_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl)
+LIBVCHAN_LIBS =3D $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenevtchn)
+$(LIBVCHAN_OBJS) $(LIBVCHAN_PIC_OBJS): CFLAGS +=3D $(CFLAGS_libxenstore) $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn)
+$(NODE_OBJS) $(NODE2_OBJS): CFLAGS +=3D $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn)
 
 MAJOR =3D 1.0
 MINOR =3D 0
diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c
index 77be4e7..66cb103 100644
--- a/tools/libvchan/init.c
+++ b/tools/libvchan/init.c
@@ -216,25 +216,25 @@ static int init_evt_srv(struct libxenvchan *ctrl, int domain, xentoollog_logger
 {
 	evtchn_port_or_error_t port;
 
-	ctrl->event =3D xc_evtchn_open(logger, 0);
+	ctrl->event =3D xenevtchn_open(logger, 0);
 	if (!ctrl->event)
 		return -1;
 
-	port =3D xc_evtchn_bind_unbound_port(ctrl->event, domain);
+	port =3D xenevtchn_bind_unbound_port(ctrl->event, domain);
 	if (port < 0)
 		goto fail;
 	ctrl->event_port =3D port;
 
-	if (xc_evtchn_unmask(ctrl->event, ctrl->event_port))
+	if (xenevtchn_unmask(ctrl->event, ctrl->event_port))
 		goto fail;
 
 	return 0;
 
 fail:
 	if (port >=3D 0)
-		xc_evtchn_unbind(ctrl->event, port);
+		xenevtchn_unbind(ctrl->event, port);
 
-	xc_evtchn_close(ctrl->event);
+	xenevtchn_close(ctrl->event);
 	ctrl->event =3D NULL;
 
 	return -1;
@@ -346,26 +346,26 @@ static int init_evt_cli(struct libxenvchan *ctrl, int domain, xentoollog_logger
 {
 	evtchn_port_or_error_t port;
 
-	ctrl->event =3D xc_evtchn_open(logger, 0);
+	ctrl->event =3D xenevtchn_open(logger, 0);
 	if (!ctrl->event)
 		return -1;
 
-	port =3D xc_evtchn_bind_interdomain(ctrl->event,
+	port =3D xenevtchn_bind_interdomain(ctrl->event,
 		domain, ctrl->event_port);
 	if (port < 0)
 		goto fail;
 	ctrl->event_port =3D port;
 
-	if (xc_evtchn_unmask(ctrl->event, ctrl->event_port))
+	if (xenevtchn_unmask(ctrl->event, ctrl->event_port))
 		goto fail;
 
 	return 0;
 
 fail:
 	if (port >=3D 0)
-		xc_evtchn_unbind(ctrl->event, port);
+		xenevtchn_unbind(ctrl->event, port);
 
-	xc_evtchn_close(ctrl->event);
+	xenevtchn_close(ctrl->event);
 	ctrl->event =3D NULL;
 
 	return -1;
diff --git a/tools/libvchan/io.c b/tools/libvchan/io.c
index 381cc05..53393a5 100644
--- a/tools/libvchan/io.c
+++ b/tools/libvchan/io.c
@@ -105,7 +105,7 @@ static inline int send_notify(struct libxenvchan *ctrl, uint8_t bit)
 	notify =3D ctrl->is_server =3F &ctrl->ring->srv_notify : &ctrl->ring->cli_notify;
 	prev =3D __sync_fetch_and_and(notify, ~bit);
 	if (prev & bit)
-		return xc_evtchn_notify(ctrl->event, ctrl->event_port);
+		return xenevtchn_notify(ctrl->event, ctrl->event_port);
 	else
 		return 0;
 }
@@ -196,10 +196,10 @@ int libxenvchan_buffer_space(struct libxenvchan *ctrl)
 
 int libxenvchan_wait(struct libxenvchan *ctrl)
 {
-	int ret =3D xc_evtchn_pending(ctrl->event);
+	int ret =3D xenevtchn_pending(ctrl->event);
 	if (ret < 0)
 		return -1;
-	xc_evtchn_unmask(ctrl->event, ret);
+	xenevtchn_unmask(ctrl->event, ret);
 	return 0;
 }
 
@@ -352,7 +352,7 @@ int libxenvchan_is_open(struct libxenvchan* ctrl)
 
 int libxenvchan_fd_for_select(struct libxenvchan *ctrl)
 {
-	return xc_evtchn_fd(ctrl->event);
+	return xenevtchn_fd(ctrl->event);
 }
 
 void libxenvchan_close(struct libxenvchan *ctrl)
@@ -374,8 +374,8 @@ void libxenvchan_close(struct libxenvchan *ctrl)
 	}
 	if (ctrl->event) {
 		if (ctrl->ring)
-			xc_evtchn_notify(ctrl->event, ctrl->event_port);
-		xc_evtchn_close(ctrl->event);
+			xenevtchn_notify(ctrl->event, ctrl->event_port);
+		xenevtchn_close(ctrl->event);
 	}
 	if (ctrl->is_server) {
 		if (ctrl->gntshr)
diff --git a/tools/libvchan/libxenvchan.h b/tools/libvchan/libxenvchan.h
index 0944a0e..1544378 100644
--- a/tools/libvchan/libxenvchan.h
+++ b/tools/libvchan/libxenvchan.h
@@ -44,6 +44,7 @@
 
 #include <xen/io/libxenvchan.h>
 #include <xen/sys/evtchn.h>
+#include <xenevtchn.h>
 #include <xenctrl.h>
 
 struct libxenvchan_ring {
@@ -71,7 +72,7 @@ struct libxenvchan {
 	/* Pointer to shared ring page */
 	struct vchan_interface *ring;
 	/* event channel interface */
-	xc_evtchn *event;
+	xenevtchn_handle *event;
 	uint32_t event_port;
 	/* informative flags: are we acting as server=3F */
 	int is_server:1;
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 940708f..b8fc6a5 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -48,6 +48,7 @@ CTRL_SRCS-$(CONFIG_SunOS) +=3D xc_solaris.c
 CTRL_SRCS-$(CONFIG_NetBSD) +=3D xc_netbsd.c
 CTRL_SRCS-$(CONFIG_NetBSDRump) +=3D xc_netbsd.c
 CTRL_SRCS-$(CONFIG_MiniOS) +=3D xc_minios.c
+CTRL_SRCS-y       +=3D xc_evtchn_compat.c
 
 GUEST_SRCS-y :=3D
 GUEST_SRCS-y +=3D xg_private.c xc_suspend.c
@@ -111,6 +112,7 @@ CFLAGS-$(CONFIG_Linux) +=3D -D_GNU_SOURCE
 
 CFLAGS	+=3D $(PTHREAD_CFLAGS)
 CFLAGS	+=3D $(CFLAGS_libxentoollog)
+CFLAGS	+=3D $(CFLAGS_libxenevtchn)
 
 CTRL_LIB_OBJS :=3D $(patsubst %.c,%.o,$(CTRL_SRCS-y))
 CTRL_PIC_OBJS :=3D $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
@@ -164,7 +166,7 @@ install: build
 	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenctrl.so
-	$(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h $(DESTDIR)$(includedir)
+	$(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h include/xenctrlosdep.h $(DESTDIR)$(includedir)
 	$(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
 	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR)
@@ -207,7 +209,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
@@ -230,7 +232,7 @@ xc_dom_bzimageloader.opic: CFLAGS +=3D $(call zlib-options,D)
 
 libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS =3D $(call zlib-options,l)
 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
-	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 xenctrl_osdep_ENOSYS.so: $(OSDEP_PIC_OBJS) libxenctrl.so
 	$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 1bf70f9..53f3033 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -117,7 +117,6 @@
  */
 
 typedef struct xc_interface_core xc_interface;
-typedef struct xenevtchn_handle xc_evtchn;
 typedef struct xc_interface_core xc_gnttab;
 typedef struct xc_interface_core xc_gntshr;
 
@@ -1085,7 +1084,6 @@ int xc_cpupool_movedomain(xc_interface *xch,
  */
 xc_cpumap_t xc_cpupool_freeinfo(xc_interface *xch);
 
-
 /*
  * EVENT CHANNEL FUNCTIONS
  *
@@ -1120,101 +1118,7 @@ int xc_evtchn_reset(xc_interface *xch,
 typedef struct evtchn_status xc_evtchn_status_t;
 int xc_evtchn_status(xc_interface *xch, xc_evtchn_status_t *status);
 
-/*
- * Return a handle to the event channel driver, or NULL on failure, in
- * which case errno will be set appropriately.
- *
- * Note:
- * After fork a child process must not use any opened xc evtchn
- * handle inherited from their parent. They must open a new handle if
- * they want to interact with xc.
- *
- * Before Xen pre-4.1 this function would sometimes report errors with perror.
- */
-xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
-                             unsigned open_flags);
 
-/*
- * Close a handle previously allocated with xc_evtchn_open().
- */
-int xc_evtchn_close(xc_evtchn *xce);
-
-/*
- * Return an fd that can be select()ed on.
- *
- * Note that due to bugs, setting this fd to non blocking may not
- * work: you would hope that it would result in xc_evtchn_pending
- * failing with EWOULDBLOCK if there are no events signaled, but in
- * fact it may block.  (Bug is present in at least Linux 3.12, and
- * perhaps on other platforms or later version.)
- *
- * To be safe, you must use poll() or select() before each call to
- * xc_evtchn_pending.  If you have multiple threads (or processes)
- * sharing a single xce handle this will not work, and there is no
- * straightforward workaround.  Please design your program some other
- * way.
- */
-int xc_evtchn_fd(xc_evtchn *xce);
-
-/*
- * Notify the given event channel. Returns -1 on failure, in which case
- * errno will be set appropriately.
- */
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port);
-
-/*
- * Returns a new event port awaiting interdomain connection from the given
- * domain ID, or -1 on failure, in which case errno will be set appropriately.
- */
-evtchn_port_or_error_t
-xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid);
-
-/*
- * Returns a new event port bound to the remote port for the given domain ID,
- * or -1 on failure, in which case errno will be set appropriately.
- */
-evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
-                           evtchn_port_t remote_port);
-
-/*
- * Bind an event channel to the given VIRQ. Returns the event channel bound to
- * the VIRQ, or -1 on failure, in which case errno will be set appropriately.
- */
-evtchn_port_or_error_t
-xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq);
-
-/*
- * Unbind the given event channel. Returns -1 on failure, in which case errno
- * will be set appropriately.
- */
-int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port);
-
-/*
- * Return the next event channel to become pending, or -1 on failure, in which
- * case errno will be set appropriately.
- *
- * At the hypervisor level the event channel will have been masked,
- * and then cleared, by the underlying machinery (evtchn kernel
- * driver, or equivalent).  So if the event channel is signaled again
- * after it is returned here, it will be queued up, and delivered
- * again after you unmask it.  (See the documentation in the Xen
- * public header event_channel.h.)
- *
- * On receiving the notification from xc_evtchn_pending, you should
- * normally: check (by other means) what work needs doing; do the
- * necessary work (if any); unmask the event channel with
- * xc_evtchn_unmask (if you want to receive any further
- * notifications).
- */
-evtchn_port_or_error_t
-xc_evtchn_pending(xc_evtchn *xce);
-
-/*
- * Unmask the given event channel. Returns -1 on failure, in which case errno
- * will be set appropriately.
- */
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port);
 
 int xc_physdev_pci_access_modify(xc_interface *xch,
                                  uint32_t domid,
@@ -2851,6 +2755,9 @@ int xc_psr_cat_get_l3_info(xc_interface *xch, uint32_t socket,
                            bool *cdp_enabled);
 #endif
 
+/* Compat shims */
+#include "xenctrl_compat.h"
+
 #endif /* XENCTRL_H */
 
 /*
diff --git a/tools/libxc/include/xenctrl_compat.h b/tools/libxc/include/xenctrl_compat.h
new file mode 100644
index 0000000..48daeb2
--- /dev/null
+++ b/tools/libxc/include/xenctrl_compat.h
@@ -0,0 +1,48 @@
+/*
+ * Compat shims for use of 3rd party consumers of libxenctrl
+ * functionality which has been split into separate libraries.
+ *
+ * New code should use the separate libraries.
+ *
+ * Each interface must be opted-into separately by defining:
+ *
+ * XC_WANT_COMPAT_EVTCHN_API
+ *  - Functions relating to /dev/xen/evtchn
+ */
+#ifndef XENCTRL_COMPAT_H
+#define XENCTRL_COMPAT_H
+
+#ifdef XC_WANT_COMPAT_EVTCHN_API
+
+typedef struct xenevtchn_handle xc_evtchn;
+
+xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
+                             unsigned open_flags);
+int xc_evtchn_close(xc_evtchn *xce);
+int xc_evtchn_fd(xc_evtchn *xce);
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port);
+evtchn_port_or_error_t
+xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid);
+evtchn_port_or_error_t
+xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+                           evtchn_port_t remote_port);
+evtchn_port_or_error_t
+xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq);
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port);
+evtchn_port_or_error_t
+xc_evtchn_pending(xc_evtchn *xce);
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port);
+
+#endif /* XC_WANT_COMPAT_EVTCHN_API */
+
+#endif
+
+/*
+ * 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/include/xenguest.h b/tools/libxc/include/xenguest.h
index 8f918b1..050a537 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -34,6 +34,12 @@
 #define X86_64_B_SIZE   64 
 #define X86_32_B_SIZE   32
 
+/*
+ * User not using xc_suspend_* / xc_await_suspent may not want to
+ * include the full libxenevtchn API here.
+ */
+typedef struct xenevtchn_handle xenevtchn_handle;
+
 /* callbacks provided by xc_domain_save */
 struct save_callbacks {
     /* Called after expiration of checkpoint interval,
@@ -161,18 +167,18 @@ struct xc_hvm_firmware_module {
  * Sets *lockfd to -1.
  * Has deallocated everything even on error.
  */
-int xc_suspend_evtchn_release(xc_interface *xch, xc_evtchn *xce, int domid, int suspend_evtchn, int *lockfd);
+int xc_suspend_evtchn_release(xc_interface *xch, xenevtchn_handle *xce, int domid, int suspend_evtchn, int *lockfd);
 
 /**
  * This function eats the initial notification.
  * xce must not be used for anything else
  * See xc_suspend_evtchn_init_sane re lockfd.
  */
-int xc_suspend_evtchn_init_exclusive(xc_interface *xch, xc_evtchn *xce,
+int xc_suspend_evtchn_init_exclusive(xc_interface *xch, xenevtchn_handle *xce,
                                      int domid, int port, int *lockfd);
 
 /* xce must not be used for anything else */
-int xc_await_suspend(xc_interface *xch, xc_evtchn *xce, int suspend_evtchn);
+int xc_await_suspend(xc_interface *xch, xenevtchn_handle *xce, int suspend_evtchn);
 
 /**
  * The port will be signaled immediately after this call
@@ -181,7 +187,7 @@ int xc_await_suspend(xc_interface *xch, xc_evtchn *xce, int suspend_evtchn);
  * and fed to xc_suspend_evtchn_release.  (On error *lockfd is
  * undefined and xc_suspend_evtchn_release is not allowed.)
  */
-int xc_suspend_evtchn_init_sane(xc_interface *xch, xc_evtchn *xce,
+int xc_suspend_evtchn_init_sane(xc_interface *xch, xenevtchn_handle *xce,
                                 int domid, int port, int *lockfd);
 
 int xc_mark_page_online(xc_interface *xch, unsigned long start,
diff --git a/tools/libxc/xc_evtchn_compat.c b/tools/libxc/xc_evtchn_compat.c
new file mode 100644
index 0000000..5d3e4ba
--- /dev/null
+++ b/tools/libxc/xc_evtchn_compat.c
@@ -0,0 +1,75 @@
+/*
+ * Compat shims for use of 3rd party consumers of libxenctrl xc_evtchn
+ * functionality which has been split into separate libraries.
+ */
+
+#include <xenevtchn.h>
+
+#define XC_WANT_COMPAT_EVTCHN_API
+#include "xenctrl.h"
+
+xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
+                          unsigned open_flags)
+{
+    return xenevtchn_open(logger, open_flags);
+}
+
+int xc_evtchn_close(xc_evtchn *xce)
+{
+    return xenevtchn_close(xce);
+}
+
+int xc_evtchn_fd(xc_evtchn *xce)
+{
+    return xenevtchn_fd(xce);
+}
+
+int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
+{
+    return xenevtchn_notify(xce, port);
+}
+
+evtchn_port_or_error_t
+xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
+{
+    return xenevtchn_bind_unbound_port(xce, domid);
+}
+
+evtchn_port_or_error_t
+xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+                           evtchn_port_t remote_port)
+{
+    return xenevtchn_bind_interdomain(xce, domid, remote_port);
+}
+
+evtchn_port_or_error_t
+xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
+{
+    return xenevtchn_bind_virq(xce, virq);
+}
+
+int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
+{
+    return xenevtchn_unbind(xce, port);
+}
+
+evtchn_port_or_error_t
+xc_evtchn_pending(xc_evtchn *xce)
+{
+    return xenevtchn_pending(xce);
+}
+
+int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
+{
+    return xenevtchn_unmask(xce, port);
+}
+
+/*
+ * 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
index 4323e16..339997c 100644
--- a/tools/libxc/xc_freebsd_osdep.c
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -31,13 +31,11 @@
 #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))
@@ -251,105 +249,6 @@ static struct xc_osdep_ops freebsd_privcmd_ops =3D {
     },
 };
 
-/*-------------------------- Evtchn device interface -------------------------*/
-int osdep_evtchn_open(xc_evtchn *xce)
-{
-    int fd =3D open(EVTCHN_DEV, O_RDWR);
-    if ( fd =3D=3D -1 )
-        return -1;
-    xce->fd =3D fd;
-    return 0;
-}
-
-int osdep_evtchn_close(xc_evtchn *xce)
-{
-    if ( xce->fd =3D=3D -1 )
-        return 0;
-
-    return close(xce->fd);
-}
-
-int xc_evtchn_fd(xc_evtchn *xce)
-{
-    return xce->fd;
-}
-
-/*------------------------------ Evtchn interface ----------------------------*/
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_notify notify;
-
-    notify.port =3D port;
-
-    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
-{
-    int ret, fd =3D xce->fd;
-    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;
-}
-
-evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid, evtchn_port_t remote_port)
-{
-    int ret, fd =3D xce->fd;
-    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;
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
-    int ret, fd =3D xce->fd;
-    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;
-}
-
-int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_unbind unbind;
-
-    unbind.port =3D port;
-
-    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
-}
-
-evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
-{
-    int fd =3D xce->fd;
-    evtchn_port_t port;
-
-    if ( read(fd, &port, sizeof(port)) !=3D sizeof(port) )
-        return -1;
-
-    return port;
-}
-
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-
-    if ( write(fd, &port, sizeof(port)) !=3D sizeof(port) )
-        return -1;
-    return 0;
-}
-
 /*---------------------------- FreeBSD interface -----------------------------*/
 static struct xc_osdep_ops *
 freebsd_osdep_init(xc_interface *xch, enum xc_osdep_type type)
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 90544fb..65299d0 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -31,7 +31,6 @@
 #include <sys/ioctl.h>
 
 #include <xen/memory.h>
-#include <xen/sys/evtchn.h>
 #include <xen/sys/gntdev.h>
 #include <xen/sys/gntalloc.h>
 
@@ -461,100 +460,6 @@ static struct xc_osdep_ops linux_privcmd_ops =3D {
 
 #define DEVXEN "/dev/xen/"
 
-int osdep_evtchn_open(xc_evtchn *xce)
-{
-    int fd =3D open(DEVXEN "evtchn", O_RDWR);
-    if ( fd =3D=3D -1 )
-        return -1;
-    xce->fd =3D fd;
-    return 0;
-}
-
-int osdep_evtchn_close(xc_evtchn *xce)
-{
-    if ( xce->fd =3D=3D -1 )
-        return 0;
-
-    return close(xce->fd);
-}
-
-int xc_evtchn_fd(xc_evtchn *xce)
-{
-    return xce->fd;
-}
-
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_notify notify;
-
-    notify.port =3D port;
-
-    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_bind_unbound_port bind;
-
-    bind.remote_domain =3D domid;
-
-    return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
-                                                  evtchn_port_t remote_port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_bind_interdomain bind;
-
-    bind.remote_domain =3D domid;
-    bind.remote_port =3D remote_port;
-
-    return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_bind_virq bind;
-
-    bind.virq =3D virq;
-
-    return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
-}
-
-int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_unbind unbind;
-
-    unbind.port =3D port;
-
-    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
-}
-
-evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
-{
-    int fd =3D xce->fd;
-    evtchn_port_t port;
-
-    if ( read(fd, &port, sizeof(port)) !=3D sizeof(port) )
-        return -1;
-
-    return port;
-}
-
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-
-    if ( write(fd, &port, sizeof(port)) !=3D sizeof(port) )
-        return -1;
-    return 0;
-}
-
 static xc_osdep_handle linux_gnttab_open(xc_gnttab *xcg)
 {
     int fd =3D open(DEVXEN "gntdev", O_RDWR);
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index 4ace1b5..db7b344 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -19,14 +19,11 @@
  */
 
 #undef NDEBUG
-#include "xen-external/bsd-sys-queue.h"
 #include <mini-os/types.h>
 #include <mini-os/os.h>
 #include <mini-os/mm.h>
 #include <mini-os/lib.h>
 #include <mini-os/gntmap.h>
-#include <mini-os/events.h>
-#include <mini-os/wait.h>
 #include <sys/mman.h>
 
 #include <xen/memory.h>
@@ -41,13 +38,9 @@
 #include "xc_private.h"
 
 void minios_interface_close_fd(int fd);
-void minios_evtchn_close_fd(int fd);
 void minios_gnttab_close_fd(int fd);
 
 extern void minios_interface_close_fd(int fd);
-extern void minios_evtchn_close_fd(int fd);
-
-extern struct wait_queue_head event_queue;
 
 static xc_osdep_handle minios_privcmd_open(xc_interface *xch)
 {
@@ -197,220 +190,6 @@ static struct xc_osdep_ops minios_privcmd_ops =3D {
     },
 };
 
-
-/* XXX Note: This is not threadsafe */
-static struct evtchn_port_info* port_alloc(int fd) {
-    struct evtchn_port_info *port_info;
-    port_info =3D malloc(sizeof(struct evtchn_port_info));
-    if (port_info =3D=3D NULL)
-        return NULL;
-    port_info->pending =3D 0;
-    port_info->port =3D -1;
-    port_info->bound =3D 0;
-
-    LIST_INSERT_HEAD(&files[fd].evtchn.ports, port_info, list);
-    return port_info;
-}
-
-static void port_dealloc(struct evtchn_port_info *port_info) {
-    if (port_info->bound)
-        unbind_evtchn(port_info->port);
-    LIST_REMOVE(port_info, list);
-    free(port_info);
-}
-
-int osdep_evtchn_open(xc_evtchn *xce)
-{
-    int fd =3D alloc_fd(FTYPE_EVTCHN);
-    if ( fd =3D=3D -1 )
-        return -1;
-    LIST_INIT(&files[fd].evtchn.ports);
-    xce->fd =3D fd;
-    printf("evtchn_open() -> %d\n", fd);
-    return 0;
-}
-
-int osdep_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
-{
-    if ( xce->fd =3D=3D -1 )
-        return 0;
-
-    return close(xce->fd);
-}
-
-void minios_evtchn_close_fd(int fd)
-{
-    struct evtchn_port_info *port_info, *tmp;
-    LIST_FOREACH_SAFE(port_info, &files[fd].evtchn.ports, list, tmp)
-        port_dealloc(port_info);
-
-    files[fd].type =3D FTYPE_NONE;
-}
-
-int xc_evtchn_fd(xc_evtchn *xce)
-{
-    return xce->fd;
-}
-
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
-{
-    int ret;
-
-    ret =3D notify_remote_via_evtchn(port);
-
-    if (ret < 0) {
-	errno =3D -ret;
-	ret =3D -1;
-    }
-    return ret;
-}
-
-static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
-{
-    int fd =3D (int)(intptr_t)data;
-    struct evtchn_port_info *port_info;
-    assert(files[fd].type =3D=3D FTYPE_EVTCHN);
-    mask_evtchn(port);
-    LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
-        if (port_info->port =3D=3D port)
-            goto found;
-    }
-    printk("Unknown port for handle %d\n", fd);
-    return;
-
- found:
-    port_info->pending =3D 1;
-    files[fd].read =3D 1;
-    wake_up(&event_queue);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
-{
-    int fd =3D xce->fd;
-    struct evtchn_port_info *port_info;
-    int ret;
-    evtchn_port_t port;
-
-    assert(get_current() =3D=3D main_thread);
-    port_info =3D port_alloc(fd);
-    if (port_info =3D=3D NULL)
-	return -1;
-
-    printf("xc_evtchn_bind_unbound_port(%d)", domid);
-    ret =3D evtchn_alloc_unbound(domid, evtchn_handler, (void*)(intptr_t)fd, &port);
-    printf(" =3D %d\n", ret);
-
-    if (ret < 0) {
-	port_dealloc(port_info);
-	errno =3D -ret;
-	return -1;
-    }
-    port_info->bound =3D 1;
-    port_info->port =3D port;
-    unmask_evtchn(port);
-    return port;
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
-                                                  evtchn_port_t remote_port)
-{
-    int fd =3D xce->fd;
-    struct evtchn_port_info *port_info;
-    evtchn_port_t local_port;
-    int ret;
-
-    assert(get_current() =3D=3D main_thread);
-    port_info =3D port_alloc(fd);
-    if (port_info =3D=3D NULL)
-	return -1;
-
-    printf("xc_evtchn_bind_interdomain(%d, %"PRId32")", domid, remote_port);
-    ret =3D evtchn_bind_interdomain(domid, remote_port, evtchn_handler, (void*)(intptr_t)fd, &local_port);
-    printf(" =3D %d\n", ret);
-
-    if (ret < 0) {
-	port_dealloc(port_info);
-	errno =3D -ret;
-	return -1;
-    }
-    port_info->bound =3D 1;
-    port_info->port =3D local_port;
-    unmask_evtchn(local_port);
-    return local_port;
-}
-
-int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct evtchn_port_info *port_info;
-
-    LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
-        if (port_info->port =3D=3D port) {
-            port_dealloc(port_info);
-            return 0;
-        }
-    }
-    printf("Warning: couldn't find port %"PRId32" for xc handle %x\n", port, fd);
-    errno =3D EINVAL;
-    return -1;
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
-    int fd =3D xce->fd;
-    struct evtchn_port_info *port_info;
-    evtchn_port_t port;
-
-    assert(get_current() =3D=3D main_thread);
-    port_info =3D port_alloc(fd);
-    if (port_info =3D=3D NULL)
-	return -1;
-
-    printf("xc_evtchn_bind_virq(%d)", virq);
-    port =3D bind_virq(virq, evtchn_handler, (void*)(intptr_t)fd);
-
-    if (port < 0) {
-	port_dealloc(port_info);
-	errno =3D -port;
-	return -1;
-    }
-    port_info->bound =3D 1;
-    port_info->port =3D port;
-    unmask_evtchn(port);
-    return port;
-}
-
-evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
-{
-    int fd =3D xce->fd;
-    struct evtchn_port_info *port_info;
-    unsigned long flags;
-    evtchn_port_t ret =3D -1;
-
-    local_irq_save(flags);
-    files[fd].read =3D 0;
-
-    LIST_FOREACH(port_info, &files[fd].evtchn.ports, list) {
-        if (port_info->port !=3D -1 && port_info->pending) {
-            if (ret =3D=3D -1) {
-                ret =3D port_info->port;
-                port_info->pending =3D 0;
-            } else {
-                files[fd].read =3D 1;
-                break;
-            }
-        }
-    }
-    local_irq_restore(flags);
-    return ret;
-}
-
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
-{
-    unmask_evtchn(port);
-    return 0;
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush)
 {
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index b1b828f..fe4f0a1 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -19,7 +19,6 @@
 
 #include "xc_private.h"
 
-#include <xen/sys/evtchn.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <malloc.h>
@@ -223,114 +222,6 @@ static struct xc_osdep_ops netbsd_privcmd_ops =3D {
     },
 };
 
-#define EVTCHN_DEV_NAME  "/dev/xenevt"
-
-int osdep_evtchn_open(xc_evtchn *xce)
-{
-    int fd =3D open(EVTCHN_DEV_NAME, O_NONBLOCK|O_RDWR);
-    if ( fd =3D=3D -1 )
-        return -1;
-    xce->fd =3D fd;
-    return 0;
-}
-
-int osdep_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
-{
-    if ( xce->fd =3D=3D -1 )
-        return 0;
-
-    return close(xce->fd);
-}
-
-int xc_evtchn_fd(xc_evtchn *xce)
-{
-    return xce->fd;
-}
-
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_notify notify;
-
-    notify.port =3D port;
-
-    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn * xce, int domid)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_bind_unbound_port bind;
-    int ret;
-
-    bind.remote_domain =3D domid;
-
-    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
-    if (ret =3D=3D 0)
-	return bind.port;
-    else
-	return -1;
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
-                                                  evtchn_port_t remote_port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_bind_interdomain bind;
-    int ret;
-
-    bind.remote_domain =3D domid;
-    bind.remote_port =3D remote_port;
-
-    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
-    if (ret =3D=3D 0)
-	return bind.port;
-    else
-	return -1;
-}
-
-int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_unbind unbind;
-
-    unbind.port =3D port;
-
-    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
-}
-
-evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_bind_virq bind;
-    int err;
-
-    bind.virq =3D virq;
-
-    err =3D ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
-    if (err)
-	return -1;
-    else
-	return bind.port;
-}
-
-evtchn_port_or_error_t xc_evtchn_pending(xc_evtchn *xce)
-{
-    int fd =3D xce->fd;
-    evtchn_port_t port;
-
-    if ( read_exact(fd, (char *)&port, sizeof(port)) =3D=3D -1 )
-        return -1;
-
-    return port;
-}
-
-int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    return write_exact(fd, (char *)&port, sizeof(port));
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index cb79f22..56d54b6 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -251,46 +251,6 @@ int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
     return xch->ops->u.privcmd.hypercall(xch, xch->ops_handle, hypercall);
 }
 
-xc_evtchn *xc_evtchn_open(xentoollog_logger *logger, unsigned open_flags)
-{
-    xc_evtchn *xce =3D malloc(sizeof(*xce));
-    int rc;
-
-    if (!xce) return NULL;
-
-    xce->fd =3D -1;
-    xce->logger =3D logger;
-    xce->logger_tofree  =3D NULL;
-
-    if (!xce->logger) {
-        xce->logger =3D xce->logger_tofree =3D
-            (xentoollog_logger*)
-            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
-        if (!xce->logger) goto err;
-    }
-
-    rc =3D osdep_evtchn_open(xce);
-    if ( rc  < 0 ) goto err;
-
-    return xce;
-
-err:
-    osdep_evtchn_close(xce);
-    xtl_logger_destroy(xce->logger_tofree);
-    free(xce);
-    return NULL;
-}
-
-int xc_evtchn_close(xc_evtchn *xce)
-{
-    int rc;
-
-    rc =3D osdep_evtchn_close(xce);
-    xtl_logger_destroy(xce->logger_tofree);
-    free(xce);
-    return rc;
-}
-
 xc_gnttab *xc_gnttab_open(xentoollog_logger *logger,
                              unsigned open_flags)
 {
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index f4d155a..a32accb 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -123,13 +123,6 @@ struct xc_interface_core {
     xc_osdep_handle  ops_handle; /* opaque data for xc_osdep_ops */
 };
 
-struct xenevtchn_handle {
-    xentoollog_logger *logger, *logger_tofree;
-    int fd;
-};
-int osdep_evtchn_open(xc_evtchn *xce);
-int osdep_evtchn_close(xc_evtchn *xce);
-
 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,
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index 088228a..ed7987c 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -20,7 +20,6 @@
 #include "xc_private.h"
 
 #include <xen/memory.h>
-#include <xen/sys/evtchn.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <malloc.h>
@@ -194,102 +193,6 @@ static struct xc_osdep_ops solaris_privcmd_ops =3D {
     },
 };
 
-int osdep_evtchn_open(xc_evtchn *xce)
-{
-    int fd;
-
-    if ( (fd =3D open("/dev/xen/evtchn", O_RDWR)) =3D=3D -1 )
-    {
-        PERROR("Could not open event channel interface");
-        return -1;
-    }
-
-    xce->fd =3D fd;
-    return 0;
-}
-
-int osdep_evtchn_close(xc_evtchn *xce)
-{
-    if ( xce->fd =3D=3D -1 )
-        return 0;
-
-    return close(xce->fd);
-}
-
-int xc_evtchn_fd(xc_evtchn *xce)
-{
-    return xce->fd;
-}
-
-int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
-{
-    int fd =3D xce->fd;
-    struct ioctl_evtchn_notify notify;


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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:14:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:14: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 1aON7W-0000So-OV; Wed, 27 Jan 2016 10:14:38 +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 1aON7V-0000SN-6g
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:37 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	2E/D6-12635-C8898A65; Wed, 27 Jan 2016 10:14:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1453889672!18463037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13241 invoked from network); 27 Jan 2016 10:14:33 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:14:33 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8I-0001vZ-Qr
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7Q-0001Iz-Kt
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:32 +0000
Date: Wed, 27 Jan 2016 10:14:32 +0000
Message-Id: <E1aON7Q-0001Iz-Kt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Arrange to check public headers
	for ANSI compatiblity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aae392b46c1d04665b8d903122b5059332ad6903
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 11 13:18:18 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:21:39 2016 +0000

    tools: Arrange to check public headers for ANSI compatiblity
    
    Using the same rune as we use for the Xen public headers, except we do
    not need stdint.h here.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 .gitignore                  |    2 ++
 tools/Rules.mk              |    8 ++++++++
 tools/libs/evtchn/Makefile  |    4 +++-
 tools/libs/toollog/Makefile |    5 ++++-
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index e7af9f7..7340a56 100644
--- a/.gitignore
+++ b/.gitignore
@@ -87,6 +87,8 @@ tools/config.cache
 config/Tools.mk
 config/Stubdom.mk
 config/Docs.mk
+tools/libs/toollog/headers.chk
+tools/libs/evtchn/headers.chk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 75d02c4..0c83e22 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -176,6 +176,14 @@ INSTALL_PYTHON_PROG = \
 %.opic: %.S
 	$(CC) $(CPPFLAGS) -DPIC $(CFLAGS) $(CFLAGS.opic) -fPIC -c -o $@ $< $(APPEND_CFLAGS)
 
+headers.chk:
+	for i in $(filter %.h,$^); do \
+	    $(CC) -x c -ansi -Wall -Werror $(CFLAGS_xeninclude) \
+	          -S -o /dev/null $$i || exit 1; \
+	    echo $$i; \
+	done >$@.new
+	mv $@.new $@
+
 subdirs-all subdirs-clean subdirs-install subdirs-distclean: .phony
 	@set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y); do \
 		$(MAKE) subdir-$(patsubst subdirs-%,%,$@)-$$subdir; \
diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile
index 46a807f..9917864 100644
--- a/tools/libs/evtchn/Makefile
+++ b/tools/libs/evtchn/Makefile
@@ -32,8 +32,9 @@ build:
 	$(MAKE) libs
 
 .PHONY: libs
-libs: $(LIB)
+libs: headers.chk $(LIB)
 
+headers.chk: $(wildcard include/*.h)
 
 libxenevtchn.a: $(LIB_OBJS)
 	$(AR) rc $@ $^
@@ -64,6 +65,7 @@ TAGS:
 clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f libxenevtchn.so.$(MAJOR).$(MINOR) libxenevtchn.so.$(MAJOR)
+	rm -f headers.chk
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile
index 9bfd179..fb701be 100644
--- a/tools/libs/toollog/Makefile
+++ b/tools/libs/toollog/Makefile
@@ -27,7 +27,9 @@ build:
 	$(MAKE) libs
 
 .PHONY: libs
-libs: $(LIB)
+libs: headers.chk $(LIB)
+
+headers.chk: $(wildcard include/*.h)
 
 libxentoollog.a: $(LIB_OBJS)
 	$(AR) rc $@ $^
@@ -58,6 +60,7 @@ TAGS:
 clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f libxentoollog.so.$(MAJOR).$(MINOR) libxentoollog.so.$(MAJOR)
+	rm -f headers.chk
 
 .PHONY: distclean
 distclean: clean
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:14:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:14: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 1aON7W-0000So-OV; Wed, 27 Jan 2016 10:14:38 +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 1aON7V-0000SN-6g
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:37 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	2E/D6-12635-C8898A65; Wed, 27 Jan 2016 10:14:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1453889672!18463037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13241 invoked from network); 27 Jan 2016 10:14:33 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:14:33 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8I-0001vZ-Qr
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7Q-0001Iz-Kt
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:32 +0000
Date: Wed, 27 Jan 2016 10:14:32 +0000
Message-Id: <E1aON7Q-0001Iz-Kt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Arrange to check public headers
	for ANSI compatiblity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aae392b46c1d04665b8d903122b5059332ad6903
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 11 13:18:18 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:21:39 2016 +0000

    tools: Arrange to check public headers for ANSI compatiblity
    
    Using the same rune as we use for the Xen public headers, except we do
    not need stdint.h here.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 .gitignore                  |    2 ++
 tools/Rules.mk              |    8 ++++++++
 tools/libs/evtchn/Makefile  |    4 +++-
 tools/libs/toollog/Makefile |    5 ++++-
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index e7af9f7..7340a56 100644
--- a/.gitignore
+++ b/.gitignore
@@ -87,6 +87,8 @@ tools/config.cache
 config/Tools.mk
 config/Stubdom.mk
 config/Docs.mk
+tools/libs/toollog/headers.chk
+tools/libs/evtchn/headers.chk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 75d02c4..0c83e22 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -176,6 +176,14 @@ INSTALL_PYTHON_PROG = \
 %.opic: %.S
 	$(CC) $(CPPFLAGS) -DPIC $(CFLAGS) $(CFLAGS.opic) -fPIC -c -o $@ $< $(APPEND_CFLAGS)
 
+headers.chk:
+	for i in $(filter %.h,$^); do \
+	    $(CC) -x c -ansi -Wall -Werror $(CFLAGS_xeninclude) \
+	          -S -o /dev/null $$i || exit 1; \
+	    echo $$i; \
+	done >$@.new
+	mv $@.new $@
+
 subdirs-all subdirs-clean subdirs-install subdirs-distclean: .phony
 	@set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y); do \
 		$(MAKE) subdir-$(patsubst subdirs-%,%,$@)-$$subdir; \
diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile
index 46a807f..9917864 100644
--- a/tools/libs/evtchn/Makefile
+++ b/tools/libs/evtchn/Makefile
@@ -32,8 +32,9 @@ build:
 	$(MAKE) libs
 
 .PHONY: libs
-libs: $(LIB)
+libs: headers.chk $(LIB)
 
+headers.chk: $(wildcard include/*.h)
 
 libxenevtchn.a: $(LIB_OBJS)
 	$(AR) rc $@ $^
@@ -64,6 +65,7 @@ TAGS:
 clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f libxenevtchn.so.$(MAJOR).$(MINOR) libxenevtchn.so.$(MAJOR)
+	rm -f headers.chk
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile
index 9bfd179..fb701be 100644
--- a/tools/libs/toollog/Makefile
+++ b/tools/libs/toollog/Makefile
@@ -27,7 +27,9 @@ build:
 	$(MAKE) libs
 
 .PHONY: libs
-libs: $(LIB)
+libs: headers.chk $(LIB)
+
+headers.chk: $(wildcard include/*.h)
 
 libxentoollog.a: $(LIB_OBJS)
 	$(AR) rc $@ $^
@@ -58,6 +60,7 @@ TAGS:
 clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f libxentoollog.so.$(MAJOR).$(MINOR) libxentoollog.so.$(MAJOR)
+	rm -f headers.chk
 
 .PHONY: distclean
 distclean: clean
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:15:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:15: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 1aON83-0000XQ-U6; Wed, 27 Jan 2016 10:15: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 1aON82-0000X8-Hn
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:10 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	E6/10-12072-DA898A65; Wed, 27 Jan 2016 10:15:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1453889705!18436061!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 65355 invoked from network); 27 Jan 2016 10:15:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8o-0001wc-VV
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7w-0001Ku-KX
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:04 +0000
Date: Wed, 27 Jan 2016 10:15:04 +0000
Message-Id: <E1aON7w-0001Ku-KX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Remove osdep indirection
	for privcmd
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7a3543df838c33db28262e5eb4560d615a89bfe6
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 11 17:39:00 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:22:38 2016 +0000

    tools/libxc: Remove osdep indirection for privcmd
    
    The alternative backend (a xen-api/xapi shim) is no longer around and
    so this stuff is now just baggage which is getting in the way of
    refactoring libxenctrl.
    
    Nested virt probably suffices for this use case now.
    
    This was the last component of the osdep infrastructure, so all the
    dynamic loading etc stuff all falls away too.
    
    As part of this I was forced to investigate the twisty
    xc_map_foreign_* maze, which I have added to the
    toolstack-library-apis doc in the hopes of doing something sensible.
    
    NetBSD and Solaris now call xc_map_foreign_bulk_compat directly from
    their xc_map_foreign_bulk, which could have been achieved by using
    some ifdefs around a renamed function. This will fall out in the wash
    when these functions move to their own library.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: David Scott <dave.scott@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 config/FreeBSD.mk                   |    2 -
 config/NetBSD.mk                    |    3 -
 config/NetBSDRump.mk                |    1 -
 config/StdGNU.mk                    |    1 -
 config/SunOS.mk                     |    1 -
 tools/libxc/Makefile                |   27 ++----
 tools/libxc/include/xenctrl.h       |    9 --
 tools/libxc/include/xenctrlosdep.h  |  133 --------------------------
 tools/libxc/xc_foreign_memory.c     |   31 +------
 tools/libxc/xc_freebsd_osdep.c      |  100 ++++++---------------
 tools/libxc/xc_hcall_buf.c          |    6 +-
 tools/libxc/xc_linux_osdep.c        |   88 ++++++------------
 tools/libxc/xc_minios.c             |   82 +++++------------
 tools/libxc/xc_netbsd.c             |   90 +++++++------------
 tools/libxc/xc_private.c            |  174 ++---------------------------------
 tools/libxc/xc_private.h            |   19 +++-
 tools/libxc/xc_solaris.c            |   90 +++++++------------
 tools/libxc/xenctrl_osdep_ENOSYS.c  |  123 ------------------------
 tools/ocaml/libs/xc/xenctrl.ml      |    2 -
 tools/ocaml/libs/xc/xenctrl.mli     |    1 -
 tools/ocaml/libs/xc/xenctrl_stubs.c |    7 --
 tools/ocaml/xenstored/domains.ml    |    6 +-
 tools/ocaml/xenstored/xenstored.ml  |    5 +-
 23 files changed, 178 insertions(+), 823 deletions(-)

diff --git a/config/FreeBSD.mk b/config/FreeBSD.mk
index 5a13d607..bb3a5d0 100644
--- a/config/FreeBSD.mk
+++ b/config/FreeBSD.mk
@@ -1,6 +1,4 @@
 include $(XEN_ROOT)/config/StdGNU.mk
 
-DLOPEN_LIBS =
-
 # No wget on FreeBSD base system
 WGET = ftp
diff --git a/config/NetBSD.mk b/config/NetBSD.mk
index 21318d6..cf766e5 100644
--- a/config/NetBSD.mk
+++ b/config/NetBSD.mk
@@ -1,6 +1,3 @@
 include $(XEN_ROOT)/config/StdGNU.mk
 
-# Override settings for this OS
-DLOPEN_LIBS =
-
 WGET = ftp
diff --git a/config/NetBSDRump.mk b/config/NetBSDRump.mk
index 2a87218..74755a1 100644
--- a/config/NetBSDRump.mk
+++ b/config/NetBSDRump.mk
@@ -1,6 +1,5 @@
 include $(XEN_ROOT)/config/StdGNU.mk
 
-DLOPEN_LIBS =
 PTHREAD_LIBS =
 
 WGET = ftp
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 129d5c8..39d36b2 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -31,7 +31,6 @@ DEBUG_DIR ?= /usr/lib/debug
 
 SOCKET_LIBS =
 UTIL_LIBS = -lutil
-DLOPEN_LIBS = -ldl
 
 SONAME_LDFLAG = -soname
 SHLIB_LDFLAGS = -shared
diff --git a/config/SunOS.mk b/config/SunOS.mk
index db5e898..86a384d 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -27,7 +27,6 @@ SunOS_LIBDIR_x86_64 = /usr/sfw/lib/amd64
 SOCKET_LIBS = -lsocket
 PTHREAD_LIBS = -lpthread
 UTIL_LIBS =
-DLOPEN_LIBS = -ldl
 
 SONAME_LDFLAG = -h
 SHLIB_LDFLAGS = -R $(SunOS_LIBDIR) -shared
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 33d18db..3305fdd 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -101,8 +101,6 @@ GUEST_SRCS-y                 += xc_dom_decompress_unsafe_lzo1x.c
 GUEST_SRCS-y                 += xc_dom_decompress_unsafe_xz.c
 endif
 
-OSDEP_SRCS-y                 += xenctrl_osdep_ENOSYS.c
-
 -include $(XEN_TARGET_ARCH)/Makefile
 
 CFLAGS   += -Werror -Wmissing-prototypes
@@ -121,11 +119,8 @@ CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
 GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
 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
+$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \
+$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h
 
 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS): CFLAGS += $(CFLAGS_libxengnttab) $(CFLAGS_libxengntshr)
 
@@ -139,17 +134,13 @@ ifneq ($(nosharedlibs),y)
 LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
 endif
 
-ifneq ($(nosharedlibs),y)
-LIB += xenctrl_osdep_ENOSYS.so
-endif
-
 genpath-target = $(call buildmakevars2header,_paths.h)
 $(eval $(genpath-target))
 
 xc_private.h: _paths.h
 
-$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) $(OSDEP_LIB_OBJS) \
-$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS) $(OSDEP_PIC_OBJS): xc_private.h
+$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \
+$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): xc_private.h
 
 .PHONY: all
 all: build
@@ -169,7 +160,7 @@ install: build
 	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenctrl.so
-	$(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h include/xenctrlosdep.h $(DESTDIR)$(includedir)
+	$(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h $(DESTDIR)$(includedir)
 	$(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
 	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR)
@@ -185,8 +176,7 @@ clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS) \
             _paths.h \
             $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
-            $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS) \
-            $(OSDEP_LIB_OBJS) $(OSDEP_PIC_OBJS)
+            $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS)
 
 .PHONY: distclean
 distclean: clean
@@ -212,7 +202,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
@@ -237,8 +227,5 @@ libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(call zlib-options,l)
 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
 	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
-xenctrl_osdep_ENOSYS.so: $(OSDEP_PIC_OBJS) libxenctrl.so
-	$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
-
 -include $(DEPS)
 
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 759f9df..d7444c8 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -181,15 +181,6 @@ enum xc_open_flags {
  */
 int xc_interface_close(xc_interface *xch);
 
-/**
- * Query the active OS interface (i.e. that which would be returned by
- * xc_interface_open) to find out if it is fake (i.e. backends onto
- * something other than an actual Xen hypervisor).
- *
- * @return 0 is "real", >0 if fake, -1 on error.
- */
-int xc_interface_is_fake(void);
-
 /*
  * HYPERCALL SAFE MEMORY BUFFER
  *
diff --git a/tools/libxc/include/xenctrlosdep.h b/tools/libxc/include/xenctrlosdep.h
deleted file mode 100644
index 423660d..0000000
--- a/tools/libxc/include/xenctrlosdep.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/******************************************************************************
- *
- * Interface to OS specific low-level operations
- *
- * Copyright (c) 2010, Citrix Systems Inc.
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * This interface defines the interactions between the Xen control
- * libraries and the OS facilities used to communicate with the
- * hypervisor.
- *
- * It is possible to override the default (native) implementation by
- * setting the XENCTRL_OSDEP environment variable to point to a
- * plugin library. Userspace can use this facility to intercept
- * hypervisor operations. This can be used e.g. to implement a
- * userspace simulator for Xen hypercalls.
- *
- * The plugin must contain a data structure:
- *  xc_osdep_info_t xc_osdep_info;
- *
- * xc_osdep_init:
- *   Must return a suitable struct xc_osdep_ops pointer or NULL on failure.
- */
-
-#ifndef XC_OSDEP_H
-#define XC_OSDEP_H
-
-/* Tell the Xen public headers we are a user-space tools build. */
-#ifndef __XEN_TOOLS__
-#define __XEN_TOOLS__ 1
-#endif
-
-#include <sys/mman.h>
-#include <sys/types.h>
-
-#include <xen/sys/privcmd.h>
-
-enum xc_osdep_type {
-    XC_OSDEP_PRIVCMD,
-};
-
-/* Opaque handle internal to the backend */
-typedef unsigned long xc_osdep_handle;
-
-#define XC_OSDEP_OPEN_ERROR ((xc_osdep_handle)-1)
-
-struct xc_osdep_ops
-{
-    /* Opens an interface.
-     *
-     * Must return an opaque handle on success or
-     * XC_OSDEP_OPEN_ERROR on failure
-     */
-    xc_osdep_handle (*open)(xc_interface *xch);
-
-    int (*close)(xc_interface *xch, xc_osdep_handle h);
-
-    union {
-        struct {
-            void *(*alloc_hypercall_buffer)(xc_interface *xch, xc_osdep_handle h, int npages);
-            void (*free_hypercall_buffer)(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages);
-
-            int (*hypercall)(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall);
-
-            void *(*map_foreign_batch)(xc_interface *xch, xc_osdep_handle h, uint32_t dom, int prot,
-                                       xen_pfn_t *arr, int num);
-            void *(*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);
-            void *(*map_foreign_range)(xc_interface *xch, xc_osdep_handle h, uint32_t dom, int size, int prot,
-                                       unsigned long mfn);
-            void *(*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);
-        } privcmd;
-    } u;
-};
-typedef struct xc_osdep_ops xc_osdep_ops;
-
-typedef xc_osdep_ops *(*xc_osdep_init_fn)(xc_interface *xch, enum xc_osdep_type);
-
-struct xc_osdep_info
-{
-    /* Describes this backend. */
-    const char *name;
-
-    /* Returns ops function. */
-    xc_osdep_init_fn init;
-
-    /* True if this interface backs onto a fake Xen. */
-    int fake;
-
-    /* For internal use by loader. */
-    void *dl_handle;
-};
-typedef struct xc_osdep_info xc_osdep_info_t;
-
-/* All backends, including the builtin backend, must supply this structure. */
-extern xc_osdep_info_t xc_osdep_info;
-
-/* Stub for not yet converted OSes */
-void *xc_map_foreign_bulk_compat(xc_interface *xch, xc_osdep_handle h,
-                                 uint32_t dom, int prot,
-                                 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, ...) __attribute__((format(printf, 4, 5)));
-
-#endif
-
-/*
- * 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_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index f42d140..9c705b6 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -50,37 +50,8 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
     return res;
 }
 
-void *xc_map_foreign_range(xc_interface *xch, uint32_t dom,
-                           int size, int prot, unsigned long mfn)
-{
-    return xch->ops->u.privcmd.map_foreign_range(xch, xch->ops_handle,
-                                                 dom, size, prot, mfn);
-}
-
-void *xc_map_foreign_ranges(xc_interface *xch, uint32_t dom,
-                            size_t size, int prot, size_t chunksize,
-                            privcmd_mmap_entry_t entries[], int nentries)
-{
-    return xch->ops->u.privcmd.map_foreign_ranges(xch, xch->ops_handle,
-                                                  dom, size, prot, chunksize, entries, nentries);
-}
-
-void *xc_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot,
-                           xen_pfn_t *arr, int num)
-{
-    return xch->ops->u.privcmd.map_foreign_batch(xch, xch->ops_handle,
-                                                 dom, prot, arr, num);
-}
-
-void *xc_map_foreign_bulk(xc_interface *xch, uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err, unsigned int num)
-{
-    return xch->ops->u.privcmd.map_foreign_bulk(xch, xch->ops_handle,
-                                                dom, prot, arr, err, num);
-}
-
 /* stub for all not yet converted OSes */
-void *xc_map_foreign_bulk_compat(xc_interface *xch, xc_osdep_handle h,
+void *xc_map_foreign_bulk_compat(xc_interface *xch,
                                  uint32_t dom, int prot,
                                  const xen_pfn_t *arr, int *err, unsigned int num)
 {
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
index 339997c..f6a2ccd 100644
--- a/tools/libxc/xc_freebsd_osdep.c
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -32,16 +32,12 @@
 
 #include <xen/memory.h>
 
-#include "xenctrl.h"
-#include "xenctrlosdep.h"
+#include "xc_private.h"
 
 #define PRIVCMD_DEV     "/dev/xen/privcmd"
 
-#define PERROR(_m, _a...) xc_osdep_log(xch,XTL_ERROR,XC_INTERNAL_ERROR,_m \
-                  " (%d = %s)", ## _a , errno, xc_strerror(xch, errno))
-
 /*------------------------- Privcmd device interface -------------------------*/
-static xc_osdep_handle freebsd_privcmd_open(xc_interface *xch)
+int osdep_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
     int fd = open(PRIVCMD_DEV, O_RDWR);
@@ -50,7 +46,7 @@ static xc_osdep_handle freebsd_privcmd_open(xc_interface *xch)
     {
         PERROR("Could not obtain handle on privileged command interface "
                PRIVCMD_DEV);
-        return XC_OSDEP_OPEN_ERROR;
+        return -1
     }
 
     /*
@@ -73,27 +69,27 @@ static xc_osdep_handle freebsd_privcmd_open(xc_interface *xch)
         goto error;
     }
 
-    return (xc_osdep_handle)fd;
+    xch->privcmdfd = fd;
+    return 0;
 
  error:
     saved_errno = errno;
     close(fd);
     errno = saved_errno;
 
-    return XC_OSDEP_OPEN_ERROR;
+    return -1;
 }
 
-static int freebsd_privcmd_close(xc_interface *xch, xc_osdep_handle h)
+int osdep_privcmd_close(xc_interface *xch)
 {
-    int fd = (int)h;
-
+    int fd = xch->privcmdfd;
+    if ( fd == -1 )
+        return 0;
     return close(fd);
 }
 
 /*------------------------ Privcmd hypercall interface -----------------------*/
-static void *freebsd_privcmd_alloc_hypercall_buffer(xc_interface *xch,
-                                                    xc_osdep_handle h,
-                                                    int npages)
+void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
 {
     size_t size = npages * XC_PAGE_SIZE;
     void *p;
@@ -117,9 +113,7 @@ static void *freebsd_privcmd_alloc_hypercall_buffer(xc_interface *xch,
     return p;
 }
 
-static void freebsd_privcmd_free_hypercall_buffer(xc_interface *xch,
-                                                  xc_osdep_handle h, void *ptr,
-                                                  int npages)
+void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
 {
 
     int saved_errno = errno;
@@ -131,10 +125,9 @@ static void freebsd_privcmd_free_hypercall_buffer(xc_interface *xch,
     errno = saved_errno;
 }
 
-static int freebsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h,
-                                     privcmd_hypercall_t *hypercall)
+int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     int ret;
 
     ret = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
@@ -143,13 +136,12 @@ static int freebsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h,
 }
 
 /*----------------------- 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)
+void *xc_map_foreign_bulk(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err,
+                          unsigned int num)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     privcmd_mmapbatch_t ioctlx;
     void *addr;
     int rc;
@@ -180,10 +172,9 @@ static void *freebsd_privcmd_map_foreign_bulk(xc_interface *xch,
     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)
+void *xc_map_foreign_range(xc_interface *xch,
+                           uint32_t dom, int size, int prot,
+                           unsigned long mfn)
 {
     xen_pfn_t *arr;
     int num;
@@ -203,12 +194,11 @@ static void *freebsd_privcmd_map_foreign_range(xc_interface *xch,
     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)
+void *xc_map_foreign_ranges(xc_interface *xch,
+                            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;
@@ -232,42 +222,6 @@ static void *freebsd_privcmd_map_foreign_ranges(xc_interface *xch,
     return ret;
 }
 
-/*----------------------------- Privcmd handlers -----------------------------*/
-static struct xc_osdep_ops freebsd_privcmd_ops = {
-    .open = &freebsd_privcmd_open,
-    .close = &freebsd_privcmd_close,
-
-    .u.privcmd = {
-        .alloc_hypercall_buffer = &freebsd_privcmd_alloc_hypercall_buffer,
-        .free_hypercall_buffer = &freebsd_privcmd_free_hypercall_buffer,
-
-        .hypercall = &freebsd_privcmd_hypercall,
-
-        .map_foreign_bulk = &freebsd_privcmd_map_foreign_bulk,
-        .map_foreign_range = &freebsd_privcmd_map_foreign_range,
-        .map_foreign_ranges = &freebsd_privcmd_map_foreign_ranges,
-    },
-};
-
-/*---------------------------- 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;
-    default:
-        return NULL;
-    }
-}
-
-xc_osdep_info_t xc_osdep_info = {
-    .name = "FreeBSD Native OS interface",
-    .init = &freebsd_osdep_init,
-    .fake = 0,
-};
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_hcall_buf.c b/tools/libxc/xc_hcall_buf.c
index 4f4444c..517b5b4 100644
--- a/tools/libxc/xc_hcall_buf.c
+++ b/tools/libxc/xc_hcall_buf.c
@@ -122,7 +122,7 @@ void xc__hypercall_buffer_cache_release(xc_interface *xch)
     while ( xch->hypercall_buffer_cache_nr > 0 )
     {
         p = xch->hypercall_buffer_cache[--xch->hypercall_buffer_cache_nr];
-        xch->ops->u.privcmd.free_hypercall_buffer(xch, xch->ops_handle, p, 1);
+        osdep_free_hypercall_buffer(xch, p, 1);
     }
 
     hypercall_buffer_cache_unlock(xch);
@@ -133,7 +133,7 @@ void *xc__hypercall_buffer_alloc_pages(xc_interface *xch, xc_hypercall_buffer_t
     void *p = hypercall_buffer_cache_alloc(xch, nr_pages);
 
     if ( !p )
-        p = xch->ops->u.privcmd.alloc_hypercall_buffer(xch, xch->ops_handle, nr_pages);
+        p = osdep_alloc_hypercall_buffer(xch, nr_pages);
 
     if (!p)
         return NULL;
@@ -151,7 +151,7 @@ void xc__hypercall_buffer_free_pages(xc_interface *xch, xc_hypercall_buffer_t *b
         return;
 
     if ( !hypercall_buffer_cache_free(xch, b->hbuf, nr_pages) )
-        xch->ops->u.privcmd.free_hypercall_buffer(xch, xch->ops_handle, b->hbuf, nr_pages);
+        osdep_free_hypercall_buffer(xch, b->hbuf, nr_pages);
 }
 
 struct allocation_header {
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 9c318e0..9f4c707 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -33,13 +33,12 @@
 #include <xen/memory.h>
 
 #include "xenctrl.h"
-#include "xenctrlosdep.h"
 
 #include "xc_private.h"
 
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
-static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
+int osdep_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
     int fd = open("/dev/xen/privcmd", O_RDWR); /* prefer this newer interface */
@@ -53,7 +52,7 @@ static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
     if ( fd == -1 )
     {
         PERROR("Could not obtain handle on privileged command interface");
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
     }
 
     /* Although we return the file handle as the 'xc handle' the API
@@ -74,22 +73,25 @@ static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
         goto error;
     }
 
-    return (xc_osdep_handle)fd;
+    xch->privcmdfd = fd;
+    return 0;
 
  error:
     saved_errno = errno;
     close(fd);
     errno = saved_errno;
-    return XC_OSDEP_OPEN_ERROR;
+    return -1;
 }
 
-static int linux_privcmd_close(xc_interface *xch, xc_osdep_handle h)
+int osdep_privcmd_close(xc_interface *xch)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
+    if (fd == -1)
+        return 0;
     return close(fd);
 }
 
-static void *linux_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, int npages)
+void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
 {
     size_t size = npages * XC_PAGE_SIZE;
     void *p;
@@ -121,7 +123,7 @@ out:
     return NULL;
 }
 
-static void linux_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages)
+void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
 {
     int saved_errno = errno;
     /* Recover the VMA flags. Maybe it's not necessary */
@@ -132,9 +134,9 @@ static void linux_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_hand
     errno = saved_errno;
 }
 
-static int linux_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
+int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     return ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
 }
 
@@ -160,11 +162,11 @@ static int xc_map_foreign_batch_single(int fd, uint32_t dom,
     return rc;
 }
 
-static void *linux_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handle h,
-                                             uint32_t dom, int prot,
-                                             xen_pfn_t *arr, int num)
+void *xc_map_foreign_batch(xc_interface *xch,
+                           uint32_t dom, int prot,
+                           xen_pfn_t *arr, int num)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     privcmd_mmapbatch_t ioctlx;
     void *addr;
     int rc;
@@ -266,11 +268,11 @@ out:
     return rc;
 }
 
-static void *linux_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)
+void *xc_map_foreign_bulk(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err, unsigned int num)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     privcmd_mmapbatch_v2_t ioctlx;
     void *addr;
     unsigned int i;
@@ -390,9 +392,9 @@ static void *linux_privcmd_map_foreign_bulk(xc_interface *xch, xc_osdep_handle h
     return addr;
 }
 
-static void *linux_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
-                                             uint32_t dom, int size, int prot,
-                                             unsigned long mfn)
+void *xc_map_foreign_range(xc_interface *xch,
+                           uint32_t dom, int size, int prot,
+                           unsigned long mfn)
 {
     xen_pfn_t *arr;
     int num;
@@ -412,10 +414,10 @@ static void *linux_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle
     return ret;
 }
 
-static void *linux_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)
+void *xc_map_foreign_ranges(xc_interface *xch,
+                            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;
@@ -439,40 +441,6 @@ static void *linux_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handle
     return ret;
 }
 
-static struct xc_osdep_ops linux_privcmd_ops = {
-    .open = &linux_privcmd_open,
-    .close = &linux_privcmd_close,
-
-    .u.privcmd = {
-        .alloc_hypercall_buffer = &linux_privcmd_alloc_hypercall_buffer,
-        .free_hypercall_buffer = &linux_privcmd_free_hypercall_buffer,
-
-        .hypercall = &linux_privcmd_hypercall,
-
-        .map_foreign_batch = &linux_privcmd_map_foreign_batch,
-        .map_foreign_bulk = &linux_privcmd_map_foreign_bulk,
-        .map_foreign_range = &linux_privcmd_map_foreign_range,
-        .map_foreign_ranges = &linux_privcmd_map_foreign_ranges,
-    },
-};
-
-static struct xc_osdep_ops *linux_osdep_init(xc_interface *xch, enum xc_osdep_type type)
-{
-    switch ( type )
-    {
-    case XC_OSDEP_PRIVCMD:
-        return &linux_privcmd_ops;
-    default:
-        return NULL;
-    }
-}
-
-xc_osdep_info_t xc_osdep_info = {
-    .name = "Linux Native OS interface",
-    .init = &linux_osdep_init,
-    .fake = 0,
-};
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index 22d985c..047e13b 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -39,19 +39,20 @@ void minios_interface_close_fd(int fd);
 
 extern void minios_interface_close_fd(int fd);
 
-static xc_osdep_handle minios_privcmd_open(xc_interface *xch)
+int osdep_privcmd_open(xc_interface *xch)
 {
     int fd = alloc_fd(FTYPE_XC);
 
     if ( fd == -1)
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
 
-    return (xc_osdep_handle)fd;
+    xch->privcmdfd = fd;
+    return 0;
 }
 
-static int minios_privcmd_close(xc_interface *xch, xc_osdep_handle h)
+int osdep_privcmd_close(xc_interface *xch)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     return close(fd);
 }
 
@@ -60,17 +61,17 @@ void minios_interface_close_fd(int fd)
     files[fd].type = FTYPE_NONE;
 }
 
-static void *minios_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, int npages)
+void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
 {
     return xc_memalign(xch, PAGE_SIZE, npages * PAGE_SIZE);
 }
 
-static void minios_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages)
+void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
 {
     free(ptr);
 }
 
-static int minios_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
+int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
 {
     multicall_entry_t call;
     int i, ret;
@@ -92,21 +93,21 @@ static int minios_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcm
     return call.result;
 }
 
-static void *minios_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)
+void *xc_map_foreign_bulk(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err, unsigned int num)
 {
     unsigned long pt_prot = 0;
     if (prot & PROT_READ)
 	pt_prot = L1_PROT_RO;
     if (prot & PROT_WRITE)
 	pt_prot = L1_PROT;
-    return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);    
+    return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
 }
 
-static void *minios_privcmd_map_foreign_batch(xc_interface *xch,  xc_osdep_handle h,
-                                              uint32_t dom, int prot,
-                                              xen_pfn_t *arr, int num)
+void *xc_map_foreign_batch(xc_interface *xch,
+                           uint32_t dom, int prot,
+                           xen_pfn_t *arr, int num)
 {
     unsigned long pt_prot = 0;
     int err[num];
@@ -126,10 +127,10 @@ static void *minios_privcmd_map_foreign_batch(xc_interface *xch,  xc_osdep_handl
     return (void *) addr;
 }
 
-static void *minios_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
-                                              uint32_t dom,
-                                              int size, int prot,
-                                              unsigned long mfn)
+void *xc_map_foreign_range(xc_interface *xch,
+                           uint32_t dom,
+                           int size, int prot,
+                           unsigned long mfn)
 {
     unsigned long pt_prot = 0;
 
@@ -142,10 +143,10 @@ static void *minios_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle
     return map_frames_ex(&mfn, size / getpagesize(), 0, 1, 1, dom, NULL, pt_prot);
 }
 
-static void *minios_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)
+void *xc_map_foreign_ranges(xc_interface *xch,
+                            uint32_t dom,
+                            size_t size, int prot, size_t chunksize,
+                            privcmd_mmap_entry_t entries[], int nentries)
 {
     unsigned long *mfns;
     int i, j, n;
@@ -169,24 +170,6 @@ static void *minios_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handl
     return ret;
 }
 
-
-static struct xc_osdep_ops minios_privcmd_ops = {
-    .open = &minios_privcmd_open,
-    .close = &minios_privcmd_close,
-
-    .u.privcmd = {
-        .alloc_hypercall_buffer = &minios_privcmd_alloc_hypercall_buffer,
-        .free_hypercall_buffer = &minios_privcmd_free_hypercall_buffer,
-
-        .hypercall = &minios_privcmd_hypercall,
-
-        .map_foreign_batch = &minios_privcmd_map_foreign_batch,
-        .map_foreign_bulk = &minios_privcmd_map_foreign_bulk,
-        .map_foreign_range = &minios_privcmd_map_foreign_range,
-        .map_foreign_ranges = &minios_privcmd_map_foreign_ranges,
-    },
-};
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush)
 {
@@ -199,23 +182,6 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return memalign(alignment, size);
 }
 
-static struct xc_osdep_ops *minios_osdep_init(xc_interface *xch, enum xc_osdep_type type)
-{
-    switch ( type )
-    {
-    case XC_OSDEP_PRIVCMD:
-        return &minios_privcmd_ops;
-    default:
-        return NULL;
-    }
-}
-
-xc_osdep_info_t xc_osdep_info = {
-    .name = "Minios Native OS interface",
-    .init = &minios_osdep_init,
-    .fake = 0,
-};
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index fe4f0a1..9abb3b6 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -24,7 +24,7 @@
 #include <malloc.h>
 #include <sys/mman.h>
 
-static xc_osdep_handle netbsd_privcmd_open(xc_interface *xch)
+int osdep_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
     int fd = open("/kern/xen/privcmd", O_RDWR);
@@ -32,7 +32,7 @@ static xc_osdep_handle netbsd_privcmd_open(xc_interface *xch)
     if ( fd == -1 )
     {
         PERROR("Could not obtain handle on privileged command interface");
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
     }
 
     /* Although we return the file handle as the 'xc handle' the API
@@ -51,22 +51,23 @@ static xc_osdep_handle netbsd_privcmd_open(xc_interface *xch)
         goto error;
     }
 
-    return (xc_osdep_handle)fd;
+    xch->privcmdfd = fd;
+    return 0;
 
  error:
     saved_errno = errno;
     close(fd);
     errno = saved_errno;
-    return XC_OSDEP_OPEN_ERROR;
+    return -1;
 }
 
-static int netbsd_privcmd_close(xc_interface *xch, xc_osdep_handle h)
+int osdep_privcmd_close(xc_interface *xch)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     return close(fd);
 }
 
-static void *netbsd_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, int npages)
+void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
 {
     size_t size = npages * XC_PAGE_SIZE;
     void *p;
@@ -83,15 +84,15 @@ static void *netbsd_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_h
     return p;
 }
 
-static void netbsd_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages)
+void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
 {
     (void) munlock(ptr, npages * XC_PAGE_SIZE);
     free(ptr);
 }
 
-static int netbsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
+int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
 
     /*
@@ -106,11 +107,18 @@ static int netbsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcm
         return hypercall->retval;
 }
 
-static void *netbsd_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handle h,
-                                              uint32_t dom, int prot,
-                                              xen_pfn_t *arr, int num)
+void *xc_map_foreign_bulk(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err, unsigned int num)
 {
-    int fd = (int)h;
+    return xc_map_foreign_bulk_compat(xch, dom, prot, arr, err, num);
+}
+
+void *xc_map_foreign_batch(xc_interface *xch,
+                           uint32_t dom, int prot,
+                           xen_pfn_t *arr, int num)
+{
+    int fd = xch->privcmdfd;
     privcmd_mmapbatch_t ioctlx;
     void *addr;
     addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
@@ -135,12 +143,12 @@ static void *netbsd_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handle
 
 }
 
-static void *netbsd_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
-                                              uint32_t dom,
-                                              int size, int prot,
-                                              unsigned long mfn)
+void *xc_map_foreign_range(xc_interface *xch,
+                           uint32_t dom,
+                           int size, int prot,
+                           unsigned long mfn)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     privcmd_mmap_t ioctlx;
     privcmd_mmap_entry_t entry;
     void *addr;
@@ -167,12 +175,12 @@ static void *netbsd_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle
     return addr;
 }
 
-static void *netbsd_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)
+void *xc_map_foreign_ranges(xc_interface *xch,
+                            uint32_t dom,
+                            size_t size, int prot, size_t chunksize,
+                            privcmd_mmap_entry_t entries[], int nentries)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
 	privcmd_mmap_t ioctlx;
 	int i, rc;
 	void *addr;
@@ -205,23 +213,6 @@ mmap_failed:
 	return NULL;
 }
 
-static struct xc_osdep_ops netbsd_privcmd_ops = {
-    .open = &netbsd_privcmd_open,
-    .close = &netbsd_privcmd_close,
-
-    .u.privcmd = {
-        .alloc_hypercall_buffer = &netbsd_privcmd_alloc_hypercall_buffer,
-        .free_hypercall_buffer = &netbsd_privcmd_free_hypercall_buffer,
-
-        .hypercall = &netbsd_privcmd_hypercall,
-
-        .map_foreign_batch = &netbsd_privcmd_map_foreign_batch,
-        .map_foreign_bulk = &xc_map_foreign_bulk_compat,
-        .map_foreign_range = &netbsd_privcmd_map_foreign_range,
-        .map_foreign_ranges = &netbsd_privcmd_map_foreign_ranges,
-    },
-};
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
@@ -262,23 +253,6 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return valloc(size);
 }
 
-static struct xc_osdep_ops *netbsd_osdep_init(xc_interface *xch, enum xc_osdep_type type)
-{
-    switch ( type )
-    {
-    case XC_OSDEP_PRIVCMD:
-        return &netbsd_privcmd_ops;
-    default:
-        return NULL;
-    }
-}
-
-xc_osdep_info_t xc_osdep_info = {
-    .name = "Netbsd Native OS interface",
-    .init = &netbsd_osdep_init,
-    .fake = 0,
-};
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 85e6f02..de5873e 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -26,111 +26,12 @@
 #include <pthread.h>
 #include <assert.h>
 
-#ifndef __MINIOS__
-#include <dlfcn.h>
-#endif
-
-#define XENCTRL_OSDEP "XENCTRL_OSDEP"
-
-#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__) && !defined(__RUMPRUN__)
-#define DO_DYNAMIC_OSDEP
-#endif
-
-/*
- * Returns a (shallow) copy of the xc_osdep_info_t for the
- * active OS interface.
- *
- * On success a handle to the relevant library is opened.  The user
- * must subsequently call xc_osdep_put_info() when it is
- * finished with the library.
- *
- * Logs IFF xch != NULL.
- *
- * Returns:
- *  0 - on success
- * -1 - on error
- */
-static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info)
-{
-    int rc = -1;
-#ifdef DO_DYNAMIC_OSDEP
-    const char *lib = getenv(XENCTRL_OSDEP);
-    xc_osdep_info_t *pinfo;
-    void *dl_handle = NULL;
-
-    if ( lib != NULL )
-    {
-        if ( getuid() != geteuid() )
-        {
-            if ( xch ) ERROR("cannot use %s=%s with setuid application", XENCTRL_OSDEP, lib);
-            abort();
-        }
-        if ( getgid() != getegid() )
-        {
-            if ( xch ) ERROR("cannot use %s=%s with setgid application", XENCTRL_OSDEP, lib);
-            abort();
-        }
-
-        dl_handle = dlopen(lib, RTLD_LAZY|RTLD_LOCAL);
-        if ( !dl_handle )
-        {
-            if ( xch ) ERROR("unable to open osdep library %s: %s", lib, dlerror());
-            goto out;
-        }
-
-        pinfo = dlsym(dl_handle, "xc_osdep_info");
-        if ( !pinfo )
-        {
-            if ( xch ) ERROR("unable to find xc_osinteface_info in %s: %s", lib, dlerror());
-            goto out;
-        }
-
-        *info = *pinfo;
-        info->dl_handle = dl_handle;
-    }
-    else
-#endif /*DO_DYNAMIC_OSDEP*/
-    {
-        *info = xc_osdep_info;
-        info->dl_handle = NULL;
-    }
-
-    rc = 0;
-
-#ifdef DO_DYNAMIC_OSDEP
-out:
-    if ( dl_handle && rc == -1 )
-        dlclose(dl_handle);
-#endif /*DO_DYNAMIC_OSDEP*/
-
-    return rc;
-}
-
-static void xc_osdep_put(xc_osdep_info_t *info)
-{
-#ifdef DO_DYNAMIC_OSDEP
-    if ( info->dl_handle )
-        dlclose(info->dl_handle);
-#endif /*DO_DYNAMIC_OSDEP*/
-}
-
-static const char *xc_osdep_type_name(enum xc_osdep_type type)
-{
-    switch ( type )
-    {
-    case XC_OSDEP_PRIVCMD: return "privcmd";
-    }
-    return "unknown";
-}
-
-static struct xc_interface_core *xc_interface_open_common(xentoollog_logger *logger,
-                                                          xentoollog_logger *dombuild_logger,
-                                                          unsigned open_flags,
-                                                          enum xc_osdep_type type)
+struct xc_interface_core *xc_interface_open(xentoollog_logger *logger,
+                                            xentoollog_logger *dombuild_logger,
+                                            unsigned open_flags)
 {
     struct xc_interface_core xch_buf, *xch = &xch_buf;
 
-    xch->type = type;
     xch->flags = open_flags;
     xch->dombuild_logger_file = 0;
     xc_clear_last_error(xch);
@@ -148,9 +49,6 @@ static struct xc_interface_core *xc_interface_open_common(xentoollog_logger *log
     xch->hypercall_buffer_cache_misses = 0;
     xch->hypercall_buffer_cache_toobig = 0;
 
-    xch->ops_handle = XC_OSDEP_OPEN_ERROR;
-    xch->ops = NULL;
-
     if (!xch->error_handler) {
         xch->error_handler = xch->error_handler_tofree =
             (xentoollog_logger*)
@@ -168,40 +66,26 @@ static struct xc_interface_core *xc_interface_open_common(xentoollog_logger *log
     *xch = xch_buf;
 
     if (!(open_flags & XC_OPENFLAG_DUMMY)) {
-        if ( xc_osdep_get_info(xch, &xch->osdep) < 0 )
+        if ( osdep_privcmd_open(xch) < 0 )
             goto err;
-
-        xch->ops = xch->osdep.init(xch, type);
-        if ( xch->ops == NULL )
-        {
-            DPRINTF("OSDEP: interface %d (%s) not supported on this platform",
-                  type, xc_osdep_type_name(type));
-            goto err_put_iface;
-        }
-
-        xch->ops_handle = xch->ops->open(xch);
-        if (xch->ops_handle == XC_OSDEP_OPEN_ERROR)
-            goto err_put_iface;
     }
 
     return xch;
 
-err_put_iface:
-    xc_osdep_put(&xch->osdep);
  err:
     xtl_logger_destroy(xch->error_handler_tofree);
     if (xch != &xch_buf) free(xch);
     return NULL;
 }
 
-static int xc_interface_close_common(xc_interface *xch)
+int xc_interface_close(xc_interface *xch)
 {
     int rc = 0;
 
     if (!xch)
-	return 0;
+        return 0;
 
-    rc = xch->ops->close(xch, xch->ops_handle);
+    rc = osdep_privcmd_close(xch);
     if (rc) PERROR("Could not close hypervisor interface");
 
     xc__hypercall_buffer_cache_release(xch);
@@ -213,42 +97,6 @@ static int xc_interface_close_common(xc_interface *xch)
     return rc;
 }
 
-int xc_interface_is_fake(void)
-{
-    xc_osdep_info_t info;
-
-    if ( xc_osdep_get_info(NULL, &info) < 0 )
-        return -1;
-
-    /* Have a copy of info so can release the interface now. */
-    xc_osdep_put(&info);
-
-    return info.fake;
-}
-
-xc_interface *xc_interface_open(xentoollog_logger *logger,
-                                xentoollog_logger *dombuild_logger,
-                                unsigned open_flags)
-{
-    xc_interface *xch;
-
-    xch = xc_interface_open_common(logger, dombuild_logger, open_flags,
-                                   XC_OSDEP_PRIVCMD);
-
-    return xch;
-}
-
-int xc_interface_close(xc_interface *xch)
-{
-    return xc_interface_close_common(xch);
-}
-
-
-int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
-{
-    return xch->ops->u.privcmd.hypercall(xch, xch->ops_handle, hypercall);
-}
-
 static pthread_key_t errbuf_pkey;
 static pthread_once_t errbuf_pkey_once = PTHREAD_ONCE_INIT;
 
@@ -335,14 +183,6 @@ void xc_report_error(xc_interface *xch, int code, const char *fmt, ...)
     va_end(args);
 }
 
-void xc_osdep_log(xc_interface *xch, xentoollog_level level, int code, const char *fmt, ...)
-{
-    va_list args;
-    va_start(args, fmt);
-    xc_reportv(xch, xch->error_handler, level, code, fmt, args);
-    va_end(args);
-}
-
 const char *xc_set_progress_prefix(xc_interface *xch, const char *doing)
 {
     const char *old = xch->currently_progress_reporting;
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index a32accb..30157cf 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -30,7 +30,6 @@
 
 #include "_paths.h"
 #include "xenctrl.h"
-#include "xenctrlosdep.h"
 
 #include <xen/sys/privcmd.h>
 
@@ -88,7 +87,6 @@ struct iovec {
 #define MAX_PAGECACHE_USAGE (4*1024)
 
 struct xc_interface_core {
-    enum xc_osdep_type type;
     int flags;
     xentoollog_logger *error_handler,   *error_handler_tofree;
     xentoollog_logger *dombuild_logger, *dombuild_logger_tofree;
@@ -117,12 +115,21 @@ struct xc_interface_core {
     int hypercall_buffer_cache_misses;
     int hypercall_buffer_cache_toobig;
 
-    /* Low lovel OS interface */
-    xc_osdep_info_t  osdep;
-    xc_osdep_ops    *ops; /* backend operations */
-    xc_osdep_handle  ops_handle; /* opaque data for xc_osdep_ops */
+    /* Privcmd interface */
+    int privcmdfd;
 };
 
+int osdep_privcmd_open(xc_interface *xch);
+int osdep_privcmd_close(xc_interface *xch);
+
+void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages);
+void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages);
+
+/* Stub for not yet converted OSes */
+void *xc_map_foreign_bulk_compat(xc_interface *xch,
+                                 uint32_t dom, int prot,
+                                 const xen_pfn_t *arr, int *err, unsigned int num);
+
 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,
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index ed7987c..6f84b82 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -24,7 +24,7 @@
 #include <fcntl.h>
 #include <malloc.h>
 
-static xc_osdep_handle solaris_privcmd_open(xc_interface *xch)
+int osdep_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
     int fd = open("/dev/xen/privcmd", O_RDWR);
@@ -32,7 +32,7 @@ static xc_osdep_handle solaris_privcmd_open(xc_interface *xch)
     if ( fd == -1 )
     {
         PERROR("Could not obtain handle on privileged command interface");
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
     }
 
     /* Although we return the file handle as the 'xc handle' the API
@@ -51,42 +51,43 @@ static xc_osdep_handle solaris_privcmd_open(xc_interface *xch)
         goto error;
     }
 
-    return (xc_osdep_handle)fd;
+    xch->privcmdfd = fd;
+    return 0;
 
  error:
     saved_errno = errno;
     close(fd);
     errno = saved_errno;
-    return XC_OSDEP_OPEN_ERROR;
+    return -1;
 }
 
-static int solaris_privcmd_close(xc_interface *xch, xc_osdep_handle h)
+int osdep_privcmd_close(xc_interface *xch)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     return close(fd);
 }
 
-static void *solaris_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, int npages)
+void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
 {
     return xc_memalign(xch, XC_PAGE_SIZE, npages * XC_PAGE_SIZE);
 }
 
-static void solaris_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages)
+static void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
 {
     free(ptr);
 }
 
-static int solaris_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
+int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     return ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
 }
 
-static void *solaris_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handle h,
-                                               uint32_t dom, int prot,
-                                               xen_pfn_t *arr, int num)
+void *xc_map_foreign_batch(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          xen_pfn_t *arr, int num)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     privcmd_mmapbatch_t ioctlx;
     void *addr;
     addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_SHARED, fd, 0);
@@ -109,12 +110,19 @@ static void *solaris_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handl
 
 }
 
-static void *xc_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
-                                  uint32_t dom,
-                                  int size, int prot,
-                                  unsigned long mfn)
+void *xc_map_foreign_bulk(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err, unsigned int num)
 {
-    int fd = (int)fd;
+    return xc_map_foreign_bulk_compat(xch, dom, prot, arr, err, num);
+}
+
+void *xc_map_foreign_range(xc_interface *xch,
+                           uint32_t dom,
+                           int size, int prot,
+                           unsigned long mfn)
+{
+    int fd = xch->privcmdfd;
     privcmd_mmap_t ioctlx;
     privcmd_mmap_entry_t entry;
     void *addr;
@@ -138,12 +146,12 @@ static void *xc_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
     return addr;
 }
 
-static void *solaric_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)
+void *xc_map_foreign_ranges(xc_interface *xch,
+                            uint32_t dom,
+                            size_t size, int prot, size_t chunksize,
+                            privcmd_mmap_entry_t entries[], int nentries)
 {
-    int fd = (int)fd;
+    int fd = xch->privcmdfd;
     privcmd_mmap_t ioctlx;
     int i, rc;
     void *addr;
@@ -176,23 +184,6 @@ mmap_failed:
     return NULL;
 }
 
-static struct xc_osdep_ops solaris_privcmd_ops = {
-    .open = &solaris_privcmd_open,
-    .close = &solaris_privcmd_close,
-
-    .u.privcmd = {
-        .alloc_hypercall_buffer = &solaris_privcmd_alloc_hypercall_buffer,
-        .free_hypercall_buffer = &solaris_privcmd_free_hypercall_buffer,
-
-        .hypercall = &solaris_privcmd_hypercall;
-
-        .map_foreign_batch = &solaris_privcmd_map_foreign_batch,
-        .map_foreign_bulk = &xc_map_foreign_bulk_compat,
-        .map_foreign_range = &solaris_privcmd_map_foreign_range,
-        .map_foreign_ranges = &solaris_privcmd_map_foreign_ranges,
-    },
-};
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
@@ -204,23 +195,6 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return memalign(alignment, size);
 }
 
-static struct xc_osdep_ops *solaris_osdep_init(xc_interface *xch, enum xc_osdep_type type)
-{
-    switch ( type )
-    {
-    case XC_OSDEP_PRIVCMD:
-        return &solaris_privcmd_ops;
-    default:
-        return NULL;
-    }
-}
-
-xc_osdep_info_t xc_osdep_info = {
-    .name = "Solaris Native OS interface",
-    .init = &solaris_osdep_init,
-    .fake = 0,
-};
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xenctrl_osdep_ENOSYS.c b/tools/libxc/xenctrl_osdep_ENOSYS.c
deleted file mode 100644
index 5182532..0000000
--- a/tools/libxc/xenctrl_osdep_ENOSYS.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* Dummy backend which just logs and returns ENOSYS. */
-
-#include <errno.h>
-#include <inttypes.h>
-#include <stdlib.h>
-
-#include "xenctrl.h"
-#include "xenctrlosdep.h"
-
-#define IPRINTF(_x, _f, _a...) xc_osdep_log(_x,XTL_INFO,0, _f , ## _a)
-
-#define ERROR(_x, _m, _a...)  xc_osdep_log(_x,XTL_ERROR,XC_INTERNAL_ERROR,_m , ## _a )
-#define PERROR(_x, _m, _a...) xc_osdep_log(_x,XTL_ERROR,XC_INTERNAL_ERROR,_m \
-                  " (%d = %s)", ## _a , errno, xc_strerror(xch, errno))
-
-static xc_osdep_handle ENOSYS_privcmd_open(xc_interface *xch)
-{
-    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 %lx\n", h);
-    return 0;
-}
-
-static int ENOSYS_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
-{
-#if defined(__FreeBSD__) || defined(__NetBSD__)
-    IPRINTF(xch, "ENOSYS_privcmd %lx: hypercall: %02lu(%#lx,%#lx,%#lx,%#lx,%#lx)\n",
-#else
-    IPRINTF(xch, "ENOSYS_privcmd %lx: hypercall: %02lld(%#llx,%#llx,%#llx,%#llx,%#llx)\n",
-#endif
-            h, hypercall->op,
-            hypercall->arg[0], hypercall->arg[1], hypercall->arg[2],
-            hypercall->arg[3], hypercall->arg[4]);
-    return -ENOSYS;
-}
-
-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 %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 %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 %lx map_foreign_range: dom%d size %#x prot %#x mfn %ld\n", h, dom, size, prot, mfn);
-    return MAP_FAILED;
-}
-
-static void *ENOSYS_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)
-{
-    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;
-}
-
-static struct xc_osdep_ops ENOSYS_privcmd_ops =
-{
-    .open      = &ENOSYS_privcmd_open,
-    .close     = &ENOSYS_privcmd_close,
-    .u.privcmd   = {
-        .hypercall = &ENOSYS_privcmd_hypercall,
-
-        .map_foreign_batch = &ENOSYS_privcmd_map_foreign_batch,
-        .map_foreign_bulk = &ENOSYS_privcmd_map_foreign_bulk,
-        .map_foreign_range = &ENOSYS_privcmd_map_foreign_range,
-        .map_foreign_ranges = &ENOSYS_privcmd_map_foreign_ranges,
-    }
-};
-
-static struct xc_osdep_ops * ENOSYS_osdep_init(xc_interface *xch, enum xc_osdep_type type)
-{
-    struct xc_osdep_ops *ops;
-
-    if (getenv("ENOSYS") == NULL)
-    {
-        PERROR(xch, "ENOSYS: not configured\n");
-        return NULL;
-    }
-
-    switch ( type )
-    {
-    case XC_OSDEP_PRIVCMD:
-        ops = &ENOSYS_privcmd_ops;
-        break;
-    default:
-        ops = NULL;
-        break;
-    }
-
-    IPRINTF(xch, "ENOSYS_osdep_init: initialising handle ops at %p\n", ops);
-
-    return ops;
-}
-
-xc_osdep_info_t xc_osdep_info = {
-    .name = "Pessimistic ENOSYS OS interface",
-    .init = &ENOSYS_osdep_init,
-    .fake = 1,
-};
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index 41d228d..58a53a1 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -108,8 +108,6 @@ external sizeof_xen_pfn: unit -> int = "stub_sizeof_xen_pfn"
 external interface_open: unit -> handle = "stub_xc_interface_open"
 external interface_close: handle -> unit = "stub_xc_interface_close"
 
-external is_fake: unit -> bool = "stub_xc_interface_is_fake"
-
 let with_intf f =
 	let xc = interface_open () in
 	let r = try f xc with exn -> interface_close xc; raise exn in
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index b4a175b..16443df 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -72,7 +72,6 @@ external sizeof_vcpu_guest_context : unit -> int
   = "stub_sizeof_vcpu_guest_context"
 external sizeof_xen_pfn : unit -> int = "stub_sizeof_xen_pfn"
 external interface_open : unit -> handle = "stub_xc_interface_open"
-external is_fake : unit -> bool = "stub_xc_interface_is_fake"
 external interface_close : handle -> unit = "stub_xc_interface_close"
 val with_intf : (handle -> 'a) -> 'a
 val domain_create : handle -> int32 -> domain_create_flag list -> string -> domid
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 393156c..e2fa7e4 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -126,13 +126,6 @@ CAMLprim value stub_xc_interface_open(void)
 }
 
 
-CAMLprim value stub_xc_interface_is_fake(void)
-{
-	CAMLparam0();
-	int is_fake = xc_interface_is_fake();
-	CAMLreturn(Val_int(is_fake));
-}
-
 CAMLprim value stub_xc_interface_close(value xch)
 {
 	CAMLparam1(xch);
diff --git a/tools/ocaml/xenstored/domains.ml b/tools/ocaml/xenstored/domains.ml
index 92e438f..395f3a9 100644
--- a/tools/ocaml/xenstored/domains.ml
+++ b/tools/ocaml/xenstored/domains.ml
@@ -65,11 +65,9 @@ let create xc doms domid mfn port =
 	Domain.bind_interdomain dom;
 	dom
 
-let create0 fake doms =
+let create0 doms =
 	let port, interface =
-		if fake then (
-			0, Xenctrl.with_intf (fun xc -> Xenctrl.map_foreign_range xc 0 (Xenmmap.getpagesize()) 0n)
-		) else (
+		(
 			let port = Utils.read_file_single_integer Define.xenstored_proc_port
 			and fd = Unix.openfile Define.xenstored_proc_kva
 					       [ Unix.O_RDWR ] 0o600 in
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 42b8183..25c126a 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -176,7 +176,7 @@ let from_channel store cons doms chan =
 			if domid > 0 then
 				Domains.create xc doms domid mfn port
 			else
-				Domains.create0 false doms
+				Domains.create0 doms
 			in
 		Connections.add_domain cons ndom;
 		in
@@ -278,8 +278,7 @@ let _ =
 			Store.mkdir store (Perms.Connection.create 0) localpath;
 
 		if cf.domain_init then (
-			let usingxiu = Xenctrl.is_fake () in
-			Connections.add_domain cons (Domains.create0 usingxiu domains);
+			Connections.add_domain cons (Domains.create0 domains);
 			Event.bind_dom_exc_virq eventchn
 		);
 	);
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:15:11 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:15: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 1aON83-0000XQ-U6; Wed, 27 Jan 2016 10:15: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 1aON82-0000X8-Hn
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:10 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	E6/10-12072-DA898A65; Wed, 27 Jan 2016 10:15:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1453889705!18436061!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 65355 invoked from network); 27 Jan 2016 10:15:06 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8o-0001wc-VV
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7w-0001Ku-KX
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:04 +0000
Date: Wed, 27 Jan 2016 10:15:04 +0000
Message-Id: <E1aON7w-0001Ku-KX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Remove osdep indirection
	for privcmd
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7a3543df838c33db28262e5eb4560d615a89bfe6
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 11 17:39:00 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:22:38 2016 +0000

    tools/libxc: Remove osdep indirection for privcmd
    
    The alternative backend (a xen-api/xapi shim) is no longer around and
    so this stuff is now just baggage which is getting in the way of
    refactoring libxenctrl.
    
    Nested virt probably suffices for this use case now.
    
    This was the last component of the osdep infrastructure, so all the
    dynamic loading etc stuff all falls away too.
    
    As part of this I was forced to investigate the twisty
    xc_map_foreign_* maze, which I have added to the
    toolstack-library-apis doc in the hopes of doing something sensible.
    
    NetBSD and Solaris now call xc_map_foreign_bulk_compat directly from
    their xc_map_foreign_bulk, which could have been achieved by using
    some ifdefs around a renamed function. This will fall out in the wash
    when these functions move to their own library.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: David Scott <dave.scott@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 config/FreeBSD.mk                   |    2 -
 config/NetBSD.mk                    |    3 -
 config/NetBSDRump.mk                |    1 -
 config/StdGNU.mk                    |    1 -
 config/SunOS.mk                     |    1 -
 tools/libxc/Makefile                |   27 ++----
 tools/libxc/include/xenctrl.h       |    9 --
 tools/libxc/include/xenctrlosdep.h  |  133 --------------------------
 tools/libxc/xc_foreign_memory.c     |   31 +------
 tools/libxc/xc_freebsd_osdep.c      |  100 ++++++---------------
 tools/libxc/xc_hcall_buf.c          |    6 +-
 tools/libxc/xc_linux_osdep.c        |   88 ++++++------------
 tools/libxc/xc_minios.c             |   82 +++++------------
 tools/libxc/xc_netbsd.c             |   90 +++++++------------
 tools/libxc/xc_private.c            |  174 ++---------------------------------
 tools/libxc/xc_private.h            |   19 +++-
 tools/libxc/xc_solaris.c            |   90 +++++++------------
 tools/libxc/xenctrl_osdep_ENOSYS.c  |  123 ------------------------
 tools/ocaml/libs/xc/xenctrl.ml      |    2 -
 tools/ocaml/libs/xc/xenctrl.mli     |    1 -
 tools/ocaml/libs/xc/xenctrl_stubs.c |    7 --
 tools/ocaml/xenstored/domains.ml    |    6 +-
 tools/ocaml/xenstored/xenstored.ml  |    5 +-
 23 files changed, 178 insertions(+), 823 deletions(-)

diff --git a/config/FreeBSD.mk b/config/FreeBSD.mk
index 5a13d607..bb3a5d0 100644
--- a/config/FreeBSD.mk
+++ b/config/FreeBSD.mk
@@ -1,6 +1,4 @@
 include $(XEN_ROOT)/config/StdGNU.mk
 
-DLOPEN_LIBS =
-
 # No wget on FreeBSD base system
 WGET = ftp
diff --git a/config/NetBSD.mk b/config/NetBSD.mk
index 21318d6..cf766e5 100644
--- a/config/NetBSD.mk
+++ b/config/NetBSD.mk
@@ -1,6 +1,3 @@
 include $(XEN_ROOT)/config/StdGNU.mk
 
-# Override settings for this OS
-DLOPEN_LIBS =
-
 WGET = ftp
diff --git a/config/NetBSDRump.mk b/config/NetBSDRump.mk
index 2a87218..74755a1 100644
--- a/config/NetBSDRump.mk
+++ b/config/NetBSDRump.mk
@@ -1,6 +1,5 @@
 include $(XEN_ROOT)/config/StdGNU.mk
 
-DLOPEN_LIBS =
 PTHREAD_LIBS =
 
 WGET = ftp
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 129d5c8..39d36b2 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -31,7 +31,6 @@ DEBUG_DIR ?= /usr/lib/debug
 
 SOCKET_LIBS =
 UTIL_LIBS = -lutil
-DLOPEN_LIBS = -ldl
 
 SONAME_LDFLAG = -soname
 SHLIB_LDFLAGS = -shared
diff --git a/config/SunOS.mk b/config/SunOS.mk
index db5e898..86a384d 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -27,7 +27,6 @@ SunOS_LIBDIR_x86_64 = /usr/sfw/lib/amd64
 SOCKET_LIBS = -lsocket
 PTHREAD_LIBS = -lpthread
 UTIL_LIBS =
-DLOPEN_LIBS = -ldl
 
 SONAME_LDFLAG = -h
 SHLIB_LDFLAGS = -R $(SunOS_LIBDIR) -shared
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 33d18db..3305fdd 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -101,8 +101,6 @@ GUEST_SRCS-y                 += xc_dom_decompress_unsafe_lzo1x.c
 GUEST_SRCS-y                 += xc_dom_decompress_unsafe_xz.c
 endif
 
-OSDEP_SRCS-y                 += xenctrl_osdep_ENOSYS.c
-
 -include $(XEN_TARGET_ARCH)/Makefile
 
 CFLAGS   += -Werror -Wmissing-prototypes
@@ -121,11 +119,8 @@ CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
 GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
 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
+$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \
+$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h
 
 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS): CFLAGS += $(CFLAGS_libxengnttab) $(CFLAGS_libxengntshr)
 
@@ -139,17 +134,13 @@ ifneq ($(nosharedlibs),y)
 LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
 endif
 
-ifneq ($(nosharedlibs),y)
-LIB += xenctrl_osdep_ENOSYS.so
-endif
-
 genpath-target = $(call buildmakevars2header,_paths.h)
 $(eval $(genpath-target))
 
 xc_private.h: _paths.h
 
-$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) $(OSDEP_LIB_OBJS) \
-$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS) $(OSDEP_PIC_OBJS): xc_private.h
+$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \
+$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): xc_private.h
 
 .PHONY: all
 all: build
@@ -169,7 +160,7 @@ install: build
 	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenctrl.so
-	$(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h include/xenctrlosdep.h $(DESTDIR)$(includedir)
+	$(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h $(DESTDIR)$(includedir)
 	$(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
 	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR)
@@ -185,8 +176,7 @@ clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS) \
             _paths.h \
             $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
-            $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS) \
-            $(OSDEP_LIB_OBJS) $(OSDEP_PIC_OBJS)
+            $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS)
 
 .PHONY: distclean
 distclean: clean
@@ -212,7 +202,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
@@ -237,8 +227,5 @@ libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(call zlib-options,l)
 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
 	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
-xenctrl_osdep_ENOSYS.so: $(OSDEP_PIC_OBJS) libxenctrl.so
-	$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OSDEP_PIC_OBJS) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
-
 -include $(DEPS)
 
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 759f9df..d7444c8 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -181,15 +181,6 @@ enum xc_open_flags {
  */
 int xc_interface_close(xc_interface *xch);
 
-/**
- * Query the active OS interface (i.e. that which would be returned by
- * xc_interface_open) to find out if it is fake (i.e. backends onto
- * something other than an actual Xen hypervisor).
- *
- * @return 0 is "real", >0 if fake, -1 on error.
- */
-int xc_interface_is_fake(void);
-
 /*
  * HYPERCALL SAFE MEMORY BUFFER
  *
diff --git a/tools/libxc/include/xenctrlosdep.h b/tools/libxc/include/xenctrlosdep.h
deleted file mode 100644
index 423660d..0000000
--- a/tools/libxc/include/xenctrlosdep.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/******************************************************************************
- *
- * Interface to OS specific low-level operations
- *
- * Copyright (c) 2010, Citrix Systems Inc.
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * This interface defines the interactions between the Xen control
- * libraries and the OS facilities used to communicate with the
- * hypervisor.
- *
- * It is possible to override the default (native) implementation by
- * setting the XENCTRL_OSDEP environment variable to point to a
- * plugin library. Userspace can use this facility to intercept
- * hypervisor operations. This can be used e.g. to implement a
- * userspace simulator for Xen hypercalls.
- *
- * The plugin must contain a data structure:
- *  xc_osdep_info_t xc_osdep_info;
- *
- * xc_osdep_init:
- *   Must return a suitable struct xc_osdep_ops pointer or NULL on failure.
- */
-
-#ifndef XC_OSDEP_H
-#define XC_OSDEP_H
-
-/* Tell the Xen public headers we are a user-space tools build. */
-#ifndef __XEN_TOOLS__
-#define __XEN_TOOLS__ 1
-#endif
-
-#include <sys/mman.h>
-#include <sys/types.h>
-
-#include <xen/sys/privcmd.h>
-
-enum xc_osdep_type {
-    XC_OSDEP_PRIVCMD,
-};
-
-/* Opaque handle internal to the backend */
-typedef unsigned long xc_osdep_handle;
-
-#define XC_OSDEP_OPEN_ERROR ((xc_osdep_handle)-1)
-
-struct xc_osdep_ops
-{
-    /* Opens an interface.
-     *
-     * Must return an opaque handle on success or
-     * XC_OSDEP_OPEN_ERROR on failure
-     */
-    xc_osdep_handle (*open)(xc_interface *xch);
-
-    int (*close)(xc_interface *xch, xc_osdep_handle h);
-
-    union {
-        struct {
-            void *(*alloc_hypercall_buffer)(xc_interface *xch, xc_osdep_handle h, int npages);
-            void (*free_hypercall_buffer)(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages);
-
-            int (*hypercall)(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall);
-
-            void *(*map_foreign_batch)(xc_interface *xch, xc_osdep_handle h, uint32_t dom, int prot,
-                                       xen_pfn_t *arr, int num);
-            void *(*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);
-            void *(*map_foreign_range)(xc_interface *xch, xc_osdep_handle h, uint32_t dom, int size, int prot,
-                                       unsigned long mfn);
-            void *(*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);
-        } privcmd;
-    } u;
-};
-typedef struct xc_osdep_ops xc_osdep_ops;
-
-typedef xc_osdep_ops *(*xc_osdep_init_fn)(xc_interface *xch, enum xc_osdep_type);
-
-struct xc_osdep_info
-{
-    /* Describes this backend. */
-    const char *name;
-
-    /* Returns ops function. */
-    xc_osdep_init_fn init;
-
-    /* True if this interface backs onto a fake Xen. */
-    int fake;
-
-    /* For internal use by loader. */
-    void *dl_handle;
-};
-typedef struct xc_osdep_info xc_osdep_info_t;
-
-/* All backends, including the builtin backend, must supply this structure. */
-extern xc_osdep_info_t xc_osdep_info;
-
-/* Stub for not yet converted OSes */
-void *xc_map_foreign_bulk_compat(xc_interface *xch, xc_osdep_handle h,
-                                 uint32_t dom, int prot,
-                                 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, ...) __attribute__((format(printf, 4, 5)));
-
-#endif
-
-/*
- * 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_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index f42d140..9c705b6 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -50,37 +50,8 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
     return res;
 }
 
-void *xc_map_foreign_range(xc_interface *xch, uint32_t dom,
-                           int size, int prot, unsigned long mfn)
-{
-    return xch->ops->u.privcmd.map_foreign_range(xch, xch->ops_handle,
-                                                 dom, size, prot, mfn);
-}
-
-void *xc_map_foreign_ranges(xc_interface *xch, uint32_t dom,
-                            size_t size, int prot, size_t chunksize,
-                            privcmd_mmap_entry_t entries[], int nentries)
-{
-    return xch->ops->u.privcmd.map_foreign_ranges(xch, xch->ops_handle,
-                                                  dom, size, prot, chunksize, entries, nentries);
-}
-
-void *xc_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot,
-                           xen_pfn_t *arr, int num)
-{
-    return xch->ops->u.privcmd.map_foreign_batch(xch, xch->ops_handle,
-                                                 dom, prot, arr, num);
-}
-
-void *xc_map_foreign_bulk(xc_interface *xch, uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err, unsigned int num)
-{
-    return xch->ops->u.privcmd.map_foreign_bulk(xch, xch->ops_handle,
-                                                dom, prot, arr, err, num);
-}
-
 /* stub for all not yet converted OSes */
-void *xc_map_foreign_bulk_compat(xc_interface *xch, xc_osdep_handle h,
+void *xc_map_foreign_bulk_compat(xc_interface *xch,
                                  uint32_t dom, int prot,
                                  const xen_pfn_t *arr, int *err, unsigned int num)
 {
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
index 339997c..f6a2ccd 100644
--- a/tools/libxc/xc_freebsd_osdep.c
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -32,16 +32,12 @@
 
 #include <xen/memory.h>
 
-#include "xenctrl.h"
-#include "xenctrlosdep.h"
+#include "xc_private.h"
 
 #define PRIVCMD_DEV     "/dev/xen/privcmd"
 
-#define PERROR(_m, _a...) xc_osdep_log(xch,XTL_ERROR,XC_INTERNAL_ERROR,_m \
-                  " (%d = %s)", ## _a , errno, xc_strerror(xch, errno))
-
 /*------------------------- Privcmd device interface -------------------------*/
-static xc_osdep_handle freebsd_privcmd_open(xc_interface *xch)
+int osdep_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
     int fd = open(PRIVCMD_DEV, O_RDWR);
@@ -50,7 +46,7 @@ static xc_osdep_handle freebsd_privcmd_open(xc_interface *xch)
     {
         PERROR("Could not obtain handle on privileged command interface "
                PRIVCMD_DEV);
-        return XC_OSDEP_OPEN_ERROR;
+        return -1
     }
 
     /*
@@ -73,27 +69,27 @@ static xc_osdep_handle freebsd_privcmd_open(xc_interface *xch)
         goto error;
     }
 
-    return (xc_osdep_handle)fd;
+    xch->privcmdfd = fd;
+    return 0;
 
  error:
     saved_errno = errno;
     close(fd);
     errno = saved_errno;
 
-    return XC_OSDEP_OPEN_ERROR;
+    return -1;
 }
 
-static int freebsd_privcmd_close(xc_interface *xch, xc_osdep_handle h)
+int osdep_privcmd_close(xc_interface *xch)
 {
-    int fd = (int)h;
-
+    int fd = xch->privcmdfd;
+    if ( fd == -1 )
+        return 0;
     return close(fd);
 }
 
 /*------------------------ Privcmd hypercall interface -----------------------*/
-static void *freebsd_privcmd_alloc_hypercall_buffer(xc_interface *xch,
-                                                    xc_osdep_handle h,
-                                                    int npages)
+void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
 {
     size_t size = npages * XC_PAGE_SIZE;
     void *p;
@@ -117,9 +113,7 @@ static void *freebsd_privcmd_alloc_hypercall_buffer(xc_interface *xch,
     return p;
 }
 
-static void freebsd_privcmd_free_hypercall_buffer(xc_interface *xch,
-                                                  xc_osdep_handle h, void *ptr,
-                                                  int npages)
+void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
 {
 
     int saved_errno = errno;
@@ -131,10 +125,9 @@ static void freebsd_privcmd_free_hypercall_buffer(xc_interface *xch,
     errno = saved_errno;
 }
 
-static int freebsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h,
-                                     privcmd_hypercall_t *hypercall)
+int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     int ret;
 
     ret = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
@@ -143,13 +136,12 @@ static int freebsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h,
 }
 
 /*----------------------- 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)
+void *xc_map_foreign_bulk(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err,
+                          unsigned int num)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     privcmd_mmapbatch_t ioctlx;
     void *addr;
     int rc;
@@ -180,10 +172,9 @@ static void *freebsd_privcmd_map_foreign_bulk(xc_interface *xch,
     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)
+void *xc_map_foreign_range(xc_interface *xch,
+                           uint32_t dom, int size, int prot,
+                           unsigned long mfn)
 {
     xen_pfn_t *arr;
     int num;
@@ -203,12 +194,11 @@ static void *freebsd_privcmd_map_foreign_range(xc_interface *xch,
     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)
+void *xc_map_foreign_ranges(xc_interface *xch,
+                            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;
@@ -232,42 +222,6 @@ static void *freebsd_privcmd_map_foreign_ranges(xc_interface *xch,
     return ret;
 }
 
-/*----------------------------- Privcmd handlers -----------------------------*/
-static struct xc_osdep_ops freebsd_privcmd_ops = {
-    .open = &freebsd_privcmd_open,
-    .close = &freebsd_privcmd_close,
-
-    .u.privcmd = {
-        .alloc_hypercall_buffer = &freebsd_privcmd_alloc_hypercall_buffer,
-        .free_hypercall_buffer = &freebsd_privcmd_free_hypercall_buffer,
-
-        .hypercall = &freebsd_privcmd_hypercall,
-
-        .map_foreign_bulk = &freebsd_privcmd_map_foreign_bulk,
-        .map_foreign_range = &freebsd_privcmd_map_foreign_range,
-        .map_foreign_ranges = &freebsd_privcmd_map_foreign_ranges,
-    },
-};
-
-/*---------------------------- 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;
-    default:
-        return NULL;
-    }
-}
-
-xc_osdep_info_t xc_osdep_info = {
-    .name = "FreeBSD Native OS interface",
-    .init = &freebsd_osdep_init,
-    .fake = 0,
-};
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_hcall_buf.c b/tools/libxc/xc_hcall_buf.c
index 4f4444c..517b5b4 100644
--- a/tools/libxc/xc_hcall_buf.c
+++ b/tools/libxc/xc_hcall_buf.c
@@ -122,7 +122,7 @@ void xc__hypercall_buffer_cache_release(xc_interface *xch)
     while ( xch->hypercall_buffer_cache_nr > 0 )
     {
         p = xch->hypercall_buffer_cache[--xch->hypercall_buffer_cache_nr];
-        xch->ops->u.privcmd.free_hypercall_buffer(xch, xch->ops_handle, p, 1);
+        osdep_free_hypercall_buffer(xch, p, 1);
     }
 
     hypercall_buffer_cache_unlock(xch);
@@ -133,7 +133,7 @@ void *xc__hypercall_buffer_alloc_pages(xc_interface *xch, xc_hypercall_buffer_t
     void *p = hypercall_buffer_cache_alloc(xch, nr_pages);
 
     if ( !p )
-        p = xch->ops->u.privcmd.alloc_hypercall_buffer(xch, xch->ops_handle, nr_pages);
+        p = osdep_alloc_hypercall_buffer(xch, nr_pages);
 
     if (!p)
         return NULL;
@@ -151,7 +151,7 @@ void xc__hypercall_buffer_free_pages(xc_interface *xch, xc_hypercall_buffer_t *b
         return;
 
     if ( !hypercall_buffer_cache_free(xch, b->hbuf, nr_pages) )
-        xch->ops->u.privcmd.free_hypercall_buffer(xch, xch->ops_handle, b->hbuf, nr_pages);
+        osdep_free_hypercall_buffer(xch, b->hbuf, nr_pages);
 }
 
 struct allocation_header {
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 9c318e0..9f4c707 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -33,13 +33,12 @@
 #include <xen/memory.h>
 
 #include "xenctrl.h"
-#include "xenctrlosdep.h"
 
 #include "xc_private.h"
 
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
-static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
+int osdep_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
     int fd = open("/dev/xen/privcmd", O_RDWR); /* prefer this newer interface */
@@ -53,7 +52,7 @@ static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
     if ( fd == -1 )
     {
         PERROR("Could not obtain handle on privileged command interface");
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
     }
 
     /* Although we return the file handle as the 'xc handle' the API
@@ -74,22 +73,25 @@ static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
         goto error;
     }
 
-    return (xc_osdep_handle)fd;
+    xch->privcmdfd = fd;
+    return 0;
 
  error:
     saved_errno = errno;
     close(fd);
     errno = saved_errno;
-    return XC_OSDEP_OPEN_ERROR;
+    return -1;
 }
 
-static int linux_privcmd_close(xc_interface *xch, xc_osdep_handle h)
+int osdep_privcmd_close(xc_interface *xch)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
+    if (fd == -1)
+        return 0;
     return close(fd);
 }
 
-static void *linux_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, int npages)
+void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
 {
     size_t size = npages * XC_PAGE_SIZE;
     void *p;
@@ -121,7 +123,7 @@ out:
     return NULL;
 }
 
-static void linux_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages)
+void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
 {
     int saved_errno = errno;
     /* Recover the VMA flags. Maybe it's not necessary */
@@ -132,9 +134,9 @@ static void linux_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_hand
     errno = saved_errno;
 }
 
-static int linux_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
+int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     return ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
 }
 
@@ -160,11 +162,11 @@ static int xc_map_foreign_batch_single(int fd, uint32_t dom,
     return rc;
 }
 
-static void *linux_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handle h,
-                                             uint32_t dom, int prot,
-                                             xen_pfn_t *arr, int num)
+void *xc_map_foreign_batch(xc_interface *xch,
+                           uint32_t dom, int prot,
+                           xen_pfn_t *arr, int num)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     privcmd_mmapbatch_t ioctlx;
     void *addr;
     int rc;
@@ -266,11 +268,11 @@ out:
     return rc;
 }
 
-static void *linux_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)
+void *xc_map_foreign_bulk(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err, unsigned int num)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     privcmd_mmapbatch_v2_t ioctlx;
     void *addr;
     unsigned int i;
@@ -390,9 +392,9 @@ static void *linux_privcmd_map_foreign_bulk(xc_interface *xch, xc_osdep_handle h
     return addr;
 }
 
-static void *linux_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
-                                             uint32_t dom, int size, int prot,
-                                             unsigned long mfn)
+void *xc_map_foreign_range(xc_interface *xch,
+                           uint32_t dom, int size, int prot,
+                           unsigned long mfn)
 {
     xen_pfn_t *arr;
     int num;
@@ -412,10 +414,10 @@ static void *linux_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle
     return ret;
 }
 
-static void *linux_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)
+void *xc_map_foreign_ranges(xc_interface *xch,
+                            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;
@@ -439,40 +441,6 @@ static void *linux_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handle
     return ret;
 }
 
-static struct xc_osdep_ops linux_privcmd_ops = {
-    .open = &linux_privcmd_open,
-    .close = &linux_privcmd_close,
-
-    .u.privcmd = {
-        .alloc_hypercall_buffer = &linux_privcmd_alloc_hypercall_buffer,
-        .free_hypercall_buffer = &linux_privcmd_free_hypercall_buffer,
-
-        .hypercall = &linux_privcmd_hypercall,
-
-        .map_foreign_batch = &linux_privcmd_map_foreign_batch,
-        .map_foreign_bulk = &linux_privcmd_map_foreign_bulk,
-        .map_foreign_range = &linux_privcmd_map_foreign_range,
-        .map_foreign_ranges = &linux_privcmd_map_foreign_ranges,
-    },
-};
-
-static struct xc_osdep_ops *linux_osdep_init(xc_interface *xch, enum xc_osdep_type type)
-{
-    switch ( type )
-    {
-    case XC_OSDEP_PRIVCMD:
-        return &linux_privcmd_ops;
-    default:
-        return NULL;
-    }
-}
-
-xc_osdep_info_t xc_osdep_info = {
-    .name = "Linux Native OS interface",
-    .init = &linux_osdep_init,
-    .fake = 0,
-};
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index 22d985c..047e13b 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -39,19 +39,20 @@ void minios_interface_close_fd(int fd);
 
 extern void minios_interface_close_fd(int fd);
 
-static xc_osdep_handle minios_privcmd_open(xc_interface *xch)
+int osdep_privcmd_open(xc_interface *xch)
 {
     int fd = alloc_fd(FTYPE_XC);
 
     if ( fd == -1)
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
 
-    return (xc_osdep_handle)fd;
+    xch->privcmdfd = fd;
+    return 0;
 }
 
-static int minios_privcmd_close(xc_interface *xch, xc_osdep_handle h)
+int osdep_privcmd_close(xc_interface *xch)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     return close(fd);
 }
 
@@ -60,17 +61,17 @@ void minios_interface_close_fd(int fd)
     files[fd].type = FTYPE_NONE;
 }
 
-static void *minios_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, int npages)
+void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
 {
     return xc_memalign(xch, PAGE_SIZE, npages * PAGE_SIZE);
 }
 
-static void minios_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages)
+void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
 {
     free(ptr);
 }
 
-static int minios_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
+int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
 {
     multicall_entry_t call;
     int i, ret;
@@ -92,21 +93,21 @@ static int minios_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcm
     return call.result;
 }
 
-static void *minios_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)
+void *xc_map_foreign_bulk(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err, unsigned int num)
 {
     unsigned long pt_prot = 0;
     if (prot & PROT_READ)
 	pt_prot = L1_PROT_RO;
     if (prot & PROT_WRITE)
 	pt_prot = L1_PROT;
-    return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);    
+    return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
 }
 
-static void *minios_privcmd_map_foreign_batch(xc_interface *xch,  xc_osdep_handle h,
-                                              uint32_t dom, int prot,
-                                              xen_pfn_t *arr, int num)
+void *xc_map_foreign_batch(xc_interface *xch,
+                           uint32_t dom, int prot,
+                           xen_pfn_t *arr, int num)
 {
     unsigned long pt_prot = 0;
     int err[num];
@@ -126,10 +127,10 @@ static void *minios_privcmd_map_foreign_batch(xc_interface *xch,  xc_osdep_handl
     return (void *) addr;
 }
 
-static void *minios_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
-                                              uint32_t dom,
-                                              int size, int prot,
-                                              unsigned long mfn)
+void *xc_map_foreign_range(xc_interface *xch,
+                           uint32_t dom,
+                           int size, int prot,
+                           unsigned long mfn)
 {
     unsigned long pt_prot = 0;
 
@@ -142,10 +143,10 @@ static void *minios_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle
     return map_frames_ex(&mfn, size / getpagesize(), 0, 1, 1, dom, NULL, pt_prot);
 }
 
-static void *minios_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)
+void *xc_map_foreign_ranges(xc_interface *xch,
+                            uint32_t dom,
+                            size_t size, int prot, size_t chunksize,
+                            privcmd_mmap_entry_t entries[], int nentries)
 {
     unsigned long *mfns;
     int i, j, n;
@@ -169,24 +170,6 @@ static void *minios_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handl
     return ret;
 }
 
-
-static struct xc_osdep_ops minios_privcmd_ops = {
-    .open = &minios_privcmd_open,
-    .close = &minios_privcmd_close,
-
-    .u.privcmd = {
-        .alloc_hypercall_buffer = &minios_privcmd_alloc_hypercall_buffer,
-        .free_hypercall_buffer = &minios_privcmd_free_hypercall_buffer,
-
-        .hypercall = &minios_privcmd_hypercall,
-
-        .map_foreign_batch = &minios_privcmd_map_foreign_batch,
-        .map_foreign_bulk = &minios_privcmd_map_foreign_bulk,
-        .map_foreign_range = &minios_privcmd_map_foreign_range,
-        .map_foreign_ranges = &minios_privcmd_map_foreign_ranges,
-    },
-};
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush)
 {
@@ -199,23 +182,6 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return memalign(alignment, size);
 }
 
-static struct xc_osdep_ops *minios_osdep_init(xc_interface *xch, enum xc_osdep_type type)
-{
-    switch ( type )
-    {
-    case XC_OSDEP_PRIVCMD:
-        return &minios_privcmd_ops;
-    default:
-        return NULL;
-    }
-}
-
-xc_osdep_info_t xc_osdep_info = {
-    .name = "Minios Native OS interface",
-    .init = &minios_osdep_init,
-    .fake = 0,
-};
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index fe4f0a1..9abb3b6 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -24,7 +24,7 @@
 #include <malloc.h>
 #include <sys/mman.h>
 
-static xc_osdep_handle netbsd_privcmd_open(xc_interface *xch)
+int osdep_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
     int fd = open("/kern/xen/privcmd", O_RDWR);
@@ -32,7 +32,7 @@ static xc_osdep_handle netbsd_privcmd_open(xc_interface *xch)
     if ( fd == -1 )
     {
         PERROR("Could not obtain handle on privileged command interface");
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
     }
 
     /* Although we return the file handle as the 'xc handle' the API
@@ -51,22 +51,23 @@ static xc_osdep_handle netbsd_privcmd_open(xc_interface *xch)
         goto error;
     }
 
-    return (xc_osdep_handle)fd;
+    xch->privcmdfd = fd;
+    return 0;
 
  error:
     saved_errno = errno;
     close(fd);
     errno = saved_errno;
-    return XC_OSDEP_OPEN_ERROR;
+    return -1;
 }
 
-static int netbsd_privcmd_close(xc_interface *xch, xc_osdep_handle h)
+int osdep_privcmd_close(xc_interface *xch)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     return close(fd);
 }
 
-static void *netbsd_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, int npages)
+void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
 {
     size_t size = npages * XC_PAGE_SIZE;
     void *p;
@@ -83,15 +84,15 @@ static void *netbsd_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_h
     return p;
 }
 
-static void netbsd_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages)
+void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
 {
     (void) munlock(ptr, npages * XC_PAGE_SIZE);
     free(ptr);
 }
 
-static int netbsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
+int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
 
     /*
@@ -106,11 +107,18 @@ static int netbsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcm
         return hypercall->retval;
 }
 
-static void *netbsd_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handle h,
-                                              uint32_t dom, int prot,
-                                              xen_pfn_t *arr, int num)
+void *xc_map_foreign_bulk(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err, unsigned int num)
 {
-    int fd = (int)h;
+    return xc_map_foreign_bulk_compat(xch, dom, prot, arr, err, num);
+}
+
+void *xc_map_foreign_batch(xc_interface *xch,
+                           uint32_t dom, int prot,
+                           xen_pfn_t *arr, int num)
+{
+    int fd = xch->privcmdfd;
     privcmd_mmapbatch_t ioctlx;
     void *addr;
     addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
@@ -135,12 +143,12 @@ static void *netbsd_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handle
 
 }
 
-static void *netbsd_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
-                                              uint32_t dom,
-                                              int size, int prot,
-                                              unsigned long mfn)
+void *xc_map_foreign_range(xc_interface *xch,
+                           uint32_t dom,
+                           int size, int prot,
+                           unsigned long mfn)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     privcmd_mmap_t ioctlx;
     privcmd_mmap_entry_t entry;
     void *addr;
@@ -167,12 +175,12 @@ static void *netbsd_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle
     return addr;
 }
 
-static void *netbsd_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)
+void *xc_map_foreign_ranges(xc_interface *xch,
+                            uint32_t dom,
+                            size_t size, int prot, size_t chunksize,
+                            privcmd_mmap_entry_t entries[], int nentries)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
 	privcmd_mmap_t ioctlx;
 	int i, rc;
 	void *addr;
@@ -205,23 +213,6 @@ mmap_failed:
 	return NULL;
 }
 
-static struct xc_osdep_ops netbsd_privcmd_ops = {
-    .open = &netbsd_privcmd_open,
-    .close = &netbsd_privcmd_close,
-
-    .u.privcmd = {
-        .alloc_hypercall_buffer = &netbsd_privcmd_alloc_hypercall_buffer,
-        .free_hypercall_buffer = &netbsd_privcmd_free_hypercall_buffer,
-
-        .hypercall = &netbsd_privcmd_hypercall,
-
-        .map_foreign_batch = &netbsd_privcmd_map_foreign_batch,
-        .map_foreign_bulk = &xc_map_foreign_bulk_compat,
-        .map_foreign_range = &netbsd_privcmd_map_foreign_range,
-        .map_foreign_ranges = &netbsd_privcmd_map_foreign_ranges,
-    },
-};
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
@@ -262,23 +253,6 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return valloc(size);
 }
 
-static struct xc_osdep_ops *netbsd_osdep_init(xc_interface *xch, enum xc_osdep_type type)
-{
-    switch ( type )
-    {
-    case XC_OSDEP_PRIVCMD:
-        return &netbsd_privcmd_ops;
-    default:
-        return NULL;
-    }
-}
-
-xc_osdep_info_t xc_osdep_info = {
-    .name = "Netbsd Native OS interface",
-    .init = &netbsd_osdep_init,
-    .fake = 0,
-};
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 85e6f02..de5873e 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -26,111 +26,12 @@
 #include <pthread.h>
 #include <assert.h>
 
-#ifndef __MINIOS__
-#include <dlfcn.h>
-#endif
-
-#define XENCTRL_OSDEP "XENCTRL_OSDEP"
-
-#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__) && !defined(__RUMPRUN__)
-#define DO_DYNAMIC_OSDEP
-#endif
-
-/*
- * Returns a (shallow) copy of the xc_osdep_info_t for the
- * active OS interface.
- *
- * On success a handle to the relevant library is opened.  The user
- * must subsequently call xc_osdep_put_info() when it is
- * finished with the library.
- *
- * Logs IFF xch != NULL.
- *
- * Returns:
- *  0 - on success
- * -1 - on error
- */
-static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info)
-{
-    int rc = -1;
-#ifdef DO_DYNAMIC_OSDEP
-    const char *lib = getenv(XENCTRL_OSDEP);
-    xc_osdep_info_t *pinfo;
-    void *dl_handle = NULL;
-
-    if ( lib != NULL )
-    {
-        if ( getuid() != geteuid() )
-        {
-            if ( xch ) ERROR("cannot use %s=%s with setuid application", XENCTRL_OSDEP, lib);
-            abort();
-        }
-        if ( getgid() != getegid() )
-        {
-            if ( xch ) ERROR("cannot use %s=%s with setgid application", XENCTRL_OSDEP, lib);
-            abort();
-        }
-
-        dl_handle = dlopen(lib, RTLD_LAZY|RTLD_LOCAL);
-        if ( !dl_handle )
-        {
-            if ( xch ) ERROR("unable to open osdep library %s: %s", lib, dlerror());
-            goto out;
-        }
-
-        pinfo = dlsym(dl_handle, "xc_osdep_info");
-        if ( !pinfo )
-        {
-            if ( xch ) ERROR("unable to find xc_osinteface_info in %s: %s", lib, dlerror());
-            goto out;
-        }
-
-        *info = *pinfo;
-        info->dl_handle = dl_handle;
-    }
-    else
-#endif /*DO_DYNAMIC_OSDEP*/
-    {
-        *info = xc_osdep_info;
-        info->dl_handle = NULL;
-    }
-
-    rc = 0;
-
-#ifdef DO_DYNAMIC_OSDEP
-out:
-    if ( dl_handle && rc == -1 )
-        dlclose(dl_handle);
-#endif /*DO_DYNAMIC_OSDEP*/
-
-    return rc;
-}
-
-static void xc_osdep_put(xc_osdep_info_t *info)
-{
-#ifdef DO_DYNAMIC_OSDEP
-    if ( info->dl_handle )
-        dlclose(info->dl_handle);
-#endif /*DO_DYNAMIC_OSDEP*/
-}
-
-static const char *xc_osdep_type_name(enum xc_osdep_type type)
-{
-    switch ( type )
-    {
-    case XC_OSDEP_PRIVCMD: return "privcmd";
-    }
-    return "unknown";
-}
-
-static struct xc_interface_core *xc_interface_open_common(xentoollog_logger *logger,
-                                                          xentoollog_logger *dombuild_logger,
-                                                          unsigned open_flags,
-                                                          enum xc_osdep_type type)
+struct xc_interface_core *xc_interface_open(xentoollog_logger *logger,
+                                            xentoollog_logger *dombuild_logger,
+                                            unsigned open_flags)
 {
     struct xc_interface_core xch_buf, *xch = &xch_buf;
 
-    xch->type = type;
     xch->flags = open_flags;
     xch->dombuild_logger_file = 0;
     xc_clear_last_error(xch);
@@ -148,9 +49,6 @@ static struct xc_interface_core *xc_interface_open_common(xentoollog_logger *log
     xch->hypercall_buffer_cache_misses = 0;
     xch->hypercall_buffer_cache_toobig = 0;
 
-    xch->ops_handle = XC_OSDEP_OPEN_ERROR;
-    xch->ops = NULL;
-
     if (!xch->error_handler) {
         xch->error_handler = xch->error_handler_tofree =
             (xentoollog_logger*)
@@ -168,40 +66,26 @@ static struct xc_interface_core *xc_interface_open_common(xentoollog_logger *log
     *xch = xch_buf;
 
     if (!(open_flags & XC_OPENFLAG_DUMMY)) {
-        if ( xc_osdep_get_info(xch, &xch->osdep) < 0 )
+        if ( osdep_privcmd_open(xch) < 0 )
             goto err;
-
-        xch->ops = xch->osdep.init(xch, type);
-        if ( xch->ops == NULL )
-        {
-            DPRINTF("OSDEP: interface %d (%s) not supported on this platform",
-                  type, xc_osdep_type_name(type));
-            goto err_put_iface;
-        }
-
-        xch->ops_handle = xch->ops->open(xch);
-        if (xch->ops_handle == XC_OSDEP_OPEN_ERROR)
-            goto err_put_iface;
     }
 
     return xch;
 
-err_put_iface:
-    xc_osdep_put(&xch->osdep);
  err:
     xtl_logger_destroy(xch->error_handler_tofree);
     if (xch != &xch_buf) free(xch);
     return NULL;
 }
 
-static int xc_interface_close_common(xc_interface *xch)
+int xc_interface_close(xc_interface *xch)
 {
     int rc = 0;
 
     if (!xch)
-	return 0;
+        return 0;
 
-    rc = xch->ops->close(xch, xch->ops_handle);
+    rc = osdep_privcmd_close(xch);
     if (rc) PERROR("Could not close hypervisor interface");
 
     xc__hypercall_buffer_cache_release(xch);
@@ -213,42 +97,6 @@ static int xc_interface_close_common(xc_interface *xch)
     return rc;
 }
 
-int xc_interface_is_fake(void)
-{
-    xc_osdep_info_t info;
-
-    if ( xc_osdep_get_info(NULL, &info) < 0 )
-        return -1;
-
-    /* Have a copy of info so can release the interface now. */
-    xc_osdep_put(&info);
-
-    return info.fake;
-}
-
-xc_interface *xc_interface_open(xentoollog_logger *logger,
-                                xentoollog_logger *dombuild_logger,
-                                unsigned open_flags)
-{
-    xc_interface *xch;
-
-    xch = xc_interface_open_common(logger, dombuild_logger, open_flags,
-                                   XC_OSDEP_PRIVCMD);
-
-    return xch;
-}
-
-int xc_interface_close(xc_interface *xch)
-{
-    return xc_interface_close_common(xch);
-}
-
-
-int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
-{
-    return xch->ops->u.privcmd.hypercall(xch, xch->ops_handle, hypercall);
-}
-
 static pthread_key_t errbuf_pkey;
 static pthread_once_t errbuf_pkey_once = PTHREAD_ONCE_INIT;
 
@@ -335,14 +183,6 @@ void xc_report_error(xc_interface *xch, int code, const char *fmt, ...)
     va_end(args);
 }
 
-void xc_osdep_log(xc_interface *xch, xentoollog_level level, int code, const char *fmt, ...)
-{
-    va_list args;
-    va_start(args, fmt);
-    xc_reportv(xch, xch->error_handler, level, code, fmt, args);
-    va_end(args);
-}
-
 const char *xc_set_progress_prefix(xc_interface *xch, const char *doing)
 {
     const char *old = xch->currently_progress_reporting;
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index a32accb..30157cf 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -30,7 +30,6 @@
 
 #include "_paths.h"
 #include "xenctrl.h"
-#include "xenctrlosdep.h"
 
 #include <xen/sys/privcmd.h>
 
@@ -88,7 +87,6 @@ struct iovec {
 #define MAX_PAGECACHE_USAGE (4*1024)
 
 struct xc_interface_core {
-    enum xc_osdep_type type;
     int flags;
     xentoollog_logger *error_handler,   *error_handler_tofree;
     xentoollog_logger *dombuild_logger, *dombuild_logger_tofree;
@@ -117,12 +115,21 @@ struct xc_interface_core {
     int hypercall_buffer_cache_misses;
     int hypercall_buffer_cache_toobig;
 
-    /* Low lovel OS interface */
-    xc_osdep_info_t  osdep;
-    xc_osdep_ops    *ops; /* backend operations */
-    xc_osdep_handle  ops_handle; /* opaque data for xc_osdep_ops */
+    /* Privcmd interface */
+    int privcmdfd;
 };
 
+int osdep_privcmd_open(xc_interface *xch);
+int osdep_privcmd_close(xc_interface *xch);
+
+void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages);
+void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages);
+
+/* Stub for not yet converted OSes */
+void *xc_map_foreign_bulk_compat(xc_interface *xch,
+                                 uint32_t dom, int prot,
+                                 const xen_pfn_t *arr, int *err, unsigned int num);
+
 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,
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index ed7987c..6f84b82 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -24,7 +24,7 @@
 #include <fcntl.h>
 #include <malloc.h>
 
-static xc_osdep_handle solaris_privcmd_open(xc_interface *xch)
+int osdep_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
     int fd = open("/dev/xen/privcmd", O_RDWR);
@@ -32,7 +32,7 @@ static xc_osdep_handle solaris_privcmd_open(xc_interface *xch)
     if ( fd == -1 )
     {
         PERROR("Could not obtain handle on privileged command interface");
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
     }
 
     /* Although we return the file handle as the 'xc handle' the API
@@ -51,42 +51,43 @@ static xc_osdep_handle solaris_privcmd_open(xc_interface *xch)
         goto error;
     }
 
-    return (xc_osdep_handle)fd;
+    xch->privcmdfd = fd;
+    return 0;
 
  error:
     saved_errno = errno;
     close(fd);
     errno = saved_errno;
-    return XC_OSDEP_OPEN_ERROR;
+    return -1;
 }
 
-static int solaris_privcmd_close(xc_interface *xch, xc_osdep_handle h)
+int osdep_privcmd_close(xc_interface *xch)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     return close(fd);
 }
 
-static void *solaris_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, int npages)
+void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
 {
     return xc_memalign(xch, XC_PAGE_SIZE, npages * XC_PAGE_SIZE);
 }
 
-static void solaris_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages)
+static void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
 {
     free(ptr);
 }
 
-static int solaris_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
+int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     return ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
 }
 
-static void *solaris_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handle h,
-                                               uint32_t dom, int prot,
-                                               xen_pfn_t *arr, int num)
+void *xc_map_foreign_batch(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          xen_pfn_t *arr, int num)
 {
-    int fd = (int)h;
+    int fd = xch->privcmdfd;
     privcmd_mmapbatch_t ioctlx;
     void *addr;
     addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_SHARED, fd, 0);
@@ -109,12 +110,19 @@ static void *solaris_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handl
 
 }
 
-static void *xc_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
-                                  uint32_t dom,
-                                  int size, int prot,
-                                  unsigned long mfn)
+void *xc_map_foreign_bulk(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err, unsigned int num)
 {
-    int fd = (int)fd;
+    return xc_map_foreign_bulk_compat(xch, dom, prot, arr, err, num);
+}
+
+void *xc_map_foreign_range(xc_interface *xch,
+                           uint32_t dom,
+                           int size, int prot,
+                           unsigned long mfn)
+{
+    int fd = xch->privcmdfd;
     privcmd_mmap_t ioctlx;
     privcmd_mmap_entry_t entry;
     void *addr;
@@ -138,12 +146,12 @@ static void *xc_map_foreign_range(xc_interface *xch, xc_osdep_handle h,
     return addr;
 }
 
-static void *solaric_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)
+void *xc_map_foreign_ranges(xc_interface *xch,
+                            uint32_t dom,
+                            size_t size, int prot, size_t chunksize,
+                            privcmd_mmap_entry_t entries[], int nentries)
 {
-    int fd = (int)fd;
+    int fd = xch->privcmdfd;
     privcmd_mmap_t ioctlx;
     int i, rc;
     void *addr;
@@ -176,23 +184,6 @@ mmap_failed:
     return NULL;
 }
 
-static struct xc_osdep_ops solaris_privcmd_ops = {
-    .open = &solaris_privcmd_open,
-    .close = &solaris_privcmd_close,
-
-    .u.privcmd = {
-        .alloc_hypercall_buffer = &solaris_privcmd_alloc_hypercall_buffer,
-        .free_hypercall_buffer = &solaris_privcmd_free_hypercall_buffer,
-
-        .hypercall = &solaris_privcmd_hypercall;
-
-        .map_foreign_batch = &solaris_privcmd_map_foreign_batch,
-        .map_foreign_bulk = &xc_map_foreign_bulk_compat,
-        .map_foreign_range = &solaris_privcmd_map_foreign_range,
-        .map_foreign_ranges = &solaris_privcmd_map_foreign_ranges,
-    },
-};
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
@@ -204,23 +195,6 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return memalign(alignment, size);
 }
 
-static struct xc_osdep_ops *solaris_osdep_init(xc_interface *xch, enum xc_osdep_type type)
-{
-    switch ( type )
-    {
-    case XC_OSDEP_PRIVCMD:
-        return &solaris_privcmd_ops;
-    default:
-        return NULL;
-    }
-}
-
-xc_osdep_info_t xc_osdep_info = {
-    .name = "Solaris Native OS interface",
-    .init = &solaris_osdep_init,
-    .fake = 0,
-};
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xenctrl_osdep_ENOSYS.c b/tools/libxc/xenctrl_osdep_ENOSYS.c
deleted file mode 100644
index 5182532..0000000
--- a/tools/libxc/xenctrl_osdep_ENOSYS.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* Dummy backend which just logs and returns ENOSYS. */
-
-#include <errno.h>
-#include <inttypes.h>
-#include <stdlib.h>
-
-#include "xenctrl.h"
-#include "xenctrlosdep.h"
-
-#define IPRINTF(_x, _f, _a...) xc_osdep_log(_x,XTL_INFO,0, _f , ## _a)
-
-#define ERROR(_x, _m, _a...)  xc_osdep_log(_x,XTL_ERROR,XC_INTERNAL_ERROR,_m , ## _a )
-#define PERROR(_x, _m, _a...) xc_osdep_log(_x,XTL_ERROR,XC_INTERNAL_ERROR,_m \
-                  " (%d = %s)", ## _a , errno, xc_strerror(xch, errno))
-
-static xc_osdep_handle ENOSYS_privcmd_open(xc_interface *xch)
-{
-    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 %lx\n", h);
-    return 0;
-}
-
-static int ENOSYS_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
-{
-#if defined(__FreeBSD__) || defined(__NetBSD__)
-    IPRINTF(xch, "ENOSYS_privcmd %lx: hypercall: %02lu(%#lx,%#lx,%#lx,%#lx,%#lx)\n",
-#else
-    IPRINTF(xch, "ENOSYS_privcmd %lx: hypercall: %02lld(%#llx,%#llx,%#llx,%#llx,%#llx)\n",
-#endif
-            h, hypercall->op,
-            hypercall->arg[0], hypercall->arg[1], hypercall->arg[2],
-            hypercall->arg[3], hypercall->arg[4]);
-    return -ENOSYS;
-}
-
-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 %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 %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 %lx map_foreign_range: dom%d size %#x prot %#x mfn %ld\n", h, dom, size, prot, mfn);
-    return MAP_FAILED;
-}
-
-static void *ENOSYS_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)
-{
-    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;
-}
-
-static struct xc_osdep_ops ENOSYS_privcmd_ops =
-{
-    .open      = &ENOSYS_privcmd_open,
-    .close     = &ENOSYS_privcmd_close,
-    .u.privcmd   = {
-        .hypercall = &ENOSYS_privcmd_hypercall,
-
-        .map_foreign_batch = &ENOSYS_privcmd_map_foreign_batch,
-        .map_foreign_bulk = &ENOSYS_privcmd_map_foreign_bulk,
-        .map_foreign_range = &ENOSYS_privcmd_map_foreign_range,
-        .map_foreign_ranges = &ENOSYS_privcmd_map_foreign_ranges,
-    }
-};
-
-static struct xc_osdep_ops * ENOSYS_osdep_init(xc_interface *xch, enum xc_osdep_type type)
-{
-    struct xc_osdep_ops *ops;
-
-    if (getenv("ENOSYS") == NULL)
-    {
-        PERROR(xch, "ENOSYS: not configured\n");
-        return NULL;
-    }
-
-    switch ( type )
-    {
-    case XC_OSDEP_PRIVCMD:
-        ops = &ENOSYS_privcmd_ops;
-        break;
-    default:
-        ops = NULL;
-        break;
-    }
-
-    IPRINTF(xch, "ENOSYS_osdep_init: initialising handle ops at %p\n", ops);
-
-    return ops;
-}
-
-xc_osdep_info_t xc_osdep_info = {
-    .name = "Pessimistic ENOSYS OS interface",
-    .init = &ENOSYS_osdep_init,
-    .fake = 1,
-};
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index 41d228d..58a53a1 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -108,8 +108,6 @@ external sizeof_xen_pfn: unit -> int = "stub_sizeof_xen_pfn"
 external interface_open: unit -> handle = "stub_xc_interface_open"
 external interface_close: handle -> unit = "stub_xc_interface_close"
 
-external is_fake: unit -> bool = "stub_xc_interface_is_fake"
-
 let with_intf f =
 	let xc = interface_open () in
 	let r = try f xc with exn -> interface_close xc; raise exn in
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index b4a175b..16443df 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -72,7 +72,6 @@ external sizeof_vcpu_guest_context : unit -> int
   = "stub_sizeof_vcpu_guest_context"
 external sizeof_xen_pfn : unit -> int = "stub_sizeof_xen_pfn"
 external interface_open : unit -> handle = "stub_xc_interface_open"
-external is_fake : unit -> bool = "stub_xc_interface_is_fake"
 external interface_close : handle -> unit = "stub_xc_interface_close"
 val with_intf : (handle -> 'a) -> 'a
 val domain_create : handle -> int32 -> domain_create_flag list -> string -> domid
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 393156c..e2fa7e4 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -126,13 +126,6 @@ CAMLprim value stub_xc_interface_open(void)
 }
 
 
-CAMLprim value stub_xc_interface_is_fake(void)
-{
-	CAMLparam0();
-	int is_fake = xc_interface_is_fake();
-	CAMLreturn(Val_int(is_fake));
-}
-
 CAMLprim value stub_xc_interface_close(value xch)
 {
 	CAMLparam1(xch);
diff --git a/tools/ocaml/xenstored/domains.ml b/tools/ocaml/xenstored/domains.ml
index 92e438f..395f3a9 100644
--- a/tools/ocaml/xenstored/domains.ml
+++ b/tools/ocaml/xenstored/domains.ml
@@ -65,11 +65,9 @@ let create xc doms domid mfn port =
 	Domain.bind_interdomain dom;
 	dom
 
-let create0 fake doms =
+let create0 doms =
 	let port, interface =
-		if fake then (
-			0, Xenctrl.with_intf (fun xc -> Xenctrl.map_foreign_range xc 0 (Xenmmap.getpagesize()) 0n)
-		) else (
+		(
 			let port = Utils.read_file_single_integer Define.xenstored_proc_port
 			and fd = Unix.openfile Define.xenstored_proc_kva
 					       [ Unix.O_RDWR ] 0o600 in
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 42b8183..25c126a 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -176,7 +176,7 @@ let from_channel store cons doms chan =
 			if domid > 0 then
 				Domains.create xc doms domid mfn port
 			else
-				Domains.create0 false doms
+				Domains.create0 doms
 			in
 		Connections.add_domain cons ndom;
 		in
@@ -278,8 +278,7 @@ let _ =
 			Store.mkdir store (Perms.Connection.create 0) localpath;
 
 		if cf.domain_init then (
-			let usingxiu = Xenctrl.is_fake () in
-			Connections.add_domain cons (Domains.create0 usingxiu domains);
+			Connections.add_domain cons (Domains.create0 domains);
 			Event.bind_dom_exc_virq eventchn
 		);
 	);
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:15:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:15: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 1aON84-0000Xg-0p; Wed, 27 Jan 2016 10:15:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON82-0000X9-S3
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:11 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	86/25-31122-EA898A65; Wed, 27 Jan 2016 10:15:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1453889686!11938913!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52030 invoked from network); 27 Jan 2016 10:15:02 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:02 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8T-0001vm-EW
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7b-0001Jf-6U
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:43 +0000
Date: Wed, 27 Jan 2016 10:14:43 +0000
Message-Id: <E1aON7b-0001Jf-6U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Remove osdep indirection
	for xc_gnt{shr, tab}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 05e88ac015c03f642d260c2b3ac187f964d6b474
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 11 17:39:00 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:21:39 2016 +0000

    tools/libxc: Remove osdep indirection for xc_gnt{shr,tab}
    
    The alternative backend (a xen-api/xapi shim) is no longer around and
    so this stuff is now just baggage which is getting in the way of
    refactoring libxenctrl.
    
    Nested virt probably suffices for this use case now.
    
    It is now necessary to provide explicit versions of things for
    platforms which do not implement this functionality, since the osdep
    dispatcher cannot fulfil this need any more. These are provided by
    appropriate xc_nognt???.c files which are compiled and linked on the
    appropriate platforms. In them open and close return failure and
    everything else aborts, since if open fails they should never be
    called.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/Makefile               |   10 ++--
 tools/libxc/include/xenctrl.h      |    4 +-
 tools/libxc/include/xenctrlosdep.h |   23 -------
 tools/libxc/xc_gnttab.c            |   57 ++++-------------
 tools/libxc/xc_linux_osdep.c       |  119 ++++++++++++++----------------------
 tools/libxc/xc_minios.c            |   51 ++++++----------
 tools/libxc/xc_nogntshr.c          |   46 ++++++++++++++
 tools/libxc/xc_nognttab.c          |   50 +++++++++++++++
 tools/libxc/xc_private.c           |   83 ++++++++++++++++++++-----
 tools/libxc/xc_private.h           |   24 +++++++
 10 files changed, 274 insertions(+), 193 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index b8fc6a5..184cbb7 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -43,11 +43,11 @@ CTRL_SRCS-y       += xc_resource.c
 CTRL_SRCS-$(CONFIG_X86) += xc_psr.c
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c xc_linux_osdep.c
-CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c xc_freebsd_osdep.c
-CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
-CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
-CTRL_SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c
-CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
+CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c xc_freebsd_osdep.c xc_nognttab.c xc_nogntshr.c
+CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c xc_nognttab.c xc_nogntshr.c
+CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c xc_nognttab.c xc_nogntshr.c
+CTRL_SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c xc_nognttab.c xc_nogntshr.c
+CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c xc_nogntshr.c
 CTRL_SRCS-y       += xc_evtchn_compat.c
 
 GUEST_SRCS-y :=
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 53f3033..513aaa3 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -117,8 +117,8 @@
  */
 
 typedef struct xc_interface_core xc_interface;
-typedef struct xc_interface_core xc_gnttab;
-typedef struct xc_interface_core xc_gntshr;
+typedef struct xengntdev_handle xc_gnttab;
+typedef struct xengntdev_handle xc_gntshr;
 
 enum xc_error_code {
   XC_ERROR_NONE = 0,
diff --git a/tools/libxc/include/xenctrlosdep.h b/tools/libxc/include/xenctrlosdep.h
index 89564e1..423660d 100644
--- a/tools/libxc/include/xenctrlosdep.h
+++ b/tools/libxc/include/xenctrlosdep.h
@@ -51,8 +51,6 @@
 
 enum xc_osdep_type {
     XC_OSDEP_PRIVCMD,
-    XC_OSDEP_GNTTAB,
-    XC_OSDEP_GNTSHR,
 };
 
 /* Opaque handle internal to the backend */
@@ -88,27 +86,6 @@ struct xc_osdep_ops
                                         size_t chunksize, privcmd_mmap_entry_t entries[],
                                         int nentries);
         } privcmd;
-        struct {
-#define XC_GRANT_MAP_SINGLE_DOMAIN 0x1
-            void *(*grant_map)(xc_gnttab *xcg, xc_osdep_handle h,
-                               uint32_t count, int flags, int prot,
-                               uint32_t *domids, uint32_t *refs,
-                               uint32_t notify_offset,
-                               evtchn_port_t notify_port);
-            int (*munmap)(xc_gnttab *xcg, xc_osdep_handle h,
-                          void *start_address,
-                          uint32_t count);
-            int (*set_max_grants)(xc_gnttab *xcg, xc_osdep_handle h, uint32_t count);
-        } gnttab;
-        struct {
-            void *(*share_pages)(xc_gntshr *xcg, xc_osdep_handle h,
-                                 uint32_t domid, int count,
-                                 uint32_t *refs, int writable,
-                                 uint32_t notify_offset,
-                                 evtchn_port_t notify_port);
-            int (*munmap)(xc_gntshr *xcg, xc_osdep_handle h,
-                          void *start_address, uint32_t count);
-        } gntshr;
     } u;
 };
 typedef struct xc_osdep_ops xc_osdep_ops;
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index 60335d8..a51f405 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -143,68 +143,48 @@ grant_entry_v2_t *xc_gnttab_map_table_v2(xc_interface *xch, int domid,
     return _gnttab_map_table(xch, domid, gnt_num);
 }
 
-void *xc_gnttab_map_grant_ref(xc_gnttab *xcg,
+void *xc_gnttab_map_grant_ref(xc_gnttab *xgt,
                               uint32_t domid,
                               uint32_t ref,
                               int prot)
 {
-	return xcg->ops->u.gnttab.grant_map(xcg, xcg->ops_handle, 1, 0, prot,
-	                                    &domid, &ref, -1, -1);
+    return osdep_gnttab_grant_map(xgt, 1, 0, prot, &domid, &ref, -1, -1);
 }
 
-void *xc_gnttab_map_grant_refs(xc_gnttab *xcg,
+void *xc_gnttab_map_grant_refs(xc_gnttab *xgt,
                                uint32_t count,
                                uint32_t *domids,
                                uint32_t *refs,
                                int prot)
 {
-	return xcg->ops->u.gnttab.grant_map(xcg, xcg->ops_handle, count, 0,
-	                                    prot, domids, refs, -1, -1);
+    return osdep_gnttab_grant_map(xgt, count, 0, prot, domids, refs, -1, -1);
 }
 
-void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xcg,
+void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xgt,
                                       uint32_t count,
                                       uint32_t domid,
                                       uint32_t *refs,
                                       int prot)
 {
-	return xcg->ops->u.gnttab.grant_map(xcg, xcg->ops_handle, count,
-	                                    XC_GRANT_MAP_SINGLE_DOMAIN,
-	                                    prot, &domid, refs, -1, -1);
+    return osdep_gnttab_grant_map(xgt, count, XC_GRANT_MAP_SINGLE_DOMAIN,
+                                  prot, &domid, refs, -1, -1);
 }
 
-void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xcg,
+void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xgt,
                                      uint32_t domid,
                                      uint32_t ref,
                                      int prot,
                                      uint32_t notify_offset,
                                      evtchn_port_t notify_port)
 {
-	return xcg->ops->u.gnttab.grant_map(xcg, xcg->ops_handle, 1, 0, prot,
-	                              &domid, &ref, notify_offset, notify_port);
-}
-
-
-int xc_gnttab_munmap(xc_gnttab *xcg,
-                     void *start_address,
-                     uint32_t count)
-{
-	return xcg->ops->u.gnttab.munmap(xcg, xcg->ops_handle,
-					 start_address, count);
-}
-
-int xc_gnttab_set_max_grants(xc_gnttab *xcg, uint32_t count)
-{
-	if (!xcg->ops->u.gnttab.set_max_grants)
-		return 0;
-	return xcg->ops->u.gnttab.set_max_grants(xcg, xcg->ops_handle, count);
+    return osdep_gnttab_grant_map(xgt, 1, 0, prot,  &domid, &ref,
+                                  notify_offset, notify_port);
 }
 
 void *xc_gntshr_share_pages(xc_gntshr *xcg, uint32_t domid,
                             int count, uint32_t *refs, int writable)
 {
-	return xcg->ops->u.gntshr.share_pages(xcg, xcg->ops_handle, domid,
-	                                      count, refs, writable, -1, -1);
+    return osdep_gntshr_share_pages(xcg, domid, count, refs, writable, -1, -1);
 }
 
 void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
@@ -212,22 +192,11 @@ void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
                                   uint32_t notify_offset,
                                   evtchn_port_t notify_port)
 {
-	return xcg->ops->u.gntshr.share_pages(xcg, xcg->ops_handle,
-			domid, 1, ref, writable, notify_offset, notify_port);
+    return osdep_gntshr_share_pages(xcg, domid, 1, ref, writable,
+                                    notify_offset, notify_port);
 }
 
 /*
- * Unmaps the @count pages starting at @start_address, which were mapped by a
- * call to xc_gntshr_share_*. Never logs.
- */
-int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count)
-{
-	return xcg->ops->u.gntshr.munmap(xcg, xcg->ops_handle,
-					 start_address, count);
-}
-
-
-/*
  * Local variables:
  * mode: C
  * c-file-style: "BSD"
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 65299d0..6b329ce 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -41,6 +41,9 @@
 
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
+#define GTERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gnttab", _f)
+#define GSERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gntshr", _f)
+
 static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
@@ -460,26 +463,26 @@ static struct xc_osdep_ops linux_privcmd_ops = {
 
 #define DEVXEN "/dev/xen/"
 
-static xc_osdep_handle linux_gnttab_open(xc_gnttab *xcg)
+int osdep_gnttab_open(xc_gnttab *xgt)
 {
     int fd = open(DEVXEN "gntdev", O_RDWR);
-
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
-
-    return (xc_osdep_handle)fd;
+        return -1;
+    xgt->fd = fd;
+    return 0;
 }
 
-static int linux_gnttab_close(xc_gnttab *xcg, xc_osdep_handle h)
+int osdep_gnttab_close(xc_gnttab *xgt)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xgt->fd == -1 )
+        return 0;
+
+    return close(xgt->fd);
 }
 
-static int linux_gnttab_set_max_grants(xc_gnttab *xch, xc_osdep_handle h,
-                                       uint32_t count)
+int xc_gnttab_set_max_grants(xc_gnttab *xgt, uint32_t count)
 {
-    int fd = (int)h, rc;
+    int fd = xgt->fd, rc;
     struct ioctl_gntdev_set_max_grants max_grants = { .count = count };
 
     rc = ioctl(fd, IOCTL_GNTDEV_SET_MAX_GRANTS, &max_grants);
@@ -491,19 +494,19 @@ static int linux_gnttab_set_max_grants(xc_gnttab *xch, xc_osdep_handle h,
         if (errno == ENOTTY)
             rc = 0;
         else
-            PERROR("linux_gnttab_set_max_grants: ioctl SET_MAX_GRANTS failed");
+            GTERROR(xgt->logger, "ioctl SET_MAX_GRANTS failed");
     }
 
     return rc;
 }
 
-static void *linux_gnttab_grant_map(xc_gnttab *xch, xc_osdep_handle h,
-                                    uint32_t count, int flags, int prot,
-                                    uint32_t *domids, uint32_t *refs,
-                                    uint32_t notify_offset,
-                                    evtchn_port_t notify_port)
+void *osdep_gnttab_grant_map(xc_gnttab *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port)
 {
-    int fd = (int)h;
+    int fd = xgt->fd;
     struct ioctl_gntdev_map_grant_ref *map;
     unsigned int map_size = ROUNDUP((sizeof(*map) + (count - 1) *
                                     sizeof(struct ioctl_gntdev_map_grant_ref)),
@@ -524,7 +527,7 @@ static void *linux_gnttab_grant_map(xc_gnttab *xch, xc_osdep_handle h,
                    MAP_PRIVATE | MAP_ANON | MAP_POPULATE, -1, 0);
         if ( map == MAP_FAILED )
         {
-            PERROR("linux_gnttab_grant_map: mmap of map failed");
+            GTERROR(xgt->logger, "mmap of map failed");
             return NULL;
         }
     }
@@ -538,7 +541,7 @@ static void *linux_gnttab_grant_map(xc_gnttab *xch, xc_osdep_handle h,
     map->count = count;
 
     if ( ioctl(fd, IOCTL_GNTDEV_MAP_GRANT_REF, map) ) {
-        PERROR("linux_gnttab_grant_map: ioctl MAP_GRANT_REF failed");
+        GTERROR(xgt->logger, "ioctl MAP_GRANT_REF failed");
         goto out;
     }
 
@@ -577,7 +580,7 @@ static void *linux_gnttab_grant_map(xc_gnttab *xch, xc_osdep_handle h,
         if (notify.action)
             rv = ioctl(fd, IOCTL_GNTDEV_SET_UNMAP_NOTIFY, &notify);
         if (rv) {
-            PERROR("linux_gnttab_grant_map: ioctl SET_UNMAP_NOTIFY failed");
+            GTERROR(xgt->logger, "ioctl SET_UNMAP_NOTIFY failed");
             munmap(addr, count * XC_PAGE_SIZE);
             addr = MAP_FAILED;
         }
@@ -589,7 +592,7 @@ static void *linux_gnttab_grant_map(xc_gnttab *xch, xc_osdep_handle h,
         struct ioctl_gntdev_unmap_grant_ref unmap_grant;
 
         /* Unmap the driver slots used to store the grant information. */
-        PERROR("xc_gnttab_map_grant_refs: mmap failed");
+        GTERROR(xgt->logger, "mmap failed");
         unmap_grant.index = map->index;
         unmap_grant.count = count;
         ioctl(fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant);
@@ -604,12 +607,9 @@ static void *linux_gnttab_grant_map(xc_gnttab *xch, xc_osdep_handle h,
     return addr;
 }
 
-
-
-static int linux_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
-                               void *start_address, uint32_t count)
+int xc_gnttab_munmap(xc_gnttab *xgt, void *start_address, uint32_t count)
 {
-    int fd = (int)h;
+    int fd = xgt->fd;
     struct ioctl_gntdev_get_offset_for_vaddr get_offset;
     struct ioctl_gntdev_unmap_grant_ref unmap_grant;
     int rc;
@@ -647,43 +647,33 @@ static int linux_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
     return 0;
 }
 
-static struct xc_osdep_ops linux_gnttab_ops = {
-    .open = &linux_gnttab_open,
-    .close = &linux_gnttab_close,
-
-    .u.gnttab = {
-        .set_max_grants = linux_gnttab_set_max_grants,
-        .grant_map = &linux_gnttab_grant_map,
-        .munmap = &linux_gnttab_munmap,
-    },
-};
-
-static xc_osdep_handle linux_gntshr_open(xc_gntshr *xcg)
+int osdep_gntshr_open(xc_gntshr *xgs)
 {
     int fd = open(DEVXEN "gntalloc", O_RDWR);
-
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
-
-    return (xc_osdep_handle)fd;
+        return -1;
+    xgs->fd = fd;
+    return 0;
 }
 
-static int linux_gntshr_close(xc_gntshr *xcg, xc_osdep_handle h)
+int osdep_gntshr_close(xc_gntshr *xgs)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xgs->fd == -1 )
+        return 0;
+
+    return close(xgs->fd);
 }
 
-static void *linux_gntshr_share_pages(xc_gntshr *xch, xc_osdep_handle h,
-                                      uint32_t domid, int count,
-                                      uint32_t *refs, int writable,
-                                      uint32_t notify_offset,
-                                      evtchn_port_t notify_port)
+void *osdep_gntshr_share_pages(xc_gntshr *xgs,
+                               uint32_t domid, int count,
+                               uint32_t *refs, int writable,
+                               uint32_t notify_offset,
+                               evtchn_port_t notify_port)
 {
     struct ioctl_gntalloc_alloc_gref *gref_info = NULL;
     struct ioctl_gntalloc_unmap_notify notify;
     struct ioctl_gntalloc_dealloc_gref gref_drop;
-    int fd = (int)h;
+    int fd = xgs->fd;
     int err;
     void *area = NULL;
     gref_info = malloc(sizeof(*gref_info) + count * sizeof(uint32_t));
@@ -695,7 +685,7 @@ static void *linux_gntshr_share_pages(xc_gntshr *xch, xc_osdep_handle h,
 
     err = ioctl(fd, IOCTL_GNTALLOC_ALLOC_GREF, gref_info);
     if (err) {
-        PERROR("linux_gntshr_share_pages: ioctl failed");
+        GSERROR(xgs->logger, "ioctl failed");
         goto out;
     }
 
@@ -704,7 +694,7 @@ static void *linux_gntshr_share_pages(xc_gntshr *xch, xc_osdep_handle h,
 
     if (area == MAP_FAILED) {
         area = NULL;
-        PERROR("linux_gntshr_share_pages: mmap failed");
+        GSERROR(xgs->logger, "mmap failed");
         goto out_remove_fdmap;
     }
 
@@ -721,7 +711,7 @@ static void *linux_gntshr_share_pages(xc_gntshr *xch, xc_osdep_handle h,
     if (notify.action)
         err = ioctl(fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &notify);
     if (err) {
-        PERROR("linux_gntshr_share_page_notify: ioctl SET_UNMAP_NOTIFY failed");
+        GSERROR(xgs->logger, "ioctl SET_UNMAP_NOTIFY failed");
 		munmap(area, count * XC_PAGE_SIZE);
 		area = NULL;
 	}
@@ -740,33 +730,18 @@ static void *linux_gntshr_share_pages(xc_gntshr *xch, xc_osdep_handle h,
     return area;
 }
 
-static int linux_gntshr_munmap(xc_gntshr *xcg, xc_osdep_handle h,
-                               void *start_address, uint32_t count)
+int xc_gntshr_munmap(xc_gntshr *xgs,
+                     void *start_address, uint32_t count)
 {
     return munmap(start_address, count * XC_PAGE_SIZE);
 }
 
-static struct xc_osdep_ops linux_gntshr_ops = {
-    .open = &linux_gntshr_open,
-    .close = &linux_gntshr_close,
-
-    .u.gntshr = {
-        .share_pages = &linux_gntshr_share_pages,
-        .munmap = &linux_gntshr_munmap,
-    },
-};
-
-
 static struct xc_osdep_ops *linux_osdep_init(xc_interface *xch, enum xc_osdep_type type)
 {
     switch ( type )
     {
     case XC_OSDEP_PRIVCMD:
         return &linux_privcmd_ops;
-    case XC_OSDEP_GNTTAB:
-        return &linux_gnttab_ops;
-    case XC_OSDEP_GNTSHR:
-        return &linux_gntshr_ops;
     default:
         return NULL;
     }
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index db7b344..fd7def6 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -202,19 +202,22 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return memalign(alignment, size);
 }
 
-static xc_osdep_handle minios_gnttab_open(xc_gnttab *xcg)
+int osdep_gnttab_open(xc_gnttab *xgt)
 {
     int fd = alloc_fd(FTYPE_GNTMAP);
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
     gntmap_init(&files[fd].gntmap);
-    return (xc_osdep_handle)fd;
+    xgt->fd = fd;
+    return 0;
 }
 
-static int minios_gnttab_close(xc_gnttab *xcg, xc_osdep_handle h)
+int osdep_gnttab_close(xc_gnttab *xgt)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xgt->fd == -1 )
+        return 0;
+
+    return close(xgt->fd);
 }
 
 void minios_gnttab_close_fd(int fd)
@@ -223,13 +226,13 @@ void minios_gnttab_close_fd(int fd)
     files[fd].type = FTYPE_NONE;
 }
 
-static void *minios_gnttab_grant_map(xc_gnttab *xcg, xc_osdep_handle h,
-                                     uint32_t count, int flags, int prot,
-                                     uint32_t *domids, uint32_t *refs,
-                                     uint32_t notify_offset,
-                                     evtchn_port_t notify_port)
+void *osdep_gnttab_grant_map(xc_gnttab *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port)
 {
-    int fd = (int)h;
+    int fd = xgt->fd;
     int stride = 1;
     if (flags & XC_GRANT_MAP_SINGLE_DOMAIN)
         stride = 0;
@@ -242,11 +245,9 @@ static void *minios_gnttab_grant_map(xc_gnttab *xcg, xc_osdep_handle h,
                                  refs, prot & PROT_WRITE);
 }
 
-static int minios_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
-                                void *start_address,
-                                uint32_t count)
+int xc_gnttab_munmap(xc_gnttab *xgt, void *start_address, uint32_t count)
 {
-    int fd = (int)h;
+    int fd = xgt->fd;
     int ret;
     ret = gntmap_munmap(&files[fd].gntmap,
                         (unsigned long) start_address,
@@ -258,10 +259,9 @@ static int minios_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
     return ret;
 }
 
-static int minios_gnttab_set_max_grants(xc_gnttab *xcg, xc_osdep_handle h,
-                             uint32_t count)
+int xc_gnttab_set_max_grants(xc_gnttab *xgt, uint32_t count)
 {
-    int fd = (int)h;
+    int fd = xgt->fd;
     int ret;
     ret = gntmap_set_max_grants(&files[fd].gntmap,
                                 count);
@@ -272,25 +272,12 @@ static int minios_gnttab_set_max_grants(xc_gnttab *xcg, xc_osdep_handle h,
     return ret;
 }
 
-static struct xc_osdep_ops minios_gnttab_ops = {
-    .open = &minios_gnttab_open,
-    .close = &minios_gnttab_close,
-
-    .u.gnttab = {
-        .grant_map = &minios_gnttab_grant_map,
-        .munmap = &minios_gnttab_munmap,
-        .set_max_grants = &minios_gnttab_set_max_grants,
-    },
-};
-
 static struct xc_osdep_ops *minios_osdep_init(xc_interface *xch, enum xc_osdep_type type)
 {
     switch ( type )
     {
     case XC_OSDEP_PRIVCMD:
         return &minios_privcmd_ops;
-    case XC_OSDEP_GNTTAB:
-        return &minios_gnttab_ops;
     default:
         return NULL;
     }
diff --git a/tools/libxc/xc_nogntshr.c b/tools/libxc/xc_nogntshr.c
new file mode 100644
index 0000000..9aa6064
--- /dev/null
+++ b/tools/libxc/xc_nogntshr.c
@@ -0,0 +1,46 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+
+#include "xc_private.h"
+
+int osdep_gntshr_open(xc_gnttab *xgt)
+{
+    return -1;
+}
+
+int osdep_gntshr_close(xc_gnttab *xgt)
+{
+    return 0;
+}
+
+void *osdep_gntshr_share_pages(xc_gntshr *xgs,
+                               uint32_t domid, int count,
+                               uint32_t *refs, int writable,
+                               uint32_t notify_offset,
+                               evtchn_port_t notify_port)
+{
+    abort()
+}
+
+int xc_gntshr_munmap(xc_gntshr *xgs,
+                     void *start_address, uint32_t count)
+{
+    abort();
+}
diff --git a/tools/libxc/xc_nognttab.c b/tools/libxc/xc_nognttab.c
new file mode 100644
index 0000000..e8a0fcb
--- /dev/null
+++ b/tools/libxc/xc_nognttab.c
@@ -0,0 +1,50 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+
+#include "xc_private.h"
+
+int osdep_gnttab_open(xc_gnttab *xgt)
+{
+    return -1;
+}
+
+int osdep_gnttab_close(xc_gnttab *xgt)
+{
+    return 0;
+}
+
+int xc_gnttab_set_max_grants(xc_gnttab *xgt, uint32_t count)
+{
+    abort();
+}
+
+void *osdep_gnttab_grant_map(xc_gnttab *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port)
+{
+    abort();
+}
+
+int xc_gnttab_munmap(xc_gnttab *xgt, void *start_address, uint32_t count)
+{
+    abort();
+}
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 56d54b6..7f52a5d 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -119,8 +119,6 @@ static const char *xc_osdep_type_name(enum xc_osdep_type type)
     switch ( type )
     {
     case XC_OSDEP_PRIVCMD: return "privcmd";
-    case XC_OSDEP_GNTTAB:  return "gnttab";
-    case XC_OSDEP_GNTSHR:  return "gntshr";
     }
     return "unknown";
 }
@@ -251,30 +249,85 @@ int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
     return xch->ops->u.privcmd.hypercall(xch, xch->ops_handle, hypercall);
 }
 
-xc_gnttab *xc_gnttab_open(xentoollog_logger *logger,
-                             unsigned open_flags)
+xc_gnttab *xc_gnttab_open(xentoollog_logger *logger, unsigned open_flags)
 {
-    return xc_interface_open_common(logger, NULL, open_flags,
-                                    XC_OSDEP_GNTTAB);
+    xc_gnttab *xgt = malloc(sizeof(*xgt));
+    int rc;
+
+    if (!xgt) return NULL;
+
+    xgt->fd = -1;
+    xgt->logger = logger;
+    xgt->logger_tofree  = NULL;
+
+    if (!xgt->logger) {
+        xgt->logger = xgt->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xgt->logger) goto err;
+    }
+
+    rc = osdep_gnttab_open(xgt);
+    if ( rc  < 0 ) goto err;
+
+    return xgt;
+
+err:
+    osdep_gnttab_close(xgt);
+    xtl_logger_destroy(xgt->logger_tofree);
+    free(xgt);
+    return NULL;
 }
 
-int xc_gnttab_close(xc_gnttab *xcg)
+int xc_gnttab_close(xc_gnttab *xgt)
 {
-    return xc_interface_close_common(xcg);
+    int rc;
+
+    rc = osdep_gnttab_close(xgt);
+    xtl_logger_destroy(xgt->logger_tofree);
+    free(xgt);
+    return rc;
 }
 
-xc_gntshr *xc_gntshr_open(xentoollog_logger *logger,
-                             unsigned open_flags)
+xc_gntshr *xc_gntshr_open(xentoollog_logger *logger, unsigned open_flags)
 {
-    return xc_interface_open_common(logger, NULL, open_flags,
-                                    XC_OSDEP_GNTSHR);
+    xc_gntshr *xgs = malloc(sizeof(*xgs));
+    int rc;
+
+    if (!xgs) return NULL;
+
+    xgs->fd = -1;
+    xgs->logger = logger;
+    xgs->logger_tofree  = NULL;
+
+    if (!xgs->logger) {
+        xgs->logger = xgs->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xgs->logger) goto err;
+    }
+
+    rc = osdep_gntshr_open(xgs);
+    if ( rc  < 0 ) goto err;
+
+    return xgs;
+
+err:
+    osdep_gntshr_close(xgs);
+    xtl_logger_destroy(xgs->logger_tofree);
+    free(xgs);
+    return NULL;
 }
 
-int xc_gntshr_close(xc_gntshr *xcg)
+int xc_gntshr_close(xc_gntshr *xgs)
 {
-    return xc_interface_close_common(xcg);
-}
+    int rc;
 
+    rc = osdep_gntshr_close(xgs);
+    xtl_logger_destroy(xgs->logger_tofree);
+    free(xgs);
+    return rc;
+}
 
 static pthread_key_t errbuf_pkey;
 static pthread_once_t errbuf_pkey_once = PTHREAD_ONCE_INIT;
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index a32accb..35c99e0 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -123,6 +123,30 @@ struct xc_interface_core {
     xc_osdep_handle  ops_handle; /* opaque data for xc_osdep_ops */
 };
 
+struct xengntdev_handle {
+    xentoollog_logger *logger, *logger_tofree;
+    int fd;
+};
+
+int osdep_gnttab_open(xc_gnttab *xgt);
+int osdep_gnttab_close(xc_gnttab *xgt);
+
+#define XC_GRANT_MAP_SINGLE_DOMAIN 0x1
+void *osdep_gnttab_grant_map(xc_gnttab *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port);
+
+int osdep_gntshr_open(xc_gntshr *xgs);
+int osdep_gntshr_close(xc_gntshr *xgs);
+
+void *osdep_gntshr_share_pages(xc_gntshr *xgs,
+                               uint32_t domid, int count,
+                               uint32_t *refs, int writable,
+                               uint32_t notify_offset,
+                               evtchn_port_t notify_port);
+
 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,
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:15:12 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:15: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 1aON84-0000Xg-0p; Wed, 27 Jan 2016 10:15:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON82-0000X9-S3
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:11 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	86/25-31122-EA898A65; Wed, 27 Jan 2016 10:15:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1453889686!11938913!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52030 invoked from network); 27 Jan 2016 10:15:02 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:02 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8T-0001vm-EW
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7b-0001Jf-6U
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:43 +0000
Date: Wed, 27 Jan 2016 10:14:43 +0000
Message-Id: <E1aON7b-0001Jf-6U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Remove osdep indirection
	for xc_gnt{shr, tab}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 05e88ac015c03f642d260c2b3ac187f964d6b474
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 11 17:39:00 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:21:39 2016 +0000

    tools/libxc: Remove osdep indirection for xc_gnt{shr,tab}
    
    The alternative backend (a xen-api/xapi shim) is no longer around and
    so this stuff is now just baggage which is getting in the way of
    refactoring libxenctrl.
    
    Nested virt probably suffices for this use case now.
    
    It is now necessary to provide explicit versions of things for
    platforms which do not implement this functionality, since the osdep
    dispatcher cannot fulfil this need any more. These are provided by
    appropriate xc_nognt???.c files which are compiled and linked on the
    appropriate platforms. In them open and close return failure and
    everything else aborts, since if open fails they should never be
    called.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/Makefile               |   10 ++--
 tools/libxc/include/xenctrl.h      |    4 +-
 tools/libxc/include/xenctrlosdep.h |   23 -------
 tools/libxc/xc_gnttab.c            |   57 ++++-------------
 tools/libxc/xc_linux_osdep.c       |  119 ++++++++++++++----------------------
 tools/libxc/xc_minios.c            |   51 ++++++----------
 tools/libxc/xc_nogntshr.c          |   46 ++++++++++++++
 tools/libxc/xc_nognttab.c          |   50 +++++++++++++++
 tools/libxc/xc_private.c           |   83 ++++++++++++++++++++-----
 tools/libxc/xc_private.h           |   24 +++++++
 10 files changed, 274 insertions(+), 193 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index b8fc6a5..184cbb7 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -43,11 +43,11 @@ CTRL_SRCS-y       += xc_resource.c
 CTRL_SRCS-$(CONFIG_X86) += xc_psr.c
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c xc_linux_osdep.c
-CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c xc_freebsd_osdep.c
-CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
-CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
-CTRL_SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c
-CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
+CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c xc_freebsd_osdep.c xc_nognttab.c xc_nogntshr.c
+CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c xc_nognttab.c xc_nogntshr.c
+CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c xc_nognttab.c xc_nogntshr.c
+CTRL_SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c xc_nognttab.c xc_nogntshr.c
+CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c xc_nogntshr.c
 CTRL_SRCS-y       += xc_evtchn_compat.c
 
 GUEST_SRCS-y :=
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 53f3033..513aaa3 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -117,8 +117,8 @@
  */
 
 typedef struct xc_interface_core xc_interface;
-typedef struct xc_interface_core xc_gnttab;
-typedef struct xc_interface_core xc_gntshr;
+typedef struct xengntdev_handle xc_gnttab;
+typedef struct xengntdev_handle xc_gntshr;
 
 enum xc_error_code {
   XC_ERROR_NONE = 0,
diff --git a/tools/libxc/include/xenctrlosdep.h b/tools/libxc/include/xenctrlosdep.h
index 89564e1..423660d 100644
--- a/tools/libxc/include/xenctrlosdep.h
+++ b/tools/libxc/include/xenctrlosdep.h
@@ -51,8 +51,6 @@
 
 enum xc_osdep_type {
     XC_OSDEP_PRIVCMD,
-    XC_OSDEP_GNTTAB,
-    XC_OSDEP_GNTSHR,
 };
 
 /* Opaque handle internal to the backend */
@@ -88,27 +86,6 @@ struct xc_osdep_ops
                                         size_t chunksize, privcmd_mmap_entry_t entries[],
                                         int nentries);
         } privcmd;
-        struct {
-#define XC_GRANT_MAP_SINGLE_DOMAIN 0x1
-            void *(*grant_map)(xc_gnttab *xcg, xc_osdep_handle h,
-                               uint32_t count, int flags, int prot,
-                               uint32_t *domids, uint32_t *refs,
-                               uint32_t notify_offset,
-                               evtchn_port_t notify_port);
-            int (*munmap)(xc_gnttab *xcg, xc_osdep_handle h,
-                          void *start_address,
-                          uint32_t count);
-            int (*set_max_grants)(xc_gnttab *xcg, xc_osdep_handle h, uint32_t count);
-        } gnttab;
-        struct {
-            void *(*share_pages)(xc_gntshr *xcg, xc_osdep_handle h,
-                                 uint32_t domid, int count,
-                                 uint32_t *refs, int writable,
-                                 uint32_t notify_offset,
-                                 evtchn_port_t notify_port);
-            int (*munmap)(xc_gntshr *xcg, xc_osdep_handle h,
-                          void *start_address, uint32_t count);
-        } gntshr;
     } u;
 };
 typedef struct xc_osdep_ops xc_osdep_ops;
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index 60335d8..a51f405 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -143,68 +143,48 @@ grant_entry_v2_t *xc_gnttab_map_table_v2(xc_interface *xch, int domid,
     return _gnttab_map_table(xch, domid, gnt_num);
 }
 
-void *xc_gnttab_map_grant_ref(xc_gnttab *xcg,
+void *xc_gnttab_map_grant_ref(xc_gnttab *xgt,
                               uint32_t domid,
                               uint32_t ref,
                               int prot)
 {
-	return xcg->ops->u.gnttab.grant_map(xcg, xcg->ops_handle, 1, 0, prot,
-	                                    &domid, &ref, -1, -1);
+    return osdep_gnttab_grant_map(xgt, 1, 0, prot, &domid, &ref, -1, -1);
 }
 
-void *xc_gnttab_map_grant_refs(xc_gnttab *xcg,
+void *xc_gnttab_map_grant_refs(xc_gnttab *xgt,
                                uint32_t count,
                                uint32_t *domids,
                                uint32_t *refs,
                                int prot)
 {
-	return xcg->ops->u.gnttab.grant_map(xcg, xcg->ops_handle, count, 0,
-	                                    prot, domids, refs, -1, -1);
+    return osdep_gnttab_grant_map(xgt, count, 0, prot, domids, refs, -1, -1);
 }
 
-void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xcg,
+void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xgt,
                                       uint32_t count,
                                       uint32_t domid,
                                       uint32_t *refs,
                                       int prot)
 {
-	return xcg->ops->u.gnttab.grant_map(xcg, xcg->ops_handle, count,
-	                                    XC_GRANT_MAP_SINGLE_DOMAIN,
-	                                    prot, &domid, refs, -1, -1);
+    return osdep_gnttab_grant_map(xgt, count, XC_GRANT_MAP_SINGLE_DOMAIN,
+                                  prot, &domid, refs, -1, -1);
 }
 
-void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xcg,
+void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xgt,
                                      uint32_t domid,
                                      uint32_t ref,
                                      int prot,
                                      uint32_t notify_offset,
                                      evtchn_port_t notify_port)
 {
-	return xcg->ops->u.gnttab.grant_map(xcg, xcg->ops_handle, 1, 0, prot,
-	                              &domid, &ref, notify_offset, notify_port);
-}
-
-
-int xc_gnttab_munmap(xc_gnttab *xcg,
-                     void *start_address,
-                     uint32_t count)
-{
-	return xcg->ops->u.gnttab.munmap(xcg, xcg->ops_handle,
-					 start_address, count);
-}
-
-int xc_gnttab_set_max_grants(xc_gnttab *xcg, uint32_t count)
-{
-	if (!xcg->ops->u.gnttab.set_max_grants)
-		return 0;
-	return xcg->ops->u.gnttab.set_max_grants(xcg, xcg->ops_handle, count);
+    return osdep_gnttab_grant_map(xgt, 1, 0, prot,  &domid, &ref,
+                                  notify_offset, notify_port);
 }
 
 void *xc_gntshr_share_pages(xc_gntshr *xcg, uint32_t domid,
                             int count, uint32_t *refs, int writable)
 {
-	return xcg->ops->u.gntshr.share_pages(xcg, xcg->ops_handle, domid,
-	                                      count, refs, writable, -1, -1);
+    return osdep_gntshr_share_pages(xcg, domid, count, refs, writable, -1, -1);
 }
 
 void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
@@ -212,22 +192,11 @@ void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
                                   uint32_t notify_offset,
                                   evtchn_port_t notify_port)
 {
-	return xcg->ops->u.gntshr.share_pages(xcg, xcg->ops_handle,
-			domid, 1, ref, writable, notify_offset, notify_port);
+    return osdep_gntshr_share_pages(xcg, domid, 1, ref, writable,
+                                    notify_offset, notify_port);
 }
 
 /*
- * Unmaps the @count pages starting at @start_address, which were mapped by a
- * call to xc_gntshr_share_*. Never logs.
- */
-int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count)
-{
-	return xcg->ops->u.gntshr.munmap(xcg, xcg->ops_handle,
-					 start_address, count);
-}
-
-
-/*
  * Local variables:
  * mode: C
  * c-file-style: "BSD"
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 65299d0..6b329ce 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -41,6 +41,9 @@
 
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
+#define GTERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gnttab", _f)
+#define GSERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gntshr", _f)
+
 static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
@@ -460,26 +463,26 @@ static struct xc_osdep_ops linux_privcmd_ops = {
 
 #define DEVXEN "/dev/xen/"
 
-static xc_osdep_handle linux_gnttab_open(xc_gnttab *xcg)
+int osdep_gnttab_open(xc_gnttab *xgt)
 {
     int fd = open(DEVXEN "gntdev", O_RDWR);
-
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
-
-    return (xc_osdep_handle)fd;
+        return -1;
+    xgt->fd = fd;
+    return 0;
 }
 
-static int linux_gnttab_close(xc_gnttab *xcg, xc_osdep_handle h)
+int osdep_gnttab_close(xc_gnttab *xgt)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xgt->fd == -1 )
+        return 0;
+
+    return close(xgt->fd);
 }
 
-static int linux_gnttab_set_max_grants(xc_gnttab *xch, xc_osdep_handle h,
-                                       uint32_t count)
+int xc_gnttab_set_max_grants(xc_gnttab *xgt, uint32_t count)
 {
-    int fd = (int)h, rc;
+    int fd = xgt->fd, rc;
     struct ioctl_gntdev_set_max_grants max_grants = { .count = count };
 
     rc = ioctl(fd, IOCTL_GNTDEV_SET_MAX_GRANTS, &max_grants);
@@ -491,19 +494,19 @@ static int linux_gnttab_set_max_grants(xc_gnttab *xch, xc_osdep_handle h,
         if (errno == ENOTTY)
             rc = 0;
         else
-            PERROR("linux_gnttab_set_max_grants: ioctl SET_MAX_GRANTS failed");
+            GTERROR(xgt->logger, "ioctl SET_MAX_GRANTS failed");
     }
 
     return rc;
 }
 
-static void *linux_gnttab_grant_map(xc_gnttab *xch, xc_osdep_handle h,
-                                    uint32_t count, int flags, int prot,
-                                    uint32_t *domids, uint32_t *refs,
-                                    uint32_t notify_offset,
-                                    evtchn_port_t notify_port)
+void *osdep_gnttab_grant_map(xc_gnttab *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port)
 {
-    int fd = (int)h;
+    int fd = xgt->fd;
     struct ioctl_gntdev_map_grant_ref *map;
     unsigned int map_size = ROUNDUP((sizeof(*map) + (count - 1) *
                                     sizeof(struct ioctl_gntdev_map_grant_ref)),
@@ -524,7 +527,7 @@ static void *linux_gnttab_grant_map(xc_gnttab *xch, xc_osdep_handle h,
                    MAP_PRIVATE | MAP_ANON | MAP_POPULATE, -1, 0);
         if ( map == MAP_FAILED )
         {
-            PERROR("linux_gnttab_grant_map: mmap of map failed");
+            GTERROR(xgt->logger, "mmap of map failed");
             return NULL;
         }
     }
@@ -538,7 +541,7 @@ static void *linux_gnttab_grant_map(xc_gnttab *xch, xc_osdep_handle h,
     map->count = count;
 
     if ( ioctl(fd, IOCTL_GNTDEV_MAP_GRANT_REF, map) ) {
-        PERROR("linux_gnttab_grant_map: ioctl MAP_GRANT_REF failed");
+        GTERROR(xgt->logger, "ioctl MAP_GRANT_REF failed");
         goto out;
     }
 
@@ -577,7 +580,7 @@ static void *linux_gnttab_grant_map(xc_gnttab *xch, xc_osdep_handle h,
         if (notify.action)
             rv = ioctl(fd, IOCTL_GNTDEV_SET_UNMAP_NOTIFY, &notify);
         if (rv) {
-            PERROR("linux_gnttab_grant_map: ioctl SET_UNMAP_NOTIFY failed");
+            GTERROR(xgt->logger, "ioctl SET_UNMAP_NOTIFY failed");
             munmap(addr, count * XC_PAGE_SIZE);
             addr = MAP_FAILED;
         }
@@ -589,7 +592,7 @@ static void *linux_gnttab_grant_map(xc_gnttab *xch, xc_osdep_handle h,
         struct ioctl_gntdev_unmap_grant_ref unmap_grant;
 
         /* Unmap the driver slots used to store the grant information. */
-        PERROR("xc_gnttab_map_grant_refs: mmap failed");
+        GTERROR(xgt->logger, "mmap failed");
         unmap_grant.index = map->index;
         unmap_grant.count = count;
         ioctl(fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant);
@@ -604,12 +607,9 @@ static void *linux_gnttab_grant_map(xc_gnttab *xch, xc_osdep_handle h,
     return addr;
 }
 
-
-
-static int linux_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
-                               void *start_address, uint32_t count)
+int xc_gnttab_munmap(xc_gnttab *xgt, void *start_address, uint32_t count)
 {
-    int fd = (int)h;
+    int fd = xgt->fd;
     struct ioctl_gntdev_get_offset_for_vaddr get_offset;
     struct ioctl_gntdev_unmap_grant_ref unmap_grant;
     int rc;
@@ -647,43 +647,33 @@ static int linux_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
     return 0;
 }
 
-static struct xc_osdep_ops linux_gnttab_ops = {
-    .open = &linux_gnttab_open,
-    .close = &linux_gnttab_close,
-
-    .u.gnttab = {
-        .set_max_grants = linux_gnttab_set_max_grants,
-        .grant_map = &linux_gnttab_grant_map,
-        .munmap = &linux_gnttab_munmap,
-    },
-};
-
-static xc_osdep_handle linux_gntshr_open(xc_gntshr *xcg)
+int osdep_gntshr_open(xc_gntshr *xgs)
 {
     int fd = open(DEVXEN "gntalloc", O_RDWR);
-
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
-
-    return (xc_osdep_handle)fd;
+        return -1;
+    xgs->fd = fd;
+    return 0;
 }
 
-static int linux_gntshr_close(xc_gntshr *xcg, xc_osdep_handle h)
+int osdep_gntshr_close(xc_gntshr *xgs)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xgs->fd == -1 )
+        return 0;
+
+    return close(xgs->fd);
 }
 
-static void *linux_gntshr_share_pages(xc_gntshr *xch, xc_osdep_handle h,
-                                      uint32_t domid, int count,
-                                      uint32_t *refs, int writable,
-                                      uint32_t notify_offset,
-                                      evtchn_port_t notify_port)
+void *osdep_gntshr_share_pages(xc_gntshr *xgs,
+                               uint32_t domid, int count,
+                               uint32_t *refs, int writable,
+                               uint32_t notify_offset,
+                               evtchn_port_t notify_port)
 {
     struct ioctl_gntalloc_alloc_gref *gref_info = NULL;
     struct ioctl_gntalloc_unmap_notify notify;
     struct ioctl_gntalloc_dealloc_gref gref_drop;
-    int fd = (int)h;
+    int fd = xgs->fd;
     int err;
     void *area = NULL;
     gref_info = malloc(sizeof(*gref_info) + count * sizeof(uint32_t));
@@ -695,7 +685,7 @@ static void *linux_gntshr_share_pages(xc_gntshr *xch, xc_osdep_handle h,
 
     err = ioctl(fd, IOCTL_GNTALLOC_ALLOC_GREF, gref_info);
     if (err) {
-        PERROR("linux_gntshr_share_pages: ioctl failed");
+        GSERROR(xgs->logger, "ioctl failed");
         goto out;
     }
 
@@ -704,7 +694,7 @@ static void *linux_gntshr_share_pages(xc_gntshr *xch, xc_osdep_handle h,
 
     if (area == MAP_FAILED) {
         area = NULL;
-        PERROR("linux_gntshr_share_pages: mmap failed");
+        GSERROR(xgs->logger, "mmap failed");
         goto out_remove_fdmap;
     }
 
@@ -721,7 +711,7 @@ static void *linux_gntshr_share_pages(xc_gntshr *xch, xc_osdep_handle h,
     if (notify.action)
         err = ioctl(fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &notify);
     if (err) {
-        PERROR("linux_gntshr_share_page_notify: ioctl SET_UNMAP_NOTIFY failed");
+        GSERROR(xgs->logger, "ioctl SET_UNMAP_NOTIFY failed");
 		munmap(area, count * XC_PAGE_SIZE);
 		area = NULL;
 	}
@@ -740,33 +730,18 @@ static void *linux_gntshr_share_pages(xc_gntshr *xch, xc_osdep_handle h,
     return area;
 }
 
-static int linux_gntshr_munmap(xc_gntshr *xcg, xc_osdep_handle h,
-                               void *start_address, uint32_t count)
+int xc_gntshr_munmap(xc_gntshr *xgs,
+                     void *start_address, uint32_t count)
 {
     return munmap(start_address, count * XC_PAGE_SIZE);
 }
 
-static struct xc_osdep_ops linux_gntshr_ops = {
-    .open = &linux_gntshr_open,
-    .close = &linux_gntshr_close,
-
-    .u.gntshr = {
-        .share_pages = &linux_gntshr_share_pages,
-        .munmap = &linux_gntshr_munmap,
-    },
-};
-
-
 static struct xc_osdep_ops *linux_osdep_init(xc_interface *xch, enum xc_osdep_type type)
 {
     switch ( type )
     {
     case XC_OSDEP_PRIVCMD:
         return &linux_privcmd_ops;
-    case XC_OSDEP_GNTTAB:
-        return &linux_gnttab_ops;
-    case XC_OSDEP_GNTSHR:
-        return &linux_gntshr_ops;
     default:
         return NULL;
     }
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index db7b344..fd7def6 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -202,19 +202,22 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return memalign(alignment, size);
 }
 
-static xc_osdep_handle minios_gnttab_open(xc_gnttab *xcg)
+int osdep_gnttab_open(xc_gnttab *xgt)
 {
     int fd = alloc_fd(FTYPE_GNTMAP);
     if ( fd == -1 )
-        return XC_OSDEP_OPEN_ERROR;
+        return -1;
     gntmap_init(&files[fd].gntmap);
-    return (xc_osdep_handle)fd;
+    xgt->fd = fd;
+    return 0;
 }
 
-static int minios_gnttab_close(xc_gnttab *xcg, xc_osdep_handle h)
+int osdep_gnttab_close(xc_gnttab *xgt)
 {
-    int fd = (int)h;
-    return close(fd);
+    if ( xgt->fd == -1 )
+        return 0;
+
+    return close(xgt->fd);
 }
 
 void minios_gnttab_close_fd(int fd)
@@ -223,13 +226,13 @@ void minios_gnttab_close_fd(int fd)
     files[fd].type = FTYPE_NONE;
 }
 
-static void *minios_gnttab_grant_map(xc_gnttab *xcg, xc_osdep_handle h,
-                                     uint32_t count, int flags, int prot,
-                                     uint32_t *domids, uint32_t *refs,
-                                     uint32_t notify_offset,
-                                     evtchn_port_t notify_port)
+void *osdep_gnttab_grant_map(xc_gnttab *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port)
 {
-    int fd = (int)h;
+    int fd = xgt->fd;
     int stride = 1;
     if (flags & XC_GRANT_MAP_SINGLE_DOMAIN)
         stride = 0;
@@ -242,11 +245,9 @@ static void *minios_gnttab_grant_map(xc_gnttab *xcg, xc_osdep_handle h,
                                  refs, prot & PROT_WRITE);
 }
 
-static int minios_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
-                                void *start_address,
-                                uint32_t count)
+int xc_gnttab_munmap(xc_gnttab *xgt, void *start_address, uint32_t count)
 {
-    int fd = (int)h;
+    int fd = xgt->fd;
     int ret;
     ret = gntmap_munmap(&files[fd].gntmap,
                         (unsigned long) start_address,
@@ -258,10 +259,9 @@ static int minios_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
     return ret;
 }
 
-static int minios_gnttab_set_max_grants(xc_gnttab *xcg, xc_osdep_handle h,
-                             uint32_t count)
+int xc_gnttab_set_max_grants(xc_gnttab *xgt, uint32_t count)
 {
-    int fd = (int)h;
+    int fd = xgt->fd;
     int ret;
     ret = gntmap_set_max_grants(&files[fd].gntmap,
                                 count);
@@ -272,25 +272,12 @@ static int minios_gnttab_set_max_grants(xc_gnttab *xcg, xc_osdep_handle h,
     return ret;
 }
 
-static struct xc_osdep_ops minios_gnttab_ops = {
-    .open = &minios_gnttab_open,
-    .close = &minios_gnttab_close,
-
-    .u.gnttab = {
-        .grant_map = &minios_gnttab_grant_map,
-        .munmap = &minios_gnttab_munmap,
-        .set_max_grants = &minios_gnttab_set_max_grants,
-    },
-};
-
 static struct xc_osdep_ops *minios_osdep_init(xc_interface *xch, enum xc_osdep_type type)
 {
     switch ( type )
     {
     case XC_OSDEP_PRIVCMD:
         return &minios_privcmd_ops;
-    case XC_OSDEP_GNTTAB:
-        return &minios_gnttab_ops;
     default:
         return NULL;
     }
diff --git a/tools/libxc/xc_nogntshr.c b/tools/libxc/xc_nogntshr.c
new file mode 100644
index 0000000..9aa6064
--- /dev/null
+++ b/tools/libxc/xc_nogntshr.c
@@ -0,0 +1,46 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+
+#include "xc_private.h"
+
+int osdep_gntshr_open(xc_gnttab *xgt)
+{
+    return -1;
+}
+
+int osdep_gntshr_close(xc_gnttab *xgt)
+{
+    return 0;
+}
+
+void *osdep_gntshr_share_pages(xc_gntshr *xgs,
+                               uint32_t domid, int count,
+                               uint32_t *refs, int writable,
+                               uint32_t notify_offset,
+                               evtchn_port_t notify_port)
+{
+    abort()
+}
+
+int xc_gntshr_munmap(xc_gntshr *xgs,
+                     void *start_address, uint32_t count)
+{
+    abort();
+}
diff --git a/tools/libxc/xc_nognttab.c b/tools/libxc/xc_nognttab.c
new file mode 100644
index 0000000..e8a0fcb
--- /dev/null
+++ b/tools/libxc/xc_nognttab.c
@@ -0,0 +1,50 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+
+#include "xc_private.h"
+
+int osdep_gnttab_open(xc_gnttab *xgt)
+{
+    return -1;
+}
+
+int osdep_gnttab_close(xc_gnttab *xgt)
+{
+    return 0;
+}
+
+int xc_gnttab_set_max_grants(xc_gnttab *xgt, uint32_t count)
+{
+    abort();
+}
+
+void *osdep_gnttab_grant_map(xc_gnttab *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port)
+{
+    abort();
+}
+
+int xc_gnttab_munmap(xc_gnttab *xgt, void *start_address, uint32_t count)
+{
+    abort();
+}
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 56d54b6..7f52a5d 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -119,8 +119,6 @@ static const char *xc_osdep_type_name(enum xc_osdep_type type)
     switch ( type )
     {
     case XC_OSDEP_PRIVCMD: return "privcmd";
-    case XC_OSDEP_GNTTAB:  return "gnttab";
-    case XC_OSDEP_GNTSHR:  return "gntshr";
     }
     return "unknown";
 }
@@ -251,30 +249,85 @@ int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
     return xch->ops->u.privcmd.hypercall(xch, xch->ops_handle, hypercall);
 }
 
-xc_gnttab *xc_gnttab_open(xentoollog_logger *logger,
-                             unsigned open_flags)
+xc_gnttab *xc_gnttab_open(xentoollog_logger *logger, unsigned open_flags)
 {
-    return xc_interface_open_common(logger, NULL, open_flags,
-                                    XC_OSDEP_GNTTAB);
+    xc_gnttab *xgt = malloc(sizeof(*xgt));
+    int rc;
+
+    if (!xgt) return NULL;
+
+    xgt->fd = -1;
+    xgt->logger = logger;
+    xgt->logger_tofree  = NULL;
+
+    if (!xgt->logger) {
+        xgt->logger = xgt->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xgt->logger) goto err;
+    }
+
+    rc = osdep_gnttab_open(xgt);
+    if ( rc  < 0 ) goto err;
+
+    return xgt;
+
+err:
+    osdep_gnttab_close(xgt);
+    xtl_logger_destroy(xgt->logger_tofree);
+    free(xgt);
+    return NULL;
 }
 
-int xc_gnttab_close(xc_gnttab *xcg)
+int xc_gnttab_close(xc_gnttab *xgt)
 {
-    return xc_interface_close_common(xcg);
+    int rc;
+
+    rc = osdep_gnttab_close(xgt);
+    xtl_logger_destroy(xgt->logger_tofree);
+    free(xgt);
+    return rc;
 }
 
-xc_gntshr *xc_gntshr_open(xentoollog_logger *logger,
-                             unsigned open_flags)
+xc_gntshr *xc_gntshr_open(xentoollog_logger *logger, unsigned open_flags)
 {
-    return xc_interface_open_common(logger, NULL, open_flags,
-                                    XC_OSDEP_GNTSHR);
+    xc_gntshr *xgs = malloc(sizeof(*xgs));
+    int rc;
+
+    if (!xgs) return NULL;
+
+    xgs->fd = -1;
+    xgs->logger = logger;
+    xgs->logger_tofree  = NULL;
+
+    if (!xgs->logger) {
+        xgs->logger = xgs->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xgs->logger) goto err;
+    }
+
+    rc = osdep_gntshr_open(xgs);
+    if ( rc  < 0 ) goto err;
+
+    return xgs;
+
+err:
+    osdep_gntshr_close(xgs);
+    xtl_logger_destroy(xgs->logger_tofree);
+    free(xgs);
+    return NULL;
 }
 
-int xc_gntshr_close(xc_gntshr *xcg)
+int xc_gntshr_close(xc_gntshr *xgs)
 {
-    return xc_interface_close_common(xcg);
-}
+    int rc;
 
+    rc = osdep_gntshr_close(xgs);
+    xtl_logger_destroy(xgs->logger_tofree);
+    free(xgs);
+    return rc;
+}
 
 static pthread_key_t errbuf_pkey;
 static pthread_once_t errbuf_pkey_once = PTHREAD_ONCE_INIT;
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index a32accb..35c99e0 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -123,6 +123,30 @@ struct xc_interface_core {
     xc_osdep_handle  ops_handle; /* opaque data for xc_osdep_ops */
 };
 
+struct xengntdev_handle {
+    xentoollog_logger *logger, *logger_tofree;
+    int fd;
+};
+
+int osdep_gnttab_open(xc_gnttab *xgt);
+int osdep_gnttab_close(xc_gnttab *xgt);
+
+#define XC_GRANT_MAP_SINGLE_DOMAIN 0x1
+void *osdep_gnttab_grant_map(xc_gnttab *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port);
+
+int osdep_gntshr_open(xc_gntshr *xgs);
+int osdep_gntshr_close(xc_gntshr *xgs);
+
+void *osdep_gntshr_share_pages(xc_gntshr *xgs,
+                               uint32_t domid, int count,
+                               uint32_t *refs, int writable,
+                               uint32_t notify_offset,
+                               evtchn_port_t notify_port);
+
 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,
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:15:33 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:15: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 1aON8P-0000ay-Di; Wed, 27 Jan 2016 10:15: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 1aON8N-0000ai-4j
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:31 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	EB/1F-15353-2C898A65; Wed, 27 Jan 2016 10:15:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1453889715!18439582!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 36297 invoked from network); 27 Jan 2016 10:15:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8z-0001x9-Me
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON87-0001MF-Bq
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:15 +0000
Date: Wed, 27 Jan 2016 10:15:15 +0000
Message-Id: <E1aON87-0001MF-Bq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Refactor hypercall calling
	wrappers into libxencall.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3e9b0d540837c4641783adcc5449d3762469ff9d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 16:20:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:23:30 2016 +0000

    tools: Refactor hypercall calling wrappers into libxencall.
    
    libxencall will provide a stable API and ABI for calling hypercalls
    (although those hypercalls themselves may not have a stable API). As
    well as the hypercall buffer infrastructure needed in order to safely
    provide pointer arguments to hypercalls.
    
    libxenctrl encapsulates a instance of this interface, so users of that
    library are not currently subjected to any actual changes. However all
    hypercalls made internally by libxc now use the correct interface. It
    is expected that most users of this library will be other libraries
    providing a higher level interface, rather than applications directly.
    
    Only the basic functionality to allocate hypercall safe memory is
    moved, the type safe stuff and bounce buffers remain in libxc.
    
    Note that the functionality to map foreign pages using privcmd is not
    yet moved, meaning that an xc_interface will now contain two open
    privcmd file descriptors. Foreign memory mapping is logically separate
    functionality and will be moved into its own library.
    
    The new library uses a version script to ensure that only expected
    symbols are exported and to version them such that ABI guarantees can
    be kept in the future.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- updated MINIOS_UPSTREAM_REVISION and QEMU_TRADITIONAL_REVISION ]
---
 .gitignore                        |    2 +
 Config.mk                         |   12 +-
 stubdom/Makefile                  |   17 +++-
 tools/Makefile                    |    1 +
 tools/Rules.mk                    |    7 +-
 tools/libs/Makefile               |    1 +
 tools/libs/call/Makefile          |   71 ++++++++++++++
 tools/libs/call/buffer.c          |  192 +++++++++++++++++++++++++++++++++++++
 tools/libs/call/core.c            |  147 ++++++++++++++++++++++++++++
 tools/libs/call/freebsd.c         |  140 +++++++++++++++++++++++++++
 tools/libs/call/include/xencall.h |   84 ++++++++++++++++
 tools/libs/call/libxencall.map    |   19 ++++
 tools/libs/call/linux.c           |  138 ++++++++++++++++++++++++++
 tools/libs/call/minios.c          |   81 ++++++++++++++++
 tools/libs/call/netbsd.c          |  121 +++++++++++++++++++++++
 tools/libs/call/private.h         |   68 +++++++++++++
 tools/libs/call/solaris.c         |   97 +++++++++++++++++++
 tools/libxc/Makefile              |    7 +-
 tools/libxc/xc_altp2m.c           |   64 +++---------
 tools/libxc/xc_domain.c           |  105 +++++++-------------
 tools/libxc/xc_evtchn.c           |    9 +-
 tools/libxc/xc_flask.c            |    8 +-
 tools/libxc/xc_freebsd_osdep.c    |   47 ---------
 tools/libxc/xc_gnttab.c           |    9 +--
 tools/libxc/xc_hcall_buf.c        |  138 +-------------------------
 tools/libxc/xc_kexec.c            |   36 +++-----
 tools/libxc/xc_linux_osdep.c      |   49 ----------
 tools/libxc/xc_minios.c           |   32 ------
 tools/libxc/xc_misc.c             |   79 +++++----------
 tools/libxc/xc_netbsd.c           |   40 --------
 tools/libxc/xc_private.c          |   64 +++++--------
 tools/libxc/xc_private.h          |   76 ++++-----------
 tools/libxc/xc_solaris.c          |   16 ---
 tools/libxc/xc_tmem.c             |    7 +-
 tools/misc/Makefile               |    4 +-
 tools/xcutils/Makefile            |    2 +-
 tools/xenpaging/Makefile          |    2 +-
 37 files changed, 1354 insertions(+), 638 deletions(-)

diff --git a/.gitignore b/.gitignore
index ea75fda..6272f6b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,6 +62,7 @@ stubdom/ioemu
 stubdom/ioemu/
 stubdom/libs-*
 stubdom/libxc-*
+stubdom/libxencall-*
 stubdom/libxenevtchn-*
 stubdom/libxengnttab-*
 stubdom/libxentoollog-*
@@ -91,6 +92,7 @@ config/Docs.mk
 tools/libs/toollog/headers.chk
 tools/libs/evtchn/headers.chk
 tools/libs/gnttab/headers.chk
+tools/libs/call/headers.chk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff --git a/Config.mk b/Config.mk
index d2f22a3..174c192 100644
--- a/Config.mk
+++ b/Config.mk
@@ -251,9 +251,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= 9faa4c3b862291315912b81fe1d4ccca800f530d
-# Fri Jan 15 13:24:01 2016 +0000
-# mini-os: Include libxengnttab with libxc
+MINIOS_UPSTREAM_REVISION ?= c7d4f84e52d901068f9c7d5cd2cc05ced93c0157
+# Fri Jan 15 13:24:02 2016 +0000
+# mini-os: Include libxencall with libxc
 
 SEABIOS_UPSTREAM_REVISION ?= 3403ac4313812752be6e6aac35239ca6888a8cab
 # Mon Dec 28 13:50:41 2015 +0100
@@ -262,9 +262,9 @@ SEABIOS_UPSTREAM_REVISION ?= 3403ac4313812752be6e6aac35239ca6888a8cab
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= d8b5666074fdbc4ddba5283d70898a2edd785028
-# Fri Jan 15 13:23:54 2016 +0000
-# qemu-xen-traditional: Use libxengnttab
+QEMU_TRADITIONAL_REVISION ?= 79ed2c5733742a7b00f9c774bece30a620150a30
+# Fri Jan 15 13:23:55 2016 +0000
+# qemu-xen-traditional: Add libxencall to rpath-link
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 2dbf4a8..5bf4ed6 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -331,6 +331,12 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
 	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/include/*.h include/ && \
 	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/Makefile . )
+	mkdir -p libs-$(XEN_TARGET_ARCH)/call/include
+	[ -h libs-$(XEN_TARGET_ARCH)/call/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/call && \
+	  ln -sf $(XEN_ROOT)/tools/libs/call/*.h . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/call/include/*.h include/ && \
+	  ln -sf $(XEN_ROOT)/tools/libs/call/*.c . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/call/Makefile . )
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
@@ -381,12 +387,21 @@ libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(N
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/gnttab
 
 #######
+# libxencall
+#######
+
+.PHONY: libxencall
+libxencall: libs-$(XEN_TARGET_ARCH)/call/libxencall.a
+libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/call
+
+#######
 # libxc
 #######
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn libxengnttab cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn libxengnttab libxencall cross-zlib
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
diff --git a/tools/Makefile b/tools/Makefile
index 50ccc75..05d8bdb 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -264,6 +264,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/evtchn \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/gnttab \
+		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/call \
 		$(QEMU_UPSTREAM_RPATH)" \
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 379990f..18e3688 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -13,6 +13,7 @@ XEN_INCLUDE        = $(XEN_ROOT)/tools/include
 XEN_LIBXENTOOLLOG  = $(XEN_ROOT)/tools/libs/toollog
 XEN_LIBXENEVTCHN   = $(XEN_ROOT)/tools/libs/evtchn
 XEN_LIBXENGNTTAB   = $(XEN_ROOT)/tools/libs/gnttab
+XEN_LIBXENCALL     = $(XEN_ROOT)/tools/libs/call
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_XENLIGHT       = $(XEN_ROOT)/tools/libxl
 XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
@@ -98,8 +99,12 @@ CFLAGS_libxengntshr = -I$(XEN_LIBXENGNTTAB)/include $(CFLAGS_xeninclude)
 LDLIBS_libxengntshr = $(XEN_LIBXENGNTTAB)/libxengnttab$(libextension)
 SHLIB_libxengntshr  = -Wl,-rpath-link=$(XEN_LIBXENGNTTAB)
 
+CFLAGS_libxencall = -I$(XEN_LIBXENCALL)/include $(CFLAGS_xeninclude)
+LDLIBS_libxencall = $(XEN_LIBXENCALL)/libxencall$(libextension)
+SHLIB_libxencall  = -Wl,-rpath-link=$(XEN_LIBXENCALL)
+
 CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_xeninclude)
-SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxengntshr)
+SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxengntshr) $(SHLIB_libxencall)
 LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libextension)
 SHLIB_libxenctrl  = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_LIBXC)
 
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index 00156ae..f4f5d57 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -5,5 +5,6 @@ SUBDIRS-y :=
 SUBDIRS-y += toollog
 SUBDIRS-y += evtchn
 SUBDIRS-y += gnttab
+SUBDIRS-y += call
 
 all clean install distclean: %: subdirs-%
diff --git a/tools/libs/call/Makefile b/tools/libs/call/Makefile
new file mode 100644
index 0000000..9402ea5
--- /dev/null
+++ b/tools/libs/call/Makefile
@@ -0,0 +1,71 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR    = 1
+MINOR    = 0
+SHLIB_LDFLAGS += -Wl,--version-script=libxencall.map
+
+CFLAGS   += -Werror -Wmissing-prototypes
+CFLAGS   += -I./include $(CFLAGS_xeninclude)
+CFLAGS   += $(CFLAGS_libxentoollog)
+
+SRCS-y                 += core.c buffer.c
+SRCS-$(CONFIG_Linux)   += linux.c
+SRCS-$(CONFIG_FreeBSD) += freebsd.c
+SRCS-$(CONFIG_SunOS)   += solaris.c
+SRCS-$(CONFIG_NetBSD)  += netbsd.c
+SRCS-$(CONFIG_MiniOS)  += minios.c
+
+LIB_OBJS := $(patsubst %.c,%.o,$(SRCS-y))
+PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS-y))
+
+LIB := libxencall.a
+ifneq ($(nosharedlibs),y)
+LIB += libxencall.so
+endif
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build:
+	$(MAKE) libs
+
+.PHONY: libs
+libs: headers.chk $(LIB)
+
+headers.chk: $(wildcard include/*.h)
+
+libxencall.a: $(LIB_OBJS)
+	$(AR) rc $@ $^
+
+libxencall.so: libxencall.so.$(MAJOR)
+	$(SYMLINK_SHLIB) $< $@
+libxencall.so.$(MAJOR): libxencall.so.$(MAJOR).$(MINOR)
+	$(SYMLINK_SHLIB) $< $@
+
+libxencall.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxencall.map
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxencall.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: build
+	$(INSTALL_DIR) $(DESTDIR)$(libdir)
+	$(INSTALL_DIR) $(DESTDIR)$(includedir)
+	$(INSTALL_SHLIB) libxencall.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) libxencall.a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) libxencall.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxencall.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxencall.so.$(MAJOR) $(DESTDIR)$(libdir)/libxencall.so
+	$(INSTALL_DATA) include/xencall.h $(DESTDIR)$(includedir)
+
+.PHONY: TAGS
+TAGS:
+	etags -t *.c *.h
+
+.PHONY: clean
+clean:
+	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -f libxencall.so.$(MAJOR).$(MINOR) libxencall.so.$(MAJOR)
+	rm -f headers.chk
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c
new file mode 100644
index 0000000..1a1b27a
--- /dev/null
+++ b/tools/libs/call/buffer.c
@@ -0,0 +1,192 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <errno.h>
+#include <string.h>
+#include <pthread.h>
+
+#include "private.h"
+
+#define DBGPRINTF(_m...) \
+	xtl_log(xcall->logger, XTL_DEBUG, -1, "xencall:buffer", _m)
+
+#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
+
+pthread_mutex_t cache_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+static void cache_lock(xencall_handle *xcall)
+{
+    int saved_errno = errno;
+    if ( xcall->flags & XENCALL_OPENFLAG_NON_REENTRANT )
+        return;
+    pthread_mutex_lock(&cache_mutex);
+    /* Ignore pthread errors. */
+    errno = saved_errno;
+}
+
+static void cache_unlock(xencall_handle *xcall)
+{
+    int saved_errno = errno;
+    if ( xcall->flags & XENCALL_OPENFLAG_NON_REENTRANT )
+        return;
+    pthread_mutex_unlock(&cache_mutex);
+    /* Ignore pthread errors. */
+    errno = saved_errno;
+}
+
+static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
+{
+    void *p = NULL;
+
+    cache_lock(xcall);
+
+    xcall->buffer_total_allocations++;
+    xcall->buffer_current_allocations++;
+    if ( xcall->buffer_current_allocations > xcall->buffer_maximum_allocations )
+        xcall->buffer_maximum_allocations = xcall->buffer_current_allocations;
+
+    if ( nr_pages > 1 )
+    {
+        xcall->buffer_cache_toobig++;
+    }
+    else if ( xcall->buffer_cache_nr > 0 )
+    {
+        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
+        xcall->buffer_cache_hits++;
+    }
+    else
+    {
+        xcall->buffer_cache_misses++;
+    }
+
+    cache_unlock(xcall);
+
+    return p;
+}
+
+static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages)
+{
+    int rc = 0;
+
+    cache_lock(xcall);
+
+    xcall->buffer_total_releases++;
+    xcall->buffer_current_allocations--;
+
+    if ( nr_pages == 1 &&
+	 xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
+    {
+        xcall->buffer_cache[xcall->buffer_cache_nr++] = p;
+        rc = 1;
+    }
+
+    cache_unlock(xcall);
+
+    return rc;
+}
+
+void buffer_release_cache(xencall_handle *xcall)
+{
+    void *p;
+
+    cache_lock(xcall);
+
+    DBGPRINTF("total allocations:%d total releases:%d",
+              xcall->buffer_total_allocations,
+              xcall->buffer_total_releases);
+    DBGPRINTF("current allocations:%d maximum allocations:%d",
+              xcall->buffer_current_allocations,
+              xcall->buffer_maximum_allocations);
+    DBGPRINTF("cache current size:%d",
+              xcall->buffer_cache_nr);
+    DBGPRINTF("cache hits:%d misses:%d toobig:%d",
+              xcall->buffer_cache_hits,
+              xcall->buffer_cache_misses,
+              xcall->buffer_cache_toobig);
+
+    while ( xcall->buffer_cache_nr > 0 )
+    {
+        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
+        osdep_free_pages(xcall, p, 1);
+    }
+
+    cache_unlock(xcall);
+}
+
+void *xencall_alloc_buffer_pages(xencall_handle *xcall, size_t nr_pages)
+{
+    void *p = cache_alloc(xcall, nr_pages);
+
+    if ( !p )
+        p = osdep_alloc_pages(xcall, nr_pages);
+
+    if (!p)
+        return NULL;
+
+    memset(p, 0, nr_pages * PAGE_SIZE);
+
+    return p;
+}
+
+void xencall_free_buffer_pages(xencall_handle *xcall, void *p, size_t nr_pages)
+{
+    if ( p == NULL )
+        return;
+
+    if ( !cache_free(xcall, p, nr_pages) )
+        osdep_free_pages(xcall, p, nr_pages);
+}
+
+struct allocation_header {
+    int nr_pages;
+};
+
+void *xencall_alloc_buffer(xencall_handle *xcall, size_t size)
+{
+    size_t actual_size = ROUNDUP(size + sizeof(struct allocation_header), PAGE_SHIFT);
+    int nr_pages = actual_size >> PAGE_SHIFT;
+    struct allocation_header *hdr;
+
+    hdr = xencall_alloc_buffer_pages(xcall, nr_pages);
+    if ( hdr == NULL )
+        return NULL;
+
+    hdr->nr_pages = nr_pages;
+
+    return (void *)(hdr+1);
+}
+
+void xencall_free_buffer(xencall_handle *xcall, void *p)
+{
+    struct allocation_header *hdr;
+
+    if (p == NULL)
+        return;
+
+    hdr = p;
+    --hdr;
+
+    xencall_free_buffer_pages(xcall, hdr, hdr->nr_pages);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
new file mode 100644
index 0000000..a342871
--- /dev/null
+++ b/tools/libs/call/core.c
@@ -0,0 +1,147 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+
+#include "private.h"
+
+xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags)
+{
+	xencall_handle *xcall = malloc(sizeof(*xcall));
+    int rc;
+
+    if (!xcall) return NULL;
+
+    xcall->flags = open_flags;
+    xcall->buffer_cache_nr = 0;
+
+    xcall->buffer_total_allocations = 0;
+    xcall->buffer_total_releases = 0;
+    xcall->buffer_current_allocations = 0;
+    xcall->buffer_maximum_allocations = 0;
+    xcall->buffer_cache_hits = 0;
+    xcall->buffer_cache_misses = 0;
+    xcall->buffer_cache_toobig = 0;
+    xcall->logger = logger;
+    xcall->logger_tofree = NULL;
+
+    if (!xcall->logger) {
+        xcall->logger = xcall->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xcall->logger) goto err;
+    }
+
+    rc = osdep_xencall_open(xcall);
+    if ( rc  < 0 ) goto err;
+
+    return xcall;
+
+err:
+    osdep_xencall_close(xcall);
+    xtl_logger_destroy(xcall->logger_tofree);
+    free(xcall);
+    return NULL;
+}
+
+int xencall_close(xencall_handle *xcall)
+{
+    int rc;
+
+    if ( !xcall )
+        return 0;
+
+    rc = osdep_xencall_close(xcall);
+    buffer_release_cache(xcall);
+    xtl_logger_destroy(xcall->logger_tofree);
+    free(xcall);
+    return rc;
+}
+
+int xencall0(xencall_handle *xcall, unsigned int op)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
+int xencall1(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+        .arg = { arg1 },
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
+int xencall2(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+        .arg = { arg1, arg2 },
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
+int xencall3(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2, uint64_t arg3)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+        .arg = { arg1, arg2, arg3},
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
+int xencall4(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2, uint64_t arg3,
+             uint64_t arg4)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+        .arg = { arg1, arg2, arg3, arg4 },
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
+int xencall5(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2, uint64_t arg3,
+             uint64_t arg4, uint64_t arg5)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+        .arg = { arg1, arg2, arg3, arg4, arg5 },
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/freebsd.c b/tools/libs/call/freebsd.c
new file mode 100644
index 0000000..2413966
--- /dev/null
+++ b/tools/libs/call/freebsd.c
@@ -0,0 +1,140 @@
+ /******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split from xc_freebsd_osdep.c
+ */
+
+#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 "private.h"
+
+#define PRIVCMD_DEV     "/dev/xen/privcmd"
+
+int osdep_xencall_open(xencall_handle *xcall)
+{
+    int flags, saved_errno;
+    int fd = open(PRIVCMD_DEV, O_RDWR);
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface "
+               PRIVCMD_DEV);
+        return -1;
+    }
+
+    /*
+     * 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+
+    flags |= FD_CLOEXEC;
+
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    xcall->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+
+    return -1;
+}
+
+int osdep_xencall_close(xencall_handle *xcall)
+{
+    int fd = xcall->fd;
+    if ( fd == -1 )
+        return 0;
+    return close(fd);
+}
+
+int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
+{
+    int fd = xcall->fd;
+    int ret;
+
+    ret = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+
+    return (ret == 0) ? hypercall->retval : ret;
+}
+
+void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
+{
+    size_t size = npages * PAGE_SIZE;
+    void *p;
+
+    /* Address returned by mmap is page aligned. */
+    p = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
+             -1, 0);
+    if (p == 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;
+}
+
+void osdep_free_pages(xencall_handle *xcall, void *ptr, size_t npages)
+{
+    int saved_errno = errno;
+    /* Unlock pages */
+    munlock(ptr, npages * PAGE_SIZE);
+
+    munmap(ptr, npages * PAGE_SIZE);
+    /* We MUST propagate the hypercall errno, not unmap call's. */
+    errno = saved_errno;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/include/xencall.h b/tools/libs/call/include/xencall.h
new file mode 100644
index 0000000..0d91aa8
--- /dev/null
+++ b/tools/libs/call/include/xencall.h
@@ -0,0 +1,84 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef XENCALL_H
+#define XENCALL_H
+
+/*
+ * This library allows you to make arbitrary hypercalls (subject to
+ * sufficient permission for the process and the domain itself). Note
+ * that while the library interface is stable the hypercalls are
+ * subject to their own rules.
+ */
+
+#include <stdint.h>
+#include <stddef.h>
+
+/* Callers who don't care don't need to #include <xentoollog.h> */
+typedef struct xentoollog_logger xentoollog_logger;
+
+typedef struct xencall_handle xencall_handle;
+
+/*
+ */
+#define XENCALL_OPENFLAG_NON_REENTRANT (1U<<0)
+
+/*
+ * Return a handle onto the hypercall driver.  Logs errors.
+ */
+xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags);
+
+/*
+ * Close a handle previously allocated with xencall_open().
+ */
+int xencall_close(xencall_handle *xcall);
+
+/*
+ * Call hypercalls with varying numbers of arguments.
+ */
+int xencall0(xencall_handle *xcall, unsigned int op);
+int xencall1(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1);
+int xencall2(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2);
+int xencall3(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2, uint64_t arg3);
+int xencall4(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2, uint64_t arg3,
+             uint64_t arg4);
+int xencall5(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2, uint64_t arg3,
+             uint64_t arg4, uint64_t arg5);
+
+/*
+ * Allocate and free memory which is suitable for use as a pointer
+ * argument to a hypercall.
+ */
+void *xencall_alloc_buffer_pages(xencall_handle *xcall, size_t nr_pages);
+void xencall_free_buffer_pages(xencall_handle *xcall, void *p, size_t nr_pages);
+
+void *xencall_alloc_buffer(xencall_handle *xcall, size_t size);
+void xencall_free_buffer(xencall_handle *xcall, void *p);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/libxencall.map b/tools/libs/call/libxencall.map
new file mode 100644
index 0000000..2f96144
--- /dev/null
+++ b/tools/libs/call/libxencall.map
@@ -0,0 +1,19 @@
+VERS_1.0 {
+	global:
+		xencall_open;
+		xencall_close;
+
+		xencall0;
+		xencall1;
+		xencall2;
+		xencall3;
+		xencall4;
+		xencall5;
+		xencall6;
+
+		xencall_alloc_buffer;
+		xencall_free_buffer;
+		xencall_alloc_buffer_pages;
+		xencall_free_buffer_pages;
+	local: *; /* Do not expose anything by default */
+};
diff --git a/tools/libs/call/linux.c b/tools/libs/call/linux.c
new file mode 100644
index 0000000..55e1e83
--- /dev/null
+++ b/tools/libs/call/linux.c
@@ -0,0 +1,138 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_linus_osdep.c:
+ *
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+
+#include "private.h"
+
+int osdep_xencall_open(xencall_handle *xcall)
+{
+    int flags, saved_errno;
+    int fd = open("/dev/xen/privcmd", O_RDWR); /* prefer this newer interface */
+
+    if ( fd == -1 && ( errno == ENOENT || errno == ENXIO || errno == ENODEV ))
+    {
+        /* Fallback to /proc/xen/privcmd */
+        fd = open("/proc/xen/privcmd", O_RDWR);
+    }
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface");
+        return -1;
+    }
+
+    /* 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+
+    flags |= FD_CLOEXEC;
+
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    xcall->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+    return -1;
+}
+
+int osdep_xencall_close(xencall_handle *xcall)
+{
+    int fd = xcall->fd;
+    if (fd == -1)
+        return 0;
+    return close(fd);
+}
+
+int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
+{
+    return ioctl(xcall->fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+}
+
+void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
+{
+    size_t size = npages * 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. */
+    rc = madvise(p, npages * 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;
+}
+
+void osdep_free_pages(xencall_handle *xcall, void *ptr, size_t npages)
+{
+    int saved_errno = errno;
+    /* Recover the VMA flags. Maybe it's not necessary */
+    madvise(ptr, npages * PAGE_SIZE, MADV_DOFORK);
+
+    munmap(ptr, npages * PAGE_SIZE);
+    /* We MUST propagate the hypercall errno, not unmap call's. */
+    errno = saved_errno;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/minios.c b/tools/libs/call/minios.c
new file mode 100644
index 0000000..3bee7be
--- /dev/null
+++ b/tools/libs/call/minios.c
@@ -0,0 +1,81 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_minios.c
+ *
+ * Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.com>.
+ */
+
+#include <mini-os/types.h>
+#include <mini-os/os.h>
+#include <mini-os/mm.h>
+#include <mini-os/lib.h>
+
+#include <errno.h>
+#include <malloc.h>
+
+#include "private.h"
+
+int osdep_xencall_open(xencall_handle *xcall)
+{
+    /* No fd required */
+    return 0;
+}
+
+int osdep_xencall_close(xencall_handle *xcall)
+{
+    return 0;
+}
+
+int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
+{
+    multicall_entry_t call;
+    int i, ret;
+
+    call.op = hypercall->op;
+    for (i = 0; i < 5; i++)
+        call.args[i] = hypercall->arg[i];
+
+    ret = HYPERVISOR_multicall(&call, 1);
+
+    if (ret < 0) {
+	errno = -ret;
+	return -1;
+    }
+    if ((long) call.result < 0) {
+        errno = - (long) call.result;
+        return -1;
+    }
+    return call.result;
+}
+
+void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
+{
+    return memalign(PAGE_SIZE, npages * PAGE_SIZE);
+}
+
+void osdep_free_pages(xencall_handle *xcall, void *ptr, size_t npages)
+{
+    free(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/libs/call/netbsd.c b/tools/libs/call/netbsd.c
new file mode 100644
index 0000000..2aa02f1
--- /dev/null
+++ b/tools/libs/call/netbsd.c
@@ -0,0 +1,121 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split from xc_netbsd.c
+ */
+
+#include "xc_private.h"
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <malloc.h>
+#include <sys/mman.h>
+
+int osdep_xencall_open(xencall_handle *xcall)
+{
+    int flags, saved_errno;
+    int fd = open("/kern/xen/privcmd", O_RDWR);
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface");
+        return -1;
+    }
+
+    /* 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+    flags |= FD_CLOEXEC;
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    xcall->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+    return -1;
+}
+
+int osdep_xencall_close(xencall_handle *xcall)
+{
+    int fd = xcall->fd;
+    return close(fd);
+}
+
+void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, size_t npages)
+{
+    size_t size = npages * XC_PAGE_SIZE;
+    void *p;
+
+    p = xc_memalign(xcall, XC_PAGE_SIZE, size);
+    if (!p)
+        return NULL;
+
+    if ( mlock(p, size) < 0 )
+    {
+        free(p);
+        return NULL;
+    }
+    return p;
+}
+
+void osdep_free_hypercall_buffer(xencall_handle *xcall, void *ptr,
+                                 size_t npages)
+{
+    (void) munlock(ptr, npages * XC_PAGE_SIZE);
+    free(ptr);
+}
+
+int do_xen_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
+{
+    int fd = xcall->fd;
+    int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+
+    /*
+     * Since NetBSD ioctl can only return 0 on success or < 0 on
+     * error, if we want to return a value from ioctl we should
+     * do so by setting hypercall->retval, to mimic Linux ioctl
+     * implementation.
+     */
+    if (error < 0)
+        return error;
+    else
+        return hypercall->retval;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/private.h b/tools/libs/call/private.h
new file mode 100644
index 0000000..37dd15f
--- /dev/null
+++ b/tools/libs/call/private.h
@@ -0,0 +1,68 @@
+#ifndef XENCALL_PRIVATE_H
+#define XENCALL_PRIVATE_H
+
+#include <xentoollog.h>
+
+#include <xencall.h>
+
+#include <xen/xen.h>
+#include <xen/sys/privcmd.h>
+
+#ifndef PAGE_SHIFT /* Mini-os, Yukk */
+#define PAGE_SHIFT           12
+#endif
+#ifndef __MINIOS__ /* Yukk */
+#define PAGE_SIZE            (1UL << PAGE_SHIFT)
+#define PAGE_MASK            (~(PAGE_SIZE-1))
+#endif
+
+struct xencall_handle {
+    xentoollog_logger *logger, *logger_tofree;
+    unsigned flags;
+    int fd;
+
+    /*
+     * A simple cache of unused, single page, hypercall buffers
+     *
+     * Protected by a global lock.
+     */
+#define BUFFER_CACHE_SIZE 4
+    int buffer_cache_nr;
+    void *buffer_cache[BUFFER_CACHE_SIZE];
+
+    /*
+     * Hypercall buffer statistics. All protected by the global
+     * buffer_cache lock.
+     */
+    int buffer_total_allocations;
+    int buffer_total_releases;
+    int buffer_current_allocations;
+    int buffer_maximum_allocations;
+    int buffer_cache_hits;
+    int buffer_cache_misses;
+    int buffer_cache_toobig;
+};
+
+int osdep_xencall_open(xencall_handle *xcall);
+int osdep_xencall_close(xencall_handle *xcall);
+
+int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall);
+
+void *osdep_alloc_pages(xencall_handle *xcall, size_t nr_pages);
+void osdep_free_pages(xencall_handle *xcall, void *p, size_t nr_pages);
+
+void buffer_release_cache(xencall_handle *xcall);
+
+#define PERROR(_f...) xtl_log(xcall->logger, XTL_ERROR, errno, "xencall", _f)
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/solaris.c b/tools/libs/call/solaris.c
new file mode 100644
index 0000000..945d867
--- /dev/null
+++ b/tools/libs/call/solaris.c
@@ -0,0 +1,97 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split from xc_solaris.c
+ */
+
+#include "xc_private.h"
+
+#include <xen/memory.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <malloc.h>
+
+int osdep_xencall_open(xencall_handle *xcall)
+{
+    int flags, saved_errno;
+    int fd = open("/dev/xen/privcmd", O_RDWR);
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface");
+        return -1;
+    }
+
+    /* 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+    flags |= FD_CLOEXEC;
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    xcall->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+    return -1;
+}
+
+int osdep_xencall_close(xencall_handle *xcall)
+{
+    int fd = xcall->fd;
+    return close(fd);
+}
+
+void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, size_t npages)
+{
+    return xc_memalign(xcall, XC_PAGE_SIZE, npages * XC_PAGE_SIZE);
+}
+
+void osdep_free_hypercall_buffer(xencall_handle *xcall, void *ptr,
+                                 size_t npages)
+{
+    free(ptr);
+}
+
+int do_xen_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
+{
+    int fd = xcall->fd;
+    return ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+}
+
+/*
+ * 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/Makefile b/tools/libxc/Makefile
index 3305fdd..a122f73 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -122,6 +122,11 @@ GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
 $(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \
 $(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h
 
+# libxenguest includes xc_private.h, so needs this despite not using
+# this functionality directly.
+$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \
+$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += $(CFLAGS_libxencall)
+
 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS): CFLAGS += $(CFLAGS_libxengnttab) $(CFLAGS_libxengntshr)
 
 LIB := libxenctrl.a
@@ -202,7 +207,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(LDLIBS_libxencall) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
diff --git a/tools/libxc/xc_altp2m.c b/tools/libxc/xc_altp2m.c
index 87a0fdf..0639632 100644
--- a/tools/libxc/xc_altp2m.c
+++ b/tools/libxc/xc_altp2m.c
@@ -27,22 +27,18 @@
 int xc_altp2m_get_domain_state(xc_interface *handle, domid_t dom, bool *state)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_get_domain_state;
     arg->domain = dom;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     if ( !rc )
         *state = arg->u.domain_state.state;
@@ -54,23 +50,19 @@ int xc_altp2m_get_domain_state(xc_interface *handle, domid_t dom, bool *state)
 int xc_altp2m_set_domain_state(xc_interface *handle, domid_t dom, bool state)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_set_domain_state;
     arg->domain = dom;
     arg->u.domain_state.state = state;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(handle, arg);
     return rc;
@@ -81,24 +73,20 @@ int xc_altp2m_set_vcpu_enable_notify(xc_interface *handle, domid_t domid,
                                      uint32_t vcpuid, xen_pfn_t gfn)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_vcpu_enable_notify;
     arg->domain = domid;
     arg->u.enable_notify.vcpu_id = vcpuid;
     arg->u.enable_notify.gfn = gfn;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(handle, arg);
     return rc;
@@ -108,24 +96,20 @@ int xc_altp2m_create_view(xc_interface *handle, domid_t domid,
                           xenmem_access_t default_access, uint16_t *view_id)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_create_p2m;
     arg->domain = domid;
     arg->u.view.view = -1;
     arg->u.view.hvmmem_default_access = default_access;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     if ( !rc )
         *view_id = arg->u.view.view;
@@ -138,23 +122,19 @@ int xc_altp2m_destroy_view(xc_interface *handle, domid_t domid,
                            uint16_t view_id)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_destroy_p2m;
     arg->domain = domid;
     arg->u.view.view = view_id;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(handle, arg);
     return rc;
@@ -165,23 +145,19 @@ int xc_altp2m_switch_to_view(xc_interface *handle, domid_t domid,
                              uint16_t view_id)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_switch_p2m;
     arg->domain = domid;
     arg->u.view.view = view_id;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(handle, arg);
     return rc;
@@ -192,17 +168,12 @@ int xc_altp2m_set_mem_access(xc_interface *handle, domid_t domid,
                              xenmem_access_t access)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_set_mem_access;
     arg->domain = domid;
@@ -210,7 +181,8 @@ int xc_altp2m_set_mem_access(xc_interface *handle, domid_t domid,
     arg->u.set_mem_access.hvmmem_access = access;
     arg->u.set_mem_access.gfn = gfn;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(handle, arg);
     return rc;
@@ -221,17 +193,12 @@ int xc_altp2m_change_gfn(xc_interface *handle, domid_t domid,
                          xen_pfn_t new_gfn)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_change_gfn;
     arg->domain = domid;
@@ -239,7 +206,8 @@ int xc_altp2m_change_gfn(xc_interface *handle, domid_t domid,
     arg->u.change_gfn.old_gfn = old_gfn;
     arg->u.change_gfn.new_gfn = new_gfn;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(handle, arg);
     return rc;
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 99e0d48..921113d 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -122,7 +122,6 @@ int xc_domain_shutdown(xc_interface *xch,
                        int reason)
 {
     int ret = -1;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(sched_remote_shutdown_t, arg);
 
     arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
@@ -132,13 +131,11 @@ int xc_domain_shutdown(xc_interface *xch,
         goto out1;
     }
 
-    hypercall.op     = __HYPERVISOR_sched_op;
-    hypercall.arg[0] = (unsigned long)SCHEDOP_remote_shutdown;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
     arg->domain_id = domid;
     arg->reason = reason;
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_sched_op,
+                   SCHEDOP_remote_shutdown,
+                   HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -562,7 +559,6 @@ int xc_watchdog(xc_interface *xch,
                 uint32_t timeout)
 {
     int ret = -1;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(sched_watchdog_t, arg);
 
     arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
@@ -572,13 +568,12 @@ int xc_watchdog(xc_interface *xch,
         goto out1;
     }
 
-    hypercall.op     = __HYPERVISOR_sched_op;
-    hypercall.arg[0] = (unsigned long)SCHEDOP_watchdog;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
     arg->id = id;
     arg->timeout = timeout;
 
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_sched_op,
+                   SCHEDOP_watchdog,
+                   HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -1357,7 +1352,6 @@ static inline int xc_hvm_param_deprecated_check(uint32_t param)
 
 int xc_hvm_param_set(xc_interface *handle, domid_t dom, uint32_t param, uint64_t value)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_param_t, arg);
     int rc = xc_hvm_param_deprecated_check(param);
 
@@ -1368,20 +1362,18 @@ int xc_hvm_param_set(xc_interface *handle, domid_t dom, uint32_t param, uint64_t
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_set_param;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
     arg->domid = dom;
     arg->index = param;
     arg->value = value;
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_set_param,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
     xc_hypercall_buffer_free(handle, arg);
     return rc;
 }
 
 int xc_hvm_param_get(xc_interface *handle, domid_t dom, uint32_t param, uint64_t *value)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_param_t, arg);
     int rc = xc_hvm_param_deprecated_check(param);
 
@@ -1392,12 +1384,11 @@ int xc_hvm_param_get(xc_interface *handle, domid_t dom, uint32_t param, uint64_t
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_get_param;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
     arg->domid = dom;
     arg->index = param;
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_get_param,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
     *value = arg->value;
     xc_hypercall_buffer_free(handle, arg);
     return rc;
@@ -1425,7 +1416,6 @@ int xc_hvm_create_ioreq_server(xc_interface *xch,
                                int handle_bufioreq,
                                ioservid_t *id)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_create_ioreq_server_t, arg);
     int rc;
 
@@ -1433,14 +1423,12 @@ int xc_hvm_create_ioreq_server(xc_interface *xch,
     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;
     arg->handle_bufioreq = handle_bufioreq;
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_create_ioreq_server,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     *id = arg->id;
 
@@ -1455,7 +1443,6 @@ int xc_hvm_get_ioreq_server_info(xc_interface *xch,
                                  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;
 
@@ -1463,14 +1450,12 @@ int xc_hvm_get_ioreq_server_info(xc_interface *xch,
     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);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_get_ioreq_server_info,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
     if ( rc != 0 )
         goto done;
 
@@ -1492,7 +1477,6 @@ 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;
 
@@ -1500,17 +1484,15 @@ int xc_hvm_map_io_range_to_ioreq_server(xc_interface *xch, domid_t domid,
     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);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_map_io_range_to_ioreq_server,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
     return rc;
@@ -1520,7 +1502,6 @@ 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;
 
@@ -1528,17 +1509,15 @@ int xc_hvm_unmap_io_range_from_ioreq_server(xc_interface *xch, domid_t domid,
     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);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_unmap_io_range_from_ioreq_server,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
     return rc;
@@ -1549,7 +1528,6 @@ int xc_hvm_map_pcidev_to_ioreq_server(xc_interface *xch, domid_t domid,
                                       uint8_t bus, uint8_t device,
                                       uint8_t function)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
     int rc;
 
@@ -1562,10 +1540,6 @@ int xc_hvm_map_pcidev_to_ioreq_server(xc_interface *xch, domid_t domid,
     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;
@@ -1579,7 +1553,9 @@ int xc_hvm_map_pcidev_to_ioreq_server(xc_interface *xch, domid_t domid,
                                            (uint64_t)device,
                                            (uint64_t)function);
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_map_io_range_to_ioreq_server,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
     return rc;
@@ -1590,7 +1566,6 @@ int xc_hvm_unmap_pcidev_from_ioreq_server(xc_interface *xch, domid_t domid,
                                           uint8_t bus, uint8_t device,
                                           uint8_t function)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
     int rc;
 
@@ -1603,10 +1578,6 @@ int xc_hvm_unmap_pcidev_from_ioreq_server(xc_interface *xch, domid_t domid,
     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;
@@ -1615,7 +1586,9 @@ int xc_hvm_unmap_pcidev_from_ioreq_server(xc_interface *xch, domid_t domid,
                                            (uint64_t)device,
                                            (uint64_t)function);
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_unmap_io_range_from_ioreq_server,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
     return rc;
@@ -1625,7 +1598,6 @@ 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;
 
@@ -1633,14 +1605,12 @@ int xc_hvm_destroy_ioreq_server(xc_interface *xch,
     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);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_destroy_ioreq_server,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
     return rc;
@@ -1651,7 +1621,6 @@ int xc_hvm_set_ioreq_server_state(xc_interface *xch,
                                   ioservid_t id,
                                   int enabled)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_set_ioreq_server_state_t, arg);
     int rc;
 
@@ -1659,15 +1628,13 @@ int xc_hvm_set_ioreq_server_state(xc_interface *xch,
     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);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_set_ioreq_server_state,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
     return rc;
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index ae2fe1a..53f7605 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -25,7 +25,6 @@ static int do_evtchn_op(xc_interface *xch, int cmd, void *arg,
                         size_t arg_size, int silently_fail)
 {
     int ret = -1;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(arg, arg_size, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
     if ( xc_hypercall_bounce_pre(xch, arg) )
@@ -34,11 +33,9 @@ static int do_evtchn_op(xc_interface *xch, int cmd, void *arg,
         goto out;
     }
 
-    hypercall.op     = __HYPERVISOR_event_channel_op;
-    hypercall.arg[0] = cmd;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
-    if ((ret = do_xen_hypercall(xch, &hypercall)) < 0 && !silently_fail)
+    ret = xencall2(xch->xcall, __HYPERVISOR_event_channel_op,
+                   cmd, HYPERCALL_BUFFER_AS_ARG(arg));
+    if ( ret < 0 && !silently_fail )
         ERROR("do_evtchn_op: HYPERVISOR_event_channel_op failed: %d", ret);
 
     xc_hypercall_bounce_post(xch, arg);
diff --git a/tools/libxc/xc_flask.c b/tools/libxc/xc_flask.c
index b533656..ec52b0f 100644
--- a/tools/libxc/xc_flask.c
+++ b/tools/libxc/xc_flask.c
@@ -37,7 +37,6 @@
 int xc_flask_op(xc_interface *xch, xen_flask_op_t *op)
 {
     int ret = -1;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(op, sizeof(*op), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
     op->interface_version = XEN_FLASK_INTERFACE_VERSION;
@@ -48,10 +47,9 @@ int xc_flask_op(xc_interface *xch, xen_flask_op_t *op)
         goto out;
     }
 
-    hypercall.op     = __HYPERVISOR_xsm_op;
-    hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(op);
-
-    if ( (ret = do_xen_hypercall(xch, &hypercall)) < 0 )
+    ret = xencall1(xch->xcall, __HYPERVISOR_xsm_op,
+                   HYPERCALL_BUFFER_AS_ARG(op));
+    if ( ret < 0 )
     {
         if ( errno == EACCES )
             fprintf(stderr, "XSM operation failed!\n");
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
index f6a2ccd..6b440ee 100644
--- a/tools/libxc/xc_freebsd_osdep.c
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -88,53 +88,6 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-/*------------------------ Privcmd hypercall interface -----------------------*/
-void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
-{
-    size_t size = npages * XC_PAGE_SIZE;
-    void *p;
-
-    /* Address returned by mmap is page aligned. */
-    p = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-             -1, 0);
-    if (p == 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;
-}
-
-void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
-{
-
-    int saved_errno = errno;
-    /* Unlock pages */
-    munlock(ptr, npages * XC_PAGE_SIZE);
-
-    munmap(ptr, npages * XC_PAGE_SIZE);
-    /* We MUST propagate the hypercall errno, not unmap call's. */
-    errno = saved_errno;
-}
-
-int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
-{
-    int fd = xch->privcmdfd;
-    int ret;
-
-    ret = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
-
-    return (ret == 0) ? hypercall->retval : ret;
-}
-
 /*----------------------- Privcmd foreign map interface ----------------------*/
 void *xc_map_foreign_bulk(xc_interface *xch,
                           uint32_t dom, int prot,
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index dd32aa2..af53fac 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -21,7 +21,6 @@
 int xc_gnttab_op(xc_interface *xch, int cmd, void * op, int op_size, int count)
 {
     int ret = 0;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(op, count * op_size, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
     if ( xc_hypercall_bounce_pre(xch, op) )
@@ -30,12 +29,8 @@ int xc_gnttab_op(xc_interface *xch, int cmd, void * op, int op_size, int count)
         goto out1;
     }
 
-    hypercall.op = __HYPERVISOR_grant_table_op;
-    hypercall.arg[0] = cmd;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(op);
-    hypercall.arg[2] = count;
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall3(xch->xcall,  __HYPERVISOR_grant_table_op,
+                   cmd, HYPERCALL_BUFFER_AS_ARG(op), count);
 
     xc_hypercall_bounce_post(xch, op);
 
diff --git a/tools/libxc/xc_hcall_buf.c b/tools/libxc/xc_hcall_buf.c
index 517b5b4..c1230a1 100644
--- a/tools/libxc/xc_hcall_buf.c
+++ b/tools/libxc/xc_hcall_buf.c
@@ -17,7 +17,6 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <pthread.h>
 
 #include "xc_private.h"
 #include "xg_private.h"
@@ -28,163 +27,38 @@ xc_hypercall_buffer_t XC__HYPERCALL_BUFFER_NAME(HYPERCALL_BUFFER_NULL) = {
     HYPERCALL_BUFFER_INIT_NO_BOUNCE
 };
 
-pthread_mutex_t hypercall_buffer_cache_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-static void hypercall_buffer_cache_lock(xc_interface *xch)
-{
-    int saved_errno = errno;
-    if ( xch->flags & XC_OPENFLAG_NON_REENTRANT )
-        return;
-    pthread_mutex_lock(&hypercall_buffer_cache_mutex);
-    /* Ignore pthread errors. */
-    errno = saved_errno;
-}
-
-static void hypercall_buffer_cache_unlock(xc_interface *xch)
-{
-    int saved_errno = errno;
-    if ( xch->flags & XC_OPENFLAG_NON_REENTRANT )
-        return;
-    pthread_mutex_unlock(&hypercall_buffer_cache_mutex);
-    /* Ignore pthread errors. */
-    errno = saved_errno;
-}
-
-static void *hypercall_buffer_cache_alloc(xc_interface *xch, int nr_pages)
-{
-    void *p = NULL;
-
-    hypercall_buffer_cache_lock(xch);
-
-    xch->hypercall_buffer_total_allocations++;
-    xch->hypercall_buffer_current_allocations++;
-    if ( xch->hypercall_buffer_current_allocations > xch->hypercall_buffer_maximum_allocations )
-        xch->hypercall_buffer_maximum_allocations = xch->hypercall_buffer_current_allocations;
-
-    if ( nr_pages > 1 )
-    {
-        xch->hypercall_buffer_cache_toobig++;
-    }
-    else if ( xch->hypercall_buffer_cache_nr > 0 )
-    {
-        p = xch->hypercall_buffer_cache[--xch->hypercall_buffer_cache_nr];
-        xch->hypercall_buffer_cache_hits++;
-    }
-    else
-    {
-        xch->hypercall_buffer_cache_misses++;
-    }
-
-    hypercall_buffer_cache_unlock(xch);
-
-    return p;
-}
-
-static int hypercall_buffer_cache_free(xc_interface *xch, void *p, int nr_pages)
-{
-    int rc = 0;
-
-    hypercall_buffer_cache_lock(xch);
-
-    xch->hypercall_buffer_total_releases++;
-    xch->hypercall_buffer_current_allocations--;
-
-    if ( nr_pages == 1 && xch->hypercall_buffer_cache_nr < HYPERCALL_BUFFER_CACHE_SIZE )
-    {
-        xch->hypercall_buffer_cache[xch->hypercall_buffer_cache_nr++] = p;
-        rc = 1;
-    }
-
-    hypercall_buffer_cache_unlock(xch);
-
-    return rc;
-}
-
-void xc__hypercall_buffer_cache_release(xc_interface *xch)
-{
-    void *p;
-
-    hypercall_buffer_cache_lock(xch);
-
-    DBGPRINTF("hypercall buffer: total allocations:%d total releases:%d",
-              xch->hypercall_buffer_total_allocations,
-              xch->hypercall_buffer_total_releases);
-    DBGPRINTF("hypercall buffer: current allocations:%d maximum allocations:%d",
-              xch->hypercall_buffer_current_allocations,
-              xch->hypercall_buffer_maximum_allocations);
-    DBGPRINTF("hypercall buffer: cache current size:%d",
-              xch->hypercall_buffer_cache_nr);
-    DBGPRINTF("hypercall buffer: cache hits:%d misses:%d toobig:%d",
-              xch->hypercall_buffer_cache_hits,
-              xch->hypercall_buffer_cache_misses,
-              xch->hypercall_buffer_cache_toobig);
-
-    while ( xch->hypercall_buffer_cache_nr > 0 )
-    {
-        p = xch->hypercall_buffer_cache[--xch->hypercall_buffer_cache_nr];
-        osdep_free_hypercall_buffer(xch, p, 1);
-    }
-
-    hypercall_buffer_cache_unlock(xch);
-}
-
 void *xc__hypercall_buffer_alloc_pages(xc_interface *xch, xc_hypercall_buffer_t *b, int nr_pages)
 {
-    void *p = hypercall_buffer_cache_alloc(xch, nr_pages);
-
-    if ( !p )
-        p = osdep_alloc_hypercall_buffer(xch, nr_pages);
+    void *p = xencall_alloc_buffer_pages(xch->xcall, nr_pages);
 
     if (!p)
         return NULL;
 
     b->hbuf = p;
 
-    memset(p, 0, nr_pages * PAGE_SIZE);
-
     return b->hbuf;
 }
 
 void xc__hypercall_buffer_free_pages(xc_interface *xch, xc_hypercall_buffer_t *b, int nr_pages)
 {
-    if ( b->hbuf == NULL )
-        return;
-
-    if ( !hypercall_buffer_cache_free(xch, b->hbuf, nr_pages) )
-        osdep_free_hypercall_buffer(xch, b->hbuf, nr_pages);
+    xencall_free_buffer_pages(xch->xcall, b->hbuf, nr_pages);
 }
 
-struct allocation_header {
-    int nr_pages;
-};
-
 void *xc__hypercall_buffer_alloc(xc_interface *xch, xc_hypercall_buffer_t *b, size_t size)
 {
-    size_t actual_size = ROUNDUP(size + sizeof(struct allocation_header), PAGE_SHIFT);
-    int nr_pages = actual_size >> PAGE_SHIFT;
-    struct allocation_header *hdr;
+    void *p = xencall_alloc_buffer(xch->xcall, size);
 
-    hdr = xc__hypercall_buffer_alloc_pages(xch, b, nr_pages);
-    if ( hdr == NULL )
+    if (!p)
         return NULL;
 
-    b->hbuf = (void *)(hdr+1);
+    b->hbuf = p;
 
-    hdr->nr_pages = nr_pages;
     return b->hbuf;
 }
 
 void xc__hypercall_buffer_free(xc_interface *xch, xc_hypercall_buffer_t *b)
 {
-    struct allocation_header *hdr;
-
-    if (b->hbuf == NULL)
-        return;
-
-    hdr = b->hbuf;
-    b->hbuf = --hdr;
-
-    xc__hypercall_buffer_free_pages(xch, b, hdr->nr_pages);
+    xencall_free_buffer(xch->xcall, b->hbuf);
 }
 
 int xc__hypercall_bounce_pre(xc_interface *xch, xc_hypercall_buffer_t *b)
diff --git a/tools/libxc/xc_kexec.c b/tools/libxc/xc_kexec.c
index a49cffb..1cceb5d 100644
--- a/tools/libxc/xc_kexec.c
+++ b/tools/libxc/xc_kexec.c
@@ -14,7 +14,6 @@
 
 int xc_kexec_exec(xc_interface *xch, int type)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_kexec_exec_t, exec);
     int ret = -1;
 
@@ -27,11 +26,9 @@ int xc_kexec_exec(xc_interface *xch, int type)
 
     exec->type = type;
 
-    hypercall.op = __HYPERVISOR_kexec_op;
-    hypercall.arg[0] = KEXEC_CMD_kexec;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(exec);
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_kexec_op,
+		   KEXEC_CMD_kexec,
+		   HYPERCALL_BUFFER_AS_ARG(exec));
 
 out:
     xc_hypercall_buffer_free(xch, exec);
@@ -42,7 +39,6 @@ out:
 int xc_kexec_get_range(xc_interface *xch, int range,  int nr,
                        uint64_t *size, uint64_t *start)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_kexec_range_t, get_range);
     int ret = -1;
 
@@ -56,11 +52,9 @@ int xc_kexec_get_range(xc_interface *xch, int range,  int nr,
     get_range->range = range;
     get_range->nr = nr;
 
-    hypercall.op = __HYPERVISOR_kexec_op;
-    hypercall.arg[0] = KEXEC_CMD_kexec_get_range;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(get_range);
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_kexec_op,
+		   KEXEC_CMD_kexec_get_range,
+		   HYPERCALL_BUFFER_AS_ARG(get_range));
 
     *size = get_range->size;
     *start = get_range->start;
@@ -76,7 +70,6 @@ int xc_kexec_load(xc_interface *xch, uint8_t type, uint16_t arch,
                   uint32_t nr_segments, xen_kexec_segment_t *segments)
 {
     int ret = -1;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(segments, sizeof(*segments) * nr_segments,
                              XC_HYPERCALL_BUFFER_BOUNCE_IN);
     DECLARE_HYPERCALL_BUFFER(xen_kexec_load_t, load);
@@ -99,11 +92,9 @@ int xc_kexec_load(xc_interface *xch, uint8_t type, uint16_t arch,
     load->nr_segments = nr_segments;
     set_xen_guest_handle(load->segments.h, segments);
 
-    hypercall.op = __HYPERVISOR_kexec_op;
-    hypercall.arg[0] = KEXEC_CMD_kexec_load;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(load);
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_kexec_op,
+		   KEXEC_CMD_kexec_load,
+		   HYPERCALL_BUFFER_AS_ARG(load));
 
 out:
     xc_hypercall_buffer_free(xch, load);
@@ -114,7 +105,6 @@ out:
 
 int xc_kexec_unload(xc_interface *xch, int type)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_kexec_unload_t, unload);
     int ret = -1;
 
@@ -127,11 +117,9 @@ int xc_kexec_unload(xc_interface *xch, int type)
 
     unload->type = type;
 
-    hypercall.op = __HYPERVISOR_kexec_op;
-    hypercall.arg[0] = KEXEC_CMD_kexec_unload;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(unload);
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_kexec_op,
+		   KEXEC_CMD_kexec_unload,
+		   HYPERCALL_BUFFER_AS_ARG(unload));
 
 out:
     xc_hypercall_buffer_free(xch, unload);
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 9f4c707..e68c495 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -91,55 +91,6 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
-{
-    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. */
-    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;
-}
-
-void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
-{
-    int saved_errno = errno;
-    /* Recover the VMA flags. Maybe it's not necessary */
-    madvise(ptr, npages * XC_PAGE_SIZE, MADV_DOFORK);
-
-    munmap(ptr, npages * XC_PAGE_SIZE);
-    /* We MUST propagate the hypercall errno, not unmap call's. */
-    errno = saved_errno;
-}
-
-int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
-{
-    int fd = xch->privcmdfd;
-    return ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
-}
-
 static int xc_map_foreign_batch_single(int fd, uint32_t dom,
                                        xen_pfn_t *mfn, unsigned long addr)
 {
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index 047e13b..e3c8241 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -61,38 +61,6 @@ void minios_interface_close_fd(int fd)
     files[fd].type = FTYPE_NONE;
 }
 
-void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
-{
-    return xc_memalign(xch, PAGE_SIZE, npages * PAGE_SIZE);
-}
-
-void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
-{
-    free(ptr);
-}
-
-int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
-{
-    multicall_entry_t call;
-    int i, ret;
-
-    call.op = hypercall->op;
-    for (i = 0; i < ARRAY_SIZE(hypercall->arg); i++)
-	call.args[i] = hypercall->arg[i];
-
-    ret = HYPERVISOR_multicall(&call, 1);
-
-    if (ret < 0) {
-	errno = -ret;
-	return -1;
-    }
-    if ((long) call.result < 0) {
-        errno = - (long) call.result;
-        return -1;
-    }
-    return call.result;
-}
-
 void *xc_map_foreign_bulk(xc_interface *xch,
                           uint32_t dom, int prot,
                           const xen_pfn_t *arr, int *err, unsigned int num)
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index c613545..124537b 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -323,7 +323,6 @@ int xc_sched_id(xc_interface *xch,
 int xc_mca_op(xc_interface *xch, struct xen_mc *mc)
 {
     int ret = 0;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(mc, sizeof(*mc), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
     if ( xc_hypercall_bounce_pre(xch, mc) )
@@ -333,9 +332,9 @@ int xc_mca_op(xc_interface *xch, struct xen_mc *mc)
     }
     mc->interface_version = XEN_MCA_INTERFACE_VERSION;
 
-    hypercall.op = __HYPERVISOR_mca;
-    hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(mc);
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall1(xch->xcall, __HYPERVISOR_mca,
+                   HYPERCALL_BUFFER_AS_ARG(mc));
+
     xc_hypercall_bounce_post(xch, mc);
     return ret;
 }
@@ -471,7 +470,6 @@ int xc_hvm_set_pci_intx_level(
     uint8_t domain, uint8_t bus, uint8_t device, uint8_t intx,
     unsigned int level)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_set_pci_intx_level, arg);
     int rc;
 
@@ -482,10 +480,6 @@ int xc_hvm_set_pci_intx_level(
         return -1;
     }
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_set_pci_intx_level;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->domid  = dom;
     arg->domain = domain;
     arg->bus    = bus;
@@ -493,7 +487,9 @@ int xc_hvm_set_pci_intx_level(
     arg->intx   = intx;
     arg->level  = level;
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_set_pci_intx_level,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -505,7 +501,6 @@ int xc_hvm_set_isa_irq_level(
     uint8_t isa_irq,
     unsigned int level)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_set_isa_irq_level, arg);
     int rc;
 
@@ -516,15 +511,13 @@ int xc_hvm_set_isa_irq_level(
         return -1;
     }
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_set_isa_irq_level;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->domid   = dom;
     arg->isa_irq = isa_irq;
     arg->level   = level;
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_set_isa_irq_level,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -534,7 +527,6 @@ int xc_hvm_set_isa_irq_level(
 int xc_hvm_set_pci_link_route(
     xc_interface *xch, domid_t dom, uint8_t link, uint8_t isa_irq)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_set_pci_link_route, arg);
     int rc;
 
@@ -545,15 +537,13 @@ int xc_hvm_set_pci_link_route(
         return -1;
     }
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_set_pci_link_route;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->domid   = dom;
     arg->link    = link;
     arg->isa_irq = isa_irq;
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_set_pci_link_route,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -563,7 +553,6 @@ int xc_hvm_set_pci_link_route(
 int xc_hvm_inject_msi(
     xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_inject_msi, arg);
     int rc;
 
@@ -574,15 +563,13 @@ int xc_hvm_inject_msi(
         return -1;
     }
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_inject_msi;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->domid = dom;
     arg->addr  = addr;
     arg->data  = data;
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_inject_msi,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -594,7 +581,6 @@ int xc_hvm_track_dirty_vram(
     uint64_t first_pfn, uint64_t nr,
     unsigned long *dirty_bitmap)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(dirty_bitmap, (nr+7) / 8, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_track_dirty_vram, arg);
     int rc;
@@ -607,16 +593,14 @@ int xc_hvm_track_dirty_vram(
         goto out;
     }
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_track_dirty_vram;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->domid     = dom;
     arg->first_pfn = first_pfn;
     arg->nr        = nr;
     set_xen_guest_handle(arg->dirty_bitmap, dirty_bitmap);
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_track_dirty_vram,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
 out:
     xc_hypercall_buffer_free(xch, arg);
@@ -627,7 +611,6 @@ out:
 int xc_hvm_modified_memory(
     xc_interface *xch, domid_t dom, uint64_t first_pfn, uint64_t nr)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_modified_memory, arg);
     int rc;
 
@@ -638,15 +621,13 @@ int xc_hvm_modified_memory(
         return -1;
     }
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_modified_memory;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->domid     = dom;
     arg->first_pfn = first_pfn;
     arg->nr        = nr;
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_modified_memory,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -656,7 +637,6 @@ int xc_hvm_modified_memory(
 int xc_hvm_set_mem_type(
     xc_interface *xch, domid_t dom, hvmmem_type_t mem_type, uint64_t first_pfn, uint64_t nr)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_set_mem_type, arg);
     int rc;
 
@@ -672,11 +652,9 @@ int xc_hvm_set_mem_type(
     arg->first_pfn    = first_pfn;
     arg->nr           = nr;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_set_mem_type;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_set_mem_type,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -688,7 +666,6 @@ int xc_hvm_inject_trap(
     uint32_t type, uint32_t error_code, uint32_t insn_len,
     uint64_t cr2)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_inject_trap, arg);
     int rc;
 
@@ -707,11 +684,9 @@ int xc_hvm_inject_trap(
     arg->insn_len    = insn_len;
     arg->cr2         = cr2;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_inject_trap;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_inject_trap,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 9abb3b6..5e3b343 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -67,46 +67,6 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
-{
-    size_t size = npages * XC_PAGE_SIZE;
-    void *p;
-
-    p = xc_memalign(xch, XC_PAGE_SIZE, size);
-    if (!p)
-        return NULL;
-
-    if ( mlock(p, size) < 0 )
-    {
-        free(p);
-        return NULL;
-    }
-    return p;
-}
-
-void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
-{
-    (void) munlock(ptr, npages * XC_PAGE_SIZE);
-    free(ptr);
-}
-
-int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
-{
-    int fd = xch->privcmdfd;
-    int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
-
-    /*
-     * Since NetBSD ioctl can only return 0 on success or < 0 on
-     * error, if we want to return a value from ioctl we should
-     * do so by setting hypercall->retval, to mimic Linux ioctl
-     * implementation.
-     */
-    if (error < 0)
-        return error;
-    else
-        return hypercall->retval;
-}
-
 void *xc_map_foreign_bulk(xc_interface *xch,
                           uint32_t dom, int prot,
                           const xen_pfn_t *arr, int *err, unsigned int num)
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index de5873e..ca4c17a 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -39,16 +39,6 @@ struct xc_interface_core *xc_interface_open(xentoollog_logger *logger,
     xch->error_handler   = logger;           xch->error_handler_tofree   = 0;
     xch->dombuild_logger = dombuild_logger;  xch->dombuild_logger_tofree = 0;
 
-    xch->hypercall_buffer_cache_nr = 0;
-
-    xch->hypercall_buffer_total_allocations = 0;
-    xch->hypercall_buffer_total_releases = 0;
-    xch->hypercall_buffer_current_allocations = 0;
-    xch->hypercall_buffer_maximum_allocations = 0;
-    xch->hypercall_buffer_cache_hits = 0;
-    xch->hypercall_buffer_cache_misses = 0;
-    xch->hypercall_buffer_cache_toobig = 0;
-
     if (!xch->error_handler) {
         xch->error_handler = xch->error_handler_tofree =
             (xentoollog_logger*)
@@ -65,14 +55,22 @@ struct xc_interface_core *xc_interface_open(xentoollog_logger *logger,
     }
     *xch = xch_buf;
 
-    if (!(open_flags & XC_OPENFLAG_DUMMY)) {
-        if ( osdep_privcmd_open(xch) < 0 )
-            goto err;
-    }
+    if (open_flags & XC_OPENFLAG_DUMMY)
+        return xch; /* We are done */
+
+    if ( osdep_privcmd_open(xch) < 0 )
+        goto err;
+
+    xch->xcall = xencall_open(xch->error_handler,
+        open_flags & XC_OPENFLAG_NON_REENTRANT ? XENCALL_OPENFLAG_NON_REENTRANT : 0U);
+
+    if ( xch->xcall == NULL )
+        goto err;
 
     return xch;
 
  err:
+    osdep_privcmd_close(xch);
     xtl_logger_destroy(xch->error_handler_tofree);
     if (xch != &xch_buf) free(xch);
     return NULL;
@@ -85,11 +83,12 @@ int xc_interface_close(xc_interface *xch)
     if (!xch)
         return 0;
 
+    rc = xencall_close(xch->xcall);
+    if (rc) PERROR("Could not close xencall interface");
+
     rc = osdep_privcmd_close(xch);
     if (rc) PERROR("Could not close hypervisor interface");
 
-    xc__hypercall_buffer_cache_release(xch);
-
     xtl_logger_destroy(xch->dombuild_logger_tofree);
     xtl_logger_destroy(xch->error_handler_tofree);
 
@@ -228,7 +227,6 @@ int xc_mmuext_op(
     unsigned int nr_ops,
     domid_t dom)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(op, nr_ops*sizeof(*op), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     long ret = -1;
 
@@ -238,13 +236,9 @@ int xc_mmuext_op(
         goto out1;
     }
 
-    hypercall.op     = __HYPERVISOR_mmuext_op;
-    hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(op);
-    hypercall.arg[1] = (unsigned long)nr_ops;
-    hypercall.arg[2] = (unsigned long)0;
-    hypercall.arg[3] = (unsigned long)dom;
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall4(xch->xcall, __HYPERVISOR_mmuext_op,
+                   HYPERCALL_BUFFER_AS_ARG(op),
+                   nr_ops, 0, dom);
 
     xc_hypercall_bounce_post(xch, op);
 
@@ -254,8 +248,7 @@ int xc_mmuext_op(
 
 static int flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu)
 {
-    int err = 0;
-    DECLARE_HYPERCALL;
+    int rc, err = 0;
     DECLARE_NAMED_HYPERCALL_BOUNCE(updates, mmu->updates, mmu->idx*sizeof(*mmu->updates), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
     if ( mmu->idx == 0 )
@@ -268,13 +261,10 @@ static int flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu)
         goto out;
     }
 
-    hypercall.op     = __HYPERVISOR_mmu_update;
-    hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(updates);
-    hypercall.arg[1] = (unsigned long)mmu->idx;
-    hypercall.arg[2] = 0;
-    hypercall.arg[3] = mmu->subject;
-
-    if ( do_xen_hypercall(xch, &hypercall) < 0 )
+    rc = xencall4(xch->xcall, __HYPERVISOR_mmu_update,
+                  HYPERCALL_BUFFER_AS_ARG(updates),
+                  mmu->idx, 0, mmu->subject);
+    if ( rc < 0 )
     {
         ERROR("Failure when submitting mmu updates");
         err = 1;
@@ -317,7 +307,6 @@ int xc_flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu)
 
 long do_memory_op(xc_interface *xch, int cmd, void *arg, size_t len)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(arg, len, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     long ret = -1;
 
@@ -327,11 +316,8 @@ long do_memory_op(xc_interface *xch, int cmd, void *arg, size_t len)
         goto out1;
     }
 
-    hypercall.op     = __HYPERVISOR_memory_op;
-    hypercall.arg[0] = (unsigned long) cmd;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_memory_op,
+                   cmd, HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_bounce_post(xch, arg);
  out1:
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 30157cf..c93df7f 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -30,6 +30,7 @@
 
 #include "_paths.h"
 #include "xenctrl.h"
+#include <xencall.h>
 
 #include <xen/sys/privcmd.h>
 
@@ -53,7 +54,6 @@ struct iovec {
 #include <sys/uio.h>
 #endif
 
-#define DECLARE_HYPERCALL privcmd_hypercall_t hypercall
 #define DECLARE_DOMCTL struct xen_domctl domctl
 #define DECLARE_SYSCTL struct xen_sysctl sysctl
 #define DECLARE_PHYSDEV_OP struct physdev_op physdev_op
@@ -94,29 +94,11 @@ struct xc_interface_core {
     FILE *dombuild_logger_file;
     const char *currently_progress_reporting;
 
-    /*
-     * A simple cache of unused, single page, hypercall buffers
-     *
-     * Protected by a global lock.
-     */
-#define HYPERCALL_BUFFER_CACHE_SIZE 4
-    int hypercall_buffer_cache_nr;
-    void *hypercall_buffer_cache[HYPERCALL_BUFFER_CACHE_SIZE];
-
-    /*
-     * Hypercall buffer statistics. All protected by the global
-     * hypercall_buffer_cache lock.
-     */
-    int hypercall_buffer_total_allocations;
-    int hypercall_buffer_total_releases;
-    int hypercall_buffer_current_allocations;
-    int hypercall_buffer_maximum_allocations;
-    int hypercall_buffer_cache_hits;
-    int hypercall_buffer_cache_misses;
-    int hypercall_buffer_cache_toobig;
-
     /* Privcmd interface */

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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:15:33 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:15: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 1aON8P-0000ay-Di; Wed, 27 Jan 2016 10:15: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 1aON8N-0000ai-4j
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:31 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	EB/1F-15353-2C898A65; Wed, 27 Jan 2016 10:15:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1453889715!18439582!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 36297 invoked from network); 27 Jan 2016 10:15:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8z-0001x9-Me
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON87-0001MF-Bq
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:15 +0000
Date: Wed, 27 Jan 2016 10:15:15 +0000
Message-Id: <E1aON87-0001MF-Bq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Refactor hypercall calling
	wrappers into libxencall.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3e9b0d540837c4641783adcc5449d3762469ff9d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 16:20:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:23:30 2016 +0000

    tools: Refactor hypercall calling wrappers into libxencall.
    
    libxencall will provide a stable API and ABI for calling hypercalls
    (although those hypercalls themselves may not have a stable API). As
    well as the hypercall buffer infrastructure needed in order to safely
    provide pointer arguments to hypercalls.
    
    libxenctrl encapsulates a instance of this interface, so users of that
    library are not currently subjected to any actual changes. However all
    hypercalls made internally by libxc now use the correct interface. It
    is expected that most users of this library will be other libraries
    providing a higher level interface, rather than applications directly.
    
    Only the basic functionality to allocate hypercall safe memory is
    moved, the type safe stuff and bounce buffers remain in libxc.
    
    Note that the functionality to map foreign pages using privcmd is not
    yet moved, meaning that an xc_interface will now contain two open
    privcmd file descriptors. Foreign memory mapping is logically separate
    functionality and will be moved into its own library.
    
    The new library uses a version script to ensure that only expected
    symbols are exported and to version them such that ABI guarantees can
    be kept in the future.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- updated MINIOS_UPSTREAM_REVISION and QEMU_TRADITIONAL_REVISION ]
---
 .gitignore                        |    2 +
 Config.mk                         |   12 +-
 stubdom/Makefile                  |   17 +++-
 tools/Makefile                    |    1 +
 tools/Rules.mk                    |    7 +-
 tools/libs/Makefile               |    1 +
 tools/libs/call/Makefile          |   71 ++++++++++++++
 tools/libs/call/buffer.c          |  192 +++++++++++++++++++++++++++++++++++++
 tools/libs/call/core.c            |  147 ++++++++++++++++++++++++++++
 tools/libs/call/freebsd.c         |  140 +++++++++++++++++++++++++++
 tools/libs/call/include/xencall.h |   84 ++++++++++++++++
 tools/libs/call/libxencall.map    |   19 ++++
 tools/libs/call/linux.c           |  138 ++++++++++++++++++++++++++
 tools/libs/call/minios.c          |   81 ++++++++++++++++
 tools/libs/call/netbsd.c          |  121 +++++++++++++++++++++++
 tools/libs/call/private.h         |   68 +++++++++++++
 tools/libs/call/solaris.c         |   97 +++++++++++++++++++
 tools/libxc/Makefile              |    7 +-
 tools/libxc/xc_altp2m.c           |   64 +++---------
 tools/libxc/xc_domain.c           |  105 +++++++-------------
 tools/libxc/xc_evtchn.c           |    9 +-
 tools/libxc/xc_flask.c            |    8 +-
 tools/libxc/xc_freebsd_osdep.c    |   47 ---------
 tools/libxc/xc_gnttab.c           |    9 +--
 tools/libxc/xc_hcall_buf.c        |  138 +-------------------------
 tools/libxc/xc_kexec.c            |   36 +++-----
 tools/libxc/xc_linux_osdep.c      |   49 ----------
 tools/libxc/xc_minios.c           |   32 ------
 tools/libxc/xc_misc.c             |   79 +++++----------
 tools/libxc/xc_netbsd.c           |   40 --------
 tools/libxc/xc_private.c          |   64 +++++--------
 tools/libxc/xc_private.h          |   76 ++++-----------
 tools/libxc/xc_solaris.c          |   16 ---
 tools/libxc/xc_tmem.c             |    7 +-
 tools/misc/Makefile               |    4 +-
 tools/xcutils/Makefile            |    2 +-
 tools/xenpaging/Makefile          |    2 +-
 37 files changed, 1354 insertions(+), 638 deletions(-)

diff --git a/.gitignore b/.gitignore
index ea75fda..6272f6b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,6 +62,7 @@ stubdom/ioemu
 stubdom/ioemu/
 stubdom/libs-*
 stubdom/libxc-*
+stubdom/libxencall-*
 stubdom/libxenevtchn-*
 stubdom/libxengnttab-*
 stubdom/libxentoollog-*
@@ -91,6 +92,7 @@ config/Docs.mk
 tools/libs/toollog/headers.chk
 tools/libs/evtchn/headers.chk
 tools/libs/gnttab/headers.chk
+tools/libs/call/headers.chk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff --git a/Config.mk b/Config.mk
index d2f22a3..174c192 100644
--- a/Config.mk
+++ b/Config.mk
@@ -251,9 +251,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= 9faa4c3b862291315912b81fe1d4ccca800f530d
-# Fri Jan 15 13:24:01 2016 +0000
-# mini-os: Include libxengnttab with libxc
+MINIOS_UPSTREAM_REVISION ?= c7d4f84e52d901068f9c7d5cd2cc05ced93c0157
+# Fri Jan 15 13:24:02 2016 +0000
+# mini-os: Include libxencall with libxc
 
 SEABIOS_UPSTREAM_REVISION ?= 3403ac4313812752be6e6aac35239ca6888a8cab
 # Mon Dec 28 13:50:41 2015 +0100
@@ -262,9 +262,9 @@ SEABIOS_UPSTREAM_REVISION ?= 3403ac4313812752be6e6aac35239ca6888a8cab
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= d8b5666074fdbc4ddba5283d70898a2edd785028
-# Fri Jan 15 13:23:54 2016 +0000
-# qemu-xen-traditional: Use libxengnttab
+QEMU_TRADITIONAL_REVISION ?= 79ed2c5733742a7b00f9c774bece30a620150a30
+# Fri Jan 15 13:23:55 2016 +0000
+# qemu-xen-traditional: Add libxencall to rpath-link
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 2dbf4a8..5bf4ed6 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -331,6 +331,12 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
 	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/include/*.h include/ && \
 	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/Makefile . )
+	mkdir -p libs-$(XEN_TARGET_ARCH)/call/include
+	[ -h libs-$(XEN_TARGET_ARCH)/call/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/call && \
+	  ln -sf $(XEN_ROOT)/tools/libs/call/*.h . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/call/include/*.h include/ && \
+	  ln -sf $(XEN_ROOT)/tools/libs/call/*.c . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/call/Makefile . )
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
@@ -381,12 +387,21 @@ libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(N
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/gnttab
 
 #######
+# libxencall
+#######
+
+.PHONY: libxencall
+libxencall: libs-$(XEN_TARGET_ARCH)/call/libxencall.a
+libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/call
+
+#######
 # libxc
 #######
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn libxengnttab cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn libxengnttab libxencall cross-zlib
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
diff --git a/tools/Makefile b/tools/Makefile
index 50ccc75..05d8bdb 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -264,6 +264,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/evtchn \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/gnttab \
+		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/call \
 		$(QEMU_UPSTREAM_RPATH)" \
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 379990f..18e3688 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -13,6 +13,7 @@ XEN_INCLUDE        = $(XEN_ROOT)/tools/include
 XEN_LIBXENTOOLLOG  = $(XEN_ROOT)/tools/libs/toollog
 XEN_LIBXENEVTCHN   = $(XEN_ROOT)/tools/libs/evtchn
 XEN_LIBXENGNTTAB   = $(XEN_ROOT)/tools/libs/gnttab
+XEN_LIBXENCALL     = $(XEN_ROOT)/tools/libs/call
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_XENLIGHT       = $(XEN_ROOT)/tools/libxl
 XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
@@ -98,8 +99,12 @@ CFLAGS_libxengntshr = -I$(XEN_LIBXENGNTTAB)/include $(CFLAGS_xeninclude)
 LDLIBS_libxengntshr = $(XEN_LIBXENGNTTAB)/libxengnttab$(libextension)
 SHLIB_libxengntshr  = -Wl,-rpath-link=$(XEN_LIBXENGNTTAB)
 
+CFLAGS_libxencall = -I$(XEN_LIBXENCALL)/include $(CFLAGS_xeninclude)
+LDLIBS_libxencall = $(XEN_LIBXENCALL)/libxencall$(libextension)
+SHLIB_libxencall  = -Wl,-rpath-link=$(XEN_LIBXENCALL)
+
 CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_xeninclude)
-SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxengntshr)
+SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxengntshr) $(SHLIB_libxencall)
 LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libextension)
 SHLIB_libxenctrl  = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_LIBXC)
 
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index 00156ae..f4f5d57 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -5,5 +5,6 @@ SUBDIRS-y :=
 SUBDIRS-y += toollog
 SUBDIRS-y += evtchn
 SUBDIRS-y += gnttab
+SUBDIRS-y += call
 
 all clean install distclean: %: subdirs-%
diff --git a/tools/libs/call/Makefile b/tools/libs/call/Makefile
new file mode 100644
index 0000000..9402ea5
--- /dev/null
+++ b/tools/libs/call/Makefile
@@ -0,0 +1,71 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR    = 1
+MINOR    = 0
+SHLIB_LDFLAGS += -Wl,--version-script=libxencall.map
+
+CFLAGS   += -Werror -Wmissing-prototypes
+CFLAGS   += -I./include $(CFLAGS_xeninclude)
+CFLAGS   += $(CFLAGS_libxentoollog)
+
+SRCS-y                 += core.c buffer.c
+SRCS-$(CONFIG_Linux)   += linux.c
+SRCS-$(CONFIG_FreeBSD) += freebsd.c
+SRCS-$(CONFIG_SunOS)   += solaris.c
+SRCS-$(CONFIG_NetBSD)  += netbsd.c
+SRCS-$(CONFIG_MiniOS)  += minios.c
+
+LIB_OBJS := $(patsubst %.c,%.o,$(SRCS-y))
+PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS-y))
+
+LIB := libxencall.a
+ifneq ($(nosharedlibs),y)
+LIB += libxencall.so
+endif
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build:
+	$(MAKE) libs
+
+.PHONY: libs
+libs: headers.chk $(LIB)
+
+headers.chk: $(wildcard include/*.h)
+
+libxencall.a: $(LIB_OBJS)
+	$(AR) rc $@ $^
+
+libxencall.so: libxencall.so.$(MAJOR)
+	$(SYMLINK_SHLIB) $< $@
+libxencall.so.$(MAJOR): libxencall.so.$(MAJOR).$(MINOR)
+	$(SYMLINK_SHLIB) $< $@
+
+libxencall.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxencall.map
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxencall.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: build
+	$(INSTALL_DIR) $(DESTDIR)$(libdir)
+	$(INSTALL_DIR) $(DESTDIR)$(includedir)
+	$(INSTALL_SHLIB) libxencall.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) libxencall.a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) libxencall.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxencall.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxencall.so.$(MAJOR) $(DESTDIR)$(libdir)/libxencall.so
+	$(INSTALL_DATA) include/xencall.h $(DESTDIR)$(includedir)
+
+.PHONY: TAGS
+TAGS:
+	etags -t *.c *.h
+
+.PHONY: clean
+clean:
+	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -f libxencall.so.$(MAJOR).$(MINOR) libxencall.so.$(MAJOR)
+	rm -f headers.chk
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c
new file mode 100644
index 0000000..1a1b27a
--- /dev/null
+++ b/tools/libs/call/buffer.c
@@ -0,0 +1,192 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <errno.h>
+#include <string.h>
+#include <pthread.h>
+
+#include "private.h"
+
+#define DBGPRINTF(_m...) \
+	xtl_log(xcall->logger, XTL_DEBUG, -1, "xencall:buffer", _m)
+
+#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
+
+pthread_mutex_t cache_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+static void cache_lock(xencall_handle *xcall)
+{
+    int saved_errno = errno;
+    if ( xcall->flags & XENCALL_OPENFLAG_NON_REENTRANT )
+        return;
+    pthread_mutex_lock(&cache_mutex);
+    /* Ignore pthread errors. */
+    errno = saved_errno;
+}
+
+static void cache_unlock(xencall_handle *xcall)
+{
+    int saved_errno = errno;
+    if ( xcall->flags & XENCALL_OPENFLAG_NON_REENTRANT )
+        return;
+    pthread_mutex_unlock(&cache_mutex);
+    /* Ignore pthread errors. */
+    errno = saved_errno;
+}
+
+static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
+{
+    void *p = NULL;
+
+    cache_lock(xcall);
+
+    xcall->buffer_total_allocations++;
+    xcall->buffer_current_allocations++;
+    if ( xcall->buffer_current_allocations > xcall->buffer_maximum_allocations )
+        xcall->buffer_maximum_allocations = xcall->buffer_current_allocations;
+
+    if ( nr_pages > 1 )
+    {
+        xcall->buffer_cache_toobig++;
+    }
+    else if ( xcall->buffer_cache_nr > 0 )
+    {
+        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
+        xcall->buffer_cache_hits++;
+    }
+    else
+    {
+        xcall->buffer_cache_misses++;
+    }
+
+    cache_unlock(xcall);
+
+    return p;
+}
+
+static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages)
+{
+    int rc = 0;
+
+    cache_lock(xcall);
+
+    xcall->buffer_total_releases++;
+    xcall->buffer_current_allocations--;
+
+    if ( nr_pages == 1 &&
+	 xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
+    {
+        xcall->buffer_cache[xcall->buffer_cache_nr++] = p;
+        rc = 1;
+    }
+
+    cache_unlock(xcall);
+
+    return rc;
+}
+
+void buffer_release_cache(xencall_handle *xcall)
+{
+    void *p;
+
+    cache_lock(xcall);
+
+    DBGPRINTF("total allocations:%d total releases:%d",
+              xcall->buffer_total_allocations,
+              xcall->buffer_total_releases);
+    DBGPRINTF("current allocations:%d maximum allocations:%d",
+              xcall->buffer_current_allocations,
+              xcall->buffer_maximum_allocations);
+    DBGPRINTF("cache current size:%d",
+              xcall->buffer_cache_nr);
+    DBGPRINTF("cache hits:%d misses:%d toobig:%d",
+              xcall->buffer_cache_hits,
+              xcall->buffer_cache_misses,
+              xcall->buffer_cache_toobig);
+
+    while ( xcall->buffer_cache_nr > 0 )
+    {
+        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
+        osdep_free_pages(xcall, p, 1);
+    }
+
+    cache_unlock(xcall);
+}
+
+void *xencall_alloc_buffer_pages(xencall_handle *xcall, size_t nr_pages)
+{
+    void *p = cache_alloc(xcall, nr_pages);
+
+    if ( !p )
+        p = osdep_alloc_pages(xcall, nr_pages);
+
+    if (!p)
+        return NULL;
+
+    memset(p, 0, nr_pages * PAGE_SIZE);
+
+    return p;
+}
+
+void xencall_free_buffer_pages(xencall_handle *xcall, void *p, size_t nr_pages)
+{
+    if ( p == NULL )
+        return;
+
+    if ( !cache_free(xcall, p, nr_pages) )
+        osdep_free_pages(xcall, p, nr_pages);
+}
+
+struct allocation_header {
+    int nr_pages;
+};
+
+void *xencall_alloc_buffer(xencall_handle *xcall, size_t size)
+{
+    size_t actual_size = ROUNDUP(size + sizeof(struct allocation_header), PAGE_SHIFT);
+    int nr_pages = actual_size >> PAGE_SHIFT;
+    struct allocation_header *hdr;
+
+    hdr = xencall_alloc_buffer_pages(xcall, nr_pages);
+    if ( hdr == NULL )
+        return NULL;
+
+    hdr->nr_pages = nr_pages;
+
+    return (void *)(hdr+1);
+}
+
+void xencall_free_buffer(xencall_handle *xcall, void *p)
+{
+    struct allocation_header *hdr;
+
+    if (p == NULL)
+        return;
+
+    hdr = p;
+    --hdr;
+
+    xencall_free_buffer_pages(xcall, hdr, hdr->nr_pages);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
new file mode 100644
index 0000000..a342871
--- /dev/null
+++ b/tools/libs/call/core.c
@@ -0,0 +1,147 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+
+#include "private.h"
+
+xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags)
+{
+	xencall_handle *xcall = malloc(sizeof(*xcall));
+    int rc;
+
+    if (!xcall) return NULL;
+
+    xcall->flags = open_flags;
+    xcall->buffer_cache_nr = 0;
+
+    xcall->buffer_total_allocations = 0;
+    xcall->buffer_total_releases = 0;
+    xcall->buffer_current_allocations = 0;
+    xcall->buffer_maximum_allocations = 0;
+    xcall->buffer_cache_hits = 0;
+    xcall->buffer_cache_misses = 0;
+    xcall->buffer_cache_toobig = 0;
+    xcall->logger = logger;
+    xcall->logger_tofree = NULL;
+
+    if (!xcall->logger) {
+        xcall->logger = xcall->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xcall->logger) goto err;
+    }
+
+    rc = osdep_xencall_open(xcall);
+    if ( rc  < 0 ) goto err;
+
+    return xcall;
+
+err:
+    osdep_xencall_close(xcall);
+    xtl_logger_destroy(xcall->logger_tofree);
+    free(xcall);
+    return NULL;
+}
+
+int xencall_close(xencall_handle *xcall)
+{
+    int rc;
+
+    if ( !xcall )
+        return 0;
+
+    rc = osdep_xencall_close(xcall);
+    buffer_release_cache(xcall);
+    xtl_logger_destroy(xcall->logger_tofree);
+    free(xcall);
+    return rc;
+}
+
+int xencall0(xencall_handle *xcall, unsigned int op)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
+int xencall1(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+        .arg = { arg1 },
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
+int xencall2(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+        .arg = { arg1, arg2 },
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
+int xencall3(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2, uint64_t arg3)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+        .arg = { arg1, arg2, arg3},
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
+int xencall4(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2, uint64_t arg3,
+             uint64_t arg4)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+        .arg = { arg1, arg2, arg3, arg4 },
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
+int xencall5(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2, uint64_t arg3,
+             uint64_t arg4, uint64_t arg5)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+        .arg = { arg1, arg2, arg3, arg4, arg5 },
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/freebsd.c b/tools/libs/call/freebsd.c
new file mode 100644
index 0000000..2413966
--- /dev/null
+++ b/tools/libs/call/freebsd.c
@@ -0,0 +1,140 @@
+ /******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split from xc_freebsd_osdep.c
+ */
+
+#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 "private.h"
+
+#define PRIVCMD_DEV     "/dev/xen/privcmd"
+
+int osdep_xencall_open(xencall_handle *xcall)
+{
+    int flags, saved_errno;
+    int fd = open(PRIVCMD_DEV, O_RDWR);
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface "
+               PRIVCMD_DEV);
+        return -1;
+    }
+
+    /*
+     * 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+
+    flags |= FD_CLOEXEC;
+
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    xcall->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+
+    return -1;
+}
+
+int osdep_xencall_close(xencall_handle *xcall)
+{
+    int fd = xcall->fd;
+    if ( fd == -1 )
+        return 0;
+    return close(fd);
+}
+
+int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
+{
+    int fd = xcall->fd;
+    int ret;
+
+    ret = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+
+    return (ret == 0) ? hypercall->retval : ret;
+}
+
+void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
+{
+    size_t size = npages * PAGE_SIZE;
+    void *p;
+
+    /* Address returned by mmap is page aligned. */
+    p = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
+             -1, 0);
+    if (p == 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;
+}
+
+void osdep_free_pages(xencall_handle *xcall, void *ptr, size_t npages)
+{
+    int saved_errno = errno;
+    /* Unlock pages */
+    munlock(ptr, npages * PAGE_SIZE);
+
+    munmap(ptr, npages * PAGE_SIZE);
+    /* We MUST propagate the hypercall errno, not unmap call's. */
+    errno = saved_errno;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/include/xencall.h b/tools/libs/call/include/xencall.h
new file mode 100644
index 0000000..0d91aa8
--- /dev/null
+++ b/tools/libs/call/include/xencall.h
@@ -0,0 +1,84 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef XENCALL_H
+#define XENCALL_H
+
+/*
+ * This library allows you to make arbitrary hypercalls (subject to
+ * sufficient permission for the process and the domain itself). Note
+ * that while the library interface is stable the hypercalls are
+ * subject to their own rules.
+ */
+
+#include <stdint.h>
+#include <stddef.h>
+
+/* Callers who don't care don't need to #include <xentoollog.h> */
+typedef struct xentoollog_logger xentoollog_logger;
+
+typedef struct xencall_handle xencall_handle;
+
+/*
+ */
+#define XENCALL_OPENFLAG_NON_REENTRANT (1U<<0)
+
+/*
+ * Return a handle onto the hypercall driver.  Logs errors.
+ */
+xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags);
+
+/*
+ * Close a handle previously allocated with xencall_open().
+ */
+int xencall_close(xencall_handle *xcall);
+
+/*
+ * Call hypercalls with varying numbers of arguments.
+ */
+int xencall0(xencall_handle *xcall, unsigned int op);
+int xencall1(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1);
+int xencall2(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2);
+int xencall3(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2, uint64_t arg3);
+int xencall4(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2, uint64_t arg3,
+             uint64_t arg4);
+int xencall5(xencall_handle *xcall, unsigned int op,
+             uint64_t arg1, uint64_t arg2, uint64_t arg3,
+             uint64_t arg4, uint64_t arg5);
+
+/*
+ * Allocate and free memory which is suitable for use as a pointer
+ * argument to a hypercall.
+ */
+void *xencall_alloc_buffer_pages(xencall_handle *xcall, size_t nr_pages);
+void xencall_free_buffer_pages(xencall_handle *xcall, void *p, size_t nr_pages);
+
+void *xencall_alloc_buffer(xencall_handle *xcall, size_t size);
+void xencall_free_buffer(xencall_handle *xcall, void *p);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/libxencall.map b/tools/libs/call/libxencall.map
new file mode 100644
index 0000000..2f96144
--- /dev/null
+++ b/tools/libs/call/libxencall.map
@@ -0,0 +1,19 @@
+VERS_1.0 {
+	global:
+		xencall_open;
+		xencall_close;
+
+		xencall0;
+		xencall1;
+		xencall2;
+		xencall3;
+		xencall4;
+		xencall5;
+		xencall6;
+
+		xencall_alloc_buffer;
+		xencall_free_buffer;
+		xencall_alloc_buffer_pages;
+		xencall_free_buffer_pages;
+	local: *; /* Do not expose anything by default */
+};
diff --git a/tools/libs/call/linux.c b/tools/libs/call/linux.c
new file mode 100644
index 0000000..55e1e83
--- /dev/null
+++ b/tools/libs/call/linux.c
@@ -0,0 +1,138 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_linus_osdep.c:
+ *
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+
+#include "private.h"
+
+int osdep_xencall_open(xencall_handle *xcall)
+{
+    int flags, saved_errno;
+    int fd = open("/dev/xen/privcmd", O_RDWR); /* prefer this newer interface */
+
+    if ( fd == -1 && ( errno == ENOENT || errno == ENXIO || errno == ENODEV ))
+    {
+        /* Fallback to /proc/xen/privcmd */
+        fd = open("/proc/xen/privcmd", O_RDWR);
+    }
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface");
+        return -1;
+    }
+
+    /* 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+
+    flags |= FD_CLOEXEC;
+
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    xcall->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+    return -1;
+}
+
+int osdep_xencall_close(xencall_handle *xcall)
+{
+    int fd = xcall->fd;
+    if (fd == -1)
+        return 0;
+    return close(fd);
+}
+
+int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
+{
+    return ioctl(xcall->fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+}
+
+void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
+{
+    size_t size = npages * 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. */
+    rc = madvise(p, npages * 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;
+}
+
+void osdep_free_pages(xencall_handle *xcall, void *ptr, size_t npages)
+{
+    int saved_errno = errno;
+    /* Recover the VMA flags. Maybe it's not necessary */
+    madvise(ptr, npages * PAGE_SIZE, MADV_DOFORK);
+
+    munmap(ptr, npages * PAGE_SIZE);
+    /* We MUST propagate the hypercall errno, not unmap call's. */
+    errno = saved_errno;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/minios.c b/tools/libs/call/minios.c
new file mode 100644
index 0000000..3bee7be
--- /dev/null
+++ b/tools/libs/call/minios.c
@@ -0,0 +1,81 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_minios.c
+ *
+ * Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.com>.
+ */
+
+#include <mini-os/types.h>
+#include <mini-os/os.h>
+#include <mini-os/mm.h>
+#include <mini-os/lib.h>
+
+#include <errno.h>
+#include <malloc.h>
+
+#include "private.h"
+
+int osdep_xencall_open(xencall_handle *xcall)
+{
+    /* No fd required */
+    return 0;
+}
+
+int osdep_xencall_close(xencall_handle *xcall)
+{
+    return 0;
+}
+
+int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
+{
+    multicall_entry_t call;
+    int i, ret;
+
+    call.op = hypercall->op;
+    for (i = 0; i < 5; i++)
+        call.args[i] = hypercall->arg[i];
+
+    ret = HYPERVISOR_multicall(&call, 1);
+
+    if (ret < 0) {
+	errno = -ret;
+	return -1;
+    }
+    if ((long) call.result < 0) {
+        errno = - (long) call.result;
+        return -1;
+    }
+    return call.result;
+}
+
+void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
+{
+    return memalign(PAGE_SIZE, npages * PAGE_SIZE);
+}
+
+void osdep_free_pages(xencall_handle *xcall, void *ptr, size_t npages)
+{
+    free(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/libs/call/netbsd.c b/tools/libs/call/netbsd.c
new file mode 100644
index 0000000..2aa02f1
--- /dev/null
+++ b/tools/libs/call/netbsd.c
@@ -0,0 +1,121 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split from xc_netbsd.c
+ */
+
+#include "xc_private.h"
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <malloc.h>
+#include <sys/mman.h>
+
+int osdep_xencall_open(xencall_handle *xcall)
+{
+    int flags, saved_errno;
+    int fd = open("/kern/xen/privcmd", O_RDWR);
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface");
+        return -1;
+    }
+
+    /* 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+    flags |= FD_CLOEXEC;
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    xcall->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+    return -1;
+}
+
+int osdep_xencall_close(xencall_handle *xcall)
+{
+    int fd = xcall->fd;
+    return close(fd);
+}
+
+void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, size_t npages)
+{
+    size_t size = npages * XC_PAGE_SIZE;
+    void *p;
+
+    p = xc_memalign(xcall, XC_PAGE_SIZE, size);
+    if (!p)
+        return NULL;
+
+    if ( mlock(p, size) < 0 )
+    {
+        free(p);
+        return NULL;
+    }
+    return p;
+}
+
+void osdep_free_hypercall_buffer(xencall_handle *xcall, void *ptr,
+                                 size_t npages)
+{
+    (void) munlock(ptr, npages * XC_PAGE_SIZE);
+    free(ptr);
+}
+
+int do_xen_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
+{
+    int fd = xcall->fd;
+    int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+
+    /*
+     * Since NetBSD ioctl can only return 0 on success or < 0 on
+     * error, if we want to return a value from ioctl we should
+     * do so by setting hypercall->retval, to mimic Linux ioctl
+     * implementation.
+     */
+    if (error < 0)
+        return error;
+    else
+        return hypercall->retval;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/private.h b/tools/libs/call/private.h
new file mode 100644
index 0000000..37dd15f
--- /dev/null
+++ b/tools/libs/call/private.h
@@ -0,0 +1,68 @@
+#ifndef XENCALL_PRIVATE_H
+#define XENCALL_PRIVATE_H
+
+#include <xentoollog.h>
+
+#include <xencall.h>
+
+#include <xen/xen.h>
+#include <xen/sys/privcmd.h>
+
+#ifndef PAGE_SHIFT /* Mini-os, Yukk */
+#define PAGE_SHIFT           12
+#endif
+#ifndef __MINIOS__ /* Yukk */
+#define PAGE_SIZE            (1UL << PAGE_SHIFT)
+#define PAGE_MASK            (~(PAGE_SIZE-1))
+#endif
+
+struct xencall_handle {
+    xentoollog_logger *logger, *logger_tofree;
+    unsigned flags;
+    int fd;
+
+    /*
+     * A simple cache of unused, single page, hypercall buffers
+     *
+     * Protected by a global lock.
+     */
+#define BUFFER_CACHE_SIZE 4
+    int buffer_cache_nr;
+    void *buffer_cache[BUFFER_CACHE_SIZE];
+
+    /*
+     * Hypercall buffer statistics. All protected by the global
+     * buffer_cache lock.
+     */
+    int buffer_total_allocations;
+    int buffer_total_releases;
+    int buffer_current_allocations;
+    int buffer_maximum_allocations;
+    int buffer_cache_hits;
+    int buffer_cache_misses;
+    int buffer_cache_toobig;
+};
+
+int osdep_xencall_open(xencall_handle *xcall);
+int osdep_xencall_close(xencall_handle *xcall);
+
+int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall);
+
+void *osdep_alloc_pages(xencall_handle *xcall, size_t nr_pages);
+void osdep_free_pages(xencall_handle *xcall, void *p, size_t nr_pages);
+
+void buffer_release_cache(xencall_handle *xcall);
+
+#define PERROR(_f...) xtl_log(xcall->logger, XTL_ERROR, errno, "xencall", _f)
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/call/solaris.c b/tools/libs/call/solaris.c
new file mode 100644
index 0000000..945d867
--- /dev/null
+++ b/tools/libs/call/solaris.c
@@ -0,0 +1,97 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split from xc_solaris.c
+ */
+
+#include "xc_private.h"
+
+#include <xen/memory.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <malloc.h>
+
+int osdep_xencall_open(xencall_handle *xcall)
+{
+    int flags, saved_errno;
+    int fd = open("/dev/xen/privcmd", O_RDWR);
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface");
+        return -1;
+    }
+
+    /* 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+    flags |= FD_CLOEXEC;
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    xcall->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+    return -1;
+}
+
+int osdep_xencall_close(xencall_handle *xcall)
+{
+    int fd = xcall->fd;
+    return close(fd);
+}
+
+void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, size_t npages)
+{
+    return xc_memalign(xcall, XC_PAGE_SIZE, npages * XC_PAGE_SIZE);
+}
+
+void osdep_free_hypercall_buffer(xencall_handle *xcall, void *ptr,
+                                 size_t npages)
+{
+    free(ptr);
+}
+
+int do_xen_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
+{
+    int fd = xcall->fd;
+    return ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+}
+
+/*
+ * 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/Makefile b/tools/libxc/Makefile
index 3305fdd..a122f73 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -122,6 +122,11 @@ GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
 $(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \
 $(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h
 
+# libxenguest includes xc_private.h, so needs this despite not using
+# this functionality directly.
+$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \
+$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += $(CFLAGS_libxencall)
+
 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS): CFLAGS += $(CFLAGS_libxengnttab) $(CFLAGS_libxengntshr)
 
 LIB := libxenctrl.a
@@ -202,7 +207,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(LDLIBS_libxencall) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
diff --git a/tools/libxc/xc_altp2m.c b/tools/libxc/xc_altp2m.c
index 87a0fdf..0639632 100644
--- a/tools/libxc/xc_altp2m.c
+++ b/tools/libxc/xc_altp2m.c
@@ -27,22 +27,18 @@
 int xc_altp2m_get_domain_state(xc_interface *handle, domid_t dom, bool *state)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_get_domain_state;
     arg->domain = dom;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     if ( !rc )
         *state = arg->u.domain_state.state;
@@ -54,23 +50,19 @@ int xc_altp2m_get_domain_state(xc_interface *handle, domid_t dom, bool *state)
 int xc_altp2m_set_domain_state(xc_interface *handle, domid_t dom, bool state)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_set_domain_state;
     arg->domain = dom;
     arg->u.domain_state.state = state;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(handle, arg);
     return rc;
@@ -81,24 +73,20 @@ int xc_altp2m_set_vcpu_enable_notify(xc_interface *handle, domid_t domid,
                                      uint32_t vcpuid, xen_pfn_t gfn)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_vcpu_enable_notify;
     arg->domain = domid;
     arg->u.enable_notify.vcpu_id = vcpuid;
     arg->u.enable_notify.gfn = gfn;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(handle, arg);
     return rc;
@@ -108,24 +96,20 @@ int xc_altp2m_create_view(xc_interface *handle, domid_t domid,
                           xenmem_access_t default_access, uint16_t *view_id)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_create_p2m;
     arg->domain = domid;
     arg->u.view.view = -1;
     arg->u.view.hvmmem_default_access = default_access;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     if ( !rc )
         *view_id = arg->u.view.view;
@@ -138,23 +122,19 @@ int xc_altp2m_destroy_view(xc_interface *handle, domid_t domid,
                            uint16_t view_id)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_destroy_p2m;
     arg->domain = domid;
     arg->u.view.view = view_id;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(handle, arg);
     return rc;
@@ -165,23 +145,19 @@ int xc_altp2m_switch_to_view(xc_interface *handle, domid_t domid,
                              uint16_t view_id)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_switch_p2m;
     arg->domain = domid;
     arg->u.view.view = view_id;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(handle, arg);
     return rc;
@@ -192,17 +168,12 @@ int xc_altp2m_set_mem_access(xc_interface *handle, domid_t domid,
                              xenmem_access_t access)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_set_mem_access;
     arg->domain = domid;
@@ -210,7 +181,8 @@ int xc_altp2m_set_mem_access(xc_interface *handle, domid_t domid,
     arg->u.set_mem_access.hvmmem_access = access;
     arg->u.set_mem_access.gfn = gfn;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(handle, arg);
     return rc;
@@ -221,17 +193,12 @@ int xc_altp2m_change_gfn(xc_interface *handle, domid_t domid,
                          xen_pfn_t new_gfn)
 {
     int rc;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
 
     arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_altp2m;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
     arg->cmd = HVMOP_altp2m_change_gfn;
     arg->domain = domid;
@@ -239,7 +206,8 @@ int xc_altp2m_change_gfn(xc_interface *handle, domid_t domid,
     arg->u.change_gfn.old_gfn = old_gfn;
     arg->u.change_gfn.new_gfn = new_gfn;
 
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
+		  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(handle, arg);
     return rc;
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 99e0d48..921113d 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -122,7 +122,6 @@ int xc_domain_shutdown(xc_interface *xch,
                        int reason)
 {
     int ret = -1;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(sched_remote_shutdown_t, arg);
 
     arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
@@ -132,13 +131,11 @@ int xc_domain_shutdown(xc_interface *xch,
         goto out1;
     }
 
-    hypercall.op     = __HYPERVISOR_sched_op;
-    hypercall.arg[0] = (unsigned long)SCHEDOP_remote_shutdown;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
     arg->domain_id = domid;
     arg->reason = reason;
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_sched_op,
+                   SCHEDOP_remote_shutdown,
+                   HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -562,7 +559,6 @@ int xc_watchdog(xc_interface *xch,
                 uint32_t timeout)
 {
     int ret = -1;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(sched_watchdog_t, arg);
 
     arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
@@ -572,13 +568,12 @@ int xc_watchdog(xc_interface *xch,
         goto out1;
     }
 
-    hypercall.op     = __HYPERVISOR_sched_op;
-    hypercall.arg[0] = (unsigned long)SCHEDOP_watchdog;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
     arg->id = id;
     arg->timeout = timeout;
 
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_sched_op,
+                   SCHEDOP_watchdog,
+                   HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -1357,7 +1352,6 @@ static inline int xc_hvm_param_deprecated_check(uint32_t param)
 
 int xc_hvm_param_set(xc_interface *handle, domid_t dom, uint32_t param, uint64_t value)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_param_t, arg);
     int rc = xc_hvm_param_deprecated_check(param);
 
@@ -1368,20 +1362,18 @@ int xc_hvm_param_set(xc_interface *handle, domid_t dom, uint32_t param, uint64_t
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_set_param;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
     arg->domid = dom;
     arg->index = param;
     arg->value = value;
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_set_param,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
     xc_hypercall_buffer_free(handle, arg);
     return rc;
 }
 
 int xc_hvm_param_get(xc_interface *handle, domid_t dom, uint32_t param, uint64_t *value)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_param_t, arg);
     int rc = xc_hvm_param_deprecated_check(param);
 
@@ -1392,12 +1384,11 @@ int xc_hvm_param_get(xc_interface *handle, domid_t dom, uint32_t param, uint64_t
     if ( arg == NULL )
         return -1;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_get_param;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
     arg->domid = dom;
     arg->index = param;
-    rc = do_xen_hypercall(handle, &hypercall);
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_get_param,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
     *value = arg->value;
     xc_hypercall_buffer_free(handle, arg);
     return rc;
@@ -1425,7 +1416,6 @@ int xc_hvm_create_ioreq_server(xc_interface *xch,
                                int handle_bufioreq,
                                ioservid_t *id)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_create_ioreq_server_t, arg);
     int rc;
 
@@ -1433,14 +1423,12 @@ int xc_hvm_create_ioreq_server(xc_interface *xch,
     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;
     arg->handle_bufioreq = handle_bufioreq;
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_create_ioreq_server,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     *id = arg->id;
 
@@ -1455,7 +1443,6 @@ int xc_hvm_get_ioreq_server_info(xc_interface *xch,
                                  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;
 
@@ -1463,14 +1450,12 @@ int xc_hvm_get_ioreq_server_info(xc_interface *xch,
     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);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_get_ioreq_server_info,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
     if ( rc != 0 )
         goto done;
 
@@ -1492,7 +1477,6 @@ 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;
 
@@ -1500,17 +1484,15 @@ int xc_hvm_map_io_range_to_ioreq_server(xc_interface *xch, domid_t domid,
     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);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_map_io_range_to_ioreq_server,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
     return rc;
@@ -1520,7 +1502,6 @@ 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;
 
@@ -1528,17 +1509,15 @@ int xc_hvm_unmap_io_range_from_ioreq_server(xc_interface *xch, domid_t domid,
     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);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_unmap_io_range_from_ioreq_server,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
     return rc;
@@ -1549,7 +1528,6 @@ int xc_hvm_map_pcidev_to_ioreq_server(xc_interface *xch, domid_t domid,
                                       uint8_t bus, uint8_t device,
                                       uint8_t function)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
     int rc;
 
@@ -1562,10 +1540,6 @@ int xc_hvm_map_pcidev_to_ioreq_server(xc_interface *xch, domid_t domid,
     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;
@@ -1579,7 +1553,9 @@ int xc_hvm_map_pcidev_to_ioreq_server(xc_interface *xch, domid_t domid,
                                            (uint64_t)device,
                                            (uint64_t)function);
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_map_io_range_to_ioreq_server,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
     return rc;
@@ -1590,7 +1566,6 @@ int xc_hvm_unmap_pcidev_from_ioreq_server(xc_interface *xch, domid_t domid,
                                           uint8_t bus, uint8_t device,
                                           uint8_t function)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
     int rc;
 
@@ -1603,10 +1578,6 @@ int xc_hvm_unmap_pcidev_from_ioreq_server(xc_interface *xch, domid_t domid,
     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;
@@ -1615,7 +1586,9 @@ int xc_hvm_unmap_pcidev_from_ioreq_server(xc_interface *xch, domid_t domid,
                                            (uint64_t)device,
                                            (uint64_t)function);
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_unmap_io_range_from_ioreq_server,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
     return rc;
@@ -1625,7 +1598,6 @@ 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;
 
@@ -1633,14 +1605,12 @@ int xc_hvm_destroy_ioreq_server(xc_interface *xch,
     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);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_destroy_ioreq_server,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
     return rc;
@@ -1651,7 +1621,6 @@ int xc_hvm_set_ioreq_server_state(xc_interface *xch,
                                   ioservid_t id,
                                   int enabled)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_hvm_set_ioreq_server_state_t, arg);
     int rc;
 
@@ -1659,15 +1628,13 @@ int xc_hvm_set_ioreq_server_state(xc_interface *xch,
     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);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_set_ioreq_server_state,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
     return rc;
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index ae2fe1a..53f7605 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -25,7 +25,6 @@ static int do_evtchn_op(xc_interface *xch, int cmd, void *arg,
                         size_t arg_size, int silently_fail)
 {
     int ret = -1;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(arg, arg_size, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
     if ( xc_hypercall_bounce_pre(xch, arg) )
@@ -34,11 +33,9 @@ static int do_evtchn_op(xc_interface *xch, int cmd, void *arg,
         goto out;
     }
 
-    hypercall.op     = __HYPERVISOR_event_channel_op;
-    hypercall.arg[0] = cmd;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
-    if ((ret = do_xen_hypercall(xch, &hypercall)) < 0 && !silently_fail)
+    ret = xencall2(xch->xcall, __HYPERVISOR_event_channel_op,
+                   cmd, HYPERCALL_BUFFER_AS_ARG(arg));
+    if ( ret < 0 && !silently_fail )
         ERROR("do_evtchn_op: HYPERVISOR_event_channel_op failed: %d", ret);
 
     xc_hypercall_bounce_post(xch, arg);
diff --git a/tools/libxc/xc_flask.c b/tools/libxc/xc_flask.c
index b533656..ec52b0f 100644
--- a/tools/libxc/xc_flask.c
+++ b/tools/libxc/xc_flask.c
@@ -37,7 +37,6 @@
 int xc_flask_op(xc_interface *xch, xen_flask_op_t *op)
 {
     int ret = -1;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(op, sizeof(*op), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
     op->interface_version = XEN_FLASK_INTERFACE_VERSION;
@@ -48,10 +47,9 @@ int xc_flask_op(xc_interface *xch, xen_flask_op_t *op)
         goto out;
     }
 
-    hypercall.op     = __HYPERVISOR_xsm_op;
-    hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(op);
-
-    if ( (ret = do_xen_hypercall(xch, &hypercall)) < 0 )
+    ret = xencall1(xch->xcall, __HYPERVISOR_xsm_op,
+                   HYPERCALL_BUFFER_AS_ARG(op));
+    if ( ret < 0 )
     {
         if ( errno == EACCES )
             fprintf(stderr, "XSM operation failed!\n");
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
index f6a2ccd..6b440ee 100644
--- a/tools/libxc/xc_freebsd_osdep.c
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -88,53 +88,6 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-/*------------------------ Privcmd hypercall interface -----------------------*/
-void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
-{
-    size_t size = npages * XC_PAGE_SIZE;
-    void *p;
-
-    /* Address returned by mmap is page aligned. */
-    p = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-             -1, 0);
-    if (p == 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;
-}
-
-void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
-{
-
-    int saved_errno = errno;
-    /* Unlock pages */
-    munlock(ptr, npages * XC_PAGE_SIZE);
-
-    munmap(ptr, npages * XC_PAGE_SIZE);
-    /* We MUST propagate the hypercall errno, not unmap call's. */
-    errno = saved_errno;
-}
-
-int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
-{
-    int fd = xch->privcmdfd;
-    int ret;
-
-    ret = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
-
-    return (ret == 0) ? hypercall->retval : ret;
-}
-
 /*----------------------- Privcmd foreign map interface ----------------------*/
 void *xc_map_foreign_bulk(xc_interface *xch,
                           uint32_t dom, int prot,
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index dd32aa2..af53fac 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -21,7 +21,6 @@
 int xc_gnttab_op(xc_interface *xch, int cmd, void * op, int op_size, int count)
 {
     int ret = 0;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(op, count * op_size, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
     if ( xc_hypercall_bounce_pre(xch, op) )
@@ -30,12 +29,8 @@ int xc_gnttab_op(xc_interface *xch, int cmd, void * op, int op_size, int count)
         goto out1;
     }
 
-    hypercall.op = __HYPERVISOR_grant_table_op;
-    hypercall.arg[0] = cmd;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(op);
-    hypercall.arg[2] = count;
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall3(xch->xcall,  __HYPERVISOR_grant_table_op,
+                   cmd, HYPERCALL_BUFFER_AS_ARG(op), count);
 
     xc_hypercall_bounce_post(xch, op);
 
diff --git a/tools/libxc/xc_hcall_buf.c b/tools/libxc/xc_hcall_buf.c
index 517b5b4..c1230a1 100644
--- a/tools/libxc/xc_hcall_buf.c
+++ b/tools/libxc/xc_hcall_buf.c
@@ -17,7 +17,6 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <pthread.h>
 
 #include "xc_private.h"
 #include "xg_private.h"
@@ -28,163 +27,38 @@ xc_hypercall_buffer_t XC__HYPERCALL_BUFFER_NAME(HYPERCALL_BUFFER_NULL) = {
     HYPERCALL_BUFFER_INIT_NO_BOUNCE
 };
 
-pthread_mutex_t hypercall_buffer_cache_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-static void hypercall_buffer_cache_lock(xc_interface *xch)
-{
-    int saved_errno = errno;
-    if ( xch->flags & XC_OPENFLAG_NON_REENTRANT )
-        return;
-    pthread_mutex_lock(&hypercall_buffer_cache_mutex);
-    /* Ignore pthread errors. */
-    errno = saved_errno;
-}
-
-static void hypercall_buffer_cache_unlock(xc_interface *xch)
-{
-    int saved_errno = errno;
-    if ( xch->flags & XC_OPENFLAG_NON_REENTRANT )
-        return;
-    pthread_mutex_unlock(&hypercall_buffer_cache_mutex);
-    /* Ignore pthread errors. */
-    errno = saved_errno;
-}
-
-static void *hypercall_buffer_cache_alloc(xc_interface *xch, int nr_pages)
-{
-    void *p = NULL;
-
-    hypercall_buffer_cache_lock(xch);
-
-    xch->hypercall_buffer_total_allocations++;
-    xch->hypercall_buffer_current_allocations++;
-    if ( xch->hypercall_buffer_current_allocations > xch->hypercall_buffer_maximum_allocations )
-        xch->hypercall_buffer_maximum_allocations = xch->hypercall_buffer_current_allocations;
-
-    if ( nr_pages > 1 )
-    {
-        xch->hypercall_buffer_cache_toobig++;
-    }
-    else if ( xch->hypercall_buffer_cache_nr > 0 )
-    {
-        p = xch->hypercall_buffer_cache[--xch->hypercall_buffer_cache_nr];
-        xch->hypercall_buffer_cache_hits++;
-    }
-    else
-    {
-        xch->hypercall_buffer_cache_misses++;
-    }
-
-    hypercall_buffer_cache_unlock(xch);
-
-    return p;
-}
-
-static int hypercall_buffer_cache_free(xc_interface *xch, void *p, int nr_pages)
-{
-    int rc = 0;
-
-    hypercall_buffer_cache_lock(xch);
-
-    xch->hypercall_buffer_total_releases++;
-    xch->hypercall_buffer_current_allocations--;
-
-    if ( nr_pages == 1 && xch->hypercall_buffer_cache_nr < HYPERCALL_BUFFER_CACHE_SIZE )
-    {
-        xch->hypercall_buffer_cache[xch->hypercall_buffer_cache_nr++] = p;
-        rc = 1;
-    }
-
-    hypercall_buffer_cache_unlock(xch);
-
-    return rc;
-}
-
-void xc__hypercall_buffer_cache_release(xc_interface *xch)
-{
-    void *p;
-
-    hypercall_buffer_cache_lock(xch);
-
-    DBGPRINTF("hypercall buffer: total allocations:%d total releases:%d",
-              xch->hypercall_buffer_total_allocations,
-              xch->hypercall_buffer_total_releases);
-    DBGPRINTF("hypercall buffer: current allocations:%d maximum allocations:%d",
-              xch->hypercall_buffer_current_allocations,
-              xch->hypercall_buffer_maximum_allocations);
-    DBGPRINTF("hypercall buffer: cache current size:%d",
-              xch->hypercall_buffer_cache_nr);
-    DBGPRINTF("hypercall buffer: cache hits:%d misses:%d toobig:%d",
-              xch->hypercall_buffer_cache_hits,
-              xch->hypercall_buffer_cache_misses,
-              xch->hypercall_buffer_cache_toobig);
-
-    while ( xch->hypercall_buffer_cache_nr > 0 )
-    {
-        p = xch->hypercall_buffer_cache[--xch->hypercall_buffer_cache_nr];
-        osdep_free_hypercall_buffer(xch, p, 1);
-    }
-
-    hypercall_buffer_cache_unlock(xch);
-}
-
 void *xc__hypercall_buffer_alloc_pages(xc_interface *xch, xc_hypercall_buffer_t *b, int nr_pages)
 {
-    void *p = hypercall_buffer_cache_alloc(xch, nr_pages);
-
-    if ( !p )
-        p = osdep_alloc_hypercall_buffer(xch, nr_pages);
+    void *p = xencall_alloc_buffer_pages(xch->xcall, nr_pages);
 
     if (!p)
         return NULL;
 
     b->hbuf = p;
 
-    memset(p, 0, nr_pages * PAGE_SIZE);
-
     return b->hbuf;
 }
 
 void xc__hypercall_buffer_free_pages(xc_interface *xch, xc_hypercall_buffer_t *b, int nr_pages)
 {
-    if ( b->hbuf == NULL )
-        return;
-
-    if ( !hypercall_buffer_cache_free(xch, b->hbuf, nr_pages) )
-        osdep_free_hypercall_buffer(xch, b->hbuf, nr_pages);
+    xencall_free_buffer_pages(xch->xcall, b->hbuf, nr_pages);
 }
 
-struct allocation_header {
-    int nr_pages;
-};
-
 void *xc__hypercall_buffer_alloc(xc_interface *xch, xc_hypercall_buffer_t *b, size_t size)
 {
-    size_t actual_size = ROUNDUP(size + sizeof(struct allocation_header), PAGE_SHIFT);
-    int nr_pages = actual_size >> PAGE_SHIFT;
-    struct allocation_header *hdr;
+    void *p = xencall_alloc_buffer(xch->xcall, size);
 
-    hdr = xc__hypercall_buffer_alloc_pages(xch, b, nr_pages);
-    if ( hdr == NULL )
+    if (!p)
         return NULL;
 
-    b->hbuf = (void *)(hdr+1);
+    b->hbuf = p;
 
-    hdr->nr_pages = nr_pages;
     return b->hbuf;
 }
 
 void xc__hypercall_buffer_free(xc_interface *xch, xc_hypercall_buffer_t *b)
 {
-    struct allocation_header *hdr;
-
-    if (b->hbuf == NULL)
-        return;
-
-    hdr = b->hbuf;
-    b->hbuf = --hdr;
-
-    xc__hypercall_buffer_free_pages(xch, b, hdr->nr_pages);
+    xencall_free_buffer(xch->xcall, b->hbuf);
 }
 
 int xc__hypercall_bounce_pre(xc_interface *xch, xc_hypercall_buffer_t *b)
diff --git a/tools/libxc/xc_kexec.c b/tools/libxc/xc_kexec.c
index a49cffb..1cceb5d 100644
--- a/tools/libxc/xc_kexec.c
+++ b/tools/libxc/xc_kexec.c
@@ -14,7 +14,6 @@
 
 int xc_kexec_exec(xc_interface *xch, int type)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_kexec_exec_t, exec);
     int ret = -1;
 
@@ -27,11 +26,9 @@ int xc_kexec_exec(xc_interface *xch, int type)
 
     exec->type = type;
 
-    hypercall.op = __HYPERVISOR_kexec_op;
-    hypercall.arg[0] = KEXEC_CMD_kexec;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(exec);
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_kexec_op,
+		   KEXEC_CMD_kexec,
+		   HYPERCALL_BUFFER_AS_ARG(exec));
 
 out:
     xc_hypercall_buffer_free(xch, exec);
@@ -42,7 +39,6 @@ out:
 int xc_kexec_get_range(xc_interface *xch, int range,  int nr,
                        uint64_t *size, uint64_t *start)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_kexec_range_t, get_range);
     int ret = -1;
 
@@ -56,11 +52,9 @@ int xc_kexec_get_range(xc_interface *xch, int range,  int nr,
     get_range->range = range;
     get_range->nr = nr;
 
-    hypercall.op = __HYPERVISOR_kexec_op;
-    hypercall.arg[0] = KEXEC_CMD_kexec_get_range;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(get_range);
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_kexec_op,
+		   KEXEC_CMD_kexec_get_range,
+		   HYPERCALL_BUFFER_AS_ARG(get_range));
 
     *size = get_range->size;
     *start = get_range->start;
@@ -76,7 +70,6 @@ int xc_kexec_load(xc_interface *xch, uint8_t type, uint16_t arch,
                   uint32_t nr_segments, xen_kexec_segment_t *segments)
 {
     int ret = -1;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(segments, sizeof(*segments) * nr_segments,
                              XC_HYPERCALL_BUFFER_BOUNCE_IN);
     DECLARE_HYPERCALL_BUFFER(xen_kexec_load_t, load);
@@ -99,11 +92,9 @@ int xc_kexec_load(xc_interface *xch, uint8_t type, uint16_t arch,
     load->nr_segments = nr_segments;
     set_xen_guest_handle(load->segments.h, segments);
 
-    hypercall.op = __HYPERVISOR_kexec_op;
-    hypercall.arg[0] = KEXEC_CMD_kexec_load;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(load);
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_kexec_op,
+		   KEXEC_CMD_kexec_load,
+		   HYPERCALL_BUFFER_AS_ARG(load));
 
 out:
     xc_hypercall_buffer_free(xch, load);
@@ -114,7 +105,6 @@ out:
 
 int xc_kexec_unload(xc_interface *xch, int type)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(xen_kexec_unload_t, unload);
     int ret = -1;
 
@@ -127,11 +117,9 @@ int xc_kexec_unload(xc_interface *xch, int type)
 
     unload->type = type;
 
-    hypercall.op = __HYPERVISOR_kexec_op;
-    hypercall.arg[0] = KEXEC_CMD_kexec_unload;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(unload);
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_kexec_op,
+		   KEXEC_CMD_kexec_unload,
+		   HYPERCALL_BUFFER_AS_ARG(unload));
 
 out:
     xc_hypercall_buffer_free(xch, unload);
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 9f4c707..e68c495 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -91,55 +91,6 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
-{
-    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. */
-    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;
-}
-
-void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
-{
-    int saved_errno = errno;
-    /* Recover the VMA flags. Maybe it's not necessary */
-    madvise(ptr, npages * XC_PAGE_SIZE, MADV_DOFORK);
-
-    munmap(ptr, npages * XC_PAGE_SIZE);
-    /* We MUST propagate the hypercall errno, not unmap call's. */
-    errno = saved_errno;
-}
-
-int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
-{
-    int fd = xch->privcmdfd;
-    return ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
-}
-
 static int xc_map_foreign_batch_single(int fd, uint32_t dom,
                                        xen_pfn_t *mfn, unsigned long addr)
 {
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index 047e13b..e3c8241 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -61,38 +61,6 @@ void minios_interface_close_fd(int fd)
     files[fd].type = FTYPE_NONE;
 }
 
-void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
-{
-    return xc_memalign(xch, PAGE_SIZE, npages * PAGE_SIZE);
-}
-
-void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
-{
-    free(ptr);
-}
-
-int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
-{
-    multicall_entry_t call;
-    int i, ret;
-
-    call.op = hypercall->op;
-    for (i = 0; i < ARRAY_SIZE(hypercall->arg); i++)
-	call.args[i] = hypercall->arg[i];
-
-    ret = HYPERVISOR_multicall(&call, 1);
-
-    if (ret < 0) {
-	errno = -ret;
-	return -1;
-    }
-    if ((long) call.result < 0) {
-        errno = - (long) call.result;
-        return -1;
-    }
-    return call.result;
-}
-
 void *xc_map_foreign_bulk(xc_interface *xch,
                           uint32_t dom, int prot,
                           const xen_pfn_t *arr, int *err, unsigned int num)
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index c613545..124537b 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -323,7 +323,6 @@ int xc_sched_id(xc_interface *xch,
 int xc_mca_op(xc_interface *xch, struct xen_mc *mc)
 {
     int ret = 0;
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(mc, sizeof(*mc), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
     if ( xc_hypercall_bounce_pre(xch, mc) )
@@ -333,9 +332,9 @@ int xc_mca_op(xc_interface *xch, struct xen_mc *mc)
     }
     mc->interface_version = XEN_MCA_INTERFACE_VERSION;
 
-    hypercall.op = __HYPERVISOR_mca;
-    hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(mc);
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall1(xch->xcall, __HYPERVISOR_mca,
+                   HYPERCALL_BUFFER_AS_ARG(mc));
+
     xc_hypercall_bounce_post(xch, mc);
     return ret;
 }
@@ -471,7 +470,6 @@ int xc_hvm_set_pci_intx_level(
     uint8_t domain, uint8_t bus, uint8_t device, uint8_t intx,
     unsigned int level)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_set_pci_intx_level, arg);
     int rc;
 
@@ -482,10 +480,6 @@ int xc_hvm_set_pci_intx_level(
         return -1;
     }
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_set_pci_intx_level;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->domid  = dom;
     arg->domain = domain;
     arg->bus    = bus;
@@ -493,7 +487,9 @@ int xc_hvm_set_pci_intx_level(
     arg->intx   = intx;
     arg->level  = level;
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_set_pci_intx_level,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -505,7 +501,6 @@ int xc_hvm_set_isa_irq_level(
     uint8_t isa_irq,
     unsigned int level)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_set_isa_irq_level, arg);
     int rc;
 
@@ -516,15 +511,13 @@ int xc_hvm_set_isa_irq_level(
         return -1;
     }
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_set_isa_irq_level;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->domid   = dom;
     arg->isa_irq = isa_irq;
     arg->level   = level;
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_set_isa_irq_level,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -534,7 +527,6 @@ int xc_hvm_set_isa_irq_level(
 int xc_hvm_set_pci_link_route(
     xc_interface *xch, domid_t dom, uint8_t link, uint8_t isa_irq)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_set_pci_link_route, arg);
     int rc;
 
@@ -545,15 +537,13 @@ int xc_hvm_set_pci_link_route(
         return -1;
     }
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_set_pci_link_route;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->domid   = dom;
     arg->link    = link;
     arg->isa_irq = isa_irq;
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_set_pci_link_route,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -563,7 +553,6 @@ int xc_hvm_set_pci_link_route(
 int xc_hvm_inject_msi(
     xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_inject_msi, arg);
     int rc;
 
@@ -574,15 +563,13 @@ int xc_hvm_inject_msi(
         return -1;
     }
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_inject_msi;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->domid = dom;
     arg->addr  = addr;
     arg->data  = data;
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_inject_msi,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -594,7 +581,6 @@ int xc_hvm_track_dirty_vram(
     uint64_t first_pfn, uint64_t nr,
     unsigned long *dirty_bitmap)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(dirty_bitmap, (nr+7) / 8, XC_HYPERCALL_BUFFER_BOUNCE_OUT);
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_track_dirty_vram, arg);
     int rc;
@@ -607,16 +593,14 @@ int xc_hvm_track_dirty_vram(
         goto out;
     }
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_track_dirty_vram;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->domid     = dom;
     arg->first_pfn = first_pfn;
     arg->nr        = nr;
     set_xen_guest_handle(arg->dirty_bitmap, dirty_bitmap);
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_track_dirty_vram,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
 out:
     xc_hypercall_buffer_free(xch, arg);
@@ -627,7 +611,6 @@ out:
 int xc_hvm_modified_memory(
     xc_interface *xch, domid_t dom, uint64_t first_pfn, uint64_t nr)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_modified_memory, arg);
     int rc;
 
@@ -638,15 +621,13 @@ int xc_hvm_modified_memory(
         return -1;
     }
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_modified_memory;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
     arg->domid     = dom;
     arg->first_pfn = first_pfn;
     arg->nr        = nr;
 
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_modified_memory,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -656,7 +637,6 @@ int xc_hvm_modified_memory(
 int xc_hvm_set_mem_type(
     xc_interface *xch, domid_t dom, hvmmem_type_t mem_type, uint64_t first_pfn, uint64_t nr)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_set_mem_type, arg);
     int rc;
 
@@ -672,11 +652,9 @@ int xc_hvm_set_mem_type(
     arg->first_pfn    = first_pfn;
     arg->nr           = nr;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_set_mem_type;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_set_mem_type,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
@@ -688,7 +666,6 @@ int xc_hvm_inject_trap(
     uint32_t type, uint32_t error_code, uint32_t insn_len,
     uint64_t cr2)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_inject_trap, arg);
     int rc;
 
@@ -707,11 +684,9 @@ int xc_hvm_inject_trap(
     arg->insn_len    = insn_len;
     arg->cr2         = cr2;
 
-    hypercall.op     = __HYPERVISOR_hvm_op;
-    hypercall.arg[0] = HVMOP_inject_trap;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
-    rc = do_xen_hypercall(xch, &hypercall);
+    rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op,
+                  HVMOP_inject_trap,
+                  HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_buffer_free(xch, arg);
 
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 9abb3b6..5e3b343 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -67,46 +67,6 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages)
-{
-    size_t size = npages * XC_PAGE_SIZE;
-    void *p;
-
-    p = xc_memalign(xch, XC_PAGE_SIZE, size);
-    if (!p)
-        return NULL;
-
-    if ( mlock(p, size) < 0 )
-    {
-        free(p);
-        return NULL;
-    }
-    return p;
-}
-
-void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages)
-{
-    (void) munlock(ptr, npages * XC_PAGE_SIZE);
-    free(ptr);
-}
-
-int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
-{
-    int fd = xch->privcmdfd;
-    int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
-
-    /*
-     * Since NetBSD ioctl can only return 0 on success or < 0 on
-     * error, if we want to return a value from ioctl we should
-     * do so by setting hypercall->retval, to mimic Linux ioctl
-     * implementation.
-     */
-    if (error < 0)
-        return error;
-    else
-        return hypercall->retval;
-}
-
 void *xc_map_foreign_bulk(xc_interface *xch,
                           uint32_t dom, int prot,
                           const xen_pfn_t *arr, int *err, unsigned int num)
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index de5873e..ca4c17a 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -39,16 +39,6 @@ struct xc_interface_core *xc_interface_open(xentoollog_logger *logger,
     xch->error_handler   = logger;           xch->error_handler_tofree   = 0;
     xch->dombuild_logger = dombuild_logger;  xch->dombuild_logger_tofree = 0;
 
-    xch->hypercall_buffer_cache_nr = 0;
-
-    xch->hypercall_buffer_total_allocations = 0;
-    xch->hypercall_buffer_total_releases = 0;
-    xch->hypercall_buffer_current_allocations = 0;
-    xch->hypercall_buffer_maximum_allocations = 0;
-    xch->hypercall_buffer_cache_hits = 0;
-    xch->hypercall_buffer_cache_misses = 0;
-    xch->hypercall_buffer_cache_toobig = 0;
-
     if (!xch->error_handler) {
         xch->error_handler = xch->error_handler_tofree =
             (xentoollog_logger*)
@@ -65,14 +55,22 @@ struct xc_interface_core *xc_interface_open(xentoollog_logger *logger,
     }
     *xch = xch_buf;
 
-    if (!(open_flags & XC_OPENFLAG_DUMMY)) {
-        if ( osdep_privcmd_open(xch) < 0 )
-            goto err;
-    }
+    if (open_flags & XC_OPENFLAG_DUMMY)
+        return xch; /* We are done */
+
+    if ( osdep_privcmd_open(xch) < 0 )
+        goto err;
+
+    xch->xcall = xencall_open(xch->error_handler,
+        open_flags & XC_OPENFLAG_NON_REENTRANT ? XENCALL_OPENFLAG_NON_REENTRANT : 0U);
+
+    if ( xch->xcall == NULL )
+        goto err;
 
     return xch;
 
  err:
+    osdep_privcmd_close(xch);
     xtl_logger_destroy(xch->error_handler_tofree);
     if (xch != &xch_buf) free(xch);
     return NULL;
@@ -85,11 +83,12 @@ int xc_interface_close(xc_interface *xch)
     if (!xch)
         return 0;
 
+    rc = xencall_close(xch->xcall);
+    if (rc) PERROR("Could not close xencall interface");
+
     rc = osdep_privcmd_close(xch);
     if (rc) PERROR("Could not close hypervisor interface");
 
-    xc__hypercall_buffer_cache_release(xch);
-
     xtl_logger_destroy(xch->dombuild_logger_tofree);
     xtl_logger_destroy(xch->error_handler_tofree);
 
@@ -228,7 +227,6 @@ int xc_mmuext_op(
     unsigned int nr_ops,
     domid_t dom)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(op, nr_ops*sizeof(*op), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     long ret = -1;
 
@@ -238,13 +236,9 @@ int xc_mmuext_op(
         goto out1;
     }
 
-    hypercall.op     = __HYPERVISOR_mmuext_op;
-    hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(op);
-    hypercall.arg[1] = (unsigned long)nr_ops;
-    hypercall.arg[2] = (unsigned long)0;
-    hypercall.arg[3] = (unsigned long)dom;
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall4(xch->xcall, __HYPERVISOR_mmuext_op,
+                   HYPERCALL_BUFFER_AS_ARG(op),
+                   nr_ops, 0, dom);
 
     xc_hypercall_bounce_post(xch, op);
 
@@ -254,8 +248,7 @@ int xc_mmuext_op(
 
 static int flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu)
 {
-    int err = 0;
-    DECLARE_HYPERCALL;
+    int rc, err = 0;
     DECLARE_NAMED_HYPERCALL_BOUNCE(updates, mmu->updates, mmu->idx*sizeof(*mmu->updates), XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
     if ( mmu->idx == 0 )
@@ -268,13 +261,10 @@ static int flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu)
         goto out;
     }
 
-    hypercall.op     = __HYPERVISOR_mmu_update;
-    hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(updates);
-    hypercall.arg[1] = (unsigned long)mmu->idx;
-    hypercall.arg[2] = 0;
-    hypercall.arg[3] = mmu->subject;
-
-    if ( do_xen_hypercall(xch, &hypercall) < 0 )
+    rc = xencall4(xch->xcall, __HYPERVISOR_mmu_update,
+                  HYPERCALL_BUFFER_AS_ARG(updates),
+                  mmu->idx, 0, mmu->subject);
+    if ( rc < 0 )
     {
         ERROR("Failure when submitting mmu updates");
         err = 1;
@@ -317,7 +307,6 @@ int xc_flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu)
 
 long do_memory_op(xc_interface *xch, int cmd, void *arg, size_t len)
 {
-    DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BOUNCE(arg, len, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
     long ret = -1;
 
@@ -327,11 +316,8 @@ long do_memory_op(xc_interface *xch, int cmd, void *arg, size_t len)
         goto out1;
     }
 
-    hypercall.op     = __HYPERVISOR_memory_op;
-    hypercall.arg[0] = (unsigned long) cmd;
-    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
-
-    ret = do_xen_hypercall(xch, &hypercall);
+    ret = xencall2(xch->xcall, __HYPERVISOR_memory_op,
+                   cmd, HYPERCALL_BUFFER_AS_ARG(arg));
 
     xc_hypercall_bounce_post(xch, arg);
  out1:
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 30157cf..c93df7f 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -30,6 +30,7 @@
 
 #include "_paths.h"
 #include "xenctrl.h"
+#include <xencall.h>
 
 #include <xen/sys/privcmd.h>
 
@@ -53,7 +54,6 @@ struct iovec {
 #include <sys/uio.h>
 #endif
 
-#define DECLARE_HYPERCALL privcmd_hypercall_t hypercall
 #define DECLARE_DOMCTL struct xen_domctl domctl
 #define DECLARE_SYSCTL struct xen_sysctl sysctl
 #define DECLARE_PHYSDEV_OP struct physdev_op physdev_op
@@ -94,29 +94,11 @@ struct xc_interface_core {
     FILE *dombuild_logger_file;
     const char *currently_progress_reporting;
 
-    /*
-     * A simple cache of unused, single page, hypercall buffers
-     *
-     * Protected by a global lock.
-     */
-#define HYPERCALL_BUFFER_CACHE_SIZE 4
-    int hypercall_buffer_cache_nr;
-    void *hypercall_buffer_cache[HYPERCALL_BUFFER_CACHE_SIZE];
-
-    /*
-     * Hypercall buffer statistics. All protected by the global
-     * hypercall_buffer_cache lock.
-     */
-    int hypercall_buffer_total_allocations;
-    int hypercall_buffer_total_releases;
-    int hypercall_buffer_current_allocations;
-    int hypercall_buffer_maximum_allocations;
-    int hypercall_buffer_cache_hits;
-    int hypercall_buffer_cache_misses;
-    int hypercall_buffer_cache_toobig;
-
     /* Privcmd interface */

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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:15:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:15: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 1aON8Y-0000dJ-QB; Wed, 27 Jan 2016 10:15: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 1aON8X-0000cM-GY
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:41 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	18/B9-21901-CC898A65; Wed, 27 Jan 2016 10:15:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453889736!18192955!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28594 invoked from network); 27 Jan 2016 10:15:37 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9K-0001xb-PA
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8S-0001NQ-IQ
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:36 +0000
Date: Wed, 27 Jan 2016 10:15:36 +0000
Message-Id: <E1aON8S-0001NQ-IQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Remove xc_map_foreign_batch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b701ccc8ab35ff63bc4d613ec3c7bafec15aa0ee
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 18 10:52:30 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:23:34 2016 +0000

    tools: Remove xc_map_foreign_batch
    
    It can trivially be replaced by xc_map_foreign_pages which is the
    interface I want to move to going forward (by standardising on _bulk
    but handling err=NULL as _pages does).
    
    The callers of _batch are checking a mixture of a NULL return or
    looking to see if the top nibble of the (usually sole) mfn they pass
    has been modified to be non-zero to detect errors. _pages never
    modifies the mfn it was given (it's const) and returns NULL on
    failure, so adjust the error handling where necessary. Some callers
    use a copy of the mfn array, for reuse on failure with _batch, which
    is no longer necessary as _pages doesn't modify the array, however I
    haven't cleaned that up here.
    
    This reduces the twist maze of xc_map_foreign_* by one, which will be
    useful when trying to come up with an underlying stable interface.
    
    NetBSD and Solaris implemented xc_map_foreign_bulk in terms of
    xc_map_foreign_batch via a compat layer, so xc_map_foreign_batch
    becomes an internal osdep for them.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
    Cc: George Dunlap <george.dunlap@eu.citrix.com>
---
 tools/libxc/include/xenctrl.h   |   10 ------
 tools/libxc/xc_foreign_memory.c |    4 ++-
 tools/libxc/xc_linux_osdep.c    |   59 ++-------------------------------------
 tools/libxc/xc_minios.c         |   22 --------------
 tools/libxc/xc_netbsd.c         |   10 +++---
 tools/libxc/xc_solaris.c        |    6 ++--
 tools/libxc/xc_vm_event.c       |   18 +++++++++--
 tools/xenmon/xenbaked.c         |   12 +++++++-
 tools/xenpaging/xenpaging.c     |   14 ++++----
 tools/xentrace/xentrace.c       |    3 +-
 10 files changed, 48 insertions(+), 110 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index d7444c8..43ce14a 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1387,16 +1387,6 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
                            const xen_pfn_t *arr, int num );
 
 /**
- * DEPRECATED - use xc_map_foreign_bulk() instead.
- *
- * Like xc_map_foreign_pages(), except it can succeeed partially.
- * When a page cannot be mapped, its PFN in @arr is or'ed with
- * 0xF0000000 to indicate the error.
- */
-void *xc_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot,
-                           xen_pfn_t *arr, int num );
-
-/**
  * Like xc_map_foreign_pages(), except it can succeed partially.
  * When a page cannot be mapped, its respective field in @err is
  * set to the corresponding errno value.
diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index b205bca..2413e75 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -55,6 +55,8 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
  * just implement xc_map_foreign_bulk.
  */
 #if defined(__NetBSD__) || defined(__sun__)
+void *osdep_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot,
+                              xen_pfn_t *arr, int num );
 void *xc_map_foreign_bulk(xc_interface *xch,
                           uint32_t dom, int prot,
                           const xen_pfn_t *arr, int *err, unsigned int num)
@@ -75,7 +77,7 @@ void *xc_map_foreign_bulk(xc_interface *xch,
     }
 
     memcpy(pfn, arr, num * sizeof(*arr));
-    ret = xc_map_foreign_batch(xch, dom, prot, pfn, num);
+    ret = osdep_map_foreign_batch(xch, dom, prot, pfn, num);
 
     if (ret) {
         for (i = 0; i < num; ++i)
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index e68c495..39c88ce 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -91,8 +91,8 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-static int xc_map_foreign_batch_single(int fd, uint32_t dom,
-                                       xen_pfn_t *mfn, unsigned long addr)
+static int map_foreign_batch_single(int fd, uint32_t dom,
+                                    xen_pfn_t *mfn, unsigned long addr)
 {
     privcmd_mmapbatch_t ioctlx;
     int rc;
@@ -113,59 +113,6 @@ static int xc_map_foreign_batch_single(int fd, uint32_t dom,
     return rc;
 }
 
-void *xc_map_foreign_batch(xc_interface *xch,
-                           uint32_t dom, int prot,
-                           xen_pfn_t *arr, int num)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmapbatch_t ioctlx;
-    void *addr;
-    int rc;
-
-    addr = mmap(NULL, num << XC_PAGE_SHIFT, prot, MAP_SHARED, fd, 0);
-    if ( addr == MAP_FAILED )
-    {
-        PERROR("xc_map_foreign_batch: mmap failed");
-        return NULL;
-    }
-
-    ioctlx.num = num;
-    ioctlx.dom = dom;
-    ioctlx.addr = (unsigned long)addr;
-    ioctlx.arr = arr;
-
-    rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
-    if ( (rc < 0) && (errno == ENOENT) )
-    {
-        int i;
-
-        for ( i = 0; i < num; i++ )
-        {
-            if ( (arr[i] & PRIVCMD_MMAPBATCH_MFN_ERROR) ==
-                           PRIVCMD_MMAPBATCH_PAGED_ERROR )
-            {
-                unsigned long paged_addr = (unsigned long)addr + (i << XC_PAGE_SHIFT);
-                rc = xc_map_foreign_batch_single(fd, dom, &arr[i],
-                                                 paged_addr);
-                if ( rc < 0 )
-                    goto out;
-            }
-        }
-    }
-
- out:
-    if ( rc < 0 )
-    {
-        int saved_errno = errno;
-        PERROR("xc_map_foreign_batch: ioctl failed");
-        (void)munmap(addr, num << XC_PAGE_SHIFT);
-        errno = saved_errno;
-        return NULL;
-    }
-
-    return addr;
-}
-
 /*
  * Retry mmap of all paged gfns in batches
  * retuns < 0 on fatal error
@@ -305,7 +252,7 @@ void *xc_map_foreign_bulk(xc_interface *xch,
                     err[i] = rc ?: -EINVAL;
                     continue;
                 }
-                rc = xc_map_foreign_batch_single(fd, dom, pfn + i,
+                rc = map_foreign_batch_single(fd, dom, pfn + i,
                         (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT));
                 if ( rc < 0 )
                 {
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index e3c8241..3ea3124 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -73,28 +73,6 @@ void *xc_map_foreign_bulk(xc_interface *xch,
     return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
 }
 
-void *xc_map_foreign_batch(xc_interface *xch,
-                           uint32_t dom, int prot,
-                           xen_pfn_t *arr, int num)
-{
-    unsigned long pt_prot = 0;
-    int err[num];
-    int i;
-    unsigned long addr;
-
-    if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
-    if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
-
-    addr = (unsigned long) map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
-    for (i = 0; i < num; i++) {
-        if (err[i])
-            arr[i] |= 0xF0000000;
-    }
-    return (void *) addr;
-}
-
 void *xc_map_foreign_range(xc_interface *xch,
                            uint32_t dom,
                            int size, int prot,
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index d7f7f31..6a7ff9f 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -67,16 +67,16 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-void *xc_map_foreign_batch(xc_interface *xch,
-                           uint32_t dom, int prot,
-                           xen_pfn_t *arr, int num)
+void *osdep_map_foreign_batch(xc_interface *xch,
+                              uint32_t dom, int prot,
+                              xen_pfn_t *arr, int num)
 {
     int fd = xch->privcmdfd;
     privcmd_mmapbatch_t ioctlx;
     void *addr;
     addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
     if ( addr == MAP_FAILED ) {
-        PERROR("xc_map_foreign_batch: mmap failed");
+        PERROR("osdep_map_foreign_batch: mmap failed");
         return NULL;
     }
 
@@ -87,7 +87,7 @@ void *xc_map_foreign_batch(xc_interface *xch,
     if ( ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 )
     {
         int saved_errno = errno;
-        PERROR("xc_map_foreign_batch: ioctl failed");
+        PERROR("osdep_map_foreign_batch: ioctl failed");
         (void)munmap(addr, num*XC_PAGE_SIZE);
         errno = saved_errno;
         return NULL;
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index 5e72dee..2df7a06 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -67,9 +67,9 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-void *xc_map_foreign_batch(xc_interface *xch,
-                          uint32_t dom, int prot,
-                          xen_pfn_t *arr, int num)
+void *osdep_map_foreign_batch(xc_interface *xch,
+                              uint32_t dom, int prot,
+                              xen_pfn_t *arr, int num)
 {
     int fd = xch->privcmdfd;
     privcmd_mmapbatch_t ioctlx;
diff --git a/tools/libxc/xc_vm_event.c b/tools/libxc/xc_vm_event.c
index 2fef96a..d2d99e4 100644
--- a/tools/libxc/xc_vm_event.c
+++ b/tools/libxc/xc_vm_event.c
@@ -72,9 +72,9 @@ void *xc_vm_event_enable(xc_interface *xch, domid_t domain_id, int param,
 
     ring_pfn = pfn;
     mmap_pfn = pfn;
-    ring_page = xc_map_foreign_batch(xch, domain_id, PROT_READ | PROT_WRITE,
+    ring_page = xc_map_foreign_pages(xch, domain_id, PROT_READ | PROT_WRITE,
                                      &mmap_pfn, 1);
-    if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+    if ( !ring_page )
     {
         /* Map failed, populate ring page */
         rc1 = xc_domain_populate_physmap_exact(xch, domain_id, 1, 0, 0,
@@ -86,9 +86,9 @@ void *xc_vm_event_enable(xc_interface *xch, domid_t domain_id, int param,
         }
 
         mmap_pfn = ring_pfn;
-        ring_page = xc_map_foreign_batch(xch, domain_id, PROT_READ | PROT_WRITE,
+        ring_page = xc_map_foreign_pages(xch, domain_id, PROT_READ | PROT_WRITE,
                                          &mmap_pfn, 1);
-        if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+        if ( !ring_page )
         {
             PERROR("Could not map the ring page\n");
             goto out;
@@ -156,3 +156,13 @@ void *xc_vm_event_enable(xc_interface *xch, domid_t domain_id, int param,
 
     return ring_page;
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/xenmon/xenbaked.c b/tools/xenmon/xenbaked.c
index e4602ef..da46126 100644
--- a/tools/xenmon/xenbaked.c
+++ b/tools/xenmon/xenbaked.c
@@ -411,7 +411,7 @@ static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
         for ( j=0; j<tbufs.t_info->tbuf_size; j++)
             pfn_list[j] = (xen_pfn_t)mfn_list[j];
 
-        tbufs.meta[i] = xc_map_foreign_batch(xc_handle, DOMID_XEN,
+        tbufs.meta[i] = xc_map_foreign_pages(xc_handle, DOMID_XEN,
                                              PROT_READ | PROT_WRITE,
                                              pfn_list,
                                              tbufs.t_info->tbuf_size);
@@ -1175,3 +1175,13 @@ static int process_record(int cpu, struct t_rec *r)
 
     return 4 + (r->cycles_included ? 8 : 0) + (r->extra_u32 * 4);
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
index df99c6a..c4bc713 100644
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -342,9 +342,9 @@ static struct xenpaging *xenpaging_init(int argc, char *argv[])
                         HVM_PARAM_PAGING_RING_PFN, &ring_pfn);
     mmap_pfn = ring_pfn;
     paging->vm_event.ring_page = 
-        xc_map_foreign_batch(xch, paging->vm_event.domain_id, 
-                                PROT_READ | PROT_WRITE, &mmap_pfn, 1);
-    if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+        xc_map_foreign_pages(xch, paging->vm_event.domain_id,
+                             PROT_READ | PROT_WRITE, &mmap_pfn, 1);
+    if ( !paging->vm_event.ring_page )
     {
         /* Map failed, populate ring page */
         rc = xc_domain_populate_physmap_exact(paging->xc_handle, 
@@ -356,11 +356,11 @@ static struct xenpaging *xenpaging_init(int argc, char *argv[])
             goto err;
         }
 
-        mmap_pfn = ring_pfn;
         paging->vm_event.ring_page = 
-            xc_map_foreign_batch(xch, paging->vm_event.domain_id, 
-                                    PROT_READ | PROT_WRITE, &mmap_pfn, 1);
-        if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+            xc_map_foreign_pages(xch, paging->vm_event.domain_id,
+                                 PROT_READ | PROT_WRITE,
+                                 &mmap_pfn, 1);
+        if ( !paging->vm_event.ring_page )
         {
             PERROR("Could not map the ring page\n");
             goto err;
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c
index c970d42..6cbe0ac 100644
--- a/tools/xentrace/xentrace.c
+++ b/tools/xentrace/xentrace.c
@@ -508,7 +508,7 @@ static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
         for ( j=0; j<tbufs.t_info->tbuf_size; j++)
             pfn_list[j] = (xen_pfn_t)mfn_list[j];
 
-        tbufs.meta[i] = xc_map_foreign_batch(xc_handle, DOMID_XEN,
+        tbufs.meta[i] = xc_map_foreign_pages(xc_handle, DOMID_XEN,
                                              PROT_READ | PROT_WRITE,
                                              pfn_list,
                                              tbufs.t_info->tbuf_size);
@@ -1221,6 +1221,7 @@ int main(int argc, char **argv)
 
     return ret;
 }
+
 /*
  * 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 Wed Jan 27 10:15:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:15: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 1aON8Y-0000dJ-QB; Wed, 27 Jan 2016 10:15: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 1aON8X-0000cM-GY
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:41 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	18/B9-21901-CC898A65; Wed, 27 Jan 2016 10:15:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453889736!18192955!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28594 invoked from network); 27 Jan 2016 10:15:37 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9K-0001xb-PA
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8S-0001NQ-IQ
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:36 +0000
Date: Wed, 27 Jan 2016 10:15:36 +0000
Message-Id: <E1aON8S-0001NQ-IQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Remove xc_map_foreign_batch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b701ccc8ab35ff63bc4d613ec3c7bafec15aa0ee
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 18 10:52:30 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:23:34 2016 +0000

    tools: Remove xc_map_foreign_batch
    
    It can trivially be replaced by xc_map_foreign_pages which is the
    interface I want to move to going forward (by standardising on _bulk
    but handling err=NULL as _pages does).
    
    The callers of _batch are checking a mixture of a NULL return or
    looking to see if the top nibble of the (usually sole) mfn they pass
    has been modified to be non-zero to detect errors. _pages never
    modifies the mfn it was given (it's const) and returns NULL on
    failure, so adjust the error handling where necessary. Some callers
    use a copy of the mfn array, for reuse on failure with _batch, which
    is no longer necessary as _pages doesn't modify the array, however I
    haven't cleaned that up here.
    
    This reduces the twist maze of xc_map_foreign_* by one, which will be
    useful when trying to come up with an underlying stable interface.
    
    NetBSD and Solaris implemented xc_map_foreign_bulk in terms of
    xc_map_foreign_batch via a compat layer, so xc_map_foreign_batch
    becomes an internal osdep for them.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
    Cc: George Dunlap <george.dunlap@eu.citrix.com>
---
 tools/libxc/include/xenctrl.h   |   10 ------
 tools/libxc/xc_foreign_memory.c |    4 ++-
 tools/libxc/xc_linux_osdep.c    |   59 ++-------------------------------------
 tools/libxc/xc_minios.c         |   22 --------------
 tools/libxc/xc_netbsd.c         |   10 +++---
 tools/libxc/xc_solaris.c        |    6 ++--
 tools/libxc/xc_vm_event.c       |   18 +++++++++--
 tools/xenmon/xenbaked.c         |   12 +++++++-
 tools/xenpaging/xenpaging.c     |   14 ++++----
 tools/xentrace/xentrace.c       |    3 +-
 10 files changed, 48 insertions(+), 110 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index d7444c8..43ce14a 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1387,16 +1387,6 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
                            const xen_pfn_t *arr, int num );
 
 /**
- * DEPRECATED - use xc_map_foreign_bulk() instead.
- *
- * Like xc_map_foreign_pages(), except it can succeeed partially.
- * When a page cannot be mapped, its PFN in @arr is or'ed with
- * 0xF0000000 to indicate the error.
- */
-void *xc_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot,
-                           xen_pfn_t *arr, int num );
-
-/**
  * Like xc_map_foreign_pages(), except it can succeed partially.
  * When a page cannot be mapped, its respective field in @err is
  * set to the corresponding errno value.
diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index b205bca..2413e75 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -55,6 +55,8 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
  * just implement xc_map_foreign_bulk.
  */
 #if defined(__NetBSD__) || defined(__sun__)
+void *osdep_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot,
+                              xen_pfn_t *arr, int num );
 void *xc_map_foreign_bulk(xc_interface *xch,
                           uint32_t dom, int prot,
                           const xen_pfn_t *arr, int *err, unsigned int num)
@@ -75,7 +77,7 @@ void *xc_map_foreign_bulk(xc_interface *xch,
     }
 
     memcpy(pfn, arr, num * sizeof(*arr));
-    ret = xc_map_foreign_batch(xch, dom, prot, pfn, num);
+    ret = osdep_map_foreign_batch(xch, dom, prot, pfn, num);
 
     if (ret) {
         for (i = 0; i < num; ++i)
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index e68c495..39c88ce 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -91,8 +91,8 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-static int xc_map_foreign_batch_single(int fd, uint32_t dom,
-                                       xen_pfn_t *mfn, unsigned long addr)
+static int map_foreign_batch_single(int fd, uint32_t dom,
+                                    xen_pfn_t *mfn, unsigned long addr)
 {
     privcmd_mmapbatch_t ioctlx;
     int rc;
@@ -113,59 +113,6 @@ static int xc_map_foreign_batch_single(int fd, uint32_t dom,
     return rc;
 }
 
-void *xc_map_foreign_batch(xc_interface *xch,
-                           uint32_t dom, int prot,
-                           xen_pfn_t *arr, int num)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmapbatch_t ioctlx;
-    void *addr;
-    int rc;
-
-    addr = mmap(NULL, num << XC_PAGE_SHIFT, prot, MAP_SHARED, fd, 0);
-    if ( addr == MAP_FAILED )
-    {
-        PERROR("xc_map_foreign_batch: mmap failed");
-        return NULL;
-    }
-
-    ioctlx.num = num;
-    ioctlx.dom = dom;
-    ioctlx.addr = (unsigned long)addr;
-    ioctlx.arr = arr;
-
-    rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
-    if ( (rc < 0) && (errno == ENOENT) )
-    {
-        int i;
-
-        for ( i = 0; i < num; i++ )
-        {
-            if ( (arr[i] & PRIVCMD_MMAPBATCH_MFN_ERROR) ==
-                           PRIVCMD_MMAPBATCH_PAGED_ERROR )
-            {
-                unsigned long paged_addr = (unsigned long)addr + (i << XC_PAGE_SHIFT);
-                rc = xc_map_foreign_batch_single(fd, dom, &arr[i],
-                                                 paged_addr);
-                if ( rc < 0 )
-                    goto out;
-            }
-        }
-    }
-
- out:
-    if ( rc < 0 )
-    {
-        int saved_errno = errno;
-        PERROR("xc_map_foreign_batch: ioctl failed");
-        (void)munmap(addr, num << XC_PAGE_SHIFT);
-        errno = saved_errno;
-        return NULL;
-    }
-
-    return addr;
-}
-
 /*
  * Retry mmap of all paged gfns in batches
  * retuns < 0 on fatal error
@@ -305,7 +252,7 @@ void *xc_map_foreign_bulk(xc_interface *xch,
                     err[i] = rc ?: -EINVAL;
                     continue;
                 }
-                rc = xc_map_foreign_batch_single(fd, dom, pfn + i,
+                rc = map_foreign_batch_single(fd, dom, pfn + i,
                         (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT));
                 if ( rc < 0 )
                 {
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index e3c8241..3ea3124 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -73,28 +73,6 @@ void *xc_map_foreign_bulk(xc_interface *xch,
     return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
 }
 
-void *xc_map_foreign_batch(xc_interface *xch,
-                           uint32_t dom, int prot,
-                           xen_pfn_t *arr, int num)
-{
-    unsigned long pt_prot = 0;
-    int err[num];
-    int i;
-    unsigned long addr;
-
-    if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
-    if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
-
-    addr = (unsigned long) map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
-    for (i = 0; i < num; i++) {
-        if (err[i])
-            arr[i] |= 0xF0000000;
-    }
-    return (void *) addr;
-}
-
 void *xc_map_foreign_range(xc_interface *xch,
                            uint32_t dom,
                            int size, int prot,
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index d7f7f31..6a7ff9f 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -67,16 +67,16 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-void *xc_map_foreign_batch(xc_interface *xch,
-                           uint32_t dom, int prot,
-                           xen_pfn_t *arr, int num)
+void *osdep_map_foreign_batch(xc_interface *xch,
+                              uint32_t dom, int prot,
+                              xen_pfn_t *arr, int num)
 {
     int fd = xch->privcmdfd;
     privcmd_mmapbatch_t ioctlx;
     void *addr;
     addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
     if ( addr == MAP_FAILED ) {
-        PERROR("xc_map_foreign_batch: mmap failed");
+        PERROR("osdep_map_foreign_batch: mmap failed");
         return NULL;
     }
 
@@ -87,7 +87,7 @@ void *xc_map_foreign_batch(xc_interface *xch,
     if ( ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 )
     {
         int saved_errno = errno;
-        PERROR("xc_map_foreign_batch: ioctl failed");
+        PERROR("osdep_map_foreign_batch: ioctl failed");
         (void)munmap(addr, num*XC_PAGE_SIZE);
         errno = saved_errno;
         return NULL;
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index 5e72dee..2df7a06 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -67,9 +67,9 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-void *xc_map_foreign_batch(xc_interface *xch,
-                          uint32_t dom, int prot,
-                          xen_pfn_t *arr, int num)
+void *osdep_map_foreign_batch(xc_interface *xch,
+                              uint32_t dom, int prot,
+                              xen_pfn_t *arr, int num)
 {
     int fd = xch->privcmdfd;
     privcmd_mmapbatch_t ioctlx;
diff --git a/tools/libxc/xc_vm_event.c b/tools/libxc/xc_vm_event.c
index 2fef96a..d2d99e4 100644
--- a/tools/libxc/xc_vm_event.c
+++ b/tools/libxc/xc_vm_event.c
@@ -72,9 +72,9 @@ void *xc_vm_event_enable(xc_interface *xch, domid_t domain_id, int param,
 
     ring_pfn = pfn;
     mmap_pfn = pfn;
-    ring_page = xc_map_foreign_batch(xch, domain_id, PROT_READ | PROT_WRITE,
+    ring_page = xc_map_foreign_pages(xch, domain_id, PROT_READ | PROT_WRITE,
                                      &mmap_pfn, 1);
-    if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+    if ( !ring_page )
     {
         /* Map failed, populate ring page */
         rc1 = xc_domain_populate_physmap_exact(xch, domain_id, 1, 0, 0,
@@ -86,9 +86,9 @@ void *xc_vm_event_enable(xc_interface *xch, domid_t domain_id, int param,
         }
 
         mmap_pfn = ring_pfn;
-        ring_page = xc_map_foreign_batch(xch, domain_id, PROT_READ | PROT_WRITE,
+        ring_page = xc_map_foreign_pages(xch, domain_id, PROT_READ | PROT_WRITE,
                                          &mmap_pfn, 1);
-        if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+        if ( !ring_page )
         {
             PERROR("Could not map the ring page\n");
             goto out;
@@ -156,3 +156,13 @@ void *xc_vm_event_enable(xc_interface *xch, domid_t domain_id, int param,
 
     return ring_page;
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/xenmon/xenbaked.c b/tools/xenmon/xenbaked.c
index e4602ef..da46126 100644
--- a/tools/xenmon/xenbaked.c
+++ b/tools/xenmon/xenbaked.c
@@ -411,7 +411,7 @@ static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
         for ( j=0; j<tbufs.t_info->tbuf_size; j++)
             pfn_list[j] = (xen_pfn_t)mfn_list[j];
 
-        tbufs.meta[i] = xc_map_foreign_batch(xc_handle, DOMID_XEN,
+        tbufs.meta[i] = xc_map_foreign_pages(xc_handle, DOMID_XEN,
                                              PROT_READ | PROT_WRITE,
                                              pfn_list,
                                              tbufs.t_info->tbuf_size);
@@ -1175,3 +1175,13 @@ static int process_record(int cpu, struct t_rec *r)
 
     return 4 + (r->cycles_included ? 8 : 0) + (r->extra_u32 * 4);
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
index df99c6a..c4bc713 100644
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -342,9 +342,9 @@ static struct xenpaging *xenpaging_init(int argc, char *argv[])
                         HVM_PARAM_PAGING_RING_PFN, &ring_pfn);
     mmap_pfn = ring_pfn;
     paging->vm_event.ring_page = 
-        xc_map_foreign_batch(xch, paging->vm_event.domain_id, 
-                                PROT_READ | PROT_WRITE, &mmap_pfn, 1);
-    if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+        xc_map_foreign_pages(xch, paging->vm_event.domain_id,
+                             PROT_READ | PROT_WRITE, &mmap_pfn, 1);
+    if ( !paging->vm_event.ring_page )
     {
         /* Map failed, populate ring page */
         rc = xc_domain_populate_physmap_exact(paging->xc_handle, 
@@ -356,11 +356,11 @@ static struct xenpaging *xenpaging_init(int argc, char *argv[])
             goto err;
         }
 
-        mmap_pfn = ring_pfn;
         paging->vm_event.ring_page = 
-            xc_map_foreign_batch(xch, paging->vm_event.domain_id, 
-                                    PROT_READ | PROT_WRITE, &mmap_pfn, 1);
-        if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+            xc_map_foreign_pages(xch, paging->vm_event.domain_id,
+                                 PROT_READ | PROT_WRITE,
+                                 &mmap_pfn, 1);
+        if ( !paging->vm_event.ring_page )
         {
             PERROR("Could not map the ring page\n");
             goto err;
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c
index c970d42..6cbe0ac 100644
--- a/tools/xentrace/xentrace.c
+++ b/tools/xentrace/xentrace.c
@@ -508,7 +508,7 @@ static struct t_struct *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
         for ( j=0; j<tbufs.t_info->tbuf_size; j++)
             pfn_list[j] = (xen_pfn_t)mfn_list[j];
 
-        tbufs.meta[i] = xc_map_foreign_batch(xc_handle, DOMID_XEN,
+        tbufs.meta[i] = xc_map_foreign_pages(xc_handle, DOMID_XEN,
                                              PROT_READ | PROT_WRITE,
                                              pfn_list,
                                              tbufs.t_info->tbuf_size);
@@ -1221,6 +1221,7 @@ int main(int argc, char **argv)
 
     return ret;
 }
+
 /*
  * 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 Wed Jan 27 10:15:53 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:15: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 1aON8i-0000ez-V2; Wed, 27 Jan 2016 10:15:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8h-0000ef-Da
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:51 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	38/4C-08479-6D898A65; Wed, 27 Jan 2016 10:15:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453889747!8806259!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35331 invoked from network); 27 Jan 2016 10:15:49 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9V-0001xl-8b
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8d-0001Ny-1r
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:47 +0000
Date: Wed, 27 Jan 2016 10:15:47 +0000
Message-Id: <E1aON8d-0001Ny-1r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Implement
	xc_map_foreign_range(s) in terms of common helper
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ee09d0a5ed068870ef2991fdc1b292b94bd1455f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 18 11:19:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:23:34 2016 +0000

    tools: Implement xc_map_foreign_range(s) in terms of common helper
    
    Both Linux and FreeBSD already implemented these functions using
    identical helpers based on xc_map_foreign_pages. Make one copy of
    these common helpers and switch all OSes to use them, even those which
    previously had a specific lower level implementation of this
    functionality.
    
    This is makes two fewer low level interfaces to think about.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_foreign_memory.c |   50 +++++++++++++++++++++++++++
 tools/libxc/xc_freebsd_osdep.c  |   50 ---------------------------
 tools/libxc/xc_linux_osdep.c    |   49 ---------------------------
 tools/libxc/xc_minios.c         |   43 ------------------------
 tools/libxc/xc_netbsd.c         |   70 ---------------------------------------
 tools/libxc/xc_solaris.c        |   67 -------------------------------------
 6 files changed, 50 insertions(+), 279 deletions(-)

diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index 2413e75..d1130e6 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -50,6 +50,56 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
     return res;
 }
 
+void *xc_map_foreign_range(xc_interface *xch,
+                           uint32_t dom, int size, int prot,
+                           unsigned long mfn)
+{
+    xen_pfn_t *arr;
+    int num;
+    int i;
+    void *ret;
+
+    num = (size + XC_PAGE_SIZE - 1) >> XC_PAGE_SHIFT;
+    arr = calloc(num, sizeof(xen_pfn_t));
+    if ( arr == NULL )
+        return NULL;
+
+    for ( i = 0; i < num; i++ )
+        arr[i] = mfn + i;
+
+    ret = xc_map_foreign_pages(xch, dom, prot, arr, num);
+    free(arr);
+    return ret;
+}
+
+void *xc_map_foreign_ranges(xc_interface *xch,
+                            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 = chunksize >> XC_PAGE_SHIFT;
+    num = num_per_entry * nentries;
+    arr = calloc(num, sizeof(xen_pfn_t));
+    if ( arr == NULL )
+        return NULL;
+
+    for ( i = 0; i < nentries; i++ )
+        for ( j = 0; j < num_per_entry; j++ )
+            arr[i * num_per_entry + j] = entries[i].mfn + j;
+
+    ret = xc_map_foreign_pages(xch, dom, prot, arr, num);
+    free(arr);
+    return ret;
+}
+
 /*
  * stub for all not yet converted OSes (NetBSD and Solaris). New OSes should
  * just implement xc_map_foreign_bulk.
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
index 6b440ee..7745d28 100644
--- a/tools/libxc/xc_freebsd_osdep.c
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -125,56 +125,6 @@ void *xc_map_foreign_bulk(xc_interface *xch,
     return addr;
 }
 
-void *xc_map_foreign_range(xc_interface *xch,
-                           uint32_t dom, int size, int prot,
-                           unsigned long mfn)
-{
-    xen_pfn_t *arr;
-    int num;
-    int i;
-    void *ret;
-
-    num = (size + XC_PAGE_SIZE - 1) >> XC_PAGE_SHIFT;
-    arr = calloc(num, sizeof(xen_pfn_t));
-    if ( arr == NULL )
-        return NULL;
-
-    for ( i = 0; i < num; i++ )
-        arr[i] = mfn + i;
-
-    ret = xc_map_foreign_pages(xch, dom, prot, arr, num);
-    free(arr);
-    return ret;
-}
-
-void *xc_map_foreign_ranges(xc_interface *xch,
-                            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 = chunksize >> XC_PAGE_SHIFT;
-    num = num_per_entry * nentries;
-    arr = calloc(num, sizeof(xen_pfn_t));
-    if ( arr == NULL )
-        return NULL;
-
-    for ( i = 0; i < nentries; i++ )
-        for ( j = 0; j < num_per_entry; j++ )
-            arr[i * num_per_entry + j] = entries[i].mfn + j;
-
-    ret = xc_map_foreign_pages(xch, dom, prot, arr, num);
-    free(arr);
-    return ret;
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 39c88ce..acf44ce 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -290,55 +290,6 @@ void *xc_map_foreign_bulk(xc_interface *xch,
     return addr;
 }
 
-void *xc_map_foreign_range(xc_interface *xch,
-                           uint32_t dom, int size, int prot,
-                           unsigned long mfn)
-{
-    xen_pfn_t *arr;
-    int num;
-    int i;
-    void *ret;
-
-    num = (size + XC_PAGE_SIZE - 1) >> XC_PAGE_SHIFT;
-    arr = calloc(num, sizeof(xen_pfn_t));
-    if ( arr == NULL )
-        return NULL;
-
-    for ( i = 0; i < num; i++ )
-        arr[i] = mfn + i;
-
-    ret = xc_map_foreign_pages(xch, dom, prot, arr, num);
-    free(arr);
-    return ret;
-}
-
-void *xc_map_foreign_ranges(xc_interface *xch,
-                            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 = chunksize >> XC_PAGE_SHIFT;
-    num = num_per_entry * nentries;
-    arr = calloc(num, sizeof(xen_pfn_t));
-    if ( arr == NULL )
-        return NULL;
-
-    for ( i = 0; i < nentries; i++ )
-        for ( j = 0; j < num_per_entry; j++ )
-            arr[i * num_per_entry + j] = entries[i].mfn + j;
-
-    ret = xc_map_foreign_pages(xch, dom, prot, arr, num);
-    free(arr);
-    return ret;
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index 3ea3124..d8ca948 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -73,49 +73,6 @@ void *xc_map_foreign_bulk(xc_interface *xch,
     return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
 }
 
-void *xc_map_foreign_range(xc_interface *xch,
-                           uint32_t dom,
-                           int size, int prot,
-                           unsigned long mfn)
-{
-    unsigned long pt_prot = 0;
-
-    if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
-    if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
-
-    assert(!(size % getpagesize()));
-    return map_frames_ex(&mfn, size / getpagesize(), 0, 1, 1, dom, NULL, pt_prot);
-}
-
-void *xc_map_foreign_ranges(xc_interface *xch,
-                            uint32_t dom,
-                            size_t size, int prot, size_t chunksize,
-                            privcmd_mmap_entry_t entries[], int nentries)
-{
-    unsigned long *mfns;
-    int i, j, n;
-    unsigned long pt_prot = 0;
-    void *ret;
-
-    if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
-    if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
-
-    mfns = malloc((size / XC_PAGE_SIZE) * sizeof(*mfns));
-
-    n = 0;
-    for (i = 0; i < nentries; i++)
-        for (j = 0; j < chunksize / XC_PAGE_SIZE; j++)
-            mfns[n++] = entries[i].mfn + j;
-
-    ret = map_frames_ex(mfns, n, 1, 0, 1, dom, NULL, pt_prot);
-    free(mfns);
-    return ret;
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush)
 {
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 6a7ff9f..3470bc4 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -96,76 +96,6 @@ void *osdep_map_foreign_batch(xc_interface *xch,
 
 }
 
-void *xc_map_foreign_range(xc_interface *xch,
-                           uint32_t dom,
-                           int size, int prot,
-                           unsigned long mfn)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmap_t ioctlx;
-    privcmd_mmap_entry_t entry;
-    void *addr;
-    addr = mmap(NULL, size, prot, MAP_ANON | MAP_SHARED, -1, 0);
-    if ( addr == MAP_FAILED ) {
-        PERROR("xc_map_foreign_range: mmap failed");
-        return NULL;
-    }
-
-    ioctlx.num=1;
-    ioctlx.dom=dom;
-    ioctlx.entry=&entry;
-    entry.va=(unsigned long) addr;
-    entry.mfn=mfn;
-    entry.npages=(size+XC_PAGE_SIZE-1)>>XC_PAGE_SHIFT;
-    if ( ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx) < 0 )
-    {
-        int saved_errno = errno;
-        PERROR("xc_map_foreign_range: ioctl failed");
-        (void)munmap(addr, size);
-        errno = saved_errno;
-        return NULL;
-    }
-    return addr;
-}
-
-void *xc_map_foreign_ranges(xc_interface *xch,
-                            uint32_t dom,
-                            size_t size, int prot, size_t chunksize,
-                            privcmd_mmap_entry_t entries[], int nentries)
-{
-    int fd = xch->privcmdfd;
-	privcmd_mmap_t ioctlx;
-	int i, rc;
-	void *addr;
-
-	addr = mmap(NULL, size, prot, MAP_ANON | MAP_SHARED, -1, 0);
-	if (addr == MAP_FAILED)
-		goto mmap_failed;
-
-	for (i = 0; i < nentries; i++) {
-		entries[i].va = (uintptr_t)addr + (i * chunksize);
-		entries[i].npages = chunksize >> XC_PAGE_SHIFT;
-	}
-
-	ioctlx.num   = nentries;
-	ioctlx.dom   = dom;
-	ioctlx.entry = entries;
-
-	rc = ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx);
-	if (rc)
-		goto ioctl_failed;
-
-	return addr;
-
-ioctl_failed:
-	rc = munmap(addr, size);
-	if (rc == -1)
-		ERROR("%s: error in error path\n", __FUNCTION__);
-
-mmap_failed:
-	return NULL;
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index 2df7a06..d686867 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -94,73 +94,6 @@ void *osdep_map_foreign_batch(xc_interface *xch,
 
 }
 
-void *xc_map_foreign_range(xc_interface *xch,
-                           uint32_t dom,
-                           int size, int prot,
-                           unsigned long mfn)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmap_t ioctlx;
-    privcmd_mmap_entry_t entry;
-    void *addr;
-    addr = mmap(NULL, size, prot, MAP_SHARED, fd, 0);
-    if ( addr == MAP_FAILED )
-        return NULL;
-
-    ioctlx.num=1;
-    ioctlx.dom=dom;
-    ioctlx.entry=&entry;
-    entry.va=(unsigned long) addr;
-    entry.mfn=mfn;
-    entry.npages=(size+XC_PAGE_SIZE-1)>>XC_PAGE_SHIFT;
-    if ( ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx) < 0 )
-    {
-        int saved_errno = errno;
-        (void)munmap(addr, size);
-        errno = saved_errno;
-        return NULL;
-    }
-    return addr;
-}
-
-void *xc_map_foreign_ranges(xc_interface *xch,
-                            uint32_t dom,
-                            size_t size, int prot, size_t chunksize,
-                            privcmd_mmap_entry_t entries[], int nentries)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmap_t ioctlx;
-    int i, rc;
-    void *addr;
-
-    addr = mmap(NULL, size, prot, MAP_SHARED, fd, 0);
-    if (addr == MAP_FAILED)
-        goto mmap_failed;
-
-    for (i = 0; i < nentries; i++) {
-        entries[i].va = (uintptr_t)addr + (i * chunksize);
-        entries[i].npages = chunksize >> XC_PAGE_SHIFT;
-    }
-
-    ioctlx.num   = nentries;
-    ioctlx.dom   = dom;
-    ioctlx.entry = entries;
-
-    rc = ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx);
-    if (rc)
-        goto ioctl_failed;
-
-    return addr;
-
-ioctl_failed:
-    rc = munmap(addr, size);
-    if (rc == -1)
-        PERROR("%s: error in error path", __FUNCTION__);
-
-mmap_failed:
-    return NULL;
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:15:53 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:15: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 1aON8i-0000ez-V2; Wed, 27 Jan 2016 10:15:52 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8h-0000ef-Da
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:51 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	38/4C-08479-6D898A65; Wed, 27 Jan 2016 10:15:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453889747!8806259!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35331 invoked from network); 27 Jan 2016 10:15:49 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9V-0001xl-8b
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8d-0001Ny-1r
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:47 +0000
Date: Wed, 27 Jan 2016 10:15:47 +0000
Message-Id: <E1aON8d-0001Ny-1r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Implement
	xc_map_foreign_range(s) in terms of common helper
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ee09d0a5ed068870ef2991fdc1b292b94bd1455f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 18 11:19:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:23:34 2016 +0000

    tools: Implement xc_map_foreign_range(s) in terms of common helper
    
    Both Linux and FreeBSD already implemented these functions using
    identical helpers based on xc_map_foreign_pages. Make one copy of
    these common helpers and switch all OSes to use them, even those which
    previously had a specific lower level implementation of this
    functionality.
    
    This is makes two fewer low level interfaces to think about.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_foreign_memory.c |   50 +++++++++++++++++++++++++++
 tools/libxc/xc_freebsd_osdep.c  |   50 ---------------------------
 tools/libxc/xc_linux_osdep.c    |   49 ---------------------------
 tools/libxc/xc_minios.c         |   43 ------------------------
 tools/libxc/xc_netbsd.c         |   70 ---------------------------------------
 tools/libxc/xc_solaris.c        |   67 -------------------------------------
 6 files changed, 50 insertions(+), 279 deletions(-)

diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index 2413e75..d1130e6 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -50,6 +50,56 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
     return res;
 }
 
+void *xc_map_foreign_range(xc_interface *xch,
+                           uint32_t dom, int size, int prot,
+                           unsigned long mfn)
+{
+    xen_pfn_t *arr;
+    int num;
+    int i;
+    void *ret;
+
+    num = (size + XC_PAGE_SIZE - 1) >> XC_PAGE_SHIFT;
+    arr = calloc(num, sizeof(xen_pfn_t));
+    if ( arr == NULL )
+        return NULL;
+
+    for ( i = 0; i < num; i++ )
+        arr[i] = mfn + i;
+
+    ret = xc_map_foreign_pages(xch, dom, prot, arr, num);
+    free(arr);
+    return ret;
+}
+
+void *xc_map_foreign_ranges(xc_interface *xch,
+                            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 = chunksize >> XC_PAGE_SHIFT;
+    num = num_per_entry * nentries;
+    arr = calloc(num, sizeof(xen_pfn_t));
+    if ( arr == NULL )
+        return NULL;
+
+    for ( i = 0; i < nentries; i++ )
+        for ( j = 0; j < num_per_entry; j++ )
+            arr[i * num_per_entry + j] = entries[i].mfn + j;
+
+    ret = xc_map_foreign_pages(xch, dom, prot, arr, num);
+    free(arr);
+    return ret;
+}
+
 /*
  * stub for all not yet converted OSes (NetBSD and Solaris). New OSes should
  * just implement xc_map_foreign_bulk.
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
index 6b440ee..7745d28 100644
--- a/tools/libxc/xc_freebsd_osdep.c
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -125,56 +125,6 @@ void *xc_map_foreign_bulk(xc_interface *xch,
     return addr;
 }
 
-void *xc_map_foreign_range(xc_interface *xch,
-                           uint32_t dom, int size, int prot,
-                           unsigned long mfn)
-{
-    xen_pfn_t *arr;
-    int num;
-    int i;
-    void *ret;
-
-    num = (size + XC_PAGE_SIZE - 1) >> XC_PAGE_SHIFT;
-    arr = calloc(num, sizeof(xen_pfn_t));
-    if ( arr == NULL )
-        return NULL;
-
-    for ( i = 0; i < num; i++ )
-        arr[i] = mfn + i;
-
-    ret = xc_map_foreign_pages(xch, dom, prot, arr, num);
-    free(arr);
-    return ret;
-}
-
-void *xc_map_foreign_ranges(xc_interface *xch,
-                            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 = chunksize >> XC_PAGE_SHIFT;
-    num = num_per_entry * nentries;
-    arr = calloc(num, sizeof(xen_pfn_t));
-    if ( arr == NULL )
-        return NULL;
-
-    for ( i = 0; i < nentries; i++ )
-        for ( j = 0; j < num_per_entry; j++ )
-            arr[i * num_per_entry + j] = entries[i].mfn + j;
-
-    ret = xc_map_foreign_pages(xch, dom, prot, arr, num);
-    free(arr);
-    return ret;
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 39c88ce..acf44ce 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -290,55 +290,6 @@ void *xc_map_foreign_bulk(xc_interface *xch,
     return addr;
 }
 
-void *xc_map_foreign_range(xc_interface *xch,
-                           uint32_t dom, int size, int prot,
-                           unsigned long mfn)
-{
-    xen_pfn_t *arr;
-    int num;
-    int i;
-    void *ret;
-
-    num = (size + XC_PAGE_SIZE - 1) >> XC_PAGE_SHIFT;
-    arr = calloc(num, sizeof(xen_pfn_t));
-    if ( arr == NULL )
-        return NULL;
-
-    for ( i = 0; i < num; i++ )
-        arr[i] = mfn + i;
-
-    ret = xc_map_foreign_pages(xch, dom, prot, arr, num);
-    free(arr);
-    return ret;
-}
-
-void *xc_map_foreign_ranges(xc_interface *xch,
-                            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 = chunksize >> XC_PAGE_SHIFT;
-    num = num_per_entry * nentries;
-    arr = calloc(num, sizeof(xen_pfn_t));
-    if ( arr == NULL )
-        return NULL;
-
-    for ( i = 0; i < nentries; i++ )
-        for ( j = 0; j < num_per_entry; j++ )
-            arr[i * num_per_entry + j] = entries[i].mfn + j;
-
-    ret = xc_map_foreign_pages(xch, dom, prot, arr, num);
-    free(arr);
-    return ret;
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index 3ea3124..d8ca948 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -73,49 +73,6 @@ void *xc_map_foreign_bulk(xc_interface *xch,
     return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
 }
 
-void *xc_map_foreign_range(xc_interface *xch,
-                           uint32_t dom,
-                           int size, int prot,
-                           unsigned long mfn)
-{
-    unsigned long pt_prot = 0;
-
-    if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
-    if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
-
-    assert(!(size % getpagesize()));
-    return map_frames_ex(&mfn, size / getpagesize(), 0, 1, 1, dom, NULL, pt_prot);
-}
-
-void *xc_map_foreign_ranges(xc_interface *xch,
-                            uint32_t dom,
-                            size_t size, int prot, size_t chunksize,
-                            privcmd_mmap_entry_t entries[], int nentries)
-{
-    unsigned long *mfns;
-    int i, j, n;
-    unsigned long pt_prot = 0;
-    void *ret;
-
-    if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
-    if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
-
-    mfns = malloc((size / XC_PAGE_SIZE) * sizeof(*mfns));
-
-    n = 0;
-    for (i = 0; i < nentries; i++)
-        for (j = 0; j < chunksize / XC_PAGE_SIZE; j++)
-            mfns[n++] = entries[i].mfn + j;
-
-    ret = map_frames_ex(mfns, n, 1, 0, 1, dom, NULL, pt_prot);
-    free(mfns);
-    return ret;
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush)
 {
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 6a7ff9f..3470bc4 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -96,76 +96,6 @@ void *osdep_map_foreign_batch(xc_interface *xch,
 
 }
 
-void *xc_map_foreign_range(xc_interface *xch,
-                           uint32_t dom,
-                           int size, int prot,
-                           unsigned long mfn)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmap_t ioctlx;
-    privcmd_mmap_entry_t entry;
-    void *addr;
-    addr = mmap(NULL, size, prot, MAP_ANON | MAP_SHARED, -1, 0);
-    if ( addr == MAP_FAILED ) {
-        PERROR("xc_map_foreign_range: mmap failed");
-        return NULL;
-    }
-
-    ioctlx.num=1;
-    ioctlx.dom=dom;
-    ioctlx.entry=&entry;
-    entry.va=(unsigned long) addr;
-    entry.mfn=mfn;
-    entry.npages=(size+XC_PAGE_SIZE-1)>>XC_PAGE_SHIFT;
-    if ( ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx) < 0 )
-    {
-        int saved_errno = errno;
-        PERROR("xc_map_foreign_range: ioctl failed");
-        (void)munmap(addr, size);
-        errno = saved_errno;
-        return NULL;
-    }
-    return addr;
-}
-
-void *xc_map_foreign_ranges(xc_interface *xch,
-                            uint32_t dom,
-                            size_t size, int prot, size_t chunksize,
-                            privcmd_mmap_entry_t entries[], int nentries)
-{
-    int fd = xch->privcmdfd;
-	privcmd_mmap_t ioctlx;
-	int i, rc;
-	void *addr;
-
-	addr = mmap(NULL, size, prot, MAP_ANON | MAP_SHARED, -1, 0);
-	if (addr == MAP_FAILED)
-		goto mmap_failed;
-
-	for (i = 0; i < nentries; i++) {
-		entries[i].va = (uintptr_t)addr + (i * chunksize);
-		entries[i].npages = chunksize >> XC_PAGE_SHIFT;
-	}
-
-	ioctlx.num   = nentries;
-	ioctlx.dom   = dom;
-	ioctlx.entry = entries;
-
-	rc = ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx);
-	if (rc)
-		goto ioctl_failed;
-
-	return addr;
-
-ioctl_failed:
-	rc = munmap(addr, size);
-	if (rc == -1)
-		ERROR("%s: error in error path\n", __FUNCTION__);
-
-mmap_failed:
-	return NULL;
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index 2df7a06..d686867 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -94,73 +94,6 @@ void *osdep_map_foreign_batch(xc_interface *xch,
 
 }
 
-void *xc_map_foreign_range(xc_interface *xch,
-                           uint32_t dom,
-                           int size, int prot,
-                           unsigned long mfn)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmap_t ioctlx;
-    privcmd_mmap_entry_t entry;
-    void *addr;
-    addr = mmap(NULL, size, prot, MAP_SHARED, fd, 0);
-    if ( addr == MAP_FAILED )
-        return NULL;
-
-    ioctlx.num=1;
-    ioctlx.dom=dom;
-    ioctlx.entry=&entry;
-    entry.va=(unsigned long) addr;
-    entry.mfn=mfn;
-    entry.npages=(size+XC_PAGE_SIZE-1)>>XC_PAGE_SHIFT;
-    if ( ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx) < 0 )
-    {
-        int saved_errno = errno;
-        (void)munmap(addr, size);
-        errno = saved_errno;
-        return NULL;
-    }
-    return addr;
-}
-
-void *xc_map_foreign_ranges(xc_interface *xch,
-                            uint32_t dom,
-                            size_t size, int prot, size_t chunksize,
-                            privcmd_mmap_entry_t entries[], int nentries)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmap_t ioctlx;
-    int i, rc;
-    void *addr;
-
-    addr = mmap(NULL, size, prot, MAP_SHARED, fd, 0);
-    if (addr == MAP_FAILED)
-        goto mmap_failed;
-
-    for (i = 0; i < nentries; i++) {
-        entries[i].va = (uintptr_t)addr + (i * chunksize);
-        entries[i].npages = chunksize >> XC_PAGE_SHIFT;
-    }
-
-    ioctlx.num   = nentries;
-    ioctlx.dom   = dom;
-    ioctlx.entry = entries;
-
-    rc = ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx);
-    if (rc)
-        goto ioctl_failed;
-
-    return addr;
-
-ioctl_failed:
-    rc = munmap(addr, size);
-    if (rc == -1)
-        PERROR("%s: error in error path", __FUNCTION__);
-
-mmap_failed:
-    return NULL;
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:15:55 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10: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 1aON8l-0000fz-6C; Wed, 27 Jan 2016 10: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 1aON8j-0000fO-Pu
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:53 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	EE/EF-08977-9D898A65; Wed, 27 Jan 2016 10:15:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1453889728!12491907!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37565 invoked from network); 27 Jan 2016 10:15:49 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9A-0001xX-7i
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8H-0001Mt-Ue
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:26 +0000
Date: Wed, 27 Jan 2016 10:15:25 +0000
Message-Id: <E1aON8H-0001Mt-Ue@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: drop
	xc_map_foreign_bulk_compat wrappers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c767a37825c041369fdce609d46c51bbc07656b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 18 10:35:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:23:33 2016 +0000

    tools/libxc: drop xc_map_foreign_bulk_compat wrappers
    
    On Solaris and NetBSD xc_map_foreign_bulk is implemented by calling
    xc_map_foreign_bulk_compat and xc_map_foreign_bulk_compat is exposed
    as a symbol by libxenctrl.so.
    
    Remove these wrappers and turn the compat function into the real thing
    surrounded by the appropriate ifdef.
    
    As this is a compat function all new ports should instead implement
    xc_map_foreign_bulk properly, hence the ifdef should never be
    expanded.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_foreign_memory.c |   13 +++++++++----
 tools/libxc/xc_netbsd.c         |    7 -------
 tools/libxc/xc_private.h        |    5 -----
 tools/libxc/xc_solaris.c        |    7 -------
 4 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index 9c705b6..b205bca 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -50,10 +50,14 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
     return res;
 }
 
-/* stub for all not yet converted OSes */
-void *xc_map_foreign_bulk_compat(xc_interface *xch,
-                                 uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, unsigned int num)
+/*
+ * stub for all not yet converted OSes (NetBSD and Solaris). New OSes should
+ * just implement xc_map_foreign_bulk.
+ */
+#if defined(__NetBSD__) || defined(__sun__)
+void *xc_map_foreign_bulk(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err, unsigned int num)
 {
     xen_pfn_t *pfn;
     unsigned int i;
@@ -90,6 +94,7 @@ void *xc_map_foreign_bulk_compat(xc_interface *xch,
 
     return ret;
 }
+#endif
 
 /*
  * Local variables:
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 5e3b343..d7f7f31 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -67,13 +67,6 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-void *xc_map_foreign_bulk(xc_interface *xch,
-                          uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err, unsigned int num)
-{
-    return xc_map_foreign_bulk_compat(xch, dom, prot, arr, err, num);
-}
-
 void *xc_map_foreign_batch(xc_interface *xch,
                            uint32_t dom, int prot,
                            xen_pfn_t *arr, int num)
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index c93df7f..ecf2451 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -107,11 +107,6 @@ int osdep_privcmd_close(xc_interface *xch);
 void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages);
 void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages);
 
-/* Stub for not yet converted OSes */
-void *xc_map_foreign_bulk_compat(xc_interface *xch,
-                                 uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, unsigned int num);
-
 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,
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index 18622fa..5e72dee 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -94,13 +94,6 @@ void *xc_map_foreign_batch(xc_interface *xch,
 
 }
 
-void *xc_map_foreign_bulk(xc_interface *xch,
-                          uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err, unsigned int num)
-{
-    return xc_map_foreign_bulk_compat(xch, dom, prot, arr, err, num);
-}
-
 void *xc_map_foreign_range(xc_interface *xch,
                            uint32_t dom,
                            int size, int prot,
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:15:55 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10: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 1aON8l-0000fz-6C; Wed, 27 Jan 2016 10: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 1aON8j-0000fO-Pu
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:53 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	EE/EF-08977-9D898A65; Wed, 27 Jan 2016 10:15:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1453889728!12491907!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37565 invoked from network); 27 Jan 2016 10:15:49 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9A-0001xX-7i
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8H-0001Mt-Ue
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:26 +0000
Date: Wed, 27 Jan 2016 10:15:25 +0000
Message-Id: <E1aON8H-0001Mt-Ue@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: drop
	xc_map_foreign_bulk_compat wrappers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c767a37825c041369fdce609d46c51bbc07656b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 18 10:35:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:23:33 2016 +0000

    tools/libxc: drop xc_map_foreign_bulk_compat wrappers
    
    On Solaris and NetBSD xc_map_foreign_bulk is implemented by calling
    xc_map_foreign_bulk_compat and xc_map_foreign_bulk_compat is exposed
    as a symbol by libxenctrl.so.
    
    Remove these wrappers and turn the compat function into the real thing
    surrounded by the appropriate ifdef.
    
    As this is a compat function all new ports should instead implement
    xc_map_foreign_bulk properly, hence the ifdef should never be
    expanded.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_foreign_memory.c |   13 +++++++++----
 tools/libxc/xc_netbsd.c         |    7 -------
 tools/libxc/xc_private.h        |    5 -----
 tools/libxc/xc_solaris.c        |    7 -------
 4 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index 9c705b6..b205bca 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -50,10 +50,14 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
     return res;
 }
 
-/* stub for all not yet converted OSes */
-void *xc_map_foreign_bulk_compat(xc_interface *xch,
-                                 uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, unsigned int num)
+/*
+ * stub for all not yet converted OSes (NetBSD and Solaris). New OSes should
+ * just implement xc_map_foreign_bulk.
+ */
+#if defined(__NetBSD__) || defined(__sun__)
+void *xc_map_foreign_bulk(xc_interface *xch,
+                          uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err, unsigned int num)
 {
     xen_pfn_t *pfn;
     unsigned int i;
@@ -90,6 +94,7 @@ void *xc_map_foreign_bulk_compat(xc_interface *xch,
 
     return ret;
 }
+#endif
 
 /*
  * Local variables:
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 5e3b343..d7f7f31 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -67,13 +67,6 @@ int osdep_privcmd_close(xc_interface *xch)
     return close(fd);
 }
 
-void *xc_map_foreign_bulk(xc_interface *xch,
-                          uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err, unsigned int num)
-{
-    return xc_map_foreign_bulk_compat(xch, dom, prot, arr, err, num);
-}
-
 void *xc_map_foreign_batch(xc_interface *xch,
                            uint32_t dom, int prot,
                            xen_pfn_t *arr, int num)
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index c93df7f..ecf2451 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -107,11 +107,6 @@ int osdep_privcmd_close(xc_interface *xch);
 void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages);
 void osdep_free_hypercall_buffer(xc_interface *xch, void *ptr, int npages);
 
-/* Stub for not yet converted OSes */
-void *xc_map_foreign_bulk_compat(xc_interface *xch,
-                                 uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, unsigned int num);
-
 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,
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index 18622fa..5e72dee 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -94,13 +94,6 @@ void *xc_map_foreign_batch(xc_interface *xch,
 
 }
 
-void *xc_map_foreign_bulk(xc_interface *xch,
-                          uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err, unsigned int num)
-{
-    return xc_map_foreign_bulk_compat(xch, dom, prot, arr, err, num);
-}
-
 void *xc_map_foreign_range(xc_interface *xch,
                            uint32_t dom,
                            int size, int prot,
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:16:05 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10: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 1aON8v-0000ib-Cw; Wed, 27 Jan 2016 10: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 1aON8t-0000i6-6D
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:03 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	70/15-29478-2E898A65; Wed, 27 Jan 2016 10:16:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1453889757!18449903!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45129 invoked from network); 27 Jan 2016 10:15:58 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9f-0001yg-Sg
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8n-0001OX-JN
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:57 +0000
Date: Wed, 27 Jan 2016 10:15:57 +0000
Message-Id: <E1aON8n-0001OX-JN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Refactor foreign memory mapping
	into libxenforeignmemory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 32486916793fd78a41fc25e53d2b53a5aa0b1bd5
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 18 16:30:19 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:03 2016 +0000

    tools: Refactor foreign memory mapping into libxenforeignmemory
    
    libxenforeignmemory will provide a stable API and ABI for mapping
    foreign domain memory (subject to appropriate privileges).
    
    The new library exposes an interface equivalent to
    xc_map_foreign_memory_bulk, which all the other
    xc_map_foreign_memory_* functions (which remain in libxc) are
    implemented in terms of.
    
    Upon request (via #define XC_WANT_COMPAT_MAP_FOREIGN_API) libxenctrl
    will provide a compat API for the old names. This is used by qemu-xen
    and qemu-trad as well as various in tree things (which required
    de-dupping various #includes in some too to get the #define before the
    first).
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    [ ijc -- updated MINIOS_UPSTREAM_REVISION and QEMU_TRADITIONAL_REVISION ]
---
 .gitignore                                         |    2 +
 Config.mk                                          |   12 +-
 stubdom/Makefile                                   |   17 +-
 tools/Makefile                                     |    2 +
 tools/Rules.mk                                     |   11 +-
 tools/console/daemon/utils.c                       |    1 -
 tools/console/daemon/utils.h                       |    1 +
 tools/libs/Makefile                                |    1 +
 tools/libs/foreignmemory/Makefile                  |   71 +++++
 tools/libs/foreignmemory/compat.c                  |   72 +++++
 tools/libs/foreignmemory/core.c                    |   84 ++++++
 tools/libs/foreignmemory/freebsd.c                 |  129 +++++++++
 .../libs/foreignmemory/include/xenforeignmemory.h  |   71 +++++
 tools/libs/foreignmemory/libxenforeignmemory.map   |    7 +
 tools/libs/foreignmemory/linux.c                   |  293 +++++++++++++++++++
 tools/libs/foreignmemory/minios.c                  |   62 ++++
 tools/libs/foreignmemory/netbsd.c                  |  105 +++++++
 tools/libs/foreignmemory/private.h                 |   53 ++++
 tools/libs/foreignmemory/solaris.c                 |   93 ++++++
 tools/libxc/Makefile                               |    8 +-
 tools/libxc/include/xenctrl.h                      |   26 --
 tools/libxc/include/xenctrl_compat.h               |   36 +++
 tools/libxc/xc_foreign_memory.c                    |   49 +---
 tools/libxc/xc_freebsd_osdep.c                     |  136 ---------
 tools/libxc/xc_linux_osdep.c                       |  301 --------------------
 tools/libxc/xc_minios.c                            |   29 --
 tools/libxc/xc_netbsd.c                            |   73 -----
 tools/libxc/xc_private.c                           |   13 +-
 tools/libxc/xc_private.h                           |   11 +-
 tools/libxc/xc_solaris.c                           |   73 -----
 tools/libxc/xc_sr_restore.c                        |    4 +-
 tools/libxc/xc_sr_save.c                           |    4 +-
 tools/libxc/xg_private.h                           |    3 +-
 tools/libxl/libxl_internal.h                       |    1 +
 tools/misc/xen-mfndump.c                           |    1 +
 tools/ocaml/libs/xc/xenctrl_stubs.c                |    1 +
 tools/python/xen/lowlevel/xc/xc.c                  |    2 +
 tools/tests/mce-test/tools/xen-mceinj.c            |    1 +
 tools/tests/mem-sharing/memshrtool.c               |    1 +
 tools/xenmon/xenbaked.c                            |    1 +
 tools/xenpaging/pagein.c                           |    1 -
 tools/xenpaging/xenpaging.c                        |    1 -
 tools/xenpaging/xenpaging.h                        |    2 +
 tools/xenstore/xenstored_core.c                    |    1 -
 tools/xenstore/xenstored_core.h                    |    1 +
 tools/xentrace/xenctx.c                            |    3 +-
 tools/xentrace/xentrace.c                          |    1 +
 47 files changed, 1154 insertions(+), 717 deletions(-)

diff --git a/.gitignore b/.gitignore
index 6272f6b..91f690c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,6 +64,7 @@ stubdom/libs-*
 stubdom/libxc-*
 stubdom/libxencall-*
 stubdom/libxenevtchn-*
+stubdom/libxenforeignmemory-*
 stubdom/libxengnttab-*
 stubdom/libxentoollog-*
 stubdom/lwip-*
@@ -93,6 +94,7 @@ tools/libs/toollog/headers.chk
 tools/libs/evtchn/headers.chk
 tools/libs/gnttab/headers.chk
 tools/libs/call/headers.chk
+tools/libs/foreignmemory/headers.chk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff --git a/Config.mk b/Config.mk
index 174c192..429e460 100644
--- a/Config.mk
+++ b/Config.mk
@@ -251,9 +251,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= c7d4f84e52d901068f9c7d5cd2cc05ced93c0157
-# Fri Jan 15 13:24:02 2016 +0000
-# mini-os: Include libxencall with libxc
+MINIOS_UPSTREAM_REVISION ?= 89268f00b0b0215057cb74edd94e866536a02489
+# Fri Jan 15 13:24:03 2016 +0000
+# mini-os: Include libxenforeignmemory with libxc
 
 SEABIOS_UPSTREAM_REVISION ?= 3403ac4313812752be6e6aac35239ca6888a8cab
 # Mon Dec 28 13:50:41 2015 +0100
@@ -262,9 +262,9 @@ SEABIOS_UPSTREAM_REVISION ?= 3403ac4313812752be6e6aac35239ca6888a8cab
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= 79ed2c5733742a7b00f9c774bece30a620150a30
-# Fri Jan 15 13:23:55 2016 +0000
-# qemu-xen-traditional: Add libxencall to rpath-link
+QEMU_TRADITIONAL_REVISION ?= 21f6526d1da331611ac5fe12967549d1a04e149b
+# Fri Jan 15 13:23:56 2016 +0000
+# qemu-xen-traditional: Add libxenforeignmemory to rpath-link
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 5bf4ed6..6f68e98 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -337,6 +337,12 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
 	  ln -sf $(XEN_ROOT)/tools/libs/call/include/*.h include/ && \
 	  ln -sf $(XEN_ROOT)/tools/libs/call/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/libs/call/Makefile . )
+	mkdir -p libs-$(XEN_TARGET_ARCH)/foreignmemory/include
+	[ -h libs-$(XEN_TARGET_ARCH)/foreignmemory/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/foreignmemory && \
+	  ln -sf $(XEN_ROOT)/tools/libs/foreignmemory/*.h . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/foreignmemory/include/*.h include/ && \
+	  ln -sf $(XEN_ROOT)/tools/libs/foreignmemory/*.c . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/foreignmemory/Makefile . )
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
@@ -396,12 +402,21 @@ libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLI
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/call
 
 #######
+# libxenforeignmemory
+#######
+
+.PHONY: libxenforeignmemory
+libxenforeignmemory: libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a
+libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/foreignmemory
+
+#######
 # libxc
 #######
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn libxengnttab libxencall cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn libxengnttab libxencall libxenforeignmemory cross-zlib
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
diff --git a/tools/Makefile b/tools/Makefile
index 05d8bdb..61785d7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -251,6 +251,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--source-path=$$source \
 		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
 		-DXC_WANT_COMPAT_GNTTAB_API=1 \
+		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
 		-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libs/toollog/include \
 		-I$(XEN_ROOT)/tools/libs/evtchn/include \
@@ -265,6 +266,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/evtchn \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/gnttab \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/call \
+		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/foreignmemory \
 		$(QEMU_UPSTREAM_RPATH)" \
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 18e3688..d47fa45 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -14,6 +14,7 @@ XEN_LIBXENTOOLLOG  = $(XEN_ROOT)/tools/libs/toollog
 XEN_LIBXENEVTCHN   = $(XEN_ROOT)/tools/libs/evtchn
 XEN_LIBXENGNTTAB   = $(XEN_ROOT)/tools/libs/gnttab
 XEN_LIBXENCALL     = $(XEN_ROOT)/tools/libs/call
+XEN_LIBXENFOREIGNMEMORY = $(XEN_ROOT)/tools/libs/foreignmemory
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_XENLIGHT       = $(XEN_ROOT)/tools/libxl
 XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
@@ -103,12 +104,16 @@ CFLAGS_libxencall = -I$(XEN_LIBXENCALL)/include $(CFLAGS_xeninclude)
 LDLIBS_libxencall = $(XEN_LIBXENCALL)/libxencall$(libextension)
 SHLIB_libxencall  = -Wl,-rpath-link=$(XEN_LIBXENCALL)
 
-CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_xeninclude)
-SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxengntshr) $(SHLIB_libxencall)
+CFLAGS_libxenforeignmemory = -I$(XEN_LIBXENFOREIGNMEMORY)/include $(CFLAGS_xeninclude)
+LDLIBS_libxenforeignmemory = $(XEN_LIBXENFOREIGNMEMORY)/libxenforeignmemory$(libextension)
+SHLIB_libxenforeignmemory  = -Wl,-rpath-link=$(XEN_LIBXENFOREIGNMEMORY)
+
+CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude)
+SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxengntshr) $(SHLIB_libxencall) $(SHLIB_libxenforeignmemory)
 LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libextension)
 SHLIB_libxenctrl  = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_LIBXC)
 
-CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_libxenevtchn) $(CFLAGS_xeninclude)
+CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_libxenevtchn) $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude)
 SHDEPS_libxenguest = $(SHLIB_libxenevtchn)
 LDLIBS_libxenguest = $(SHDEPS_libxenguest) $(XEN_LIBXC)/libxenguest$(libextension)
 SHLIB_libxenguest  = $(SHDEPS_libxenguest) -Wl,-rpath-link=$(XEN_LIBXC)
diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c
index 644f6af..97d7798 100644
--- a/tools/console/daemon/utils.c
+++ b/tools/console/daemon/utils.c
@@ -33,7 +33,6 @@
 #include <string.h>
 #include <signal.h>
 
-#include "xenctrl.h"
 #include "utils.h"
 
 struct xs_handle *xs;
diff --git a/tools/console/daemon/utils.h b/tools/console/daemon/utils.h
index 1295822..a010ac4 100644
--- a/tools/console/daemon/utils.h
+++ b/tools/console/daemon/utils.h
@@ -23,6 +23,7 @@
 #include <stdbool.h>
 #include <syslog.h>
 #include <stdio.h>
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 
 #include <xenstore.h>
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index f4f5d57..dc5726d 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -6,5 +6,6 @@ SUBDIRS-y += toollog
 SUBDIRS-y += evtchn
 SUBDIRS-y += gnttab
 SUBDIRS-y += call
+SUBDIRS-y += foreignmemory
 
 all clean install distclean: %: subdirs-%
diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/Makefile
new file mode 100644
index 0000000..f062f45
--- /dev/null
+++ b/tools/libs/foreignmemory/Makefile
@@ -0,0 +1,71 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR    = 1
+MINOR    = 0
+SHLIB_LDFLAGS += -Wl,--version-script=libxenforeignmemory.map
+
+CFLAGS   += -Werror -Wmissing-prototypes
+CFLAGS   += -I./include $(CFLAGS_xeninclude)
+CFLAGS   += $(CFLAGS_libxentoollog)
+
+SRCS-y                 += core.c
+SRCS-$(CONFIG_Linux)   += linux.c
+SRCS-$(CONFIG_FreeBSD) += freebsd.c
+SRCS-$(CONFIG_SunOS)   += compat.c solaris.c
+SRCS-$(CONFIG_NetBSD)  += compat.c netbsd.c
+SRCS-$(CONFIG_MiniOS)  += minios.c
+
+LIB_OBJS := $(patsubst %.c,%.o,$(SRCS-y))
+PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS-y))
+
+LIB := libxenforeignmemory.a
+ifneq ($(nosharedlibs),y)
+LIB += libxenforeignmemory.so
+endif
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build:
+	$(MAKE) libs
+
+.PHONY: libs
+libs: headers.chk $(LIB)
+
+headers.chk: $(wildcard include/*.h)
+
+libxenforeignmemory.a: $(LIB_OBJS)
+	$(AR) rc $@ $^
+
+libxenforeignmemory.so: libxenforeignmemory.so.$(MAJOR)
+	$(SYMLINK_SHLIB) $< $@
+libxenforeignmemory.so.$(MAJOR): libxenforeignmemory.so.$(MAJOR).$(MINOR)
+	$(SYMLINK_SHLIB) $< $@
+
+libxenforeignmemory.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxenforeignmemory.map
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenforeignmemory.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: build
+	$(INSTALL_DIR) $(DESTDIR)$(libdir)
+	$(INSTALL_DIR) $(DESTDIR)$(includedir)
+	$(INSTALL_SHLIB) libxenforeignmemory.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) libxenforeignmemory.a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) libxenforeignmemory.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenforeignmemory.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxenforeignmemory.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenforeignmemory.so
+	$(INSTALL_DATA) include/xenforeignmemory.h $(DESTDIR)$(includedir)
+
+.PHONY: TAGS
+TAGS:
+	etags -t *.c *.h
+
+.PHONY: clean
+clean:
+	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -f libxenforeignmemory.so.$(MAJOR).$(MINOR) libxenforeignmemory.so.$(MAJOR)
+	rm -f headers.chk
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/libs/foreignmemory/compat.c b/tools/libs/foreignmemory/compat.c
new file mode 100644
index 0000000..b8c6fc6
--- /dev/null
+++ b/tools/libs/foreignmemory/compat.c
@@ -0,0 +1,72 @@
+/* Compatibility functions for mapping foreign domain's memory.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_foreign_memory.c
+ */
+#if !defined(__NetBSD__) && !defined(__sun__)
+#error Please implement osdep_xenforeignmemory_map directly for new ports.
+#endif
+
+#include "private.h"
+
+void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                                 uint32_t dom, int prot,
+                                 const xen_pfn_t *arr, int *err, unsigned int num)
+{
+    xen_pfn_t *pfn;
+    unsigned int i;
+    void *ret;
+
+    if ((int)num <= 0) {
+        errno = EINVAL;
+        return NULL;
+    }
+
+    pfn = malloc(num * sizeof(*pfn));
+    if (!pfn) {
+        errno = ENOMEM;
+        return NULL;
+    }
+
+    memcpy(pfn, arr, num * sizeof(*arr));
+    ret = osdep_map_foreign_batch(fmem, dom, prot, pfn, num);
+
+    if (ret) {
+        for (i = 0; i < num; ++i)
+            switch (pfn[i] ^ arr[i]) {
+            case 0:
+                err[i] = 0;
+                break;
+            default:
+                err[i] = -EINVAL;
+                break;
+            }
+    } else
+        memset(err, 0, num * sizeof(*err));
+
+    free(pfn);
+
+    return ret;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/core.c b/tools/libs/foreignmemory/core.c
new file mode 100644
index 0000000..21dc7ee
--- /dev/null
+++ b/tools/libs/foreignmemory/core.c
@@ -0,0 +1,84 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+
+#include "private.h"
+
+xenforeignmemory_handle *xenforeignmemory_open(xentoollog_logger *logger,
+                                               unsigned open_flags)
+{
+    xenforeignmemory_handle *fmem = malloc(sizeof(*fmem));
+    int rc;
+
+    if (!fmem) return NULL;
+
+    fmem->logger = logger;
+    fmem->logger_tofree = NULL;
+
+    if (!fmem->logger) {
+        fmem->logger = fmem->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!fmem->logger) goto err;
+    }
+
+    rc = osdep_xenforeignmemory_open(fmem);
+    if ( rc  < 0 ) goto err;
+
+    return fmem;
+
+err:
+    osdep_xenforeignmemory_close(fmem);
+    xtl_logger_destroy(fmem->logger_tofree);
+    free(fmem);
+    return NULL;
+}
+
+int xenforeignmemory_close(xenforeignmemory_handle *fmem)
+{
+    int rc;
+
+    if ( !fmem )
+        return 0;
+
+    rc = osdep_xenforeignmemory_close(fmem);
+    xtl_logger_destroy(fmem->logger_tofree);
+    free(fmem);
+    return rc;
+}
+
+void *xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                           uint32_t dom, int prot,
+                           const xen_pfn_t *arr, int *err, size_t num)
+{
+    return osdep_xenforeignmemory_map(fmem, dom, prot, arr, err, num);
+}
+
+int xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                           void *addr, size_t num)
+{
+    return osdep_xenforeignmemory_unmap(fmem, addr, num);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
new file mode 100644
index 0000000..4b2815d
--- /dev/null
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -0,0 +1,129 @@
+ /******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#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 "private.h"
+
+#define PRIVCMD_DEV     "/dev/xen/privcmd"
+
+int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
+{
+    int flags, saved_errno;
+    int fd = open(PRIVCMD_DEV, O_RDWR);
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface "
+               PRIVCMD_DEV);
+        return -1;
+    }
+
+    /*
+     * 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+
+    flags |= FD_CLOEXEC;
+
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    fmem->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+
+    return -1;
+}
+
+int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
+{
+    int fd = fmem->fd;
+    if ( fd == -1 )
+        return 0;
+    return close(fd);
+}
+
+void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                                 uint32_t dom, int prot,
+                                 const xen_pfn_t *arr, int *err,
+                                 unsigned int num)
+{
+    int fd = fmem->fd;
+    privcmd_mmapbatch_t ioctlx;
+    void *addr;
+    int rc;
+
+    addr = mmap(NULL, num << PAGE_SHIFT, prot, MAP_SHARED, fd, 0);
+    if ( addr == MAP_FAILED )
+    {
+        PERROR("xc_map_foreign_bulk: mmap failed");
+        return NULL;
+    }
+
+    ioctlx.num = num;
+    ioctlx.dom = dom;
+    ioctlx.addr = (unsigned long)addr;
+    ioctlx.arr = arr;
+    ioctlx.err = err;
+
+    rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
+    if ( rc < 0 )
+    {
+        int saved_errno = errno;
+        PERROR("xc_map_foreign_bulk: ioctl failed");
+        (void)munmap(addr, num << PAGE_SHIFT);
+        errno = saved_errno;
+        return NULL;
+    }
+
+    return addr;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
new file mode 100644
index 0000000..5b3fa7a
--- /dev/null
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -0,0 +1,71 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef XENFOREIGNMEMORY_H
+#define XENFOREIGNMEMORY_H
+
+/*
+ * This library allows you to map foreign domain memory, subject to
+ * permissions for both the process and the domain in which the
+ * process runs.
+ */
+
+#include <stdint.h>
+#include <stddef.h>
+
+#include <xen/xen.h>
+
+/* Callers who don't care don't need to #include <xentoollog.h> */
+typedef struct xentoollog_logger xentoollog_logger;
+
+typedef struct xenforeignmemory_handle xenforeignmemory_handle;
+
+/*
+ * Return a handle onto the hypercall driver.  Logs errors.
+ */
+xenforeignmemory_handle *xenforeignmemory_open(xentoollog_logger *logger,
+                                               unsigned open_flags);
+
+/*
+ * Close a handle previously allocated with xenforeignmemory_open().
+ */
+int xenforeignmemory_close(xenforeignmemory_handle *fmem);
+
+/*
+ * Maps a range within one domain to a local address range.  Mappings
+ * should be unmapped with munmap and should follow the same rules as mmap
+ * regarding page alignment.
+ *
+ * prot is as for mmap(2).
+ *
+ * Can partially succeed. When a page cannot be mapped, its respective
+ * field in @err is set to the corresponding errno value.
+ *
+ * Returns NULL if no pages can be mapped.
+ */
+void *xenforeignmemory_map(xenforeignmemory_handle *fmem, uint32_t dom,
+                           int prot, const xen_pfn_t *arr, int *err,
+                           unsigned int num);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/libxenforeignmemory.map b/tools/libs/foreignmemory/libxenforeignmemory.map
new file mode 100644
index 0000000..11f0d2b
--- /dev/null
+++ b/tools/libs/foreignmemory/libxenforeignmemory.map
@@ -0,0 +1,7 @@
+VERS_1.0 {
+	global:
+		xenforeignmemory_open;
+		xenforeignmemory_close;
+		xenforeignmemory_map;
+	local: *; /* Do not expose anything by default */
+};
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
new file mode 100644
index 0000000..b403ca7
--- /dev/null
+++ b/tools/libs/foreignmemory/linux.c
@@ -0,0 +1,293 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_linus_osdep.c:
+ *
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ */
+
+#include <alloca.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+
+#include "private.h"
+
+#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
+
+int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
+{
+    int flags, saved_errno;
+    int fd = open("/dev/xen/privcmd", O_RDWR); /* prefer this newer interface */
+
+    if ( fd == -1 && ( errno == ENOENT || errno == ENXIO || errno == ENODEV ))
+    {
+        /* Fallback to /proc/xen/privcmd */
+        fd = open("/proc/xen/privcmd", O_RDWR);
+    }
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface");
+        return -1;
+    }
+
+    /* 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+
+    flags |= FD_CLOEXEC;
+
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    fmem->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+    return -1;
+}
+
+int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
+{
+    int fd = fmem->fd;
+    if (fd == -1)
+        return 0;
+    return close(fd);
+}
+
+static int map_foreign_batch_single(int fd, uint32_t dom,
+                                    xen_pfn_t *mfn, unsigned long addr)
+{
+    privcmd_mmapbatch_t ioctlx;
+    int rc;
+
+    ioctlx.num = 1;
+    ioctlx.dom = dom;
+    ioctlx.addr = addr;
+    ioctlx.arr = mfn;
+
+    do
+    {
+        *mfn ^= PRIVCMD_MMAPBATCH_PAGED_ERROR;
+        usleep(100);
+        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
+    }
+    while ( (rc < 0) && (errno == ENOENT) );
+
+    return rc;
+}
+
+/*
+ * Retry mmap of all paged gfns in batches
+ * retuns < 0 on fatal error
+ * returns 0 if all gfns left paging state
+ * returns > 0 if some gfns are still in paging state
+ *
+ * Walk all gfns and try to assemble blocks of gfns in paging state.
+ * This will keep the request ring full and avoids delays.
+ */
+static int retry_paged(int fd, uint32_t dom, void *addr,
+                       const xen_pfn_t *arr, int *err, unsigned int num)
+{
+    privcmd_mmapbatch_v2_t ioctlx;
+    int rc, paged = 0, i = 0;
+
+    do
+    {
+        /* Skip gfns not in paging state */
+        if ( err[i] != -ENOENT )
+        {
+            i++;
+            continue;
+        }
+
+        paged++;
+
+        /* At least one gfn is still in paging state */
+        ioctlx.num = 1;
+        ioctlx.dom = dom;
+        ioctlx.addr = (unsigned long)addr + ((unsigned long)i<<PAGE_SHIFT);
+        ioctlx.arr = arr + i;
+        ioctlx.err = err + i;
+
+        /* Assemble a batch of requests */
+        while ( ++i < num )
+        {
+            if ( err[i] != -ENOENT )
+                break;
+            ioctlx.num++;
+        }
+
+        /* Send request and abort on fatal error */
+        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
+        if ( rc < 0 && errno != ENOENT )
+            goto out;
+
+    } while ( i < num );
+
+    rc = paged;
+out:
+    return rc;
+}
+
+void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                                 uint32_t dom, int prot,
+                                 const xen_pfn_t *arr, int *err, unsigned int num)
+{
+    int fd = fmem->fd;
+    privcmd_mmapbatch_v2_t ioctlx;
+    void *addr;
+    unsigned int i;
+    int rc;
+
+    addr = mmap(NULL, (unsigned long)num << PAGE_SHIFT, prot, MAP_SHARED,
+                fd, 0);
+    if ( addr == MAP_FAILED )
+    {
+        PERROR("mmap failed");
+        return NULL;
+    }
+
+    ioctlx.num = num;
+    ioctlx.dom = dom;
+    ioctlx.addr = (unsigned long)addr;
+    ioctlx.arr = arr;
+    ioctlx.err = err;
+
+    rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
+
+    /* Command was recognized, some gfn in arr are in paging state */
+    if ( rc < 0 && errno == ENOENT )
+    {
+        do {
+            usleep(100);
+            rc = retry_paged(fd, dom, addr, arr, err, num);
+        } while ( rc > 0 );
+    }
+    /* Command was not recognized, use fall back */
+    else if ( rc < 0 && errno == EINVAL && (int)num > 0 )
+    {
+        /*
+         * IOCTL_PRIVCMD_MMAPBATCH_V2 is not supported - fall back to
+         * IOCTL_PRIVCMD_MMAPBATCH.
+         */
+        privcmd_mmapbatch_t ioctlx;
+        xen_pfn_t *pfn;
+        unsigned int pfn_arr_size = ROUNDUP((num * sizeof(*pfn)), PAGE_SHIFT);
+
+        if ( pfn_arr_size <= PAGE_SIZE )
+            pfn = alloca(num * sizeof(*pfn));
+        else
+        {
+            pfn = mmap(NULL, pfn_arr_size, PROT_READ | PROT_WRITE,
+                       MAP_PRIVATE | MAP_ANON | MAP_POPULATE, -1, 0);
+            if ( pfn == MAP_FAILED )
+            {
+                PERROR("mmap of pfn array failed");
+                (void)munmap(addr, (unsigned long)num << PAGE_SHIFT);
+                return NULL;
+            }
+        }
+
+        memcpy(pfn, arr, num * sizeof(*arr));
+
+        ioctlx.num = num;
+        ioctlx.dom = dom;
+        ioctlx.addr = (unsigned long)addr;
+        ioctlx.arr = pfn;
+
+        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
+
+        rc = rc < 0 ? -errno : 0;
+
+        for ( i = 0; i < num; ++i )
+        {
+            switch ( pfn[i] ^ arr[i] )
+            {
+            case 0:
+                err[i] = rc != -ENOENT ? rc : 0;
+                continue;
+            default:
+                err[i] = -EINVAL;
+                continue;
+            case PRIVCMD_MMAPBATCH_PAGED_ERROR:
+                if ( rc != -ENOENT )
+                {
+                    err[i] = rc ?: -EINVAL;
+                    continue;
+                }
+                rc = map_foreign_batch_single(fd, dom, pfn + i,
+                        (unsigned long)addr + ((unsigned long)i<<PAGE_SHIFT));
+                if ( rc < 0 )
+                {
+                    rc = -errno;
+                    break;
+                }
+                rc = -ENOENT;
+                continue;
+            }
+            break;
+        }
+
+        if ( pfn_arr_size > PAGE_SIZE )
+            munmap(pfn, pfn_arr_size);
+
+        if ( rc == -ENOENT && i == num )
+            rc = 0;
+        else if ( rc )
+        {
+            errno = -rc;
+            rc = -1;
+        }
+    }
+
+    if ( rc < 0 )
+    {
+        int saved_errno = errno;
+
+        PERROR("ioctl failed");
+        (void)munmap(addr, (unsigned long)num << PAGE_SHIFT);
+        errno = saved_errno;
+        return NULL;
+    }
+
+    return addr;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
new file mode 100644
index 0000000..a542e3d
--- /dev/null
+++ b/tools/libs/foreignmemory/minios.c
@@ -0,0 +1,62 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_minios.c
+ *
+ * Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.com>.
+ */
+
+#include <mini-os/types.h>
+#include <mini-os/os.h>
+#include <mini-os/mm.h>
+#include <mini-os/lib.h>
+
+#include <errno.h>
+
+#include <sys/mman.h>
+
+#include "private.h"
+
+int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
+{
+    /* No fd required */
+    return 0;
+}
+
+int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
+{
+    return 0;
+}
+
+void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                                 uint32_t dom, int prot,
+                                 const xen_pfn_t *arr, int *err, unsigned int num)
+{
+    unsigned long pt_prot = 0;
+    if (prot & PROT_READ)
+	pt_prot = L1_PROT_RO;
+    if (prot & PROT_WRITE)
+	pt_prot = L1_PROT;
+    return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/netbsd.c b/tools/libs/foreignmemory/netbsd.c
new file mode 100644
index 0000000..704a096
--- /dev/null
+++ b/tools/libs/foreignmemory/netbsd.c
@@ -0,0 +1,105 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#include "private.h"
+
+int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
+{
+    int flags, saved_errno;
+    int fd = open("/kern/xen/privcmd", O_RDWR);
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface");
+        return -1;
+    }
+
+    /* 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+    flags |= FD_CLOEXEC;
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    fmem->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+    return -1;
+}
+
+int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
+{
+    int fd = fmem->fd;
+    return close(fd);
+}
+
+void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
+                              int prot, xen_pfn_t *arr, int num)
+{
+    int fd = fmem->fd;
+    privcmd_mmapbatch_t ioctlx;
+    void *addr;
+    addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
+    if ( addr == MAP_FAILED ) {
+        PERROR("osdep_map_foreign_batch: mmap failed");
+        return NULL;
+    }
+
+    ioctlx.num=num;
+    ioctlx.dom=dom;
+    ioctlx.addr=(unsigned long)addr;
+    ioctlx.arr=arr;
+    if ( ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 )
+    {
+        int saved_errno = errno;
+        PERROR("osdep_map_foreign_batch: ioctl failed");
+        (void)munmap(addr, num*XC_PAGE_SIZE);
+        errno = saved_errno;
+        return NULL;
+    }
+    return addr;
+
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
new file mode 100644
index 0000000..36a71ec
--- /dev/null
+++ b/tools/libs/foreignmemory/private.h
@@ -0,0 +1,53 @@
+#ifndef XENFOREIGNMEMORY_PRIVATE_H
+#define XENFOREIGNMEMORY_PRIVATE_H
+
+#include <xentoollog.h>
+
+#include <xenforeignmemory.h>
+
+#include <xen/xen.h>
+#include <xen/sys/privcmd.h>
+
+#ifndef PAGE_SHIFT /* Mini-os, Yukk */
+#define PAGE_SHIFT           12
+#endif
+#ifndef __MINIOS__ /* Yukk */
+#define PAGE_SIZE            (1UL << PAGE_SHIFT)
+#define PAGE_MASK            (~(PAGE_SIZE-1))
+#endif
+
+struct xenforeignmemory_handle {
+    xentoollog_logger *logger, *logger_tofree;
+    unsigned flags;
+    int fd;
+};
+
+int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem);
+int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
+
+void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                                 uint32_t dom, int prot,
+                                 const xen_pfn_t *arr, int *err, size_t num);
+int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                                 void *addr, size_t num);
+
+#if defined(__NetBSD__) || defined(__sun__)
+/* Strictly compat for those two only only */
+void *compat_mapforeign_batch(xenforeignmem_handle *fmem, uint32_t dom,
+                              int prot, xen_pfn_t *arr, int num);
+#endif
+
+#define PERROR(_f...) \
+	xtl_log(fmem->logger, XTL_ERROR, errno, "xenforeignmemory", _f)
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/solaris.c b/tools/libs/foreignmemory/solaris.c
new file mode 100644
index 0000000..f4dd634
--- /dev/null
+++ b/tools/libs/foreignmemory/solaris.c
@@ -0,0 +1,93 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "xc_private.h"
+
+#include <xen/memory.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <malloc.h>
+
+int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
+{
+    int flags, saved_errno;
+    int fd = open("/dev/xen/privcmd", O_RDWR);
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface");
+        return -1;
+    }
+
+    /* 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+    flags |= FD_CLOEXEC;
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    fmem->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+    return -1;
+}
+
+int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
+{
+    int fd = fmem->fd;
+    return close(fd);
+}
+
+void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
+                              int prot, xen_pfn_t *arr, int num)
+{
+    int fd = fmem->fd;
+    privcmd_mmapbatch_t ioctlx;
+    void *addr;
+    addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_SHARED, fd, 0);
+    if ( addr == MAP_FAILED )
+        return NULL;
+
+    ioctlx.num=num;
+    ioctlx.dom=dom;
+    ioctlx.addr=(unsigned long)addr;
+    ioctlx.arr=arr;
+    if ( ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 )
+    {
+        int saved_errno = errno;
+        PERROR("XXXXXXXX");
+        (void)munmap(addr, num*XC_PAGE_SIZE);
+        errno = saved_errno;
+        return NULL;
+    }
+    return addr;
+}
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index a122f73..ca8bab7 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -42,8 +42,8 @@ CTRL_SRCS-y       += xc_kexec.c
 CTRL_SRCS-y       += xc_resource.c
 CTRL_SRCS-$(CONFIG_X86) += xc_psr.c
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
-CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c xc_linux_osdep.c
-CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c xc_freebsd_osdep.c
+CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
+CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c
 CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
 CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
 CTRL_SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c
@@ -125,7 +125,7 @@ $(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.
 # libxenguest includes xc_private.h, so needs this despite not using
 # this functionality directly.
 $(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \
-$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += $(CFLAGS_libxencall)
+$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += $(CFLAGS_libxencall) $(CFLAGS_libxenforeignmemory)
 
 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS): CFLAGS += $(CFLAGS_libxengnttab) $(CFLAGS_libxengntshr)
 
@@ -207,7 +207,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(LDLIBS_libxencall) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(LDLIBS_libxencall) $(LDLIBS_libxenforeignmemory) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 43ce14a..e632b1e 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1369,32 +1369,6 @@ int xc_lockprof_query(xc_interface *xch,
 void *xc_memalign(xc_interface *xch, size_t alignment, size_t size);
 
 /**
- * Memory maps a range within one domain to a local address range.  Mappings
- * should be unmapped with munmap and should follow the same rules as mmap
- * regarding page alignment.  Returns NULL on failure.
- *
- * @parm xch a handle on an open hypervisor interface
- * @parm dom the domain to map memory from
- * @parm size the amount of memory to map (in multiples of page size)
- * @parm prot same flag as in mmap().
- * @parm mfn the frame address to map.
- */
-void *xc_map_foreign_range(xc_interface *xch, uint32_t dom,
-                            int size, int prot,
-                            unsigned long mfn );
-
-void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
-                           const xen_pfn_t *arr, int num );
-
-/**
- * Like xc_map_foreign_pages(), except it can succeed partially.
- * When a page cannot be mapped, its respective field in @err is
- * set to the corresponding errno value.
- */
-void *xc_map_foreign_bulk(xc_interface *xch, uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err, unsigned int num);
-
-/**
  * Translates a virtual address in the context of a given domain and
  * vcpu returning the GFN containing the address (that is, an MFN for 
  * PV guests, a PFN for HVM guests).  Returns 0 for failure.
diff --git a/tools/libxc/include/xenctrl_compat.h b/tools/libxc/include/xenctrl_compat.h
index d99fa11..54c23a4 100644
--- a/tools/libxc/include/xenctrl_compat.h
+++ b/tools/libxc/include/xenctrl_compat.h
@@ -12,6 +12,42 @@
 #ifndef XENCTRL_COMPAT_H
 #define XENCTRL_COMPAT_H
 
+#ifdef XC_WANT_COMPAT_MAP_FOREIGN_API
+/**
+ * Memory maps a range within one domain to a local address range.  Mappings
+ * should be unmapped with munmap and should follow the same rules as mmap
+ * regarding page alignment.  Returns NULL on failure.
+ *
+ * @parm xch a handle on an open hypervisor interface
+ * @parm dom the domain to map memory from
+ * @parm size the amount of memory to map (in multiples of page size)
+ * @parm prot same flag as in mmap().
+ * @parm mfn the frame address to map.
+ */
+void *xc_map_foreign_range(xc_interface *xch, uint32_t dom,
+                            int size, int prot,
+                            unsigned long mfn );
+
+void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
+                           const xen_pfn_t *arr, int num );
+
+/* Nothing within the library itself other than the compat wrapper
+ * itself should be using this, everything inside has access to
+ * xenforeignmemory_map().
+ */
+#if !defined(XC_INTERNAL_COMPAT_MAP_FOREIGN_API) || \
+     defined(XC_BUILDING_COMPAT_MAP_FOREIGN_API)
+/**
+ * Like xc_map_foreign_pages(), except it can succeed partially.
+ * When a page cannot be mapped, its respective field in @err is
+ * set to the corresponding errno value.
+ */
+void *xc_map_foreign_bulk(xc_interface *xch, uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err, unsigned int num);
+#endif
+
+#endif
+
 #ifdef XC_WANT_COMPAT_EVTCHN_API
 
 typedef struct xenevtchn_handle xc_evtchn;
diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index d1130e6..1737c10 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -17,6 +17,7 @@
  * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#define XC_BUILDING_COMPAT_MAP_FOREIGN_API
 #include "xc_private.h"
 
 void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
@@ -34,7 +35,7 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
     if (!err)
         return NULL;
 
-    res = xc_map_foreign_bulk(xch, dom, prot, arr, err, num);
+    res = xenforeignmemory_map(xch->fmem, dom, prot, arr, err, num);
     if (res) {
         for (i = 0; i < num; i++) {
             if (err[i]) {
@@ -100,53 +101,11 @@ void *xc_map_foreign_ranges(xc_interface *xch,
     return ret;
 }
 
-/*
- * stub for all not yet converted OSes (NetBSD and Solaris). New OSes should
- * just implement xc_map_foreign_bulk.
- */
-#if defined(__NetBSD__) || defined(__sun__)
-void *osdep_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot,
-                              xen_pfn_t *arr, int num );
-void *xc_map_foreign_bulk(xc_interface *xch,
-                          uint32_t dom, int prot,
+void *xc_map_foreign_bulk(xc_interface *xch, uint32_t dom, int prot,
                           const xen_pfn_t *arr, int *err, unsigned int num)
 {
-    xen_pfn_t *pfn;
-    unsigned int i;
-    void *ret;
-
-    if ((int)num <= 0) {
-        errno = EINVAL;
-        return NULL;
-    }
-
-    pfn = malloc(num * sizeof(*pfn));
-    if (!pfn) {
-        errno = ENOMEM;
-        return NULL;
-    }
-
-    memcpy(pfn, arr, num * sizeof(*arr));
-    ret = osdep_map_foreign_batch(xch, dom, prot, pfn, num);
-
-    if (ret) {
-        for (i = 0; i < num; ++i)
-            switch (pfn[i] ^ arr[i]) {
-            case 0:
-                err[i] = 0;
-                break;
-            default:
-                err[i] = -EINVAL;
-                break;
-            }
-    } else
-        memset(err, 0, num * sizeof(*err));
-
-    free(pfn);
-
-    return ret;
+    return xenforeignmemory_map(xch->fmem, dom, prot, arr, err, num);
 }
-#endif
 
 /*
  * Local variables:
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
deleted file mode 100644
index 7745d28..0000000
--- a/tools/libxc/xc_freebsd_osdep.c
+++ /dev/null
@@ -1,136 +0,0 @@
- /******************************************************************************
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#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 "xc_private.h"
-
-#define PRIVCMD_DEV     "/dev/xen/privcmd"
-
-/*------------------------- Privcmd device interface -------------------------*/
-int osdep_privcmd_open(xc_interface *xch)
-{
-    int flags, saved_errno;
-    int fd = open(PRIVCMD_DEV, O_RDWR);
-
-    if ( fd == -1 )
-    {
-        PERROR("Could not obtain handle on privileged command interface "
-               PRIVCMD_DEV);
-        return -1
-    }
-
-    /*
-     * 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 = fcntl(fd, F_GETFD)) < 0 )
-    {
-        PERROR("Could not get file handle flags");
-        goto error;
-    }
-
-    flags |= FD_CLOEXEC;
-
-    if ( fcntl(fd, F_SETFD, flags) < 0 )
-    {
-        PERROR("Could not set file handle flags");
-        goto error;
-    }
-
-    xch->privcmdfd = fd;
-    return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-
-    return -1;
-}
-
-int osdep_privcmd_close(xc_interface *xch)
-{
-    int fd = xch->privcmdfd;
-    if ( fd == -1 )
-        return 0;
-    return close(fd);
-}
-
-/*----------------------- Privcmd foreign map interface ----------------------*/
-void *xc_map_foreign_bulk(xc_interface *xch,
-                          uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err,
-                          unsigned int num)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmapbatch_t ioctlx;
-    void *addr;
-    int rc;
-
-    addr = mmap(NULL, num << XC_PAGE_SHIFT, prot, MAP_SHARED, fd, 0);
-    if ( addr == MAP_FAILED )
-    {
-        PERROR("xc_map_foreign_bulk: mmap failed");
-        return NULL;
-    }
-
-    ioctlx.num = num;
-    ioctlx.dom = dom;
-    ioctlx.addr = (unsigned long)addr;
-    ioctlx.arr = arr;
-    ioctlx.err = err;
-
-    rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
-    if ( rc < 0 )
-    {
-        int saved_errno = errno;
-        PERROR("xc_map_foreign_bulk: ioctl failed");
-        (void)munmap(addr, num << XC_PAGE_SHIFT);
-        errno = saved_errno;
-        return NULL;
-    }
-
-    return addr;
-}
-
-/*
- * 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_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
deleted file mode 100644
index acf44ce..0000000
--- a/tools/libxc/xc_linux_osdep.c
+++ /dev/null
@@ -1,301 +0,0 @@
- /******************************************************************************
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#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 "xenctrl.h"
-
-#include "xc_private.h"
-
-#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
-
-int osdep_privcmd_open(xc_interface *xch)
-{
-    int flags, saved_errno;
-    int fd = open("/dev/xen/privcmd", O_RDWR); /* prefer this newer interface */
-
-    if ( fd == -1 && ( errno == ENOENT || errno == ENXIO || errno == ENODEV ))
-    {
-        /* Fallback to /proc/xen/privcmd */
-        fd = open("/proc/xen/privcmd", O_RDWR);
-    }
-
-    if ( fd == -1 )
-    {
-        PERROR("Could not obtain handle on privileged command interface");
-        return -1;
-    }
-
-    /* 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 = fcntl(fd, F_GETFD)) < 0 )
-    {
-        PERROR("Could not get file handle flags");
-        goto error;
-    }
-
-    flags |= FD_CLOEXEC;
-
-    if ( fcntl(fd, F_SETFD, flags) < 0 )
-    {
-        PERROR("Could not set file handle flags");
-        goto error;
-    }
-
-    xch->privcmdfd = fd;
-    return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-    return -1;
-}
-
-int osdep_privcmd_close(xc_interface *xch)
-{
-    int fd = xch->privcmdfd;
-    if (fd == -1)
-        return 0;
-    return close(fd);
-}
-
-static int map_foreign_batch_single(int fd, uint32_t dom,
-                                    xen_pfn_t *mfn, unsigned long addr)
-{
-    privcmd_mmapbatch_t ioctlx;
-    int rc;
-
-    ioctlx.num = 1;
-    ioctlx.dom = dom;
-    ioctlx.addr = addr;
-    ioctlx.arr = mfn;
-
-    do
-    {
-        *mfn ^= PRIVCMD_MMAPBATCH_PAGED_ERROR;
-        usleep(100);
-        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
-    }
-    while ( (rc < 0) && (errno == ENOENT) );
-
-    return rc;
-}
-
-/*
- * Retry mmap of all paged gfns in batches
- * retuns < 0 on fatal error
- * returns 0 if all gfns left paging state
- * returns > 0 if some gfns are still in paging state
- *
- * Walk all gfns and try to assemble blocks of gfns in paging state.
- * This will keep the request ring full and avoids delays.
- */
-static int retry_paged(int fd, uint32_t dom, void *addr,
-                       const xen_pfn_t *arr, int *err, unsigned int num)
-{
-    privcmd_mmapbatch_v2_t ioctlx;
-    int rc, paged = 0, i = 0;
-    
-    do
-    {
-        /* Skip gfns not in paging state */
-        if ( err[i] != -ENOENT )
-        {
-            i++;
-            continue;
-        }
-
-        paged++;
-
-        /* At least one gfn is still in paging state */
-        ioctlx.num = 1;
-        ioctlx.dom = dom;
-        ioctlx.addr = (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT);
-        ioctlx.arr = arr + i;
-        ioctlx.err = err + i;
-        
-        /* Assemble a batch of requests */
-        while ( ++i < num )
-        {
-            if ( err[i] != -ENOENT )
-                break;
-            ioctlx.num++;
-        }
-        
-        /* Send request and abort on fatal error */
-        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
-        if ( rc < 0 && errno != ENOENT )
-            goto out;
-
-    } while ( i < num );
-    
-    rc = paged;
-out:
-    return rc;
-}
-
-void *xc_map_foreign_bulk(xc_interface *xch,
-                          uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err, unsigned int num)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmapbatch_v2_t ioctlx;
-    void *addr;
-    unsigned int i;
-    int rc;
-
-    addr = mmap(NULL, (unsigned long)num << XC_PAGE_SHIFT, prot, MAP_SHARED,
-                fd, 0);
-    if ( addr == MAP_FAILED )
-    {
-        PERROR("xc_map_foreign_bulk: mmap failed");
-        return NULL;
-    }
-
-    ioctlx.num = num;
-    ioctlx.dom = dom;
-    ioctlx.addr = (unsigned long)addr;
-    ioctlx.arr = arr;
-    ioctlx.err = err;
-
-    rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
-
-    /* Command was recognized, some gfn in arr are in paging state */
-    if ( rc < 0 && errno == ENOENT )
-    {
-        do {
-            usleep(100);
-            rc = retry_paged(fd, dom, addr, arr, err, num);
-        } while ( rc > 0 );
-    }
-    /* Command was not recognized, use fall back */
-    else if ( rc < 0 && errno == EINVAL && (int)num > 0 )
-    {
-        /*
-         * IOCTL_PRIVCMD_MMAPBATCH_V2 is not supported - fall back to
-         * IOCTL_PRIVCMD_MMAPBATCH.
-         */
-        privcmd_mmapbatch_t ioctlx;
-        xen_pfn_t *pfn;
-        unsigned int pfn_arr_size = ROUNDUP((num * sizeof(*pfn)), XC_PAGE_SHIFT);
-
-        if ( pfn_arr_size <= XC_PAGE_SIZE )
-            pfn = alloca(num * sizeof(*pfn));
-        else
-        {
-            pfn = mmap(NULL, pfn_arr_size, PROT_READ | PROT_WRITE,
-                       MAP_PRIVATE | MAP_ANON | MAP_POPULATE, -1, 0);
-            if ( pfn == MAP_FAILED )
-            {
-                PERROR("xc_map_foreign_bulk: mmap of pfn array failed");
-                (void)munmap(addr, (unsigned long)num << XC_PAGE_SHIFT);
-                return NULL;
-            }
-        }
-
-        memcpy(pfn, arr, num * sizeof(*arr));
-
-        ioctlx.num = num;
-        ioctlx.dom = dom;
-        ioctlx.addr = (unsigned long)addr;
-        ioctlx.arr = pfn;
-
-        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
-
-        rc = rc < 0 ? -errno : 0;
-
-        for ( i = 0; i < num; ++i )
-        {
-            switch ( pfn[i] ^ arr[i] )
-            {
-            case 0:
-                err[i] = rc != -ENOENT ? rc : 0;
-                continue;
-            default:
-                err[i] = -EINVAL;
-                continue;
-            case PRIVCMD_MMAPBATCH_PAGED_ERROR:
-                if ( rc != -ENOENT )
-                {
-                    err[i] = rc ?: -EINVAL;
-                    continue;
-                }
-                rc = map_foreign_batch_single(fd, dom, pfn + i,
-                        (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT));
-                if ( rc < 0 )
-                {
-                    rc = -errno;
-                    break;
-                }
-                rc = -ENOENT;
-                continue;
-            }
-            break;
-        }
-
-        if ( pfn_arr_size > XC_PAGE_SIZE )
-            munmap(pfn, pfn_arr_size);
-
-        if ( rc == -ENOENT && i == num )
-            rc = 0;
-        else if ( rc )
-        {
-            errno = -rc;
-            rc = -1;
-        }
-    }
-
-    if ( rc < 0 )
-    {
-        int saved_errno = errno;
-
-        PERROR("xc_map_foreign_bulk: ioctl failed");
-        (void)munmap(addr, (unsigned long)num << XC_PAGE_SHIFT);
-        errno = saved_errno;
-        return NULL;
-    }
-
-    return addr;
-}
-
-/*
- * 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_minios.c b/tools/libxc/xc_minios.c
index d8ca948..1799daa 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -39,40 +39,11 @@ void minios_interface_close_fd(int fd);
 
 extern void minios_interface_close_fd(int fd);
 
-int osdep_privcmd_open(xc_interface *xch)
-{
-    int fd = alloc_fd(FTYPE_XC);
-
-    if ( fd == -1)
-        return -1;
-
-    xch->privcmdfd = fd;
-    return 0;
-}
-
-int osdep_privcmd_close(xc_interface *xch)
-{
-    int fd = xch->privcmdfd;
-    return close(fd);
-}
-
 void minios_interface_close_fd(int fd)
 {
     files[fd].type = FTYPE_NONE;
 }
 
-void *xc_map_foreign_bulk(xc_interface *xch,
-                          uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err, unsigned int num)
-{
-    unsigned long pt_prot = 0;
-    if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
-    if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
-    return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush)
 {
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 3470bc4..3197993 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -22,79 +22,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <malloc.h>
-#include <sys/mman.h>
-
-int osdep_privcmd_open(xc_interface *xch)
-{
-    int flags, saved_errno;
-    int fd = open("/kern/xen/privcmd", O_RDWR);
-
-    if ( fd == -1 )
-    {
-        PERROR("Could not obtain handle on privileged command interface");
-        return -1;
-    }
-
-    /* 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 = fcntl(fd, F_GETFD)) < 0 )
-    {
-        PERROR("Could not get file handle flags");
-        goto error;
-    }
-    flags |= FD_CLOEXEC;
-    if ( fcntl(fd, F_SETFD, flags) < 0 )
-    {
-        PERROR("Could not set file handle flags");
-        goto error;
-    }
-
-    xch->privcmdfd = fd;
-    return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-    return -1;
-}
-
-int osdep_privcmd_close(xc_interface *xch)
-{
-    int fd = xch->privcmdfd;
-    return close(fd);
-}
-
-void *osdep_map_foreign_batch(xc_interface *xch,
-                              uint32_t dom, int prot,
-                              xen_pfn_t *arr, int num)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmapbatch_t ioctlx;
-    void *addr;
-    addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
-    if ( addr == MAP_FAILED ) {
-        PERROR("osdep_map_foreign_batch: mmap failed");
-        return NULL;
-    }
-
-    ioctlx.num=num;
-    ioctlx.dom=dom;
-    ioctlx.addr=(unsigned long)addr;
-    ioctlx.arr=arr;
-    if ( ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 )
-    {
-        int saved_errno = errno;
-        PERROR("osdep_map_foreign_batch: ioctl failed");
-        (void)munmap(addr, num*XC_PAGE_SIZE);
-        errno = saved_errno;
-        return NULL;
-    }
-    return addr;
-
-}
 
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index ca4c17a..c41e433 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -58,11 +58,12 @@ struct xc_interface_core *xc_interface_open(xentoollog_logger *logger,
     if (open_flags & XC_OPENFLAG_DUMMY)
         return xch; /* We are done */
 
-    if ( osdep_privcmd_open(xch) < 0 )
-        goto err;
-
     xch->xcall = xencall_open(xch->error_handler,
         open_flags & XC_OPENFLAG_NON_REENTRANT ? XENCALL_OPENFLAG_NON_REENTRANT : 0U);
+    if ( xch->xcall == NULL )
+        goto err;
+
+    xch->fmem = xenforeignmemory_open(xch->error_handler, 0);
 
     if ( xch->xcall == NULL )
         goto err;
@@ -70,7 +71,7 @@ struct xc_interface_core *xc_interface_open(xentoollog_logger *logger,
     return xch;
 
  err:
-    osdep_privcmd_close(xch);
+    xencall_close(xch->xcall);
     xtl_logger_destroy(xch->error_handler_tofree);
     if (xch != &xch_buf) free(xch);
     return NULL;
@@ -86,8 +87,8 @@ int xc_interface_close(xc_interface *xch)
     rc = xencall_close(xch->xcall);
     if (rc) PERROR("Could not close xencall interface");
 
-    rc = osdep_privcmd_close(xch);
-    if (rc) PERROR("Could not close hypervisor interface");
+    rc = xenforeignmemory_close(xch->fmem);
+    if (rc) PERROR("Could not close foreign memory interface");
 
     xtl_logger_destroy(xch->dombuild_logger_tofree);
     xtl_logger_destroy(xch->error_handler_tofree);
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index ecf2451..aa8daf1 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -29,8 +29,13 @@
 #include <sys/ioctl.h>
 
 #include "_paths.h"
+
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
+#define XC_INTERNAL_COMPAT_MAP_FOREIGN_API
 #include "xenctrl.h"
+
 #include <xencall.h>
+#include <xenforeignmemory.h>
 
 #include <xen/sys/privcmd.h>
 
@@ -94,11 +99,11 @@ struct xc_interface_core {
     FILE *dombuild_logger_file;
     const char *currently_progress_reporting;
 
-    /* Privcmd interface */
-    int privcmdfd;
-
     /* Hypercall interface */
     xencall_handle *xcall;
+
+    /* Foreign mappings */
+    xenforeignmemory_handle *fmem;
 };
 
 int osdep_privcmd_open(xc_interface *xch);
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index d686867..5128f3f 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -19,81 +19,8 @@
 
 #include "xc_private.h"
 
-#include <xen/memory.h>
-#include <unistd.h>
-#include <fcntl.h>
 #include <malloc.h>
 
-int osdep_privcmd_open(xc_interface *xch)
-{
-    int flags, saved_errno;
-    int fd = open("/dev/xen/privcmd", O_RDWR);
-
-    if ( fd == -1 )
-    {
-        PERROR("Could not obtain handle on privileged command interface");
-        return -1;
-    }
-
-    /* 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 = fcntl(fd, F_GETFD)) < 0 )
-    {
-        PERROR("Could not get file handle flags");
-        goto error;
-    }
-    flags |= FD_CLOEXEC;
-    if ( fcntl(fd, F_SETFD, flags) < 0 )
-    {
-        PERROR("Could not set file handle flags");
-        goto error;
-    }
-
-    xch->privcmdfd = fd;
-    return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-    return -1;
-}
-
-int osdep_privcmd_close(xc_interface *xch)
-{
-    int fd = xch->privcmdfd;
-    return close(fd);
-}
-
-void *osdep_map_foreign_batch(xc_interface *xch,
-                              uint32_t dom, int prot,
-                              xen_pfn_t *arr, int num)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmapbatch_t ioctlx;
-    void *addr;
-    addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_SHARED, fd, 0);
-    if ( addr == MAP_FAILED )
-        return NULL;
-
-    ioctlx.num=num;
-    ioctlx.dom=dom;
-    ioctlx.addr=(unsigned long)addr;
-    ioctlx.arr=arr;
-    if ( ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 )
-    {
-        int saved_errno = errno;
-        PERROR("XXXXXXXX");
-        (void)munmap(addr, num*XC_PAGE_SIZE);
-        errno = saved_errno;
-        return NULL;
-    }
-    return addr;
-
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index 6ccdab9..4f44d20 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -316,8 +316,8 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count,
     if ( nr_pages == 0 )
         goto done;
 
-    mapping = guest_page = xc_map_foreign_bulk(
-        xch, ctx->domid, PROT_READ | PROT_WRITE,
+    mapping = guest_page = xenforeignmemory_map(xch->fmem,
+        ctx->domid, PROT_READ | PROT_WRITE,
         mfns, map_errs, nr_pages);
     if ( !mapping )
     {
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index e4ba560..8ee0719 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -153,8 +153,8 @@ static int write_batch(struct xc_sr_context *ctx)
 
     if ( nr_pages > 0 )
     {
-        guest_mapping = xc_map_foreign_bulk(
-            xch, ctx->domid, PROT_READ, mfns, errors, nr_pages);
+        guest_mapping = xenforeignmemory_map(xch->fmem,
+            ctx->domid, PROT_READ, mfns, errors, nr_pages);
         if ( !guest_mapping )
         {
             PERROR("Failed to map guest pages");
diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h
index a76d6b3..175c1e5 100644
--- a/tools/libxc/xg_private.h
+++ b/tools/libxc/xg_private.h
@@ -26,9 +26,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include "xenctrl.h"
-#include "xenguest.h"
 #include "xc_private.h"
+#include "xenguest.h"
 
 #include <xen/memory.h>
 #include <xen/elfnote.h>
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 2198d07..b194e65 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -50,6 +50,7 @@
 
 #include <xenevtchn.h>
 #include <xenstore.h>
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <xenguest.h>
 #include <xc_dom.h>
diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c
index ceeeaa9..1b22ad7 100644
--- a/tools/misc/xen-mfndump.c
+++ b/tools/misc/xen-mfndump.c
@@ -1,3 +1,4 @@
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <xc_private.h>
 #include <xc_core.h>
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index e2fa7e4..74928e9 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -29,6 +29,7 @@
 #include <stdint.h>
 #include <string.h>
 
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 
 #include "mmap_stubs.h"
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 6dd79e0..c40a4e9 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -5,6 +5,7 @@
  */
 
 #include <Python.h>
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <fcntl.h>
 #include <netinet/in.h>
@@ -15,6 +16,7 @@
 #include <netdb.h>
 #include <arpa/inet.h>
 
+#include <xen/elfnote.h>
 #include <xen/tmem.h>
 #include "xc_dom.h"
 #include <xen/hvm/hvm_info_table.h>
diff --git a/tools/tests/mce-test/tools/xen-mceinj.c b/tools/tests/mce-test/tools/xen-mceinj.c
index d22f0ad..061ec7c 100644
--- a/tools/tests/mce-test/tools/xen-mceinj.c
+++ b/tools/tests/mce-test/tools/xen-mceinj.c
@@ -30,6 +30,7 @@
 #include <signal.h>
 #include <stdarg.h>
 
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <xenguest.h>
 #include <inttypes.h>
diff --git a/tools/tests/mem-sharing/memshrtool.c b/tools/tests/mem-sharing/memshrtool.c
index 6454bc3..437c7c9 100644
--- a/tools/tests/mem-sharing/memshrtool.c
+++ b/tools/tests/mem-sharing/memshrtool.c
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <sys/mman.h>
 
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include "xenctrl.h"
 
 static int usage(const char* prog)
diff --git a/tools/xenmon/xenbaked.c b/tools/xenmon/xenbaked.c
index da46126..eacacb0 100644
--- a/tools/xenmon/xenbaked.c
+++ b/tools/xenmon/xenbaked.c
@@ -38,6 +38,7 @@
 #include <errno.h>
 #include <signal.h>
 #include <xenevtchn.h>
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <xen/xen.h>
 #include <string.h>
diff --git a/tools/xenpaging/pagein.c b/tools/xenpaging/pagein.c
index 7cb0f33..2a298b4 100644
--- a/tools/xenpaging/pagein.c
+++ b/tools/xenpaging/pagein.c
@@ -1,6 +1,5 @@
 /* Trigger a page-in in a separate thread-of-execution to avoid deadlock */
 #include <pthread.h>
-#include <xc_private.h>
 #include "xenpaging.h"
 
 struct page_in_args {
diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
index c4bc713..0377507 100644
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -27,7 +27,6 @@
 #include <signal.h>
 #include <unistd.h>
 #include <poll.h>
-#include <xc_private.h>
 #include <xenstore.h>
 #include <getopt.h>
 
diff --git a/tools/xenpaging/xenpaging.h b/tools/xenpaging/xenpaging.h
index d0f8d20..d6c8ee5 100644
--- a/tools/xenpaging/xenpaging.h
+++ b/tools/xenpaging/xenpaging.h
@@ -25,6 +25,8 @@
 
 
 #include <xenevtchn.h>
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
+#include <xenctrl.h>
 #include <xc_private.h>
 #include <xen/event_channel.h>
 #include <xen/vm_event.h>
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index f62c192..51fb0b3 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -50,7 +50,6 @@
 #include "xenstored_watch.h"
 #include "xenstored_transaction.h"
 #include "xenstored_domain.h"
-#include "xenctrl.h"
 #include "tdb.h"
 
 #include "hashtable.h"
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 624737d..3a497f7 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -19,6 +19,7 @@
 #ifndef _XENSTORED_CORE_H
 #define _XENSTORED_CORE_H
 
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <xengnttab.h>
 
diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 4ed120a..e647179 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -25,7 +25,8 @@
 #include <getopt.h>
 #include <limits.h>
 
-#include "xenctrl.h"
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
+#include <xenctrl.h>
 #include <xen/foreign/x86_32.h>
 #include <xen/foreign/x86_64.h>
 #include <xen/hvm/save.h>
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c
index 6cbe0ac..f09fe6c 100644
--- a/tools/xentrace/xentrace.c
+++ b/tools/xentrace/xentrace.c
@@ -30,6 +30,7 @@
 #include <xen/xen.h>
 #include <xen/trace.h>
 
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenevtchn.h>
 #include <xenctrl.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 Wed Jan 27 10:16:05 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10: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 1aON8v-0000ib-Cw; Wed, 27 Jan 2016 10: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 1aON8t-0000i6-6D
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:03 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	70/15-29478-2E898A65; Wed, 27 Jan 2016 10:16:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1453889757!18449903!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45129 invoked from network); 27 Jan 2016 10:15:58 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9f-0001yg-Sg
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8n-0001OX-JN
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:57 +0000
Date: Wed, 27 Jan 2016 10:15:57 +0000
Message-Id: <E1aON8n-0001OX-JN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Refactor foreign memory mapping
	into libxenforeignmemory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 32486916793fd78a41fc25e53d2b53a5aa0b1bd5
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 18 16:30:19 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:03 2016 +0000

    tools: Refactor foreign memory mapping into libxenforeignmemory
    
    libxenforeignmemory will provide a stable API and ABI for mapping
    foreign domain memory (subject to appropriate privileges).
    
    The new library exposes an interface equivalent to
    xc_map_foreign_memory_bulk, which all the other
    xc_map_foreign_memory_* functions (which remain in libxc) are
    implemented in terms of.
    
    Upon request (via #define XC_WANT_COMPAT_MAP_FOREIGN_API) libxenctrl
    will provide a compat API for the old names. This is used by qemu-xen
    and qemu-trad as well as various in tree things (which required
    de-dupping various #includes in some too to get the #define before the
    first).
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    [ ijc -- updated MINIOS_UPSTREAM_REVISION and QEMU_TRADITIONAL_REVISION ]
---
 .gitignore                                         |    2 +
 Config.mk                                          |   12 +-
 stubdom/Makefile                                   |   17 +-
 tools/Makefile                                     |    2 +
 tools/Rules.mk                                     |   11 +-
 tools/console/daemon/utils.c                       |    1 -
 tools/console/daemon/utils.h                       |    1 +
 tools/libs/Makefile                                |    1 +
 tools/libs/foreignmemory/Makefile                  |   71 +++++
 tools/libs/foreignmemory/compat.c                  |   72 +++++
 tools/libs/foreignmemory/core.c                    |   84 ++++++
 tools/libs/foreignmemory/freebsd.c                 |  129 +++++++++
 .../libs/foreignmemory/include/xenforeignmemory.h  |   71 +++++
 tools/libs/foreignmemory/libxenforeignmemory.map   |    7 +
 tools/libs/foreignmemory/linux.c                   |  293 +++++++++++++++++++
 tools/libs/foreignmemory/minios.c                  |   62 ++++
 tools/libs/foreignmemory/netbsd.c                  |  105 +++++++
 tools/libs/foreignmemory/private.h                 |   53 ++++
 tools/libs/foreignmemory/solaris.c                 |   93 ++++++
 tools/libxc/Makefile                               |    8 +-
 tools/libxc/include/xenctrl.h                      |   26 --
 tools/libxc/include/xenctrl_compat.h               |   36 +++
 tools/libxc/xc_foreign_memory.c                    |   49 +---
 tools/libxc/xc_freebsd_osdep.c                     |  136 ---------
 tools/libxc/xc_linux_osdep.c                       |  301 --------------------
 tools/libxc/xc_minios.c                            |   29 --
 tools/libxc/xc_netbsd.c                            |   73 -----
 tools/libxc/xc_private.c                           |   13 +-
 tools/libxc/xc_private.h                           |   11 +-
 tools/libxc/xc_solaris.c                           |   73 -----
 tools/libxc/xc_sr_restore.c                        |    4 +-
 tools/libxc/xc_sr_save.c                           |    4 +-
 tools/libxc/xg_private.h                           |    3 +-
 tools/libxl/libxl_internal.h                       |    1 +
 tools/misc/xen-mfndump.c                           |    1 +
 tools/ocaml/libs/xc/xenctrl_stubs.c                |    1 +
 tools/python/xen/lowlevel/xc/xc.c                  |    2 +
 tools/tests/mce-test/tools/xen-mceinj.c            |    1 +
 tools/tests/mem-sharing/memshrtool.c               |    1 +
 tools/xenmon/xenbaked.c                            |    1 +
 tools/xenpaging/pagein.c                           |    1 -
 tools/xenpaging/xenpaging.c                        |    1 -
 tools/xenpaging/xenpaging.h                        |    2 +
 tools/xenstore/xenstored_core.c                    |    1 -
 tools/xenstore/xenstored_core.h                    |    1 +
 tools/xentrace/xenctx.c                            |    3 +-
 tools/xentrace/xentrace.c                          |    1 +
 47 files changed, 1154 insertions(+), 717 deletions(-)

diff --git a/.gitignore b/.gitignore
index 6272f6b..91f690c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,6 +64,7 @@ stubdom/libs-*
 stubdom/libxc-*
 stubdom/libxencall-*
 stubdom/libxenevtchn-*
+stubdom/libxenforeignmemory-*
 stubdom/libxengnttab-*
 stubdom/libxentoollog-*
 stubdom/lwip-*
@@ -93,6 +94,7 @@ tools/libs/toollog/headers.chk
 tools/libs/evtchn/headers.chk
 tools/libs/gnttab/headers.chk
 tools/libs/call/headers.chk
+tools/libs/foreignmemory/headers.chk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff --git a/Config.mk b/Config.mk
index 174c192..429e460 100644
--- a/Config.mk
+++ b/Config.mk
@@ -251,9 +251,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= c7d4f84e52d901068f9c7d5cd2cc05ced93c0157
-# Fri Jan 15 13:24:02 2016 +0000
-# mini-os: Include libxencall with libxc
+MINIOS_UPSTREAM_REVISION ?= 89268f00b0b0215057cb74edd94e866536a02489
+# Fri Jan 15 13:24:03 2016 +0000
+# mini-os: Include libxenforeignmemory with libxc
 
 SEABIOS_UPSTREAM_REVISION ?= 3403ac4313812752be6e6aac35239ca6888a8cab
 # Mon Dec 28 13:50:41 2015 +0100
@@ -262,9 +262,9 @@ SEABIOS_UPSTREAM_REVISION ?= 3403ac4313812752be6e6aac35239ca6888a8cab
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= 79ed2c5733742a7b00f9c774bece30a620150a30
-# Fri Jan 15 13:23:55 2016 +0000
-# qemu-xen-traditional: Add libxencall to rpath-link
+QEMU_TRADITIONAL_REVISION ?= 21f6526d1da331611ac5fe12967549d1a04e149b
+# Fri Jan 15 13:23:56 2016 +0000
+# qemu-xen-traditional: Add libxenforeignmemory to rpath-link
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 5bf4ed6..6f68e98 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -337,6 +337,12 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
 	  ln -sf $(XEN_ROOT)/tools/libs/call/include/*.h include/ && \
 	  ln -sf $(XEN_ROOT)/tools/libs/call/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/libs/call/Makefile . )
+	mkdir -p libs-$(XEN_TARGET_ARCH)/foreignmemory/include
+	[ -h libs-$(XEN_TARGET_ARCH)/foreignmemory/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/foreignmemory && \
+	  ln -sf $(XEN_ROOT)/tools/libs/foreignmemory/*.h . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/foreignmemory/include/*.h include/ && \
+	  ln -sf $(XEN_ROOT)/tools/libs/foreignmemory/*.c . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/foreignmemory/Makefile . )
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
@@ -396,12 +402,21 @@ libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLI
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/call
 
 #######
+# libxenforeignmemory
+#######
+
+.PHONY: libxenforeignmemory
+libxenforeignmemory: libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a
+libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/foreignmemory
+
+#######
 # libxc
 #######
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn libxengnttab libxencall cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn libxengnttab libxencall libxenforeignmemory cross-zlib
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
diff --git a/tools/Makefile b/tools/Makefile
index 05d8bdb..61785d7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -251,6 +251,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--source-path=$$source \
 		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
 		-DXC_WANT_COMPAT_GNTTAB_API=1 \
+		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
 		-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libs/toollog/include \
 		-I$(XEN_ROOT)/tools/libs/evtchn/include \
@@ -265,6 +266,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/evtchn \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/gnttab \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/call \
+		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/foreignmemory \
 		$(QEMU_UPSTREAM_RPATH)" \
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 18e3688..d47fa45 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -14,6 +14,7 @@ XEN_LIBXENTOOLLOG  = $(XEN_ROOT)/tools/libs/toollog
 XEN_LIBXENEVTCHN   = $(XEN_ROOT)/tools/libs/evtchn
 XEN_LIBXENGNTTAB   = $(XEN_ROOT)/tools/libs/gnttab
 XEN_LIBXENCALL     = $(XEN_ROOT)/tools/libs/call
+XEN_LIBXENFOREIGNMEMORY = $(XEN_ROOT)/tools/libs/foreignmemory
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_XENLIGHT       = $(XEN_ROOT)/tools/libxl
 XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
@@ -103,12 +104,16 @@ CFLAGS_libxencall = -I$(XEN_LIBXENCALL)/include $(CFLAGS_xeninclude)
 LDLIBS_libxencall = $(XEN_LIBXENCALL)/libxencall$(libextension)
 SHLIB_libxencall  = -Wl,-rpath-link=$(XEN_LIBXENCALL)
 
-CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_xeninclude)
-SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxengntshr) $(SHLIB_libxencall)
+CFLAGS_libxenforeignmemory = -I$(XEN_LIBXENFOREIGNMEMORY)/include $(CFLAGS_xeninclude)
+LDLIBS_libxenforeignmemory = $(XEN_LIBXENFOREIGNMEMORY)/libxenforeignmemory$(libextension)
+SHLIB_libxenforeignmemory  = -Wl,-rpath-link=$(XEN_LIBXENFOREIGNMEMORY)
+
+CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude)
+SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxengntshr) $(SHLIB_libxencall) $(SHLIB_libxenforeignmemory)
 LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libextension)
 SHLIB_libxenctrl  = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_LIBXC)
 
-CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_libxenevtchn) $(CFLAGS_xeninclude)
+CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_libxenevtchn) $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude)
 SHDEPS_libxenguest = $(SHLIB_libxenevtchn)
 LDLIBS_libxenguest = $(SHDEPS_libxenguest) $(XEN_LIBXC)/libxenguest$(libextension)
 SHLIB_libxenguest  = $(SHDEPS_libxenguest) -Wl,-rpath-link=$(XEN_LIBXC)
diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c
index 644f6af..97d7798 100644
--- a/tools/console/daemon/utils.c
+++ b/tools/console/daemon/utils.c
@@ -33,7 +33,6 @@
 #include <string.h>
 #include <signal.h>
 
-#include "xenctrl.h"
 #include "utils.h"
 
 struct xs_handle *xs;
diff --git a/tools/console/daemon/utils.h b/tools/console/daemon/utils.h
index 1295822..a010ac4 100644
--- a/tools/console/daemon/utils.h
+++ b/tools/console/daemon/utils.h
@@ -23,6 +23,7 @@
 #include <stdbool.h>
 #include <syslog.h>
 #include <stdio.h>
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 
 #include <xenstore.h>
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index f4f5d57..dc5726d 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -6,5 +6,6 @@ SUBDIRS-y += toollog
 SUBDIRS-y += evtchn
 SUBDIRS-y += gnttab
 SUBDIRS-y += call
+SUBDIRS-y += foreignmemory
 
 all clean install distclean: %: subdirs-%
diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/Makefile
new file mode 100644
index 0000000..f062f45
--- /dev/null
+++ b/tools/libs/foreignmemory/Makefile
@@ -0,0 +1,71 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR    = 1
+MINOR    = 0
+SHLIB_LDFLAGS += -Wl,--version-script=libxenforeignmemory.map
+
+CFLAGS   += -Werror -Wmissing-prototypes
+CFLAGS   += -I./include $(CFLAGS_xeninclude)
+CFLAGS   += $(CFLAGS_libxentoollog)
+
+SRCS-y                 += core.c
+SRCS-$(CONFIG_Linux)   += linux.c
+SRCS-$(CONFIG_FreeBSD) += freebsd.c
+SRCS-$(CONFIG_SunOS)   += compat.c solaris.c
+SRCS-$(CONFIG_NetBSD)  += compat.c netbsd.c
+SRCS-$(CONFIG_MiniOS)  += minios.c
+
+LIB_OBJS := $(patsubst %.c,%.o,$(SRCS-y))
+PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS-y))
+
+LIB := libxenforeignmemory.a
+ifneq ($(nosharedlibs),y)
+LIB += libxenforeignmemory.so
+endif
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build:
+	$(MAKE) libs
+
+.PHONY: libs
+libs: headers.chk $(LIB)
+
+headers.chk: $(wildcard include/*.h)
+
+libxenforeignmemory.a: $(LIB_OBJS)
+	$(AR) rc $@ $^
+
+libxenforeignmemory.so: libxenforeignmemory.so.$(MAJOR)
+	$(SYMLINK_SHLIB) $< $@
+libxenforeignmemory.so.$(MAJOR): libxenforeignmemory.so.$(MAJOR).$(MINOR)
+	$(SYMLINK_SHLIB) $< $@
+
+libxenforeignmemory.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxenforeignmemory.map
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenforeignmemory.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: build
+	$(INSTALL_DIR) $(DESTDIR)$(libdir)
+	$(INSTALL_DIR) $(DESTDIR)$(includedir)
+	$(INSTALL_SHLIB) libxenforeignmemory.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) libxenforeignmemory.a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) libxenforeignmemory.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenforeignmemory.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxenforeignmemory.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenforeignmemory.so
+	$(INSTALL_DATA) include/xenforeignmemory.h $(DESTDIR)$(includedir)
+
+.PHONY: TAGS
+TAGS:
+	etags -t *.c *.h
+
+.PHONY: clean
+clean:
+	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -f libxenforeignmemory.so.$(MAJOR).$(MINOR) libxenforeignmemory.so.$(MAJOR)
+	rm -f headers.chk
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/libs/foreignmemory/compat.c b/tools/libs/foreignmemory/compat.c
new file mode 100644
index 0000000..b8c6fc6
--- /dev/null
+++ b/tools/libs/foreignmemory/compat.c
@@ -0,0 +1,72 @@
+/* Compatibility functions for mapping foreign domain's memory.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_foreign_memory.c
+ */
+#if !defined(__NetBSD__) && !defined(__sun__)
+#error Please implement osdep_xenforeignmemory_map directly for new ports.
+#endif
+
+#include "private.h"
+
+void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                                 uint32_t dom, int prot,
+                                 const xen_pfn_t *arr, int *err, unsigned int num)
+{
+    xen_pfn_t *pfn;
+    unsigned int i;
+    void *ret;
+
+    if ((int)num <= 0) {
+        errno = EINVAL;
+        return NULL;
+    }
+
+    pfn = malloc(num * sizeof(*pfn));
+    if (!pfn) {
+        errno = ENOMEM;
+        return NULL;
+    }
+
+    memcpy(pfn, arr, num * sizeof(*arr));
+    ret = osdep_map_foreign_batch(fmem, dom, prot, pfn, num);
+
+    if (ret) {
+        for (i = 0; i < num; ++i)
+            switch (pfn[i] ^ arr[i]) {
+            case 0:
+                err[i] = 0;
+                break;
+            default:
+                err[i] = -EINVAL;
+                break;
+            }
+    } else
+        memset(err, 0, num * sizeof(*err));
+
+    free(pfn);
+
+    return ret;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/core.c b/tools/libs/foreignmemory/core.c
new file mode 100644
index 0000000..21dc7ee
--- /dev/null
+++ b/tools/libs/foreignmemory/core.c
@@ -0,0 +1,84 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+
+#include "private.h"
+
+xenforeignmemory_handle *xenforeignmemory_open(xentoollog_logger *logger,
+                                               unsigned open_flags)
+{
+    xenforeignmemory_handle *fmem = malloc(sizeof(*fmem));
+    int rc;
+
+    if (!fmem) return NULL;
+
+    fmem->logger = logger;
+    fmem->logger_tofree = NULL;
+
+    if (!fmem->logger) {
+        fmem->logger = fmem->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!fmem->logger) goto err;
+    }
+
+    rc = osdep_xenforeignmemory_open(fmem);
+    if ( rc  < 0 ) goto err;
+
+    return fmem;
+
+err:
+    osdep_xenforeignmemory_close(fmem);
+    xtl_logger_destroy(fmem->logger_tofree);
+    free(fmem);
+    return NULL;
+}
+
+int xenforeignmemory_close(xenforeignmemory_handle *fmem)
+{
+    int rc;
+
+    if ( !fmem )
+        return 0;
+
+    rc = osdep_xenforeignmemory_close(fmem);
+    xtl_logger_destroy(fmem->logger_tofree);
+    free(fmem);
+    return rc;
+}
+
+void *xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                           uint32_t dom, int prot,
+                           const xen_pfn_t *arr, int *err, size_t num)
+{
+    return osdep_xenforeignmemory_map(fmem, dom, prot, arr, err, num);
+}
+
+int xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                           void *addr, size_t num)
+{
+    return osdep_xenforeignmemory_unmap(fmem, addr, num);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
new file mode 100644
index 0000000..4b2815d
--- /dev/null
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -0,0 +1,129 @@
+ /******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#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 "private.h"
+
+#define PRIVCMD_DEV     "/dev/xen/privcmd"
+
+int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
+{
+    int flags, saved_errno;
+    int fd = open(PRIVCMD_DEV, O_RDWR);
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface "
+               PRIVCMD_DEV);
+        return -1;
+    }
+
+    /*
+     * 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+
+    flags |= FD_CLOEXEC;
+
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    fmem->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+
+    return -1;
+}
+
+int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
+{
+    int fd = fmem->fd;
+    if ( fd == -1 )
+        return 0;
+    return close(fd);
+}
+
+void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                                 uint32_t dom, int prot,
+                                 const xen_pfn_t *arr, int *err,
+                                 unsigned int num)
+{
+    int fd = fmem->fd;
+    privcmd_mmapbatch_t ioctlx;
+    void *addr;
+    int rc;
+
+    addr = mmap(NULL, num << PAGE_SHIFT, prot, MAP_SHARED, fd, 0);
+    if ( addr == MAP_FAILED )
+    {
+        PERROR("xc_map_foreign_bulk: mmap failed");
+        return NULL;
+    }
+
+    ioctlx.num = num;
+    ioctlx.dom = dom;
+    ioctlx.addr = (unsigned long)addr;
+    ioctlx.arr = arr;
+    ioctlx.err = err;
+
+    rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
+    if ( rc < 0 )
+    {
+        int saved_errno = errno;
+        PERROR("xc_map_foreign_bulk: ioctl failed");
+        (void)munmap(addr, num << PAGE_SHIFT);
+        errno = saved_errno;
+        return NULL;
+    }
+
+    return addr;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
new file mode 100644
index 0000000..5b3fa7a
--- /dev/null
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -0,0 +1,71 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef XENFOREIGNMEMORY_H
+#define XENFOREIGNMEMORY_H
+
+/*
+ * This library allows you to map foreign domain memory, subject to
+ * permissions for both the process and the domain in which the
+ * process runs.
+ */
+
+#include <stdint.h>
+#include <stddef.h>
+
+#include <xen/xen.h>
+
+/* Callers who don't care don't need to #include <xentoollog.h> */
+typedef struct xentoollog_logger xentoollog_logger;
+
+typedef struct xenforeignmemory_handle xenforeignmemory_handle;
+
+/*
+ * Return a handle onto the hypercall driver.  Logs errors.
+ */
+xenforeignmemory_handle *xenforeignmemory_open(xentoollog_logger *logger,
+                                               unsigned open_flags);
+
+/*
+ * Close a handle previously allocated with xenforeignmemory_open().
+ */
+int xenforeignmemory_close(xenforeignmemory_handle *fmem);
+
+/*
+ * Maps a range within one domain to a local address range.  Mappings
+ * should be unmapped with munmap and should follow the same rules as mmap
+ * regarding page alignment.
+ *
+ * prot is as for mmap(2).
+ *
+ * Can partially succeed. When a page cannot be mapped, its respective
+ * field in @err is set to the corresponding errno value.
+ *
+ * Returns NULL if no pages can be mapped.
+ */
+void *xenforeignmemory_map(xenforeignmemory_handle *fmem, uint32_t dom,
+                           int prot, const xen_pfn_t *arr, int *err,
+                           unsigned int num);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/libxenforeignmemory.map b/tools/libs/foreignmemory/libxenforeignmemory.map
new file mode 100644
index 0000000..11f0d2b
--- /dev/null
+++ b/tools/libs/foreignmemory/libxenforeignmemory.map
@@ -0,0 +1,7 @@
+VERS_1.0 {
+	global:
+		xenforeignmemory_open;
+		xenforeignmemory_close;
+		xenforeignmemory_map;
+	local: *; /* Do not expose anything by default */
+};
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
new file mode 100644
index 0000000..b403ca7
--- /dev/null
+++ b/tools/libs/foreignmemory/linux.c
@@ -0,0 +1,293 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_linus_osdep.c:
+ *
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ */
+
+#include <alloca.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+
+#include "private.h"
+
+#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
+
+int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
+{
+    int flags, saved_errno;
+    int fd = open("/dev/xen/privcmd", O_RDWR); /* prefer this newer interface */
+
+    if ( fd == -1 && ( errno == ENOENT || errno == ENXIO || errno == ENODEV ))
+    {
+        /* Fallback to /proc/xen/privcmd */
+        fd = open("/proc/xen/privcmd", O_RDWR);
+    }
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface");
+        return -1;
+    }
+
+    /* 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+
+    flags |= FD_CLOEXEC;
+
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    fmem->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+    return -1;
+}
+
+int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
+{
+    int fd = fmem->fd;
+    if (fd == -1)
+        return 0;
+    return close(fd);
+}
+
+static int map_foreign_batch_single(int fd, uint32_t dom,
+                                    xen_pfn_t *mfn, unsigned long addr)
+{
+    privcmd_mmapbatch_t ioctlx;
+    int rc;
+
+    ioctlx.num = 1;
+    ioctlx.dom = dom;
+    ioctlx.addr = addr;
+    ioctlx.arr = mfn;
+
+    do
+    {
+        *mfn ^= PRIVCMD_MMAPBATCH_PAGED_ERROR;
+        usleep(100);
+        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
+    }
+    while ( (rc < 0) && (errno == ENOENT) );
+
+    return rc;
+}
+
+/*
+ * Retry mmap of all paged gfns in batches
+ * retuns < 0 on fatal error
+ * returns 0 if all gfns left paging state
+ * returns > 0 if some gfns are still in paging state
+ *
+ * Walk all gfns and try to assemble blocks of gfns in paging state.
+ * This will keep the request ring full and avoids delays.
+ */
+static int retry_paged(int fd, uint32_t dom, void *addr,
+                       const xen_pfn_t *arr, int *err, unsigned int num)
+{
+    privcmd_mmapbatch_v2_t ioctlx;
+    int rc, paged = 0, i = 0;
+
+    do
+    {
+        /* Skip gfns not in paging state */
+        if ( err[i] != -ENOENT )
+        {
+            i++;
+            continue;
+        }
+
+        paged++;
+
+        /* At least one gfn is still in paging state */
+        ioctlx.num = 1;
+        ioctlx.dom = dom;
+        ioctlx.addr = (unsigned long)addr + ((unsigned long)i<<PAGE_SHIFT);
+        ioctlx.arr = arr + i;
+        ioctlx.err = err + i;
+
+        /* Assemble a batch of requests */
+        while ( ++i < num )
+        {
+            if ( err[i] != -ENOENT )
+                break;
+            ioctlx.num++;
+        }
+
+        /* Send request and abort on fatal error */
+        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
+        if ( rc < 0 && errno != ENOENT )
+            goto out;
+
+    } while ( i < num );
+
+    rc = paged;
+out:
+    return rc;
+}
+
+void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                                 uint32_t dom, int prot,
+                                 const xen_pfn_t *arr, int *err, unsigned int num)
+{
+    int fd = fmem->fd;
+    privcmd_mmapbatch_v2_t ioctlx;
+    void *addr;
+    unsigned int i;
+    int rc;
+
+    addr = mmap(NULL, (unsigned long)num << PAGE_SHIFT, prot, MAP_SHARED,
+                fd, 0);
+    if ( addr == MAP_FAILED )
+    {
+        PERROR("mmap failed");
+        return NULL;
+    }
+
+    ioctlx.num = num;
+    ioctlx.dom = dom;
+    ioctlx.addr = (unsigned long)addr;
+    ioctlx.arr = arr;
+    ioctlx.err = err;
+
+    rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
+
+    /* Command was recognized, some gfn in arr are in paging state */
+    if ( rc < 0 && errno == ENOENT )
+    {
+        do {
+            usleep(100);
+            rc = retry_paged(fd, dom, addr, arr, err, num);
+        } while ( rc > 0 );
+    }
+    /* Command was not recognized, use fall back */
+    else if ( rc < 0 && errno == EINVAL && (int)num > 0 )
+    {
+        /*
+         * IOCTL_PRIVCMD_MMAPBATCH_V2 is not supported - fall back to
+         * IOCTL_PRIVCMD_MMAPBATCH.
+         */
+        privcmd_mmapbatch_t ioctlx;
+        xen_pfn_t *pfn;
+        unsigned int pfn_arr_size = ROUNDUP((num * sizeof(*pfn)), PAGE_SHIFT);
+
+        if ( pfn_arr_size <= PAGE_SIZE )
+            pfn = alloca(num * sizeof(*pfn));
+        else
+        {
+            pfn = mmap(NULL, pfn_arr_size, PROT_READ | PROT_WRITE,
+                       MAP_PRIVATE | MAP_ANON | MAP_POPULATE, -1, 0);
+            if ( pfn == MAP_FAILED )
+            {
+                PERROR("mmap of pfn array failed");
+                (void)munmap(addr, (unsigned long)num << PAGE_SHIFT);
+                return NULL;
+            }
+        }
+
+        memcpy(pfn, arr, num * sizeof(*arr));
+
+        ioctlx.num = num;
+        ioctlx.dom = dom;
+        ioctlx.addr = (unsigned long)addr;
+        ioctlx.arr = pfn;
+
+        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
+
+        rc = rc < 0 ? -errno : 0;
+
+        for ( i = 0; i < num; ++i )
+        {
+            switch ( pfn[i] ^ arr[i] )
+            {
+            case 0:
+                err[i] = rc != -ENOENT ? rc : 0;
+                continue;
+            default:
+                err[i] = -EINVAL;
+                continue;
+            case PRIVCMD_MMAPBATCH_PAGED_ERROR:
+                if ( rc != -ENOENT )
+                {
+                    err[i] = rc ?: -EINVAL;
+                    continue;
+                }
+                rc = map_foreign_batch_single(fd, dom, pfn + i,
+                        (unsigned long)addr + ((unsigned long)i<<PAGE_SHIFT));
+                if ( rc < 0 )
+                {
+                    rc = -errno;
+                    break;
+                }
+                rc = -ENOENT;
+                continue;
+            }
+            break;
+        }
+
+        if ( pfn_arr_size > PAGE_SIZE )
+            munmap(pfn, pfn_arr_size);
+
+        if ( rc == -ENOENT && i == num )
+            rc = 0;
+        else if ( rc )
+        {
+            errno = -rc;
+            rc = -1;
+        }
+    }
+
+    if ( rc < 0 )
+    {
+        int saved_errno = errno;
+
+        PERROR("ioctl failed");
+        (void)munmap(addr, (unsigned long)num << PAGE_SHIFT);
+        errno = saved_errno;
+        return NULL;
+    }
+
+    return addr;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
new file mode 100644
index 0000000..a542e3d
--- /dev/null
+++ b/tools/libs/foreignmemory/minios.c
@@ -0,0 +1,62 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_minios.c
+ *
+ * Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.com>.
+ */
+
+#include <mini-os/types.h>
+#include <mini-os/os.h>
+#include <mini-os/mm.h>
+#include <mini-os/lib.h>
+
+#include <errno.h>
+
+#include <sys/mman.h>
+
+#include "private.h"
+
+int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
+{
+    /* No fd required */
+    return 0;
+}
+
+int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
+{
+    return 0;
+}
+
+void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                                 uint32_t dom, int prot,
+                                 const xen_pfn_t *arr, int *err, unsigned int num)
+{
+    unsigned long pt_prot = 0;
+    if (prot & PROT_READ)
+	pt_prot = L1_PROT_RO;
+    if (prot & PROT_WRITE)
+	pt_prot = L1_PROT;
+    return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/netbsd.c b/tools/libs/foreignmemory/netbsd.c
new file mode 100644
index 0000000..704a096
--- /dev/null
+++ b/tools/libs/foreignmemory/netbsd.c
@@ -0,0 +1,105 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#include "private.h"
+
+int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
+{
+    int flags, saved_errno;
+    int fd = open("/kern/xen/privcmd", O_RDWR);
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface");
+        return -1;
+    }
+
+    /* 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+    flags |= FD_CLOEXEC;
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    fmem->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+    return -1;
+}
+
+int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
+{
+    int fd = fmem->fd;
+    return close(fd);
+}
+
+void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
+                              int prot, xen_pfn_t *arr, int num)
+{
+    int fd = fmem->fd;
+    privcmd_mmapbatch_t ioctlx;
+    void *addr;
+    addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
+    if ( addr == MAP_FAILED ) {
+        PERROR("osdep_map_foreign_batch: mmap failed");
+        return NULL;
+    }
+
+    ioctlx.num=num;
+    ioctlx.dom=dom;
+    ioctlx.addr=(unsigned long)addr;
+    ioctlx.arr=arr;
+    if ( ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 )
+    {
+        int saved_errno = errno;
+        PERROR("osdep_map_foreign_batch: ioctl failed");
+        (void)munmap(addr, num*XC_PAGE_SIZE);
+        errno = saved_errno;
+        return NULL;
+    }
+    return addr;
+
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
new file mode 100644
index 0000000..36a71ec
--- /dev/null
+++ b/tools/libs/foreignmemory/private.h
@@ -0,0 +1,53 @@
+#ifndef XENFOREIGNMEMORY_PRIVATE_H
+#define XENFOREIGNMEMORY_PRIVATE_H
+
+#include <xentoollog.h>
+
+#include <xenforeignmemory.h>
+
+#include <xen/xen.h>
+#include <xen/sys/privcmd.h>
+
+#ifndef PAGE_SHIFT /* Mini-os, Yukk */
+#define PAGE_SHIFT           12
+#endif
+#ifndef __MINIOS__ /* Yukk */
+#define PAGE_SIZE            (1UL << PAGE_SHIFT)
+#define PAGE_MASK            (~(PAGE_SIZE-1))
+#endif
+
+struct xenforeignmemory_handle {
+    xentoollog_logger *logger, *logger_tofree;
+    unsigned flags;
+    int fd;
+};
+
+int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem);
+int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
+
+void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
+                                 uint32_t dom, int prot,
+                                 const xen_pfn_t *arr, int *err, size_t num);
+int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                                 void *addr, size_t num);
+
+#if defined(__NetBSD__) || defined(__sun__)
+/* Strictly compat for those two only only */
+void *compat_mapforeign_batch(xenforeignmem_handle *fmem, uint32_t dom,
+                              int prot, xen_pfn_t *arr, int num);
+#endif
+
+#define PERROR(_f...) \
+	xtl_log(fmem->logger, XTL_ERROR, errno, "xenforeignmemory", _f)
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/foreignmemory/solaris.c b/tools/libs/foreignmemory/solaris.c
new file mode 100644
index 0000000..f4dd634
--- /dev/null
+++ b/tools/libs/foreignmemory/solaris.c
@@ -0,0 +1,93 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "xc_private.h"
+
+#include <xen/memory.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <malloc.h>
+
+int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
+{
+    int flags, saved_errno;
+    int fd = open("/dev/xen/privcmd", O_RDWR);
+
+    if ( fd == -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface");
+        return -1;
+    }
+
+    /* 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 = fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+    flags |= FD_CLOEXEC;
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    fmem->fd = fd;
+    return 0;
+
+ error:
+    saved_errno = errno;
+    close(fd);
+    errno = saved_errno;
+    return -1;
+}
+
+int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
+{
+    int fd = fmem->fd;
+    return close(fd);
+}
+
+void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
+                              int prot, xen_pfn_t *arr, int num)
+{
+    int fd = fmem->fd;
+    privcmd_mmapbatch_t ioctlx;
+    void *addr;
+    addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_SHARED, fd, 0);
+    if ( addr == MAP_FAILED )
+        return NULL;
+
+    ioctlx.num=num;
+    ioctlx.dom=dom;
+    ioctlx.addr=(unsigned long)addr;
+    ioctlx.arr=arr;
+    if ( ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 )
+    {
+        int saved_errno = errno;
+        PERROR("XXXXXXXX");
+        (void)munmap(addr, num*XC_PAGE_SIZE);
+        errno = saved_errno;
+        return NULL;
+    }
+    return addr;
+}
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index a122f73..ca8bab7 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -42,8 +42,8 @@ CTRL_SRCS-y       += xc_kexec.c
 CTRL_SRCS-y       += xc_resource.c
 CTRL_SRCS-$(CONFIG_X86) += xc_psr.c
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
-CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c xc_linux_osdep.c
-CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c xc_freebsd_osdep.c
+CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
+CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c
 CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
 CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
 CTRL_SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c
@@ -125,7 +125,7 @@ $(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.
 # libxenguest includes xc_private.h, so needs this despite not using
 # this functionality directly.
 $(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \
-$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += $(CFLAGS_libxencall)
+$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): CFLAGS += $(CFLAGS_libxencall) $(CFLAGS_libxenforeignmemory)
 
 $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS): CFLAGS += $(CFLAGS_libxengnttab) $(CFLAGS_libxengntshr)
 
@@ -207,7 +207,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(LDLIBS_libxencall) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(LDLIBS_libxencall) $(LDLIBS_libxenforeignmemory) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 43ce14a..e632b1e 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1369,32 +1369,6 @@ int xc_lockprof_query(xc_interface *xch,
 void *xc_memalign(xc_interface *xch, size_t alignment, size_t size);
 
 /**
- * Memory maps a range within one domain to a local address range.  Mappings
- * should be unmapped with munmap and should follow the same rules as mmap
- * regarding page alignment.  Returns NULL on failure.
- *
- * @parm xch a handle on an open hypervisor interface
- * @parm dom the domain to map memory from
- * @parm size the amount of memory to map (in multiples of page size)
- * @parm prot same flag as in mmap().
- * @parm mfn the frame address to map.
- */
-void *xc_map_foreign_range(xc_interface *xch, uint32_t dom,
-                            int size, int prot,
-                            unsigned long mfn );
-
-void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
-                           const xen_pfn_t *arr, int num );
-
-/**
- * Like xc_map_foreign_pages(), except it can succeed partially.
- * When a page cannot be mapped, its respective field in @err is
- * set to the corresponding errno value.
- */
-void *xc_map_foreign_bulk(xc_interface *xch, uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err, unsigned int num);
-
-/**
  * Translates a virtual address in the context of a given domain and
  * vcpu returning the GFN containing the address (that is, an MFN for 
  * PV guests, a PFN for HVM guests).  Returns 0 for failure.
diff --git a/tools/libxc/include/xenctrl_compat.h b/tools/libxc/include/xenctrl_compat.h
index d99fa11..54c23a4 100644
--- a/tools/libxc/include/xenctrl_compat.h
+++ b/tools/libxc/include/xenctrl_compat.h
@@ -12,6 +12,42 @@
 #ifndef XENCTRL_COMPAT_H
 #define XENCTRL_COMPAT_H
 
+#ifdef XC_WANT_COMPAT_MAP_FOREIGN_API
+/**
+ * Memory maps a range within one domain to a local address range.  Mappings
+ * should be unmapped with munmap and should follow the same rules as mmap
+ * regarding page alignment.  Returns NULL on failure.
+ *
+ * @parm xch a handle on an open hypervisor interface
+ * @parm dom the domain to map memory from
+ * @parm size the amount of memory to map (in multiples of page size)
+ * @parm prot same flag as in mmap().
+ * @parm mfn the frame address to map.
+ */
+void *xc_map_foreign_range(xc_interface *xch, uint32_t dom,
+                            int size, int prot,
+                            unsigned long mfn );
+
+void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
+                           const xen_pfn_t *arr, int num );
+
+/* Nothing within the library itself other than the compat wrapper
+ * itself should be using this, everything inside has access to
+ * xenforeignmemory_map().
+ */
+#if !defined(XC_INTERNAL_COMPAT_MAP_FOREIGN_API) || \
+     defined(XC_BUILDING_COMPAT_MAP_FOREIGN_API)
+/**
+ * Like xc_map_foreign_pages(), except it can succeed partially.
+ * When a page cannot be mapped, its respective field in @err is
+ * set to the corresponding errno value.
+ */
+void *xc_map_foreign_bulk(xc_interface *xch, uint32_t dom, int prot,
+                          const xen_pfn_t *arr, int *err, unsigned int num);
+#endif
+
+#endif
+
 #ifdef XC_WANT_COMPAT_EVTCHN_API
 
 typedef struct xenevtchn_handle xc_evtchn;
diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index d1130e6..1737c10 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -17,6 +17,7 @@
  * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#define XC_BUILDING_COMPAT_MAP_FOREIGN_API
 #include "xc_private.h"
 
 void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
@@ -34,7 +35,7 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
     if (!err)
         return NULL;
 
-    res = xc_map_foreign_bulk(xch, dom, prot, arr, err, num);
+    res = xenforeignmemory_map(xch->fmem, dom, prot, arr, err, num);
     if (res) {
         for (i = 0; i < num; i++) {
             if (err[i]) {
@@ -100,53 +101,11 @@ void *xc_map_foreign_ranges(xc_interface *xch,
     return ret;
 }
 
-/*
- * stub for all not yet converted OSes (NetBSD and Solaris). New OSes should
- * just implement xc_map_foreign_bulk.
- */
-#if defined(__NetBSD__) || defined(__sun__)
-void *osdep_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot,
-                              xen_pfn_t *arr, int num );
-void *xc_map_foreign_bulk(xc_interface *xch,
-                          uint32_t dom, int prot,
+void *xc_map_foreign_bulk(xc_interface *xch, uint32_t dom, int prot,
                           const xen_pfn_t *arr, int *err, unsigned int num)
 {
-    xen_pfn_t *pfn;
-    unsigned int i;
-    void *ret;
-
-    if ((int)num <= 0) {
-        errno = EINVAL;
-        return NULL;
-    }
-
-    pfn = malloc(num * sizeof(*pfn));
-    if (!pfn) {
-        errno = ENOMEM;
-        return NULL;
-    }
-
-    memcpy(pfn, arr, num * sizeof(*arr));
-    ret = osdep_map_foreign_batch(xch, dom, prot, pfn, num);
-
-    if (ret) {
-        for (i = 0; i < num; ++i)
-            switch (pfn[i] ^ arr[i]) {
-            case 0:
-                err[i] = 0;
-                break;
-            default:
-                err[i] = -EINVAL;
-                break;
-            }
-    } else
-        memset(err, 0, num * sizeof(*err));
-
-    free(pfn);
-
-    return ret;
+    return xenforeignmemory_map(xch->fmem, dom, prot, arr, err, num);
 }
-#endif
 
 /*
  * Local variables:
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
deleted file mode 100644
index 7745d28..0000000
--- a/tools/libxc/xc_freebsd_osdep.c
+++ /dev/null
@@ -1,136 +0,0 @@
- /******************************************************************************
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#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 "xc_private.h"
-
-#define PRIVCMD_DEV     "/dev/xen/privcmd"
-
-/*------------------------- Privcmd device interface -------------------------*/
-int osdep_privcmd_open(xc_interface *xch)
-{
-    int flags, saved_errno;
-    int fd = open(PRIVCMD_DEV, O_RDWR);
-
-    if ( fd == -1 )
-    {
-        PERROR("Could not obtain handle on privileged command interface "
-               PRIVCMD_DEV);
-        return -1
-    }
-
-    /*
-     * 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 = fcntl(fd, F_GETFD)) < 0 )
-    {
-        PERROR("Could not get file handle flags");
-        goto error;
-    }
-
-    flags |= FD_CLOEXEC;
-
-    if ( fcntl(fd, F_SETFD, flags) < 0 )
-    {
-        PERROR("Could not set file handle flags");
-        goto error;
-    }
-
-    xch->privcmdfd = fd;
-    return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-
-    return -1;
-}
-
-int osdep_privcmd_close(xc_interface *xch)
-{
-    int fd = xch->privcmdfd;
-    if ( fd == -1 )
-        return 0;
-    return close(fd);
-}
-
-/*----------------------- Privcmd foreign map interface ----------------------*/
-void *xc_map_foreign_bulk(xc_interface *xch,
-                          uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err,
-                          unsigned int num)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmapbatch_t ioctlx;
-    void *addr;
-    int rc;
-
-    addr = mmap(NULL, num << XC_PAGE_SHIFT, prot, MAP_SHARED, fd, 0);
-    if ( addr == MAP_FAILED )
-    {
-        PERROR("xc_map_foreign_bulk: mmap failed");
-        return NULL;
-    }
-
-    ioctlx.num = num;
-    ioctlx.dom = dom;
-    ioctlx.addr = (unsigned long)addr;
-    ioctlx.arr = arr;
-    ioctlx.err = err;
-
-    rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
-    if ( rc < 0 )
-    {
-        int saved_errno = errno;
-        PERROR("xc_map_foreign_bulk: ioctl failed");
-        (void)munmap(addr, num << XC_PAGE_SHIFT);
-        errno = saved_errno;
-        return NULL;
-    }
-
-    return addr;
-}
-
-/*
- * 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_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
deleted file mode 100644
index acf44ce..0000000
--- a/tools/libxc/xc_linux_osdep.c
+++ /dev/null
@@ -1,301 +0,0 @@
- /******************************************************************************
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#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 "xenctrl.h"
-
-#include "xc_private.h"
-
-#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
-
-int osdep_privcmd_open(xc_interface *xch)
-{
-    int flags, saved_errno;
-    int fd = open("/dev/xen/privcmd", O_RDWR); /* prefer this newer interface */
-
-    if ( fd == -1 && ( errno == ENOENT || errno == ENXIO || errno == ENODEV ))
-    {
-        /* Fallback to /proc/xen/privcmd */
-        fd = open("/proc/xen/privcmd", O_RDWR);
-    }
-
-    if ( fd == -1 )
-    {
-        PERROR("Could not obtain handle on privileged command interface");
-        return -1;
-    }
-
-    /* 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 = fcntl(fd, F_GETFD)) < 0 )
-    {
-        PERROR("Could not get file handle flags");
-        goto error;
-    }
-
-    flags |= FD_CLOEXEC;
-
-    if ( fcntl(fd, F_SETFD, flags) < 0 )
-    {
-        PERROR("Could not set file handle flags");
-        goto error;
-    }
-
-    xch->privcmdfd = fd;
-    return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-    return -1;
-}
-
-int osdep_privcmd_close(xc_interface *xch)
-{
-    int fd = xch->privcmdfd;
-    if (fd == -1)
-        return 0;
-    return close(fd);
-}
-
-static int map_foreign_batch_single(int fd, uint32_t dom,
-                                    xen_pfn_t *mfn, unsigned long addr)
-{
-    privcmd_mmapbatch_t ioctlx;
-    int rc;
-
-    ioctlx.num = 1;
-    ioctlx.dom = dom;
-    ioctlx.addr = addr;
-    ioctlx.arr = mfn;
-
-    do
-    {
-        *mfn ^= PRIVCMD_MMAPBATCH_PAGED_ERROR;
-        usleep(100);
-        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
-    }
-    while ( (rc < 0) && (errno == ENOENT) );
-
-    return rc;
-}
-
-/*
- * Retry mmap of all paged gfns in batches
- * retuns < 0 on fatal error
- * returns 0 if all gfns left paging state
- * returns > 0 if some gfns are still in paging state
- *
- * Walk all gfns and try to assemble blocks of gfns in paging state.
- * This will keep the request ring full and avoids delays.
- */
-static int retry_paged(int fd, uint32_t dom, void *addr,
-                       const xen_pfn_t *arr, int *err, unsigned int num)
-{
-    privcmd_mmapbatch_v2_t ioctlx;
-    int rc, paged = 0, i = 0;
-    
-    do
-    {
-        /* Skip gfns not in paging state */
-        if ( err[i] != -ENOENT )
-        {
-            i++;
-            continue;
-        }
-
-        paged++;
-
-        /* At least one gfn is still in paging state */
-        ioctlx.num = 1;
-        ioctlx.dom = dom;
-        ioctlx.addr = (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT);
-        ioctlx.arr = arr + i;
-        ioctlx.err = err + i;
-        
-        /* Assemble a batch of requests */
-        while ( ++i < num )
-        {
-            if ( err[i] != -ENOENT )
-                break;
-            ioctlx.num++;
-        }
-        
-        /* Send request and abort on fatal error */
-        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
-        if ( rc < 0 && errno != ENOENT )
-            goto out;
-
-    } while ( i < num );
-    
-    rc = paged;
-out:
-    return rc;
-}
-
-void *xc_map_foreign_bulk(xc_interface *xch,
-                          uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err, unsigned int num)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmapbatch_v2_t ioctlx;
-    void *addr;
-    unsigned int i;
-    int rc;
-
-    addr = mmap(NULL, (unsigned long)num << XC_PAGE_SHIFT, prot, MAP_SHARED,
-                fd, 0);
-    if ( addr == MAP_FAILED )
-    {
-        PERROR("xc_map_foreign_bulk: mmap failed");
-        return NULL;
-    }
-
-    ioctlx.num = num;
-    ioctlx.dom = dom;
-    ioctlx.addr = (unsigned long)addr;
-    ioctlx.arr = arr;
-    ioctlx.err = err;
-
-    rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx);
-
-    /* Command was recognized, some gfn in arr are in paging state */
-    if ( rc < 0 && errno == ENOENT )
-    {
-        do {
-            usleep(100);
-            rc = retry_paged(fd, dom, addr, arr, err, num);
-        } while ( rc > 0 );
-    }
-    /* Command was not recognized, use fall back */
-    else if ( rc < 0 && errno == EINVAL && (int)num > 0 )
-    {
-        /*
-         * IOCTL_PRIVCMD_MMAPBATCH_V2 is not supported - fall back to
-         * IOCTL_PRIVCMD_MMAPBATCH.
-         */
-        privcmd_mmapbatch_t ioctlx;
-        xen_pfn_t *pfn;
-        unsigned int pfn_arr_size = ROUNDUP((num * sizeof(*pfn)), XC_PAGE_SHIFT);
-
-        if ( pfn_arr_size <= XC_PAGE_SIZE )
-            pfn = alloca(num * sizeof(*pfn));
-        else
-        {
-            pfn = mmap(NULL, pfn_arr_size, PROT_READ | PROT_WRITE,
-                       MAP_PRIVATE | MAP_ANON | MAP_POPULATE, -1, 0);
-            if ( pfn == MAP_FAILED )
-            {
-                PERROR("xc_map_foreign_bulk: mmap of pfn array failed");
-                (void)munmap(addr, (unsigned long)num << XC_PAGE_SHIFT);
-                return NULL;
-            }
-        }
-
-        memcpy(pfn, arr, num * sizeof(*arr));
-
-        ioctlx.num = num;
-        ioctlx.dom = dom;
-        ioctlx.addr = (unsigned long)addr;
-        ioctlx.arr = pfn;
-
-        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
-
-        rc = rc < 0 ? -errno : 0;
-
-        for ( i = 0; i < num; ++i )
-        {
-            switch ( pfn[i] ^ arr[i] )
-            {
-            case 0:
-                err[i] = rc != -ENOENT ? rc : 0;
-                continue;
-            default:
-                err[i] = -EINVAL;
-                continue;
-            case PRIVCMD_MMAPBATCH_PAGED_ERROR:
-                if ( rc != -ENOENT )
-                {
-                    err[i] = rc ?: -EINVAL;
-                    continue;
-                }
-                rc = map_foreign_batch_single(fd, dom, pfn + i,
-                        (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT));
-                if ( rc < 0 )
-                {
-                    rc = -errno;
-                    break;
-                }
-                rc = -ENOENT;
-                continue;
-            }
-            break;
-        }
-
-        if ( pfn_arr_size > XC_PAGE_SIZE )
-            munmap(pfn, pfn_arr_size);
-
-        if ( rc == -ENOENT && i == num )
-            rc = 0;
-        else if ( rc )
-        {
-            errno = -rc;
-            rc = -1;
-        }
-    }
-
-    if ( rc < 0 )
-    {
-        int saved_errno = errno;
-
-        PERROR("xc_map_foreign_bulk: ioctl failed");
-        (void)munmap(addr, (unsigned long)num << XC_PAGE_SHIFT);
-        errno = saved_errno;
-        return NULL;
-    }
-
-    return addr;
-}
-
-/*
- * 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_minios.c b/tools/libxc/xc_minios.c
index d8ca948..1799daa 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -39,40 +39,11 @@ void minios_interface_close_fd(int fd);
 
 extern void minios_interface_close_fd(int fd);
 
-int osdep_privcmd_open(xc_interface *xch)
-{
-    int fd = alloc_fd(FTYPE_XC);
-
-    if ( fd == -1)
-        return -1;
-
-    xch->privcmdfd = fd;
-    return 0;
-}
-
-int osdep_privcmd_close(xc_interface *xch)
-{
-    int fd = xch->privcmdfd;
-    return close(fd);
-}
-
 void minios_interface_close_fd(int fd)
 {
     files[fd].type = FTYPE_NONE;
 }
 
-void *xc_map_foreign_bulk(xc_interface *xch,
-                          uint32_t dom, int prot,
-                          const xen_pfn_t *arr, int *err, unsigned int num)
-{
-    unsigned long pt_prot = 0;
-    if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
-    if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
-    return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush)
 {
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 3470bc4..3197993 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -22,79 +22,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <malloc.h>
-#include <sys/mman.h>
-
-int osdep_privcmd_open(xc_interface *xch)
-{
-    int flags, saved_errno;
-    int fd = open("/kern/xen/privcmd", O_RDWR);
-
-    if ( fd == -1 )
-    {
-        PERROR("Could not obtain handle on privileged command interface");
-        return -1;
-    }
-
-    /* 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 = fcntl(fd, F_GETFD)) < 0 )
-    {
-        PERROR("Could not get file handle flags");
-        goto error;
-    }
-    flags |= FD_CLOEXEC;
-    if ( fcntl(fd, F_SETFD, flags) < 0 )
-    {
-        PERROR("Could not set file handle flags");
-        goto error;
-    }
-
-    xch->privcmdfd = fd;
-    return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-    return -1;
-}
-
-int osdep_privcmd_close(xc_interface *xch)
-{
-    int fd = xch->privcmdfd;
-    return close(fd);
-}
-
-void *osdep_map_foreign_batch(xc_interface *xch,
-                              uint32_t dom, int prot,
-                              xen_pfn_t *arr, int num)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmapbatch_t ioctlx;
-    void *addr;
-    addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_ANON | MAP_SHARED, -1, 0);
-    if ( addr == MAP_FAILED ) {
-        PERROR("osdep_map_foreign_batch: mmap failed");
-        return NULL;
-    }
-
-    ioctlx.num=num;
-    ioctlx.dom=dom;
-    ioctlx.addr=(unsigned long)addr;
-    ioctlx.arr=arr;
-    if ( ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 )
-    {
-        int saved_errno = errno;
-        PERROR("osdep_map_foreign_batch: ioctl failed");
-        (void)munmap(addr, num*XC_PAGE_SIZE);
-        errno = saved_errno;
-        return NULL;
-    }
-    return addr;
-
-}
 
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index ca4c17a..c41e433 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -58,11 +58,12 @@ struct xc_interface_core *xc_interface_open(xentoollog_logger *logger,
     if (open_flags & XC_OPENFLAG_DUMMY)
         return xch; /* We are done */
 
-    if ( osdep_privcmd_open(xch) < 0 )
-        goto err;
-
     xch->xcall = xencall_open(xch->error_handler,
         open_flags & XC_OPENFLAG_NON_REENTRANT ? XENCALL_OPENFLAG_NON_REENTRANT : 0U);
+    if ( xch->xcall == NULL )
+        goto err;
+
+    xch->fmem = xenforeignmemory_open(xch->error_handler, 0);
 
     if ( xch->xcall == NULL )
         goto err;
@@ -70,7 +71,7 @@ struct xc_interface_core *xc_interface_open(xentoollog_logger *logger,
     return xch;
 
  err:
-    osdep_privcmd_close(xch);
+    xencall_close(xch->xcall);
     xtl_logger_destroy(xch->error_handler_tofree);
     if (xch != &xch_buf) free(xch);
     return NULL;
@@ -86,8 +87,8 @@ int xc_interface_close(xc_interface *xch)
     rc = xencall_close(xch->xcall);
     if (rc) PERROR("Could not close xencall interface");
 
-    rc = osdep_privcmd_close(xch);
-    if (rc) PERROR("Could not close hypervisor interface");
+    rc = xenforeignmemory_close(xch->fmem);
+    if (rc) PERROR("Could not close foreign memory interface");
 
     xtl_logger_destroy(xch->dombuild_logger_tofree);
     xtl_logger_destroy(xch->error_handler_tofree);
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index ecf2451..aa8daf1 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -29,8 +29,13 @@
 #include <sys/ioctl.h>
 
 #include "_paths.h"
+
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
+#define XC_INTERNAL_COMPAT_MAP_FOREIGN_API
 #include "xenctrl.h"
+
 #include <xencall.h>
+#include <xenforeignmemory.h>
 
 #include <xen/sys/privcmd.h>
 
@@ -94,11 +99,11 @@ struct xc_interface_core {
     FILE *dombuild_logger_file;
     const char *currently_progress_reporting;
 
-    /* Privcmd interface */
-    int privcmdfd;
-
     /* Hypercall interface */
     xencall_handle *xcall;
+
+    /* Foreign mappings */
+    xenforeignmemory_handle *fmem;
 };
 
 int osdep_privcmd_open(xc_interface *xch);
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index d686867..5128f3f 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -19,81 +19,8 @@
 
 #include "xc_private.h"
 
-#include <xen/memory.h>
-#include <unistd.h>
-#include <fcntl.h>
 #include <malloc.h>
 
-int osdep_privcmd_open(xc_interface *xch)
-{
-    int flags, saved_errno;
-    int fd = open("/dev/xen/privcmd", O_RDWR);
-
-    if ( fd == -1 )
-    {
-        PERROR("Could not obtain handle on privileged command interface");
-        return -1;
-    }
-
-    /* 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 = fcntl(fd, F_GETFD)) < 0 )
-    {
-        PERROR("Could not get file handle flags");
-        goto error;
-    }
-    flags |= FD_CLOEXEC;
-    if ( fcntl(fd, F_SETFD, flags) < 0 )
-    {
-        PERROR("Could not set file handle flags");
-        goto error;
-    }
-
-    xch->privcmdfd = fd;
-    return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-    return -1;
-}
-
-int osdep_privcmd_close(xc_interface *xch)
-{
-    int fd = xch->privcmdfd;
-    return close(fd);
-}
-
-void *osdep_map_foreign_batch(xc_interface *xch,
-                              uint32_t dom, int prot,
-                              xen_pfn_t *arr, int num)
-{
-    int fd = xch->privcmdfd;
-    privcmd_mmapbatch_t ioctlx;
-    void *addr;
-    addr = mmap(NULL, num*XC_PAGE_SIZE, prot, MAP_SHARED, fd, 0);
-    if ( addr == MAP_FAILED )
-        return NULL;
-
-    ioctlx.num=num;
-    ioctlx.dom=dom;
-    ioctlx.addr=(unsigned long)addr;
-    ioctlx.arr=arr;
-    if ( ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 )
-    {
-        int saved_errno = errno;
-        PERROR("XXXXXXXX");
-        (void)munmap(addr, num*XC_PAGE_SIZE);
-        errno = saved_errno;
-        return NULL;
-    }
-    return addr;
-
-}
-
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush) 
 {
diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index 6ccdab9..4f44d20 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -316,8 +316,8 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count,
     if ( nr_pages == 0 )
         goto done;
 
-    mapping = guest_page = xc_map_foreign_bulk(
-        xch, ctx->domid, PROT_READ | PROT_WRITE,
+    mapping = guest_page = xenforeignmemory_map(xch->fmem,
+        ctx->domid, PROT_READ | PROT_WRITE,
         mfns, map_errs, nr_pages);
     if ( !mapping )
     {
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index e4ba560..8ee0719 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -153,8 +153,8 @@ static int write_batch(struct xc_sr_context *ctx)
 
     if ( nr_pages > 0 )
     {
-        guest_mapping = xc_map_foreign_bulk(
-            xch, ctx->domid, PROT_READ, mfns, errors, nr_pages);
+        guest_mapping = xenforeignmemory_map(xch->fmem,
+            ctx->domid, PROT_READ, mfns, errors, nr_pages);
         if ( !guest_mapping )
         {
             PERROR("Failed to map guest pages");
diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h
index a76d6b3..175c1e5 100644
--- a/tools/libxc/xg_private.h
+++ b/tools/libxc/xg_private.h
@@ -26,9 +26,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include "xenctrl.h"
-#include "xenguest.h"
 #include "xc_private.h"
+#include "xenguest.h"
 
 #include <xen/memory.h>
 #include <xen/elfnote.h>
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 2198d07..b194e65 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -50,6 +50,7 @@
 
 #include <xenevtchn.h>
 #include <xenstore.h>
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <xenguest.h>
 #include <xc_dom.h>
diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c
index ceeeaa9..1b22ad7 100644
--- a/tools/misc/xen-mfndump.c
+++ b/tools/misc/xen-mfndump.c
@@ -1,3 +1,4 @@
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <xc_private.h>
 #include <xc_core.h>
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index e2fa7e4..74928e9 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -29,6 +29,7 @@
 #include <stdint.h>
 #include <string.h>
 
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 
 #include "mmap_stubs.h"
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 6dd79e0..c40a4e9 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -5,6 +5,7 @@
  */
 
 #include <Python.h>
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <fcntl.h>
 #include <netinet/in.h>
@@ -15,6 +16,7 @@
 #include <netdb.h>
 #include <arpa/inet.h>
 
+#include <xen/elfnote.h>
 #include <xen/tmem.h>
 #include "xc_dom.h"
 #include <xen/hvm/hvm_info_table.h>
diff --git a/tools/tests/mce-test/tools/xen-mceinj.c b/tools/tests/mce-test/tools/xen-mceinj.c
index d22f0ad..061ec7c 100644
--- a/tools/tests/mce-test/tools/xen-mceinj.c
+++ b/tools/tests/mce-test/tools/xen-mceinj.c
@@ -30,6 +30,7 @@
 #include <signal.h>
 #include <stdarg.h>
 
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <xenguest.h>
 #include <inttypes.h>
diff --git a/tools/tests/mem-sharing/memshrtool.c b/tools/tests/mem-sharing/memshrtool.c
index 6454bc3..437c7c9 100644
--- a/tools/tests/mem-sharing/memshrtool.c
+++ b/tools/tests/mem-sharing/memshrtool.c
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <sys/mman.h>
 
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include "xenctrl.h"
 
 static int usage(const char* prog)
diff --git a/tools/xenmon/xenbaked.c b/tools/xenmon/xenbaked.c
index da46126..eacacb0 100644
--- a/tools/xenmon/xenbaked.c
+++ b/tools/xenmon/xenbaked.c
@@ -38,6 +38,7 @@
 #include <errno.h>
 #include <signal.h>
 #include <xenevtchn.h>
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <xen/xen.h>
 #include <string.h>
diff --git a/tools/xenpaging/pagein.c b/tools/xenpaging/pagein.c
index 7cb0f33..2a298b4 100644
--- a/tools/xenpaging/pagein.c
+++ b/tools/xenpaging/pagein.c
@@ -1,6 +1,5 @@
 /* Trigger a page-in in a separate thread-of-execution to avoid deadlock */
 #include <pthread.h>
-#include <xc_private.h>
 #include "xenpaging.h"
 
 struct page_in_args {
diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
index c4bc713..0377507 100644
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -27,7 +27,6 @@
 #include <signal.h>
 #include <unistd.h>
 #include <poll.h>
-#include <xc_private.h>
 #include <xenstore.h>
 #include <getopt.h>
 
diff --git a/tools/xenpaging/xenpaging.h b/tools/xenpaging/xenpaging.h
index d0f8d20..d6c8ee5 100644
--- a/tools/xenpaging/xenpaging.h
+++ b/tools/xenpaging/xenpaging.h
@@ -25,6 +25,8 @@
 
 
 #include <xenevtchn.h>
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
+#include <xenctrl.h>
 #include <xc_private.h>
 #include <xen/event_channel.h>
 #include <xen/vm_event.h>
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index f62c192..51fb0b3 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -50,7 +50,6 @@
 #include "xenstored_watch.h"
 #include "xenstored_transaction.h"
 #include "xenstored_domain.h"
-#include "xenctrl.h"
 #include "tdb.h"
 
 #include "hashtable.h"
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 624737d..3a497f7 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -19,6 +19,7 @@
 #ifndef _XENSTORED_CORE_H
 #define _XENSTORED_CORE_H
 
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
 #include <xengnttab.h>
 
diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 4ed120a..e647179 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -25,7 +25,8 @@
 #include <getopt.h>
 #include <limits.h>
 
-#include "xenctrl.h"
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
+#include <xenctrl.h>
 #include <xen/foreign/x86_32.h>
 #include <xen/foreign/x86_64.h>
 #include <xen/hvm/save.h>
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c
index 6cbe0ac..f09fe6c 100644
--- a/tools/xentrace/xentrace.c
+++ b/tools/xentrace/xentrace.c
@@ -30,6 +30,7 @@
 #include <xen/xen.h>
 #include <xen/trace.h>
 
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenevtchn.h>
 #include <xenctrl.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 Wed Jan 27 10:16:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:16: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 1aON93-0000kZ-Og; Wed, 27 Jan 2016 10:16:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON92-0000kB-3x
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:12 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	37/A4-03225-BE898A65; Wed, 27 Jan 2016 10:16:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1453889768!18450038!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48793 invoked from network); 27 Jan 2016 10:16:09 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:16:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9q-0001zH-DG
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8y-0001Pd-5S
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:08 +0000
Date: Wed, 27 Jan 2016 10:16:08 +0000
Message-Id: <E1aON8y-0001Pd-5S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/foreignmemory: provide
	xenforeignmemory_unmap.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0be403a41f5c45d766eced66cf3b9d9a5de8da43
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jul 28 14:20:01 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:18 2016 +0000

    tools/libs/foreignmemory: provide xenforeignmemory_unmap.
    
    And require it be used instead of direct munmap.
    
    This will allow e.g. Valgrind hooks to help track incorrect use of
    foreign mappings.
    
    Switch all uses of xenforeignmemory_map to use
    xenforeignmemory_unmap, not that foreign mappings via the libxc compat
    xc_map_foreign_* interface will not take advantage of this and will
    need converting.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libs/foreignmemory/freebsd.c                 |    6 ++++++
 .../libs/foreignmemory/include/xenforeignmemory.h  |   11 +++++++++--
 tools/libs/foreignmemory/libxenforeignmemory.map   |    1 +
 tools/libs/foreignmemory/linux.c                   |    6 ++++++
 tools/libs/foreignmemory/minios.c                  |    6 ++++++
 tools/libs/foreignmemory/netbsd.c                  |    6 ++++++
 tools/libs/foreignmemory/solaris.c                 |    6 ++++++
 tools/libxc/xc_sr_restore.c                        |    2 +-
 tools/libxc/xc_sr_save.c                           |    2 +-
 tools/libxc/xc_vm_event.c                          |    2 +-
 10 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index 4b2815d..3c3ad09 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -118,6 +118,12 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     return addr;
 }
 
+int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                                 void *addr, unsigned int num)
+{
+	return munmap(addr, num << PAGE_SHIFT);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
index 5b3fa7a..b783af3 100644
--- a/tools/libs/foreignmemory/include/xenforeignmemory.h
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -44,8 +44,8 @@ int xenforeignmemory_close(xenforeignmemory_handle *fmem);
 
 /*
  * Maps a range within one domain to a local address range.  Mappings
- * should be unmapped with munmap and should follow the same rules as mmap
- * regarding page alignment.
+ * must be unmapped with xenforeignmemory_unmap and should follow the
+ * same rules as mmap regarding page alignment.
  *
  * prot is as for mmap(2).
  *
@@ -57,6 +57,13 @@ int xenforeignmemory_close(xenforeignmemory_handle *fmem);
 void *xenforeignmemory_map(xenforeignmemory_handle *fmem, uint32_t dom,
                            int prot, const xen_pfn_t *arr, int *err,
                            unsigned int num);
+/*
+ * Unmap a mapping previous created with xenforeignmemory_map().
+ *
+ * Returns 0 on success on failure sets errno and returns -1.
+ */
+int xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                           void *addr, unsigned int num);
 
 #endif
 
diff --git a/tools/libs/foreignmemory/libxenforeignmemory.map b/tools/libs/foreignmemory/libxenforeignmemory.map
index 11f0d2b..df206b3 100644
--- a/tools/libs/foreignmemory/libxenforeignmemory.map
+++ b/tools/libs/foreignmemory/libxenforeignmemory.map
@@ -3,5 +3,6 @@ VERS_1.0 {
 		xenforeignmemory_open;
 		xenforeignmemory_close;
 		xenforeignmemory_map;
+		xenforeignmemory_unmap;
 	local: *; /* Do not expose anything by default */
 };
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
index b403ca7..40ecd41 100644
--- a/tools/libs/foreignmemory/linux.c
+++ b/tools/libs/foreignmemory/linux.c
@@ -282,6 +282,12 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     return addr;
 }
 
+int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                                 void *addr, unsigned int num)
+{
+    return munmap(addr, (unsigned long)num << PAGE_SHIFT);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index a542e3d..5fcb861 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -51,6 +51,12 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
 }
 
+int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                                 void *addr, unsigned int num)
+{
+	return munmap(addr, num << PAGE_SHIFT);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/foreignmemory/netbsd.c b/tools/libs/foreignmemory/netbsd.c
index 704a096..740c26f 100644
--- a/tools/libs/foreignmemory/netbsd.c
+++ b/tools/libs/foreignmemory/netbsd.c
@@ -94,6 +94,12 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
 
 }
 
+int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                                 void *addr, unsigned int num)
+{
+	return munmap(addr, num*XC_PAGE_SIZE);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/foreignmemory/solaris.c b/tools/libs/foreignmemory/solaris.c
index f4dd634..966fccb 100644
--- a/tools/libs/foreignmemory/solaris.c
+++ b/tools/libs/foreignmemory/solaris.c
@@ -91,3 +91,9 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
     }
     return addr;
 }
+
+int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                                 void *addr, unsigned int num)
+{
+	return munmap(addr, num*XC_PAGE_SIZE);
+}
diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index 4f44d20..5a51f26 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -378,7 +378,7 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count,
 
  err:
     if ( mapping )
-        munmap(mapping, nr_pages * PAGE_SIZE);
+        xenforeignmemory_unmap(xch->fmem, mapping, nr_pages);
 
     free(map_errs);
     free(mfns);
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index 8ee0719..fba4e40 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -263,7 +263,7 @@ static int write_batch(struct xc_sr_context *ctx)
  err:
     free(rec_pfns);
     if ( guest_mapping )
-        munmap(guest_mapping, nr_pages_mapped * PAGE_SIZE);
+        xenforeignmemory_unmap(xch->fmem, guest_mapping, nr_pages_mapped);
     for ( i = 0; local_pages && i < nr_pfns; ++i )
         free(local_pages[i]);
     free(iov);
diff --git a/tools/libxc/xc_vm_event.c b/tools/libxc/xc_vm_event.c
index d2d99e4..57abce0 100644
--- a/tools/libxc/xc_vm_event.c
+++ b/tools/libxc/xc_vm_event.c
@@ -148,7 +148,7 @@ void *xc_vm_event_enable(xc_interface *xch, domid_t domain_id, int param,
         }
 
         if ( ring_page )
-            munmap(ring_page, XC_PAGE_SIZE);
+            xenforeignmemory_unmap(xch->fmem, ring_page, 1);
         ring_page = NULL;
 
         errno = saved_errno;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:16:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:16: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 1aON93-0000kZ-Og; Wed, 27 Jan 2016 10:16:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON92-0000kB-3x
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:12 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	37/A4-03225-BE898A65; Wed, 27 Jan 2016 10:16:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1453889768!18450038!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48793 invoked from network); 27 Jan 2016 10:16:09 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:16:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9q-0001zH-DG
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8y-0001Pd-5S
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:08 +0000
Date: Wed, 27 Jan 2016 10:16:08 +0000
Message-Id: <E1aON8y-0001Pd-5S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/foreignmemory: provide
	xenforeignmemory_unmap.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0be403a41f5c45d766eced66cf3b9d9a5de8da43
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jul 28 14:20:01 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:18 2016 +0000

    tools/libs/foreignmemory: provide xenforeignmemory_unmap.
    
    And require it be used instead of direct munmap.
    
    This will allow e.g. Valgrind hooks to help track incorrect use of
    foreign mappings.
    
    Switch all uses of xenforeignmemory_map to use
    xenforeignmemory_unmap, not that foreign mappings via the libxc compat
    xc_map_foreign_* interface will not take advantage of this and will
    need converting.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libs/foreignmemory/freebsd.c                 |    6 ++++++
 .../libs/foreignmemory/include/xenforeignmemory.h  |   11 +++++++++--
 tools/libs/foreignmemory/libxenforeignmemory.map   |    1 +
 tools/libs/foreignmemory/linux.c                   |    6 ++++++
 tools/libs/foreignmemory/minios.c                  |    6 ++++++
 tools/libs/foreignmemory/netbsd.c                  |    6 ++++++
 tools/libs/foreignmemory/solaris.c                 |    6 ++++++
 tools/libxc/xc_sr_restore.c                        |    2 +-
 tools/libxc/xc_sr_save.c                           |    2 +-
 tools/libxc/xc_vm_event.c                          |    2 +-
 10 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index 4b2815d..3c3ad09 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -118,6 +118,12 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     return addr;
 }
 
+int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                                 void *addr, unsigned int num)
+{
+	return munmap(addr, num << PAGE_SHIFT);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
index 5b3fa7a..b783af3 100644
--- a/tools/libs/foreignmemory/include/xenforeignmemory.h
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -44,8 +44,8 @@ int xenforeignmemory_close(xenforeignmemory_handle *fmem);
 
 /*
  * Maps a range within one domain to a local address range.  Mappings
- * should be unmapped with munmap and should follow the same rules as mmap
- * regarding page alignment.
+ * must be unmapped with xenforeignmemory_unmap and should follow the
+ * same rules as mmap regarding page alignment.
  *
  * prot is as for mmap(2).
  *
@@ -57,6 +57,13 @@ int xenforeignmemory_close(xenforeignmemory_handle *fmem);
 void *xenforeignmemory_map(xenforeignmemory_handle *fmem, uint32_t dom,
                            int prot, const xen_pfn_t *arr, int *err,
                            unsigned int num);
+/*
+ * Unmap a mapping previous created with xenforeignmemory_map().
+ *
+ * Returns 0 on success on failure sets errno and returns -1.
+ */
+int xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                           void *addr, unsigned int num);
 
 #endif
 
diff --git a/tools/libs/foreignmemory/libxenforeignmemory.map b/tools/libs/foreignmemory/libxenforeignmemory.map
index 11f0d2b..df206b3 100644
--- a/tools/libs/foreignmemory/libxenforeignmemory.map
+++ b/tools/libs/foreignmemory/libxenforeignmemory.map
@@ -3,5 +3,6 @@ VERS_1.0 {
 		xenforeignmemory_open;
 		xenforeignmemory_close;
 		xenforeignmemory_map;
+		xenforeignmemory_unmap;
 	local: *; /* Do not expose anything by default */
 };
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
index b403ca7..40ecd41 100644
--- a/tools/libs/foreignmemory/linux.c
+++ b/tools/libs/foreignmemory/linux.c
@@ -282,6 +282,12 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     return addr;
 }
 
+int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                                 void *addr, unsigned int num)
+{
+    return munmap(addr, (unsigned long)num << PAGE_SHIFT);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index a542e3d..5fcb861 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -51,6 +51,12 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
     return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
 }
 
+int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                                 void *addr, unsigned int num)
+{
+	return munmap(addr, num << PAGE_SHIFT);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/foreignmemory/netbsd.c b/tools/libs/foreignmemory/netbsd.c
index 704a096..740c26f 100644
--- a/tools/libs/foreignmemory/netbsd.c
+++ b/tools/libs/foreignmemory/netbsd.c
@@ -94,6 +94,12 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
 
 }
 
+int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                                 void *addr, unsigned int num)
+{
+	return munmap(addr, num*XC_PAGE_SIZE);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/foreignmemory/solaris.c b/tools/libs/foreignmemory/solaris.c
index f4dd634..966fccb 100644
--- a/tools/libs/foreignmemory/solaris.c
+++ b/tools/libs/foreignmemory/solaris.c
@@ -91,3 +91,9 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
     }
     return addr;
 }
+
+int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
+                                 void *addr, unsigned int num)
+{
+	return munmap(addr, num*XC_PAGE_SIZE);
+}
diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index 4f44d20..5a51f26 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -378,7 +378,7 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count,
 
  err:
     if ( mapping )
-        munmap(mapping, nr_pages * PAGE_SIZE);
+        xenforeignmemory_unmap(xch->fmem, mapping, nr_pages);
 
     free(map_errs);
     free(mfns);
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index 8ee0719..fba4e40 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -263,7 +263,7 @@ static int write_batch(struct xc_sr_context *ctx)
  err:
     free(rec_pfns);
     if ( guest_mapping )
-        munmap(guest_mapping, nr_pages_mapped * PAGE_SIZE);
+        xenforeignmemory_unmap(xch->fmem, guest_mapping, nr_pages_mapped);
     for ( i = 0; local_pages && i < nr_pfns; ++i )
         free(local_pages[i]);
     free(iov);
diff --git a/tools/libxc/xc_vm_event.c b/tools/libxc/xc_vm_event.c
index d2d99e4..57abce0 100644
--- a/tools/libxc/xc_vm_event.c
+++ b/tools/libxc/xc_vm_event.c
@@ -148,7 +148,7 @@ void *xc_vm_event_enable(xc_interface *xch, domid_t domain_id, int param,
         }
 
         if ( ring_page )
-            munmap(ring_page, XC_PAGE_SIZE);
+            xenforeignmemory_unmap(xch->fmem, ring_page, 1);
         ring_page = NULL;
 
         errno = saved_errno;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:16:23 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:16: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 1aON9C-0000mQ-Tb; Wed, 27 Jan 2016 10:16:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9B-0000m4-9k
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:21 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	51/D2-18633-4F898A65; Wed, 27 Jan 2016 10:16:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1453889778!18448312!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37365 invoked from network); 27 Jan 2016 10:16:19 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:16:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONA0-0001zM-Qr
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON98-0001QZ-Jm
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:18 +0000
Date: Wed, 27 Jan 2016 10:16:18 +0000
Message-Id: <E1aON98-0001QZ-Jm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/foreignmemory: use size_t
	for size arguments.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9391f25767e2898a89fcebf8b58ec8712bd5d366
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 16 16:12:56 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:18 2016 +0000

    tools/libs/foreignmemory: use size_t for size arguments.
    
    Surprisingly it appears no callers need updating.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libs/foreignmemory/compat.c                  |    2 +-
 tools/libs/foreignmemory/freebsd.c                 |    4 +-
 .../libs/foreignmemory/include/xenforeignmemory.h  |    5 ++-
 tools/libs/foreignmemory/linux.c                   |   23 ++++++++++---------
 tools/libs/foreignmemory/minios.c                  |    4 +-
 tools/libs/foreignmemory/netbsd.c                  |    2 +-
 tools/libs/foreignmemory/solaris.c                 |    2 +-
 7 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/tools/libs/foreignmemory/compat.c b/tools/libs/foreignmemory/compat.c
index b8c6fc6..039297c 100644
--- a/tools/libs/foreignmemory/compat.c
+++ b/tools/libs/foreignmemory/compat.c
@@ -23,7 +23,7 @@
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, unsigned int num)
+                                 const xen_pfn_t *arr, int *err, size_t num)
 {
     xen_pfn_t *pfn;
     unsigned int i;
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index 3c3ad09..ed26ebb 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -85,7 +85,7 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
                                  const xen_pfn_t *arr, int *err,
-                                 unsigned int num)
+                                 size_t num)
 {
     int fd = fmem->fd;
     privcmd_mmapbatch_t ioctlx;
@@ -119,7 +119,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 }
 
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
-                                 void *addr, unsigned int num)
+                                 void *addr, size_t num)
 {
 	return munmap(addr, num << PAGE_SHIFT);
 }
diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
index b783af3..04ff548 100644
--- a/tools/libs/foreignmemory/include/xenforeignmemory.h
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -56,14 +56,15 @@ int xenforeignmemory_close(xenforeignmemory_handle *fmem);
  */
 void *xenforeignmemory_map(xenforeignmemory_handle *fmem, uint32_t dom,
                            int prot, const xen_pfn_t *arr, int *err,
-                           unsigned int num);
+                           size_t pages);
+
 /*
  * Unmap a mapping previous created with xenforeignmemory_map().
  *
  * Returns 0 on success on failure sets errno and returns -1.
  */
 int xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
-                           void *addr, unsigned int num);
+                           void *addr, size_t pages);
 
 #endif
 
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
index 40ecd41..6620391 100644
--- a/tools/libs/foreignmemory/linux.c
+++ b/tools/libs/foreignmemory/linux.c
@@ -115,10 +115,11 @@ static int map_foreign_batch_single(int fd, uint32_t dom,
  * This will keep the request ring full and avoids delays.
  */
 static int retry_paged(int fd, uint32_t dom, void *addr,
-                       const xen_pfn_t *arr, int *err, unsigned int num)
+                       const xen_pfn_t *arr, int *err, size_t num)
 {
     privcmd_mmapbatch_v2_t ioctlx;
-    int rc, paged = 0, i = 0;
+    int rc, paged = 0;
+    size_t i = 0;
 
     do
     {
@@ -134,7 +135,7 @@ static int retry_paged(int fd, uint32_t dom, void *addr,
         /* At least one gfn is still in paging state */
         ioctlx.num = 1;
         ioctlx.dom = dom;
-        ioctlx.addr = (unsigned long)addr + ((unsigned long)i<<PAGE_SHIFT);
+        ioctlx.addr = (unsigned long)addr + (i<<PAGE_SHIFT);
         ioctlx.arr = arr + i;
         ioctlx.err = err + i;
 
@@ -160,15 +161,15 @@ out:
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, unsigned int num)
+                                 const xen_pfn_t *arr, int *err, size_t num)
 {
     int fd = fmem->fd;
     privcmd_mmapbatch_v2_t ioctlx;
     void *addr;
-    unsigned int i;
+    size_t i;
     int rc;
 
-    addr = mmap(NULL, (unsigned long)num << PAGE_SHIFT, prot, MAP_SHARED,
+    addr = mmap(NULL, num << PAGE_SHIFT, prot, MAP_SHARED,
                 fd, 0);
     if ( addr == MAP_FAILED )
     {
@@ -212,7 +213,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
             if ( pfn == MAP_FAILED )
             {
                 PERROR("mmap of pfn array failed");
-                (void)munmap(addr, (unsigned long)num << PAGE_SHIFT);
+                (void)munmap(addr, num << PAGE_SHIFT);
                 return NULL;
             }
         }
@@ -245,7 +246,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                     continue;
                 }
                 rc = map_foreign_batch_single(fd, dom, pfn + i,
-                        (unsigned long)addr + ((unsigned long)i<<PAGE_SHIFT));
+                        (unsigned long)addr + (i<<PAGE_SHIFT));
                 if ( rc < 0 )
                 {
                     rc = -errno;
@@ -274,7 +275,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
         int saved_errno = errno;
 
         PERROR("ioctl failed");
-        (void)munmap(addr, (unsigned long)num << PAGE_SHIFT);
+        (void)munmap(addr, num << PAGE_SHIFT);
         errno = saved_errno;
         return NULL;
     }
@@ -283,9 +284,9 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 }
 
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
-                                 void *addr, unsigned int num)
+                                 void *addr, size_t num)
 {
-    return munmap(addr, (unsigned long)num << PAGE_SHIFT);
+    return munmap(addr, num << PAGE_SHIFT);
 }
 
 /*
diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index 5fcb861..bdc1239 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -41,7 +41,7 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, unsigned int num)
+                                 const xen_pfn_t *arr, int *err, size_t num)
 {
     unsigned long pt_prot = 0;
     if (prot & PROT_READ)
@@ -52,7 +52,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 }
 
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
-                                 void *addr, unsigned int num)
+                                 void *addr, size_t num)
 {
 	return munmap(addr, num << PAGE_SHIFT);
 }
diff --git a/tools/libs/foreignmemory/netbsd.c b/tools/libs/foreignmemory/netbsd.c
index 740c26f..d0d233a 100644
--- a/tools/libs/foreignmemory/netbsd.c
+++ b/tools/libs/foreignmemory/netbsd.c
@@ -95,7 +95,7 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
 }
 
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
-                                 void *addr, unsigned int num)
+                                 void *addr, size_t num)
 {
 	return munmap(addr, num*XC_PAGE_SIZE);
 }
diff --git a/tools/libs/foreignmemory/solaris.c b/tools/libs/foreignmemory/solaris.c
index 966fccb..f1c44bc 100644
--- a/tools/libs/foreignmemory/solaris.c
+++ b/tools/libs/foreignmemory/solaris.c
@@ -93,7 +93,7 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
 }
 
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
-                                 void *addr, unsigned int num)
+                                 void *addr, size_t num)
 {
 	return munmap(addr, num*XC_PAGE_SIZE);
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:16:23 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:16: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 1aON9C-0000mQ-Tb; Wed, 27 Jan 2016 10:16:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9B-0000m4-9k
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:21 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	51/D2-18633-4F898A65; Wed, 27 Jan 2016 10:16:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1453889778!18448312!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37365 invoked from network); 27 Jan 2016 10:16:19 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:16:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONA0-0001zM-Qr
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON98-0001QZ-Jm
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:18 +0000
Date: Wed, 27 Jan 2016 10:16:18 +0000
Message-Id: <E1aON98-0001QZ-Jm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/foreignmemory: use size_t
	for size arguments.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9391f25767e2898a89fcebf8b58ec8712bd5d366
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 16 16:12:56 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:18 2016 +0000

    tools/libs/foreignmemory: use size_t for size arguments.
    
    Surprisingly it appears no callers need updating.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libs/foreignmemory/compat.c                  |    2 +-
 tools/libs/foreignmemory/freebsd.c                 |    4 +-
 .../libs/foreignmemory/include/xenforeignmemory.h  |    5 ++-
 tools/libs/foreignmemory/linux.c                   |   23 ++++++++++---------
 tools/libs/foreignmemory/minios.c                  |    4 +-
 tools/libs/foreignmemory/netbsd.c                  |    2 +-
 tools/libs/foreignmemory/solaris.c                 |    2 +-
 7 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/tools/libs/foreignmemory/compat.c b/tools/libs/foreignmemory/compat.c
index b8c6fc6..039297c 100644
--- a/tools/libs/foreignmemory/compat.c
+++ b/tools/libs/foreignmemory/compat.c
@@ -23,7 +23,7 @@
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, unsigned int num)
+                                 const xen_pfn_t *arr, int *err, size_t num)
 {
     xen_pfn_t *pfn;
     unsigned int i;
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index 3c3ad09..ed26ebb 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -85,7 +85,7 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
                                  const xen_pfn_t *arr, int *err,
-                                 unsigned int num)
+                                 size_t num)
 {
     int fd = fmem->fd;
     privcmd_mmapbatch_t ioctlx;
@@ -119,7 +119,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 }
 
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
-                                 void *addr, unsigned int num)
+                                 void *addr, size_t num)
 {
 	return munmap(addr, num << PAGE_SHIFT);
 }
diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
index b783af3..04ff548 100644
--- a/tools/libs/foreignmemory/include/xenforeignmemory.h
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -56,14 +56,15 @@ int xenforeignmemory_close(xenforeignmemory_handle *fmem);
  */
 void *xenforeignmemory_map(xenforeignmemory_handle *fmem, uint32_t dom,
                            int prot, const xen_pfn_t *arr, int *err,
-                           unsigned int num);
+                           size_t pages);
+
 /*
  * Unmap a mapping previous created with xenforeignmemory_map().
  *
  * Returns 0 on success on failure sets errno and returns -1.
  */
 int xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
-                           void *addr, unsigned int num);
+                           void *addr, size_t pages);
 
 #endif
 
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
index 40ecd41..6620391 100644
--- a/tools/libs/foreignmemory/linux.c
+++ b/tools/libs/foreignmemory/linux.c
@@ -115,10 +115,11 @@ static int map_foreign_batch_single(int fd, uint32_t dom,
  * This will keep the request ring full and avoids delays.
  */
 static int retry_paged(int fd, uint32_t dom, void *addr,
-                       const xen_pfn_t *arr, int *err, unsigned int num)
+                       const xen_pfn_t *arr, int *err, size_t num)
 {
     privcmd_mmapbatch_v2_t ioctlx;
-    int rc, paged = 0, i = 0;
+    int rc, paged = 0;
+    size_t i = 0;
 
     do
     {
@@ -134,7 +135,7 @@ static int retry_paged(int fd, uint32_t dom, void *addr,
         /* At least one gfn is still in paging state */
         ioctlx.num = 1;
         ioctlx.dom = dom;
-        ioctlx.addr = (unsigned long)addr + ((unsigned long)i<<PAGE_SHIFT);
+        ioctlx.addr = (unsigned long)addr + (i<<PAGE_SHIFT);
         ioctlx.arr = arr + i;
         ioctlx.err = err + i;
 
@@ -160,15 +161,15 @@ out:
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, unsigned int num)
+                                 const xen_pfn_t *arr, int *err, size_t num)
 {
     int fd = fmem->fd;
     privcmd_mmapbatch_v2_t ioctlx;
     void *addr;
-    unsigned int i;
+    size_t i;
     int rc;
 
-    addr = mmap(NULL, (unsigned long)num << PAGE_SHIFT, prot, MAP_SHARED,
+    addr = mmap(NULL, num << PAGE_SHIFT, prot, MAP_SHARED,
                 fd, 0);
     if ( addr == MAP_FAILED )
     {
@@ -212,7 +213,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
             if ( pfn == MAP_FAILED )
             {
                 PERROR("mmap of pfn array failed");
-                (void)munmap(addr, (unsigned long)num << PAGE_SHIFT);
+                (void)munmap(addr, num << PAGE_SHIFT);
                 return NULL;
             }
         }
@@ -245,7 +246,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                     continue;
                 }
                 rc = map_foreign_batch_single(fd, dom, pfn + i,
-                        (unsigned long)addr + ((unsigned long)i<<PAGE_SHIFT));
+                        (unsigned long)addr + (i<<PAGE_SHIFT));
                 if ( rc < 0 )
                 {
                     rc = -errno;
@@ -274,7 +275,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
         int saved_errno = errno;
 
         PERROR("ioctl failed");
-        (void)munmap(addr, (unsigned long)num << PAGE_SHIFT);
+        (void)munmap(addr, num << PAGE_SHIFT);
         errno = saved_errno;
         return NULL;
     }
@@ -283,9 +284,9 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 }
 
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
-                                 void *addr, unsigned int num)
+                                 void *addr, size_t num)
 {
-    return munmap(addr, (unsigned long)num << PAGE_SHIFT);
+    return munmap(addr, num << PAGE_SHIFT);
 }
 
 /*
diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index 5fcb861..bdc1239 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -41,7 +41,7 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, unsigned int num)
+                                 const xen_pfn_t *arr, int *err, size_t num)
 {
     unsigned long pt_prot = 0;
     if (prot & PROT_READ)
@@ -52,7 +52,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 }
 
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
-                                 void *addr, unsigned int num)
+                                 void *addr, size_t num)
 {
 	return munmap(addr, num << PAGE_SHIFT);
 }
diff --git a/tools/libs/foreignmemory/netbsd.c b/tools/libs/foreignmemory/netbsd.c
index 740c26f..d0d233a 100644
--- a/tools/libs/foreignmemory/netbsd.c
+++ b/tools/libs/foreignmemory/netbsd.c
@@ -95,7 +95,7 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
 }
 
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
-                                 void *addr, unsigned int num)
+                                 void *addr, size_t num)
 {
 	return munmap(addr, num*XC_PAGE_SIZE);
 }
diff --git a/tools/libs/foreignmemory/solaris.c b/tools/libs/foreignmemory/solaris.c
index 966fccb..f1c44bc 100644
--- a/tools/libs/foreignmemory/solaris.c
+++ b/tools/libs/foreignmemory/solaris.c
@@ -93,7 +93,7 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
 }
 
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
-                                 void *addr, unsigned int num)
+                                 void *addr, size_t num)
 {
 	return munmap(addr, num*XC_PAGE_SIZE);
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:16:33 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:16: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 1aON9N-0000o3-6E; Wed, 27 Jan 2016 10:16: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 1aON9L-0000nj-IB
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:31 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	54/14-21594-EF898A65; Wed, 27 Jan 2016 10:16:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1453889789!18122412!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33618 invoked from network); 27 Jan 2016 10:16:30 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:16:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAB-00020f-6e
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9I-0001RJ-TY
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:28 +0000
Date: Wed, 27 Jan 2016 10:16:28 +0000
Message-Id: <E1aON9I-0001RJ-TY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/foreignmemory: Mention
	restrictions on fork in docs.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c4f9e14dea6bf9723775332721af736f615cf24d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Sep 24 17:14:45 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:18 2016 +0000

    tools/libs/foreignmemory: Mention restrictions on fork in docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 .../libs/foreignmemory/include/xenforeignmemory.h  |   33 +++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
index 04ff548..a6d1bdb 100644
--- a/tools/libs/foreignmemory/include/xenforeignmemory.h
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -32,13 +32,44 @@ typedef struct xentoollog_logger xentoollog_logger;
 typedef struct xenforeignmemory_handle xenforeignmemory_handle;
 
 /*
- * Return a handle onto the hypercall driver.  Logs errors.
+ * Return a handle onto the foreign memory mapping driver.  Logs errors.
+ *
+ * Note: After fork(2) a child process must not use any opened
+ * foreignmemory handle inherited from their parent, nor access any
+ * grant mapped areas associated with that handle.
+ *
+ * The child must open a new handle if they want to interact with
+ * foreignmemory.
+ *
+ * Calling exec(2) in a child will safely (and reliably) reclaim any
+ * resources which were allocated via a xenforeignmemory_handle in the
+ * parent.
+ *
+ * A child which does not call exec(2) may safely call
+ * xenforeignmemory_close() on a xenforeignmemory_handle inherited
+ * from their parent. This will attempt to reclaim any resources
+ * associated with that handle. Note that in some implementations this
+ * reclamation may not be completely effective, in this case any
+ * affected resources remain allocated.
+ *
+ * Calling xenforeignmemory_close() is the only safe operation on a
+ * xenforeignmemory_handle which has been inherited.
  */
 xenforeignmemory_handle *xenforeignmemory_open(xentoollog_logger *logger,
                                                unsigned open_flags);
 
 /*
  * Close a handle previously allocated with xenforeignmemory_open().
+ *
+ * Under normal circumstances (i.e. not in the child after a fork)
+ * xenforeignmemory_unmap() should be used on all mappings allocated
+ * by xenforeignmemory_map() prior to closing the handle in order to
+ * free up resources associated with those mappings.
+ *
+ * This is the only function which may be safely called on a
+ * xenforeignmemory_handle in a child after a
+ * fork. xenforeignmemory_unmap() must not be called under such
+ * circumstances.
  */
 int xenforeignmemory_close(xenforeignmemory_handle *fmem);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:16:33 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:16: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 1aON9N-0000o3-6E; Wed, 27 Jan 2016 10:16: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 1aON9L-0000nj-IB
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:31 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	54/14-21594-EF898A65; Wed, 27 Jan 2016 10:16:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1453889789!18122412!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33618 invoked from network); 27 Jan 2016 10:16:30 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:16:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAB-00020f-6e
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9I-0001RJ-TY
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:28 +0000
Date: Wed, 27 Jan 2016 10:16:28 +0000
Message-Id: <E1aON9I-0001RJ-TY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/foreignmemory: Mention
	restrictions on fork in docs.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c4f9e14dea6bf9723775332721af736f615cf24d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Sep 24 17:14:45 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:18 2016 +0000

    tools/libs/foreignmemory: Mention restrictions on fork in docs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 .../libs/foreignmemory/include/xenforeignmemory.h  |   33 +++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
index 04ff548..a6d1bdb 100644
--- a/tools/libs/foreignmemory/include/xenforeignmemory.h
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -32,13 +32,44 @@ typedef struct xentoollog_logger xentoollog_logger;
 typedef struct xenforeignmemory_handle xenforeignmemory_handle;
 
 /*
- * Return a handle onto the hypercall driver.  Logs errors.
+ * Return a handle onto the foreign memory mapping driver.  Logs errors.
+ *
+ * Note: After fork(2) a child process must not use any opened
+ * foreignmemory handle inherited from their parent, nor access any
+ * grant mapped areas associated with that handle.
+ *
+ * The child must open a new handle if they want to interact with
+ * foreignmemory.
+ *
+ * Calling exec(2) in a child will safely (and reliably) reclaim any
+ * resources which were allocated via a xenforeignmemory_handle in the
+ * parent.
+ *
+ * A child which does not call exec(2) may safely call
+ * xenforeignmemory_close() on a xenforeignmemory_handle inherited
+ * from their parent. This will attempt to reclaim any resources
+ * associated with that handle. Note that in some implementations this
+ * reclamation may not be completely effective, in this case any
+ * affected resources remain allocated.
+ *
+ * Calling xenforeignmemory_close() is the only safe operation on a
+ * xenforeignmemory_handle which has been inherited.
  */
 xenforeignmemory_handle *xenforeignmemory_open(xentoollog_logger *logger,
                                                unsigned open_flags);
 
 /*
  * Close a handle previously allocated with xenforeignmemory_open().
+ *
+ * Under normal circumstances (i.e. not in the child after a fork)
+ * xenforeignmemory_unmap() should be used on all mappings allocated
+ * by xenforeignmemory_map() prior to closing the handle in order to
+ * free up resources associated with those mappings.
+ *
+ * This is the only function which may be safely called on a
+ * xenforeignmemory_handle in a child after a
+ * fork. xenforeignmemory_unmap() must not be called under such
+ * circumstances.
  */
 int xenforeignmemory_close(xenforeignmemory_handle *fmem);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:16:43 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:16: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 1aON9X-0000qH-AP; Wed, 27 Jan 2016 10:16:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9W-0000pc-21
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:42 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	9D/B0-22089-90998A65; Wed, 27 Jan 2016 10:16:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1453889799!18440487!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60026 invoked from network); 27 Jan 2016 10:16:40 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:16:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAL-00020u-Ic
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9T-0001S4-C0
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:39 +0000
Date: Wed, 27 Jan 2016 10:16:39 +0000
Message-Id: <E1aON9T-0001S4-C0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/foreignmemory: Support err
	== NULL to 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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bd1c1ea4404fd374d91c266a10ddc6ac5d29e637
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Nov 27 15:55:57 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:18 2016 +0000

    tools/libs/foreignmemory: Support err == NULL to map.
    
    The existing xc_map_foreign_bulk-like interface encourages callers to
    miss error checking for partial failure (by forgetting to scan the err
    array).
    
    Add support for passing err==NULL which behaves in a
    xc_map_foreign_pages-like manner and returns a global error for any
    failure.
    
    While documenting this also clarify the overall behaviour and the
    behaviour with err!=NULL.
    
    With this the compat wrapper of xc_map_foreign_pages() can be
    simplified.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libs/foreignmemory/core.c                    |   33 +++++++++++++++++++-
 .../libs/foreignmemory/include/xenforeignmemory.h  |   24 ++++++++++++--
 tools/libxc/xc_foreign_memory.c                    |   22 +------------
 3 files changed, 54 insertions(+), 25 deletions(-)

diff --git a/tools/libs/foreignmemory/core.c b/tools/libs/foreignmemory/core.c
index 21dc7ee..4e0541f 100644
--- a/tools/libs/foreignmemory/core.c
+++ b/tools/libs/foreignmemory/core.c
@@ -14,6 +14,8 @@
  */
 
 #include <stdlib.h>
+#include <assert.h>
+#include <errno.h>
 
 #include "private.h"
 
@@ -64,7 +66,36 @@ void *xenforeignmemory_map(xenforeignmemory_handle *fmem,
                            uint32_t dom, int prot,
                            const xen_pfn_t *arr, int *err, size_t num)
 {
-    return osdep_xenforeignmemory_map(fmem, dom, prot, arr, err, num);
+    void *ret;
+    int *err_to_free = NULL;
+
+    if ( err == NULL )
+        err = err_to_free = malloc(num * sizeof(int));
+
+    if ( err == NULL )
+        return NULL;
+
+    ret = osdep_xenforeignmemory_map(fmem, dom, prot, arr, err, num);
+
+    if ( ret == 0 && err_to_free )
+    {
+        int i;
+
+        for ( i = 0 ; i < num ; i++ )
+        {
+            if ( err[i] )
+            {
+                errno = -err[i];
+                (void)osdep_xenforeignmemory_unmap(fmem, ret, num);
+                ret = NULL;
+                break;
+            }
+        }
+    }
+
+    free(err_to_free);
+
+    return ret;
 }
 
 int xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
index a6d1bdb..0ec6325 100644
--- a/tools/libs/foreignmemory/include/xenforeignmemory.h
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -80,10 +80,28 @@ int xenforeignmemory_close(xenforeignmemory_handle *fmem);
  *
  * prot is as for mmap(2).
  *
- * Can partially succeed. When a page cannot be mapped, its respective
- * field in @err is set to the corresponding errno value.
+ * @arr is an array of @pages gfns to be mapped linearly in the local
+ * address range. @err is an (optional) output array used to report
+ * per-page errors, as errno values.
  *
- * Returns NULL if no pages can be mapped.
+ * If @err is given (is non-NULL) then the mapping may partially
+ * succeed and return a valid pointer while also using @err to
+ * indicate the success (0) or failure (errno value) of the individual
+ * pages. The global errno thread local variable is not valid in this
+ * case.
+ *
+ * If @err is not given (is NULL) then on failure to map any page any
+ * successful mappings will be undone and NULL will be returned. errno
+ * will be set to correspond to the first failure (which may not be
+ * the most critical).
+ *
+ * It is also possible to return NULL due to a complete failure,
+ * i.e. failure to even attempt the mapping, in this case the global
+ * errno will have been set and the contents of @err (if given) is
+ * invalid.
+ *
+ * Note that it is also possible to return non-NULL with the contents
+ * of @err indicating failure to map every page.
  */
 void *xenforeignmemory_map(xenforeignmemory_handle *fmem, uint32_t dom,
                            int prot, const xen_pfn_t *arr, int *err,
diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index 1737c10..4b24388 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -23,32 +23,12 @@
 void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
                            const xen_pfn_t *arr, int num)
 {
-    void *res;
-    int i, *err;
-
     if (num < 0) {
         errno = EINVAL;
         return NULL;
     }
 
-    err = malloc(num * sizeof(*err));
-    if (!err)
-        return NULL;
-
-    res = xenforeignmemory_map(xch->fmem, dom, prot, arr, err, num);
-    if (res) {
-        for (i = 0; i < num; i++) {
-            if (err[i]) {
-                errno = -err[i];
-                munmap(res, num * PAGE_SIZE);
-                res = NULL;
-                break;
-            }
-        }
-    }
-
-    free(err);
-    return res;
+    return xenforeignmemory_map(xch->fmem, dom, prot, arr, NULL, num);
 }
 
 void *xc_map_foreign_range(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 Wed Jan 27 10:16:43 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:16: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 1aON9X-0000qH-AP; Wed, 27 Jan 2016 10:16:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9W-0000pc-21
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:42 +0000
Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id
	9D/B0-22089-90998A65; Wed, 27 Jan 2016 10:16:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1453889799!18440487!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60026 invoked from network); 27 Jan 2016 10:16:40 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:16:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAL-00020u-Ic
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9T-0001S4-C0
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:39 +0000
Date: Wed, 27 Jan 2016 10:16:39 +0000
Message-Id: <E1aON9T-0001S4-C0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/foreignmemory: Support err
	== NULL to 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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bd1c1ea4404fd374d91c266a10ddc6ac5d29e637
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Nov 27 15:55:57 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:18 2016 +0000

    tools/libs/foreignmemory: Support err == NULL to map.
    
    The existing xc_map_foreign_bulk-like interface encourages callers to
    miss error checking for partial failure (by forgetting to scan the err
    array).
    
    Add support for passing err==NULL which behaves in a
    xc_map_foreign_pages-like manner and returns a global error for any
    failure.
    
    While documenting this also clarify the overall behaviour and the
    behaviour with err!=NULL.
    
    With this the compat wrapper of xc_map_foreign_pages() can be
    simplified.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libs/foreignmemory/core.c                    |   33 +++++++++++++++++++-
 .../libs/foreignmemory/include/xenforeignmemory.h  |   24 ++++++++++++--
 tools/libxc/xc_foreign_memory.c                    |   22 +------------
 3 files changed, 54 insertions(+), 25 deletions(-)

diff --git a/tools/libs/foreignmemory/core.c b/tools/libs/foreignmemory/core.c
index 21dc7ee..4e0541f 100644
--- a/tools/libs/foreignmemory/core.c
+++ b/tools/libs/foreignmemory/core.c
@@ -14,6 +14,8 @@
  */
 
 #include <stdlib.h>
+#include <assert.h>
+#include <errno.h>
 
 #include "private.h"
 
@@ -64,7 +66,36 @@ void *xenforeignmemory_map(xenforeignmemory_handle *fmem,
                            uint32_t dom, int prot,
                            const xen_pfn_t *arr, int *err, size_t num)
 {
-    return osdep_xenforeignmemory_map(fmem, dom, prot, arr, err, num);
+    void *ret;
+    int *err_to_free = NULL;
+
+    if ( err == NULL )
+        err = err_to_free = malloc(num * sizeof(int));
+
+    if ( err == NULL )
+        return NULL;
+
+    ret = osdep_xenforeignmemory_map(fmem, dom, prot, arr, err, num);
+
+    if ( ret == 0 && err_to_free )
+    {
+        int i;
+
+        for ( i = 0 ; i < num ; i++ )
+        {
+            if ( err[i] )
+            {
+                errno = -err[i];
+                (void)osdep_xenforeignmemory_unmap(fmem, ret, num);
+                ret = NULL;
+                break;
+            }
+        }
+    }
+
+    free(err_to_free);
+
+    return ret;
 }
 
 int xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
index a6d1bdb..0ec6325 100644
--- a/tools/libs/foreignmemory/include/xenforeignmemory.h
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -80,10 +80,28 @@ int xenforeignmemory_close(xenforeignmemory_handle *fmem);
  *
  * prot is as for mmap(2).
  *
- * Can partially succeed. When a page cannot be mapped, its respective
- * field in @err is set to the corresponding errno value.
+ * @arr is an array of @pages gfns to be mapped linearly in the local
+ * address range. @err is an (optional) output array used to report
+ * per-page errors, as errno values.
  *
- * Returns NULL if no pages can be mapped.
+ * If @err is given (is non-NULL) then the mapping may partially
+ * succeed and return a valid pointer while also using @err to
+ * indicate the success (0) or failure (errno value) of the individual
+ * pages. The global errno thread local variable is not valid in this
+ * case.
+ *
+ * If @err is not given (is NULL) then on failure to map any page any
+ * successful mappings will be undone and NULL will be returned. errno
+ * will be set to correspond to the first failure (which may not be
+ * the most critical).
+ *
+ * It is also possible to return NULL due to a complete failure,
+ * i.e. failure to even attempt the mapping, in this case the global
+ * errno will have been set and the contents of @err (if given) is
+ * invalid.
+ *
+ * Note that it is also possible to return non-NULL with the contents
+ * of @err indicating failure to map every page.
  */
 void *xenforeignmemory_map(xenforeignmemory_handle *fmem, uint32_t dom,
                            int prot, const xen_pfn_t *arr, int *err,
diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index 1737c10..4b24388 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -23,32 +23,12 @@
 void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
                            const xen_pfn_t *arr, int num)
 {
-    void *res;
-    int i, *err;
-
     if (num < 0) {
         errno = EINVAL;
         return NULL;
     }
 
-    err = malloc(num * sizeof(*err));
-    if (!err)
-        return NULL;
-
-    res = xenforeignmemory_map(xch->fmem, dom, prot, arr, err, num);
-    if (res) {
-        for (i = 0; i < num; i++) {
-            if (err[i]) {
-                errno = -err[i];
-                munmap(res, num * PAGE_SIZE);
-                res = NULL;
-                break;
-            }
-        }
-    }
-
-    free(err);
-    return res;
+    return xenforeignmemory_map(xch->fmem, dom, prot, arr, NULL, num);
 }
 
 void *xc_map_foreign_range(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 Wed Jan 27 10:16:55 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:16: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 1aON9j-0000sA-Ji; Wed, 27 Jan 2016 10:16:55 +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 1aON9i-0000ry-5a
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:54 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	53/BE-12635-51998A65; Wed, 27 Jan 2016 10:16:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1453889810!18440570!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 63224 invoked from network); 27 Jan 2016 10:16:51 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:16:51 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAW-000216-1V
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9d-0001Sx-Oc
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:49 +0000
Date: Wed, 27 Jan 2016 10:16:49 +0000
Message-Id: <E1aON9d-0001Sx-Oc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/foreignmemory: pull array
	length argument to map forward
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cf8c4d3d13b89bddc64a1b8a8a3fead8b9c87c92
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Nov 30 10:32:28 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:19 2016 +0000

    tools/libs/foreignmemory: pull array length argument to map forward
    
    By having the "num" argument before the page and error arrays we can
    potentially use a variable-length-array argument ("int pages[num]") in
    the function prototype.
    
    However VLAs are a C99 feature and we are currently targetting C89 and
    later, so we don't actually make use of this here, merely arrange that
    we can switch to VLAs in the future without changing the function ABI.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libs/foreignmemory/compat.c                  |    4 ++--
 tools/libs/foreignmemory/core.c                    |    5 +++--
 tools/libs/foreignmemory/freebsd.c                 |    4 ++--
 .../libs/foreignmemory/include/xenforeignmemory.h  |    4 ++--
 tools/libs/foreignmemory/linux.c                   |    3 ++-
 tools/libs/foreignmemory/minios.c                  |    3 ++-
 tools/libs/foreignmemory/private.h                 |    3 ++-
 tools/libxc/xc_foreign_memory.c                    |    4 ++--
 tools/libxc/xc_sr_restore.c                        |    2 +-
 tools/libxc/xc_sr_save.c                           |    2 +-
 10 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/tools/libs/foreignmemory/compat.c b/tools/libs/foreignmemory/compat.c
index 039297c..b79ec1a 100644
--- a/tools/libs/foreignmemory/compat.c
+++ b/tools/libs/foreignmemory/compat.c
@@ -22,8 +22,8 @@
 #include "private.h"
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
-                                 uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, size_t num)
+                                 uint32_t dom, int prot, size_t num,
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/])
 {
     xen_pfn_t *pfn;
     unsigned int i;
diff --git a/tools/libs/foreignmemory/core.c b/tools/libs/foreignmemory/core.c
index 4e0541f..cfb0a73 100644
--- a/tools/libs/foreignmemory/core.c
+++ b/tools/libs/foreignmemory/core.c
@@ -64,7 +64,8 @@ int xenforeignmemory_close(xenforeignmemory_handle *fmem)
 
 void *xenforeignmemory_map(xenforeignmemory_handle *fmem,
                            uint32_t dom, int prot,
-                           const xen_pfn_t *arr, int *err, size_t num)
+                           size_t num,
+                           const xen_pfn_t arr[/*num*/], int err[/*num*/])
 {
     void *ret;
     int *err_to_free = NULL;
@@ -75,7 +76,7 @@ void *xenforeignmemory_map(xenforeignmemory_handle *fmem,
     if ( err == NULL )
         return NULL;
 
-    ret = osdep_xenforeignmemory_map(fmem, dom, prot, arr, err, num);
+    ret = osdep_xenforeignmemory_map(fmem, dom, prot, num, arr, err);
 
     if ( ret == 0 && err_to_free )
     {
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index ed26ebb..703754f 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -84,8 +84,8 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err,
-                                 size_t num)
+                                 size_t num,
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/])
 {
     int fd = fmem->fd;
     privcmd_mmapbatch_t ioctlx;
diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
index 0ec6325..3724c63 100644
--- a/tools/libs/foreignmemory/include/xenforeignmemory.h
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -104,8 +104,8 @@ int xenforeignmemory_close(xenforeignmemory_handle *fmem);
  * of @err indicating failure to map every page.
  */
 void *xenforeignmemory_map(xenforeignmemory_handle *fmem, uint32_t dom,
-                           int prot, const xen_pfn_t *arr, int *err,
-                           size_t pages);
+                           int prot, size_t pages,
+                           const xen_pfn_t arr[/*pages*/], int err[/*pages*/]);
 
 /*
  * Unmap a mapping previous created with xenforeignmemory_map().
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
index 6620391..32b6def 100644
--- a/tools/libs/foreignmemory/linux.c
+++ b/tools/libs/foreignmemory/linux.c
@@ -161,7 +161,8 @@ out:
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, size_t num)
+                                 size_t num,
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/])
 {
     int fd = fmem->fd;
     privcmd_mmapbatch_v2_t ioctlx;
diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index bdc1239..ca5ba71 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -41,7 +41,8 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, size_t num)
+                                 size_t num,
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/])
 {
     unsigned long pt_prot = 0;
     if (prot & PROT_READ)
diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
index 36a71ec..cd732fd 100644
--- a/tools/libs/foreignmemory/private.h
+++ b/tools/libs/foreignmemory/private.h
@@ -27,7 +27,8 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, size_t num);
+                                 size_t num,
+                                 const xen_pfn_t arr[num], int err[num]);
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num);
 
diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index 4b24388..4053d26 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -28,7 +28,7 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
         return NULL;
     }
 
-    return xenforeignmemory_map(xch->fmem, dom, prot, arr, NULL, num);
+    return xenforeignmemory_map(xch->fmem, dom, prot, num, arr, NULL);
 }
 
 void *xc_map_foreign_range(xc_interface *xch,
@@ -84,7 +84,7 @@ void *xc_map_foreign_ranges(xc_interface *xch,
 void *xc_map_foreign_bulk(xc_interface *xch, uint32_t dom, int prot,
                           const xen_pfn_t *arr, int *err, unsigned int num)
 {
-    return xenforeignmemory_map(xch->fmem, dom, prot, arr, err, num);
+    return xenforeignmemory_map(xch->fmem, dom, prot, num, arr, err);
 }
 
 /*
diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index 5a51f26..d4d33fd 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -318,7 +318,7 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count,
 
     mapping = guest_page = xenforeignmemory_map(xch->fmem,
         ctx->domid, PROT_READ | PROT_WRITE,
-        mfns, map_errs, nr_pages);
+        nr_pages, mfns, map_errs);
     if ( !mapping )
     {
         rc = -1;
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index fba4e40..ccb000e 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -154,7 +154,7 @@ static int write_batch(struct xc_sr_context *ctx)
     if ( nr_pages > 0 )
     {
         guest_mapping = xenforeignmemory_map(xch->fmem,
-            ctx->domid, PROT_READ, mfns, errors, nr_pages);
+            ctx->domid, PROT_READ, nr_pages, mfns, errors);
         if ( !guest_mapping )
         {
             PERROR("Failed to map guest pages");
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:16:55 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:16: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 1aON9j-0000sA-Ji; Wed, 27 Jan 2016 10:16:55 +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 1aON9i-0000ry-5a
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:54 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	53/BE-12635-51998A65; Wed, 27 Jan 2016 10:16:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1453889810!18440570!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 63224 invoked from network); 27 Jan 2016 10:16:51 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:16:51 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAW-000216-1V
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9d-0001Sx-Oc
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:16:49 +0000
Date: Wed, 27 Jan 2016 10:16:49 +0000
Message-Id: <E1aON9d-0001Sx-Oc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/foreignmemory: pull array
	length argument to map forward
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cf8c4d3d13b89bddc64a1b8a8a3fead8b9c87c92
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Nov 30 10:32:28 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:19 2016 +0000

    tools/libs/foreignmemory: pull array length argument to map forward
    
    By having the "num" argument before the page and error arrays we can
    potentially use a variable-length-array argument ("int pages[num]") in
    the function prototype.
    
    However VLAs are a C99 feature and we are currently targetting C89 and
    later, so we don't actually make use of this here, merely arrange that
    we can switch to VLAs in the future without changing the function ABI.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libs/foreignmemory/compat.c                  |    4 ++--
 tools/libs/foreignmemory/core.c                    |    5 +++--
 tools/libs/foreignmemory/freebsd.c                 |    4 ++--
 .../libs/foreignmemory/include/xenforeignmemory.h  |    4 ++--
 tools/libs/foreignmemory/linux.c                   |    3 ++-
 tools/libs/foreignmemory/minios.c                  |    3 ++-
 tools/libs/foreignmemory/private.h                 |    3 ++-
 tools/libxc/xc_foreign_memory.c                    |    4 ++--
 tools/libxc/xc_sr_restore.c                        |    2 +-
 tools/libxc/xc_sr_save.c                           |    2 +-
 10 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/tools/libs/foreignmemory/compat.c b/tools/libs/foreignmemory/compat.c
index 039297c..b79ec1a 100644
--- a/tools/libs/foreignmemory/compat.c
+++ b/tools/libs/foreignmemory/compat.c
@@ -22,8 +22,8 @@
 #include "private.h"
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
-                                 uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, size_t num)
+                                 uint32_t dom, int prot, size_t num,
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/])
 {
     xen_pfn_t *pfn;
     unsigned int i;
diff --git a/tools/libs/foreignmemory/core.c b/tools/libs/foreignmemory/core.c
index 4e0541f..cfb0a73 100644
--- a/tools/libs/foreignmemory/core.c
+++ b/tools/libs/foreignmemory/core.c
@@ -64,7 +64,8 @@ int xenforeignmemory_close(xenforeignmemory_handle *fmem)
 
 void *xenforeignmemory_map(xenforeignmemory_handle *fmem,
                            uint32_t dom, int prot,
-                           const xen_pfn_t *arr, int *err, size_t num)
+                           size_t num,
+                           const xen_pfn_t arr[/*num*/], int err[/*num*/])
 {
     void *ret;
     int *err_to_free = NULL;
@@ -75,7 +76,7 @@ void *xenforeignmemory_map(xenforeignmemory_handle *fmem,
     if ( err == NULL )
         return NULL;
 
-    ret = osdep_xenforeignmemory_map(fmem, dom, prot, arr, err, num);
+    ret = osdep_xenforeignmemory_map(fmem, dom, prot, num, arr, err);
 
     if ( ret == 0 && err_to_free )
     {
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index ed26ebb..703754f 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -84,8 +84,8 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err,
-                                 size_t num)
+                                 size_t num,
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/])
 {
     int fd = fmem->fd;
     privcmd_mmapbatch_t ioctlx;
diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
index 0ec6325..3724c63 100644
--- a/tools/libs/foreignmemory/include/xenforeignmemory.h
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -104,8 +104,8 @@ int xenforeignmemory_close(xenforeignmemory_handle *fmem);
  * of @err indicating failure to map every page.
  */
 void *xenforeignmemory_map(xenforeignmemory_handle *fmem, uint32_t dom,
-                           int prot, const xen_pfn_t *arr, int *err,
-                           size_t pages);
+                           int prot, size_t pages,
+                           const xen_pfn_t arr[/*pages*/], int err[/*pages*/]);
 
 /*
  * Unmap a mapping previous created with xenforeignmemory_map().
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
index 6620391..32b6def 100644
--- a/tools/libs/foreignmemory/linux.c
+++ b/tools/libs/foreignmemory/linux.c
@@ -161,7 +161,8 @@ out:
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, size_t num)
+                                 size_t num,
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/])
 {
     int fd = fmem->fd;
     privcmd_mmapbatch_v2_t ioctlx;
diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index bdc1239..ca5ba71 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -41,7 +41,8 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, size_t num)
+                                 size_t num,
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/])
 {
     unsigned long pt_prot = 0;
     if (prot & PROT_READ)
diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
index 36a71ec..cd732fd 100644
--- a/tools/libs/foreignmemory/private.h
+++ b/tools/libs/foreignmemory/private.h
@@ -27,7 +27,8 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
 
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, int prot,
-                                 const xen_pfn_t *arr, int *err, size_t num);
+                                 size_t num,
+                                 const xen_pfn_t arr[num], int err[num]);
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num);
 
diff --git a/tools/libxc/xc_foreign_memory.c b/tools/libxc/xc_foreign_memory.c
index 4b24388..4053d26 100644
--- a/tools/libxc/xc_foreign_memory.c
+++ b/tools/libxc/xc_foreign_memory.c
@@ -28,7 +28,7 @@ void *xc_map_foreign_pages(xc_interface *xch, uint32_t dom, int prot,
         return NULL;
     }
 
-    return xenforeignmemory_map(xch->fmem, dom, prot, arr, NULL, num);
+    return xenforeignmemory_map(xch->fmem, dom, prot, num, arr, NULL);
 }
 
 void *xc_map_foreign_range(xc_interface *xch,
@@ -84,7 +84,7 @@ void *xc_map_foreign_ranges(xc_interface *xch,
 void *xc_map_foreign_bulk(xc_interface *xch, uint32_t dom, int prot,
                           const xen_pfn_t *arr, int *err, unsigned int num)
 {
-    return xenforeignmemory_map(xch->fmem, dom, prot, arr, err, num);
+    return xenforeignmemory_map(xch->fmem, dom, prot, num, arr, err);
 }
 
 /*
diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index 5a51f26..d4d33fd 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -318,7 +318,7 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count,
 
     mapping = guest_page = xenforeignmemory_map(xch->fmem,
         ctx->domid, PROT_READ | PROT_WRITE,
-        mfns, map_errs, nr_pages);
+        nr_pages, mfns, map_errs);
     if ( !mapping )
     {
         rc = -1;
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index fba4e40..ccb000e 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -154,7 +154,7 @@ static int write_batch(struct xc_sr_context *ctx)
     if ( nr_pages > 0 )
     {
         guest_mapping = xenforeignmemory_map(xch->fmem,
-            ctx->domid, PROT_READ, mfns, errors, nr_pages);
+            ctx->domid, PROT_READ, nr_pages, mfns, errors);
         if ( !guest_mapping )
         {
             PERROR("Failed to map guest pages");
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:17:06 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:17: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 1aON9u-0000tq-NS; Wed, 27 Jan 2016 10:17: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 1aON9t-0000ta-NO
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:05 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	96/D5-02940-D1998A65; Wed, 27 Jan 2016 10:17:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1453889820!18449851!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28579 invoked from network); 27 Jan 2016 10:17:01 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:17:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAg-00021h-B4
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9o-0001Tw-3c
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:00 +0000
Date: Wed, 27 Jan 2016 10:17:00 +0000
Message-Id: <E1aON9o-0001Tw-3c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/evtchn: Review and update
	doc comments.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 650c168e62c16a202438d29686b6ade4e8067308
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Sep 21 16:54:05 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:19 2016 +0000

    tools/libs/evtchn: Review and update doc comments.
    
    Remove the reference to pre-4.1, since this is now a new library.
    
    Fixup references to xc.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libs/evtchn/include/xenevtchn.h |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/libs/evtchn/include/xenevtchn.h b/tools/libs/evtchn/include/xenevtchn.h
index 3380fa3..60da2a3 100644
--- a/tools/libs/evtchn/include/xenevtchn.h
+++ b/tools/libs/evtchn/include/xenevtchn.h
@@ -46,11 +46,9 @@ typedef struct xentoollog_logger xentoollog_logger;
  * which case errno will be set appropriately.
  *
  * Note:
- * After fork a child process must not use any opened xc evtchn
+ * After fork a child process must not use any opened evtchn
  * handle inherited from their parent. They must open a new handle if
- * they want to interact with xc.
- *
- * Before Xen pre-4.1 this function would sometimes report errors with perror.
+ * they want to interact with evtchn.
  */
 /* Currently no flags are defined */
 xenevtchn_handle *xenevtchn_open(xentoollog_logger *logger, unsigned open_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 Wed Jan 27 10:17:06 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:17: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 1aON9u-0000tq-NS; Wed, 27 Jan 2016 10:17: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 1aON9t-0000ta-NO
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:05 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	96/D5-02940-D1998A65; Wed, 27 Jan 2016 10:17:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1453889820!18449851!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28579 invoked from network); 27 Jan 2016 10:17:01 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:17:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAg-00021h-B4
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9o-0001Tw-3c
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:00 +0000
Date: Wed, 27 Jan 2016 10:17:00 +0000
Message-Id: <E1aON9o-0001Tw-3c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/evtchn: Review and update
	doc comments.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 650c168e62c16a202438d29686b6ade4e8067308
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Sep 21 16:54:05 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:19 2016 +0000

    tools/libs/evtchn: Review and update doc comments.
    
    Remove the reference to pre-4.1, since this is now a new library.
    
    Fixup references to xc.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libs/evtchn/include/xenevtchn.h |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/libs/evtchn/include/xenevtchn.h b/tools/libs/evtchn/include/xenevtchn.h
index 3380fa3..60da2a3 100644
--- a/tools/libs/evtchn/include/xenevtchn.h
+++ b/tools/libs/evtchn/include/xenevtchn.h
@@ -46,11 +46,9 @@ typedef struct xentoollog_logger xentoollog_logger;
  * which case errno will be set appropriately.
  *
  * Note:
- * After fork a child process must not use any opened xc evtchn
+ * After fork a child process must not use any opened evtchn
  * handle inherited from their parent. They must open a new handle if
- * they want to interact with xc.
- *
- * Before Xen pre-4.1 this function would sometimes report errors with perror.
+ * they want to interact with evtchn.
  */
 /* Currently no flags are defined */
 xenevtchn_handle *xenevtchn_open(xentoollog_logger *logger, unsigned open_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 Wed Jan 27 10:17:14 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:17: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 1aONA2-0000vo-Ef; Wed, 27 Jan 2016 10:17: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 1aONA1-0000v3-0c
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:13 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	4B/A9-29478-82998A65; Wed, 27 Jan 2016 10:17:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453889830!18193897!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 59541 invoked from network); 27 Jan 2016 10:17:11 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:17:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAq-00022P-NW
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9y-0001VM-FB
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:10 +0000
Date: Wed, 27 Jan 2016 10:17:10 +0000
Message-Id: <E1aON9y-0001VM-FB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/evtchn: Use uint32_t for
	domid arguments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 449e75b16adc667fb94c4bd4f2d578a6728aba29
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 16 15:44:49 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:19 2016 +0000

    tools/libs/evtchn: Use uint32_t for domid arguments
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/evtchn/freebsd.c           |    4 ++--
 tools/libs/evtchn/include/xenevtchn.h |    4 ++--
 tools/libs/evtchn/linux.c             |    4 ++--
 tools/libs/evtchn/minios.c            |    4 ++--
 tools/libs/evtchn/netbsd.c            |    4 ++--
 tools/libs/evtchn/solaris.c           |    4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tools/libs/evtchn/freebsd.c b/tools/libs/evtchn/freebsd.c
index 636f052..6479f7c 100644
--- a/tools/libs/evtchn/freebsd.c
+++ b/tools/libs/evtchn/freebsd.c
@@ -62,7 +62,7 @@ int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
     return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
-evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid)
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32_t domid)
 {
     int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
@@ -74,7 +74,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int do
 }
 
 evtchn_port_or_error_t
-xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid, evtchn_port_t remote_port)
+xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint_32 domid, evtchn_port_t remote_port)
 {
     int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
diff --git a/tools/libs/evtchn/include/xenevtchn.h b/tools/libs/evtchn/include/xenevtchn.h
index 60da2a3..428d54c 100644
--- a/tools/libs/evtchn/include/xenevtchn.h
+++ b/tools/libs/evtchn/include/xenevtchn.h
@@ -86,14 +86,14 @@ int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port);
  * domain ID, or -1 on failure, in which case errno will be set appropriately.
  */
 evtchn_port_or_error_t
-xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid);
+xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32_t domid);
 
 /*
  * Returns a new event port bound to the remote port for the given domain ID,
  * or -1 on failure, in which case errno will be set appropriately.
  */
 evtchn_port_or_error_t
-xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid,
                            evtchn_port_t remote_port);
 
 /*
diff --git a/tools/libs/evtchn/linux.c b/tools/libs/evtchn/linux.c
index 27fd6e9..76cf0ac 100644
--- a/tools/libs/evtchn/linux.c
+++ b/tools/libs/evtchn/linux.c
@@ -61,7 +61,7 @@ int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
 }
 
 evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce,
-                                                   int domid)
+                                                   uint32_t domid)
 {
     int fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
@@ -72,7 +72,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce,
 }
 
 evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce,
-                                                  int domid,
+                                                  uint32_t domid,
                                                   evtchn_port_t remote_port)
 {
     int fd = xce->fd;
diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
index b839cd0..773942d 100644
--- a/tools/libs/evtchn/minios.c
+++ b/tools/libs/evtchn/minios.c
@@ -128,7 +128,7 @@ static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
     wake_up(&event_queue);
 }
 
-evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid)
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32_t domid)
 {
     int fd = xce->fd;
     struct evtchn_port_info *port_info;
@@ -155,7 +155,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int do
     return port;
 }
 
-evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid,
                                                   evtchn_port_t remote_port)
 {
     int fd = xce->fd;
diff --git a/tools/libs/evtchn/netbsd.c b/tools/libs/evtchn/netbsd.c
index c4123fe..1472ca6 100644
--- a/tools/libs/evtchn/netbsd.c
+++ b/tools/libs/evtchn/netbsd.c
@@ -62,7 +62,7 @@ int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
     return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
-evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle * xce, int domid)
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle * xce, uint32_t domid)
 {
     int fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
@@ -77,7 +77,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle * xce, int d
 	return -1;
 }
 
-evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid,
                                                   evtchn_port_t remote_port)
 {
     int fd = xce->fd;
diff --git a/tools/libs/evtchn/solaris.c b/tools/libs/evtchn/solaris.c
index 114cefb..b4720cd 100644
--- a/tools/libs/evtchn/solaris.c
+++ b/tools/libs/evtchn/solaris.c
@@ -65,7 +65,7 @@ int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
     return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
-evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid)
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32_t domid)
 {
     int fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
@@ -75,7 +75,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int do
     return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
 }
 
-evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid,
                                                   evtchn_port_t remote_port)
 {
     int fd = xce->fd;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:17:14 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:17: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 1aONA2-0000vo-Ef; Wed, 27 Jan 2016 10:17: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 1aONA1-0000v3-0c
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:13 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	4B/A9-29478-82998A65; Wed, 27 Jan 2016 10:17:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453889830!18193897!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 59541 invoked from network); 27 Jan 2016 10:17:11 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:17:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAq-00022P-NW
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON9y-0001VM-FB
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:10 +0000
Date: Wed, 27 Jan 2016 10:17:10 +0000
Message-Id: <E1aON9y-0001VM-FB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/evtchn: Use uint32_t for
	domid arguments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 449e75b16adc667fb94c4bd4f2d578a6728aba29
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 16 15:44:49 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:19 2016 +0000

    tools/libs/evtchn: Use uint32_t for domid arguments
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/evtchn/freebsd.c           |    4 ++--
 tools/libs/evtchn/include/xenevtchn.h |    4 ++--
 tools/libs/evtchn/linux.c             |    4 ++--
 tools/libs/evtchn/minios.c            |    4 ++--
 tools/libs/evtchn/netbsd.c            |    4 ++--
 tools/libs/evtchn/solaris.c           |    4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tools/libs/evtchn/freebsd.c b/tools/libs/evtchn/freebsd.c
index 636f052..6479f7c 100644
--- a/tools/libs/evtchn/freebsd.c
+++ b/tools/libs/evtchn/freebsd.c
@@ -62,7 +62,7 @@ int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
     return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
-evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid)
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32_t domid)
 {
     int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
@@ -74,7 +74,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int do
 }
 
 evtchn_port_or_error_t
-xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid, evtchn_port_t remote_port)
+xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint_32 domid, evtchn_port_t remote_port)
 {
     int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
diff --git a/tools/libs/evtchn/include/xenevtchn.h b/tools/libs/evtchn/include/xenevtchn.h
index 60da2a3..428d54c 100644
--- a/tools/libs/evtchn/include/xenevtchn.h
+++ b/tools/libs/evtchn/include/xenevtchn.h
@@ -86,14 +86,14 @@ int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port);
  * domain ID, or -1 on failure, in which case errno will be set appropriately.
  */
 evtchn_port_or_error_t
-xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid);
+xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32_t domid);
 
 /*
  * Returns a new event port bound to the remote port for the given domain ID,
  * or -1 on failure, in which case errno will be set appropriately.
  */
 evtchn_port_or_error_t
-xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid,
                            evtchn_port_t remote_port);
 
 /*
diff --git a/tools/libs/evtchn/linux.c b/tools/libs/evtchn/linux.c
index 27fd6e9..76cf0ac 100644
--- a/tools/libs/evtchn/linux.c
+++ b/tools/libs/evtchn/linux.c
@@ -61,7 +61,7 @@ int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
 }
 
 evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce,
-                                                   int domid)
+                                                   uint32_t domid)
 {
     int fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
@@ -72,7 +72,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce,
 }
 
 evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce,
-                                                  int domid,
+                                                  uint32_t domid,
                                                   evtchn_port_t remote_port)
 {
     int fd = xce->fd;
diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
index b839cd0..773942d 100644
--- a/tools/libs/evtchn/minios.c
+++ b/tools/libs/evtchn/minios.c
@@ -128,7 +128,7 @@ static void evtchn_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
     wake_up(&event_queue);
 }
 
-evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid)
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32_t domid)
 {
     int fd = xce->fd;
     struct evtchn_port_info *port_info;
@@ -155,7 +155,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int do
     return port;
 }
 
-evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid,
                                                   evtchn_port_t remote_port)
 {
     int fd = xce->fd;
diff --git a/tools/libs/evtchn/netbsd.c b/tools/libs/evtchn/netbsd.c
index c4123fe..1472ca6 100644
--- a/tools/libs/evtchn/netbsd.c
+++ b/tools/libs/evtchn/netbsd.c
@@ -62,7 +62,7 @@ int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
     return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
-evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle * xce, int domid)
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle * xce, uint32_t domid)
 {
     int fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
@@ -77,7 +77,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle * xce, int d
 	return -1;
 }
 
-evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid,
                                                   evtchn_port_t remote_port)
 {
     int fd = xce->fd;
diff --git a/tools/libs/evtchn/solaris.c b/tools/libs/evtchn/solaris.c
index 114cefb..b4720cd 100644
--- a/tools/libs/evtchn/solaris.c
+++ b/tools/libs/evtchn/solaris.c
@@ -65,7 +65,7 @@ int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
     return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
 }
 
-evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int domid)
+evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32_t domid)
 {
     int fd = xce->fd;
     struct ioctl_evtchn_bind_unbound_port bind;
@@ -75,7 +75,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, int do
     return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
 }
 
-evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, int domid,
+evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid,
                                                   evtchn_port_t remote_port)
 {
     int fd = xce->fd;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:17:25 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:17: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 1aONAD-0000yL-IE; Wed, 27 Jan 2016 10:17: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 1aONAB-0000xn-N0
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:23 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	32/67-21594-33998A65; Wed, 27 Jan 2016 10:17:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1453889841!18413578!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40757 invoked from network); 27 Jan 2016 10:17:22 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:17:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONB1-00022a-2Z
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONA8-0001WP-Sy
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:20 +0000
Date: Wed, 27 Jan 2016 10:17:20 +0000
Message-Id: <E1aONA8-0001WP-Sy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs: Clean up hard tabs.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bfddc736f8b4ebadd93330bc0b4342f50de0958d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Sep 21 17:34:42 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:20 2016 +0000

    tools/libs: Clean up hard tabs.
    
    These were wrong in the context of libxc before this code was
    extracted, clean them up.
    
    Also add some emacs magic blocks
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/call/buffer.c              |    4 ++--
 tools/libs/call/core.c                |    2 +-
 tools/libs/call/minios.c              |    4 ++--
 tools/libs/evtchn/minios.c            |   28 ++++++++++++++--------------
 tools/libs/evtchn/netbsd.c            |   12 ++++++------
 tools/libs/foreignmemory/freebsd.c    |    2 +-
 tools/libs/foreignmemory/minios.c     |    6 +++---
 tools/libs/foreignmemory/netbsd.c     |    2 +-
 tools/libs/foreignmemory/private.h    |    2 +-
 tools/libs/foreignmemory/solaris.c    |   12 +++++++++++-
 tools/libs/gnttab/include/xengnttab.h |    4 ++--
 tools/libs/gnttab/linux.c             |    6 +++---
 tools/libs/toollog/xtl_logger_stdio.c |    2 +-
 13 files changed, 48 insertions(+), 38 deletions(-)

diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c
index 1a1b27a..2d8fc29 100644
--- a/tools/libs/call/buffer.c
+++ b/tools/libs/call/buffer.c
@@ -20,7 +20,7 @@
 #include "private.h"
 
 #define DBGPRINTF(_m...) \
-	xtl_log(xcall->logger, XTL_DEBUG, -1, "xencall:buffer", _m)
+    xtl_log(xcall->logger, XTL_DEBUG, -1, "xencall:buffer", _m)
 
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
@@ -86,7 +86,7 @@ static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages)
     xcall->buffer_current_allocations--;
 
     if ( nr_pages == 1 &&
-	 xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
+         xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
     {
         xcall->buffer_cache[xcall->buffer_cache_nr++] = p;
         rc = 1;
diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
index a342871..bbf88de 100644
--- a/tools/libs/call/core.c
+++ b/tools/libs/call/core.c
@@ -19,7 +19,7 @@
 
 xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags)
 {
-	xencall_handle *xcall = malloc(sizeof(*xcall));
+    xencall_handle *xcall = malloc(sizeof(*xcall));
     int rc;
 
     if (!xcall) return NULL;
diff --git a/tools/libs/call/minios.c b/tools/libs/call/minios.c
index 3bee7be..f04688f 100644
--- a/tools/libs/call/minios.c
+++ b/tools/libs/call/minios.c
@@ -50,8 +50,8 @@ int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
     ret = HYPERVISOR_multicall(&call, 1);
 
     if (ret < 0) {
-	errno = -ret;
-	return -1;
+        errno = -ret;
+        return -1;
     }
     if ((long) call.result < 0) {
         errno = - (long) call.result;
diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
index 773942d..2c89952 100644
--- a/tools/libs/evtchn/minios.c
+++ b/tools/libs/evtchn/minios.c
@@ -103,8 +103,8 @@ int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
     ret = notify_remote_via_evtchn(port);
 
     if (ret < 0) {
-	errno = -ret;
-	ret = -1;
+        errno = -ret;
+        ret = -1;
     }
     return ret;
 }
@@ -138,16 +138,16 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32
     assert(get_current() == main_thread);
     port_info = port_alloc(fd);
     if (port_info == NULL)
-	return -1;
+        return -1;
 
     printf("xenevtchn_bind_unbound_port(%d)", domid);
     ret = evtchn_alloc_unbound(domid, evtchn_handler, (void*)(intptr_t)fd, &port);
     printf(" = %d\n", ret);
 
     if (ret < 0) {
-	port_dealloc(port_info);
-	errno = -ret;
-	return -1;
+        port_dealloc(port_info);
+        errno = -ret;
+        return -1;
     }
     port_info->bound = 1;
     port_info->port = port;
@@ -166,16 +166,16 @@ evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_
     assert(get_current() == main_thread);
     port_info = port_alloc(fd);
     if (port_info == NULL)
-	return -1;
+        return -1;
 
     printf("xenevtchn_bind_interdomain(%d, %"PRId32")", domid, remote_port);
     ret = evtchn_bind_interdomain(domid, remote_port, evtchn_handler, (void*)(intptr_t)fd, &local_port);
     printf(" = %d\n", ret);
 
     if (ret < 0) {
-	port_dealloc(port_info);
-	errno = -ret;
-	return -1;
+        port_dealloc(port_info);
+        errno = -ret;
+        return -1;
     }
     port_info->bound = 1;
     port_info->port = local_port;
@@ -208,15 +208,15 @@ evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int v
     assert(get_current() == main_thread);
     port_info = port_alloc(fd);
     if (port_info == NULL)
-	return -1;
+        return -1;
 
     printf("xenevtchn_bind_virq(%d)", virq);
     port = bind_virq(virq, evtchn_handler, (void*)(intptr_t)fd);
 
     if (port < 0) {
-	port_dealloc(port_info);
-	errno = -port;
-	return -1;
+        port_dealloc(port_info);
+        errno = -port;
+        return -1;
     }
     port_info->bound = 1;
     port_info->port = port;
diff --git a/tools/libs/evtchn/netbsd.c b/tools/libs/evtchn/netbsd.c
index 1472ca6..77ae51f 100644
--- a/tools/libs/evtchn/netbsd.c
+++ b/tools/libs/evtchn/netbsd.c
@@ -72,9 +72,9 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle * xce, uint3
 
     ret = ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
     if (ret == 0)
-	return bind.port;
+        return bind.port;
     else
-	return -1;
+        return -1;
 }
 
 evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid,
@@ -89,9 +89,9 @@ evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_
 
     ret = ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
     if (ret == 0)
-	return bind.port;
+        return bind.port;
     else
-	return -1;
+        return -1;
 }
 
 int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
@@ -114,9 +114,9 @@ evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int v
 
     err = ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
     if (err)
-	return -1;
+        return -1;
     else
-	return bind.port;
+        return bind.port;
 }
 
 evtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index 703754f..38138dc 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -121,7 +121,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-	return munmap(addr, num << PAGE_SHIFT);
+    return munmap(addr, num << PAGE_SHIFT);
 }
 
 /*
diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index ca5ba71..6dc97bd 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -46,16 +46,16 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 {
     unsigned long pt_prot = 0;
     if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
+        pt_prot = L1_PROT_RO;
     if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
+        pt_prot = L1_PROT;
     return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
 }
 
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-	return munmap(addr, num << PAGE_SHIFT);
+    return munmap(addr, num << PAGE_SHIFT);
 }
 
 /*
diff --git a/tools/libs/foreignmemory/netbsd.c b/tools/libs/foreignmemory/netbsd.c
index d0d233a..08f4964 100644
--- a/tools/libs/foreignmemory/netbsd.c
+++ b/tools/libs/foreignmemory/netbsd.c
@@ -97,7 +97,7 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-	return munmap(addr, num*XC_PAGE_SIZE);
+    return munmap(addr, num*XC_PAGE_SIZE);
 }
 
 /*
diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
index cd732fd..9cc7814 100644
--- a/tools/libs/foreignmemory/private.h
+++ b/tools/libs/foreignmemory/private.h
@@ -39,7 +39,7 @@ void *compat_mapforeign_batch(xenforeignmem_handle *fmem, uint32_t dom,
 #endif
 
 #define PERROR(_f...) \
-	xtl_log(fmem->logger, XTL_ERROR, errno, "xenforeignmemory", _f)
+    xtl_log(fmem->logger, XTL_ERROR, errno, "xenforeignmemory", _f)
 
 #endif
 
diff --git a/tools/libs/foreignmemory/solaris.c b/tools/libs/foreignmemory/solaris.c
index f1c44bc..e925a29 100644
--- a/tools/libs/foreignmemory/solaris.c
+++ b/tools/libs/foreignmemory/solaris.c
@@ -95,5 +95,15 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-	return munmap(addr, num*XC_PAGE_SIZE);
+    return munmap(addr, num*XC_PAGE_SIZE);
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/include/xengnttab.h b/tools/libs/gnttab/include/xengnttab.h
index 700a5f1..1e07672 100644
--- a/tools/libs/gnttab/include/xengnttab.h
+++ b/tools/libs/gnttab/include/xengnttab.h
@@ -142,7 +142,7 @@ int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count);
  *      of grants.
  */
 int xengnttab_set_max_grants(xengnttab_handle *xgt,
-			     uint32_t count);
+                             uint32_t count);
 
 /*
  * Grant Sharing Interface (allocating and granting pages)
@@ -160,7 +160,7 @@ typedef struct xengntdev_handle xengntshr_handle;
  *
  */
 xengntshr_handle *xengntshr_open(xentoollog_logger *logger,
-			  unsigned open_flags);
+                                 unsigned open_flags);
 
 /*
  * Close a handle previously allocated with xengntshr_open().
diff --git a/tools/libs/gnttab/linux.c b/tools/libs/gnttab/linux.c
index 768119a..8dbdff8 100644
--- a/tools/libs/gnttab/linux.c
+++ b/tools/libs/gnttab/linux.c
@@ -294,9 +294,9 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
         err = ioctl(fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &notify);
     if (err) {
         GSERROR(xgs->logger, "ioctl SET_UNMAP_NOTIFY failed");
-		munmap(area, count * PAGE_SIZE);
-		area = NULL;
-	}
+        munmap(area, count * PAGE_SIZE);
+        area = NULL;
+    }
 
     memcpy(refs, gref_info->gref_ids, count * sizeof(uint32_t));
 
diff --git a/tools/libs/toollog/xtl_logger_stdio.c b/tools/libs/toollog/xtl_logger_stdio.c
index f9c5bd8..52dfbf5 100644
--- a/tools/libs/toollog/xtl_logger_stdio.c
+++ b/tools/libs/toollog/xtl_logger_stdio.c
@@ -135,7 +135,7 @@ static void stdiostream_progress(struct xentoollog_logger *logger_in,
     newpel = fprintf(lg->f, "%s%s" "%s: %lu/%lu  %3d%%%s",
                      context?context:"", context?": ":"",
                      doing_what, done, total, percent,
-		     done == total ? "\n" : "");
+                     done == total ? "\n" : "");
 
     extra_erase = lg->progress_erase_len - newpel;
     if (extra_erase > 0)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:17:25 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:17: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 1aONAD-0000yL-IE; Wed, 27 Jan 2016 10:17: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 1aONAB-0000xn-N0
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:23 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	32/67-21594-33998A65; Wed, 27 Jan 2016 10:17:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1453889841!18413578!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40757 invoked from network); 27 Jan 2016 10:17:22 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:17:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONB1-00022a-2Z
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONA8-0001WP-Sy
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:20 +0000
Date: Wed, 27 Jan 2016 10:17:20 +0000
Message-Id: <E1aONA8-0001WP-Sy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs: Clean up hard tabs.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bfddc736f8b4ebadd93330bc0b4342f50de0958d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Sep 21 17:34:42 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:20 2016 +0000

    tools/libs: Clean up hard tabs.
    
    These were wrong in the context of libxc before this code was
    extracted, clean them up.
    
    Also add some emacs magic blocks
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/call/buffer.c              |    4 ++--
 tools/libs/call/core.c                |    2 +-
 tools/libs/call/minios.c              |    4 ++--
 tools/libs/evtchn/minios.c            |   28 ++++++++++++++--------------
 tools/libs/evtchn/netbsd.c            |   12 ++++++------
 tools/libs/foreignmemory/freebsd.c    |    2 +-
 tools/libs/foreignmemory/minios.c     |    6 +++---
 tools/libs/foreignmemory/netbsd.c     |    2 +-
 tools/libs/foreignmemory/private.h    |    2 +-
 tools/libs/foreignmemory/solaris.c    |   12 +++++++++++-
 tools/libs/gnttab/include/xengnttab.h |    4 ++--
 tools/libs/gnttab/linux.c             |    6 +++---
 tools/libs/toollog/xtl_logger_stdio.c |    2 +-
 13 files changed, 48 insertions(+), 38 deletions(-)

diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c
index 1a1b27a..2d8fc29 100644
--- a/tools/libs/call/buffer.c
+++ b/tools/libs/call/buffer.c
@@ -20,7 +20,7 @@
 #include "private.h"
 
 #define DBGPRINTF(_m...) \
-	xtl_log(xcall->logger, XTL_DEBUG, -1, "xencall:buffer", _m)
+    xtl_log(xcall->logger, XTL_DEBUG, -1, "xencall:buffer", _m)
 
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
@@ -86,7 +86,7 @@ static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages)
     xcall->buffer_current_allocations--;
 
     if ( nr_pages == 1 &&
-	 xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
+         xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
     {
         xcall->buffer_cache[xcall->buffer_cache_nr++] = p;
         rc = 1;
diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
index a342871..bbf88de 100644
--- a/tools/libs/call/core.c
+++ b/tools/libs/call/core.c
@@ -19,7 +19,7 @@
 
 xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags)
 {
-	xencall_handle *xcall = malloc(sizeof(*xcall));
+    xencall_handle *xcall = malloc(sizeof(*xcall));
     int rc;
 
     if (!xcall) return NULL;
diff --git a/tools/libs/call/minios.c b/tools/libs/call/minios.c
index 3bee7be..f04688f 100644
--- a/tools/libs/call/minios.c
+++ b/tools/libs/call/minios.c
@@ -50,8 +50,8 @@ int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall)
     ret = HYPERVISOR_multicall(&call, 1);
 
     if (ret < 0) {
-	errno = -ret;
-	return -1;
+        errno = -ret;
+        return -1;
     }
     if ((long) call.result < 0) {
         errno = - (long) call.result;
diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
index 773942d..2c89952 100644
--- a/tools/libs/evtchn/minios.c
+++ b/tools/libs/evtchn/minios.c
@@ -103,8 +103,8 @@ int xenevtchn_notify(xenevtchn_handle *xce, evtchn_port_t port)
     ret = notify_remote_via_evtchn(port);
 
     if (ret < 0) {
-	errno = -ret;
-	ret = -1;
+        errno = -ret;
+        ret = -1;
     }
     return ret;
 }
@@ -138,16 +138,16 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32
     assert(get_current() == main_thread);
     port_info = port_alloc(fd);
     if (port_info == NULL)
-	return -1;
+        return -1;
 
     printf("xenevtchn_bind_unbound_port(%d)", domid);
     ret = evtchn_alloc_unbound(domid, evtchn_handler, (void*)(intptr_t)fd, &port);
     printf(" = %d\n", ret);
 
     if (ret < 0) {
-	port_dealloc(port_info);
-	errno = -ret;
-	return -1;
+        port_dealloc(port_info);
+        errno = -ret;
+        return -1;
     }
     port_info->bound = 1;
     port_info->port = port;
@@ -166,16 +166,16 @@ evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_
     assert(get_current() == main_thread);
     port_info = port_alloc(fd);
     if (port_info == NULL)
-	return -1;
+        return -1;
 
     printf("xenevtchn_bind_interdomain(%d, %"PRId32")", domid, remote_port);
     ret = evtchn_bind_interdomain(domid, remote_port, evtchn_handler, (void*)(intptr_t)fd, &local_port);
     printf(" = %d\n", ret);
 
     if (ret < 0) {
-	port_dealloc(port_info);
-	errno = -ret;
-	return -1;
+        port_dealloc(port_info);
+        errno = -ret;
+        return -1;
     }
     port_info->bound = 1;
     port_info->port = local_port;
@@ -208,15 +208,15 @@ evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int v
     assert(get_current() == main_thread);
     port_info = port_alloc(fd);
     if (port_info == NULL)
-	return -1;
+        return -1;
 
     printf("xenevtchn_bind_virq(%d)", virq);
     port = bind_virq(virq, evtchn_handler, (void*)(intptr_t)fd);
 
     if (port < 0) {
-	port_dealloc(port_info);
-	errno = -port;
-	return -1;
+        port_dealloc(port_info);
+        errno = -port;
+        return -1;
     }
     port_info->bound = 1;
     port_info->port = port;
diff --git a/tools/libs/evtchn/netbsd.c b/tools/libs/evtchn/netbsd.c
index 1472ca6..77ae51f 100644
--- a/tools/libs/evtchn/netbsd.c
+++ b/tools/libs/evtchn/netbsd.c
@@ -72,9 +72,9 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle * xce, uint3
 
     ret = ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
     if (ret == 0)
-	return bind.port;
+        return bind.port;
     else
-	return -1;
+        return -1;
 }
 
 evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid,
@@ -89,9 +89,9 @@ evtchn_port_or_error_t xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_
 
     ret = ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
     if (ret == 0)
-	return bind.port;
+        return bind.port;
     else
-	return -1;
+        return -1;
 }
 
 int xenevtchn_unbind(xenevtchn_handle *xce, evtchn_port_t port)
@@ -114,9 +114,9 @@ evtchn_port_or_error_t xenevtchn_bind_virq(xenevtchn_handle *xce, unsigned int v
 
     err = ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
     if (err)
-	return -1;
+        return -1;
     else
-	return bind.port;
+        return bind.port;
 }
 
 evtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce)
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index 703754f..38138dc 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -121,7 +121,7 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-	return munmap(addr, num << PAGE_SHIFT);
+    return munmap(addr, num << PAGE_SHIFT);
 }
 
 /*
diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index ca5ba71..6dc97bd 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -46,16 +46,16 @@ void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
 {
     unsigned long pt_prot = 0;
     if (prot & PROT_READ)
-	pt_prot = L1_PROT_RO;
+        pt_prot = L1_PROT_RO;
     if (prot & PROT_WRITE)
-	pt_prot = L1_PROT;
+        pt_prot = L1_PROT;
     return map_frames_ex(arr, num, 1, 0, 1, dom, err, pt_prot);
 }
 
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-	return munmap(addr, num << PAGE_SHIFT);
+    return munmap(addr, num << PAGE_SHIFT);
 }
 
 /*
diff --git a/tools/libs/foreignmemory/netbsd.c b/tools/libs/foreignmemory/netbsd.c
index d0d233a..08f4964 100644
--- a/tools/libs/foreignmemory/netbsd.c
+++ b/tools/libs/foreignmemory/netbsd.c
@@ -97,7 +97,7 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-	return munmap(addr, num*XC_PAGE_SIZE);
+    return munmap(addr, num*XC_PAGE_SIZE);
 }
 
 /*
diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h
index cd732fd..9cc7814 100644
--- a/tools/libs/foreignmemory/private.h
+++ b/tools/libs/foreignmemory/private.h
@@ -39,7 +39,7 @@ void *compat_mapforeign_batch(xenforeignmem_handle *fmem, uint32_t dom,
 #endif
 
 #define PERROR(_f...) \
-	xtl_log(fmem->logger, XTL_ERROR, errno, "xenforeignmemory", _f)
+    xtl_log(fmem->logger, XTL_ERROR, errno, "xenforeignmemory", _f)
 
 #endif
 
diff --git a/tools/libs/foreignmemory/solaris.c b/tools/libs/foreignmemory/solaris.c
index f1c44bc..e925a29 100644
--- a/tools/libs/foreignmemory/solaris.c
+++ b/tools/libs/foreignmemory/solaris.c
@@ -95,5 +95,15 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom,
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num)
 {
-	return munmap(addr, num*XC_PAGE_SIZE);
+    return munmap(addr, num*XC_PAGE_SIZE);
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/include/xengnttab.h b/tools/libs/gnttab/include/xengnttab.h
index 700a5f1..1e07672 100644
--- a/tools/libs/gnttab/include/xengnttab.h
+++ b/tools/libs/gnttab/include/xengnttab.h
@@ -142,7 +142,7 @@ int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count);
  *      of grants.
  */
 int xengnttab_set_max_grants(xengnttab_handle *xgt,
-			     uint32_t count);
+                             uint32_t count);
 
 /*
  * Grant Sharing Interface (allocating and granting pages)
@@ -160,7 +160,7 @@ typedef struct xengntdev_handle xengntshr_handle;
  *
  */
 xengntshr_handle *xengntshr_open(xentoollog_logger *logger,
-			  unsigned open_flags);
+                                 unsigned open_flags);
 
 /*
  * Close a handle previously allocated with xengntshr_open().
diff --git a/tools/libs/gnttab/linux.c b/tools/libs/gnttab/linux.c
index 768119a..8dbdff8 100644
--- a/tools/libs/gnttab/linux.c
+++ b/tools/libs/gnttab/linux.c
@@ -294,9 +294,9 @@ void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
         err = ioctl(fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &notify);
     if (err) {
         GSERROR(xgs->logger, "ioctl SET_UNMAP_NOTIFY failed");
-		munmap(area, count * PAGE_SIZE);
-		area = NULL;
-	}
+        munmap(area, count * PAGE_SIZE);
+        area = NULL;
+    }
 
     memcpy(refs, gref_info->gref_ids, count * sizeof(uint32_t));
 
diff --git a/tools/libs/toollog/xtl_logger_stdio.c b/tools/libs/toollog/xtl_logger_stdio.c
index f9c5bd8..52dfbf5 100644
--- a/tools/libs/toollog/xtl_logger_stdio.c
+++ b/tools/libs/toollog/xtl_logger_stdio.c
@@ -135,7 +135,7 @@ static void stdiostream_progress(struct xentoollog_logger *logger_in,
     newpel = fprintf(lg->f, "%s%s" "%s: %lu/%lu  %3d%%%s",
                      context?context:"", context?": ":"",
                      doing_what, done, total, percent,
-		     done == total ? "\n" : "");
+                     done == total ? "\n" : "");
 
     extra_erase = lg->progress_erase_len - newpel;
     if (extra_erase > 0)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:17:39 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:17: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 1aONAQ-00010m-Ql; Wed, 27 Jan 2016 10:17:38 +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 1aONAP-00010a-6u
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:37 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	33/A2-13905-04998A65; Wed, 27 Jan 2016 10:17:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1453889851!18179535!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9956 invoked from network); 27 Jan 2016 10:17:32 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:17:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBB-00022j-E9
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAJ-0001Wy-7A
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:31 +0000
Date: Wed, 27 Jan 2016 10:17:31 +0000
Message-Id: <E1aONAJ-0001Wy-7A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/gnttab: Extensive updates
	to API documentation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18d46064c37fc734dd9f488fba0ee64d8f90fe07
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Sep 22 12:12:55 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:20 2016 +0000

    tools/libs/gnttab: Extensive updates to API documentation.
    
    In particular around error handling, behaviour on fork and the unmap
    notification mechanism.
    
    Behaviour of xengnttab_map_*grant_refs and xengntshr_share_pages on
    partial failure has been confirmed/inferred (by inspection) on Linux
    and Mini-os (the only two known implementations. Likewise the
    behaviour of the notification mechanism has been confirmed/inferred
    (by inspection) of the Linux implementation (currently the only
    implementation) and libvchan (primary known user).
    
    These updates are not folded into "tools: Refactor
    /dev/xen/gnt{dev,shr} wrappers into libxengnttab." to try and reduce
    the amount of non-movement changes in that patch.
    
    While I'm not convinced by javadoc/doxygen cause the existing comments
    which appear to use that syntax to have the appropriate /** marker.
    
    Also fix a typo in a code comment.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/libs/gnttab/include/xengnttab.h |  201 ++++++++++++++++++++++++++++-----
 tools/libs/gnttab/linux.c             |   12 +-
 2 files changed, 181 insertions(+), 32 deletions(-)

diff --git a/tools/libs/gnttab/include/xengnttab.h b/tools/libs/gnttab/include/xengnttab.h
index 1e07672..1ca1e70 100644
--- a/tools/libs/gnttab/include/xengnttab.h
+++ b/tools/libs/gnttab/include/xengnttab.h
@@ -31,28 +31,124 @@
 typedef struct xentoollog_logger xentoollog_logger;
 
 /*
+ * PRODUCING AND CONSUMING GRANT REFERENCES
+ * ========================================
+ *
+ * The xengnttab library contains two distinct interfaces, each with
+ * their own distinct handle type and entry points. The represent the
+ * two sides of the grant table interface, producer (gntshr) and
+ * consumer (gnttab).
+ *
+ * The xengnttab_* interfaces take a xengnttab_handle and provide
+ * mechanisms for consuming (i.e. mapping or copying to/from) grant
+ * references provided by a peer.
+ *
+ * The xengntshr_* interfaces take a xengntshr_handle and provide a
+ * mechanism to produce grantable memory and grant references to that
+ * memory, which can be handed to some peer.
+ *
+ * UNMAP NOTIFICATION
+ * ==================
+ *
+ * The xengnt{tab,shr}_*_notify interfaces implement a cooperative
+ * interface which is intended to allow the underlying kernel
+ * interfaces to attempt to notify the peer to perform graceful
+ * teardown upon failure (i.e. crash or exit) of the process on their
+ * end.
+ *
+ * These interfaces operate on a single page only and are intended for
+ * use on the main shared-ring page of a protocol. It is assumed that
+ * on teardown both ends would automatically teardown all grants
+ * associated with the protocol in addition to the shared ring itself.
+ *
+ * Each end is able to optionally nominate a byte offset within the
+ * shared page or an event channel or both. On exit of the process the
+ * underlying kernel driver will zero the byte at the given offset and
+ * signal the event channel.
+ *
+ * The event channel can be the same event channel used for regular
+ * ring progress notifications, or may be a dedicated event channel.
+ *
+ * Both ends may share the same notification byte offset within the
+ * shared page, or may have dedicated "client" and "server" status
+ * bytes.
+ *
+ * Since the byte is cleared on shutdown the protocol must use 0 as
+ * the "closed/dead" status, but is permitted to use any other non-0
+ * values to indicate various other "live" states (waiting for
+ * connection, connected, etc).
+ *
+ * Both ends are permitted to modify (including clear) their
+ * respective status bytes and to signal the event channel themselves
+ * from userspace.
+ *
+ * Depending on the mechanisms which have been registered an
+ * the peer may receive a shutdown notification as:
+ *
+ *   - An event channel notification on a dedicated event channel
+ *   - Observation of the other ends's status byte being cleared
+ *     (whether in response to an explicit notification or in the
+ *     course of normal operation).
+ *
+ * The mechanism should be defined as part of the specific ring
+ * protocol.
+ *
+ * Upon receiving notification of the peer is expected to teardown any
+ * resources (and in particular any grant mappings) in a timely
+ * manner.
+ *
+ * NOTE: this protocol is intended to allow for better error behaviour
+ * and recovery between two cooperating peers. It does not cover the
+ * case of a malicious peer who may continue to hold resources open.
+ */
+
+/*
  * Grant Table Interface (making use of grants from other domains)
  */
 
 typedef struct xengntdev_handle xengnttab_handle;
 
 /*
- * Note:
- * After fork a child process must not use any opened xc gnttab
- * handle inherited from their parent. They must open a new handle if
- * they want to interact with xc.
+ * Returns a handle onto the grant table driver.  Logs errors.
+ *
+ * Note: After fork(2) a child process must not use any opened gnttab
+ * handle inherited from their parent, nor access any grant mapped
+ * areas associated with that handle.
  *
- * Return an fd onto the grant table driver.  Logs errors.
+ * The child must open a new handle if they want to interact with
+ * gnttab.
+ *
+ * Calling exec(2) in a child will safely (and reliably) reclaim any
+ * resources which were allocated via a xengnttab_handle in the parent.
+ *
+ * A child which does not call exec(2) may safely call
+ * xengnttab_close() on a xengnttab_handle inherited from their
+ * parent. This will attempt to reclaim any resources associated with
+ * that handle. Note that in some implementations this reclamation may
+ * not be completely effective, in this case any affected resources
+ * remain allocated.
+ *
+ * Calling xengnttab_close() is the only safe operation on a
+ * xengnttab_handle which has been inherited. xengnttab_unmap() must
+ * not be called under such circumstances.
  */
 xengnttab_handle *xengnttab_open(xentoollog_logger *logger, unsigned open_flags);
 
 /*
- * Close a handle previously allocated with xengnttab_open().
- * Never logs errors.
+ * Close a handle previously allocated with xengnttab_open(),
+ * including unmaping any current grant maps.  Never logs errors.
+ *
+ * Under normal circumstances (i.e. not in the child after a fork)
+ * xengnttab_unmap() should be used on all mappings allocated through
+ * a xengnttab_handle prior to closing the handle in order to free up
+ * resources associated with those mappings.
+ *
+ * This is the only function which may be safely called on a
+ * xengnttab_handle in a child after a fork.
  */
 int xengnttab_close(xengnttab_handle *xgt);
 
-/*
+/**
  * Memory maps a grant reference from one domain to a local address range.
  * Mappings should be unmapped with xengnttab_unmap.  Logs errors.
  *
@@ -71,6 +167,10 @@ void *xengnttab_map_grant_ref(xengnttab_handle *xgt,
  * contiguous local address range. Mappings should be unmapped with
  * xengnttab_unmap.  Logs errors.
  *
+ * On failure (including partial failure) sets errno and returns
+ * NULL. On partial failure no mappings are established (any partial
+ * work is undone).
+ *
  * @parm xgt a handle on an open grant table interface
  * @parm count the number of grant references to be mapped
  * @parm domids an array of @count domain IDs by which the corresponding @refs
@@ -89,6 +189,9 @@ void *xengnttab_map_grant_refs(xengnttab_handle *xgt,
  * contiguous local address range. Mappings should be unmapped with
  * xengnttab_unmap.  Logs errors.
  *
+ * This call is equivalent to calling @xengnttab_map_grant_refs with a
+ * @domids array with every entry set to @domid.
+ *
  * @parm xgt a handle on an open grant table interface
  * @parm count the number of grant references to be mapped
  * @parm domid the domain to map memory from
@@ -109,6 +212,11 @@ void *xengnttab_map_domain_grant_refs(xengnttab_handle *xgt,
  * unmapped, the byte at the given offset will be zeroed and a wakeup will be
  * sent to the given event channel.  Logs errors.
  *
+ * On failure sets errno and returns NULL.
+ *
+ * If notify_offset or notify_port are requested and cannot be set up
+ * an error will be returned and no mapping will be made.
+ *
  * @parm xgt a handle on an open grant table interface
  * @parm domid the domain to map memory from
  * @parm ref the grant reference ID to map
@@ -124,15 +232,20 @@ void *xengnttab_map_grant_ref_notify(xengnttab_handle *xgt,
                                      uint32_t notify_offset,
                                      evtchn_port_t notify_port);
 
-/*
- * Unmaps the @count pages starting at @start_address, which were mapped by a
- * call to xengnttab_map_grant_ref or xengnttab_map_grant_refs. Never logs.
+/**
+ * Unmaps the @count pages starting at @start_address, which were
+ * mapped by a call to xengnttab_map_grant_ref,
+ * xengnttab_map_grant_refs or xengnttab_map_grant_ref_notify. Never
+ * logs.
+ *
+ * If the mapping was made using xengnttab_map_grant_ref_notify() with
+ * either notify_offset or notify_port then the peer will be notified.
  */
 int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count);
 
-/*
- * Sets the maximum number of grants that may be mapped by the given instance
- * to @count.  Never logs.
+/**
+ * Sets the maximum number of grants that may be mapped by the given
+ * instance to @count.  Never logs.
  *
  * N.B. This function must be called after opening the handle, and before any
  *      other functions are invoked on it.
@@ -142,22 +255,37 @@ int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count);
  *      of grants.
  */
 int xengnttab_set_max_grants(xengnttab_handle *xgt,
-                             uint32_t count);
+                             uint32_t nr_grants);
 
 /*
- * Grant Sharing Interface (allocating and granting pages)
+ * Grant Sharing Interface (allocating and granting pages to others)
  */
 
 typedef struct xengntdev_handle xengntshr_handle;
 
 /*
- * Return an fd onto the grant sharing driver.  Logs errors.
+ * Returns a handle onto the grant sharing driver.  Logs errors.
+ *
+ * Note: After fork(2) a child process must not use any opened gntshr
+ * handle inherited from their parent, nor access any grant mapped
+ * areas associated with that handle.
+ *
+ * The child must open a new handle if they want to interact with
+ * gntshr.
  *
- * Note:
- * After fork a child process must not use any opened xc gntshr
- * handle inherited from their parent. They must open a new handle if
- * they want to interact with xc.
+ * Calling exec(2) in a child will safely (and reliably) reclaim any
+ * resources which were allocated via a xengntshr_handle in the
+ * parent.
  *
+ * A child which does not call exec(2) may safely call
+ * xengntshr_close() on a xengntshr_handle inherited from their
+ * parent. This will attempt to reclaim any resources associated with
+ * that handle. Note that in some implementations this reclamation may
+ * not be completely effective, in this case any affected resources
+ * remain allocated.
+ *
+ * Calling xengntshr_close() is the only safe operation on a
+ * xengntshr_handle which has been inherited.
  */
 xengntshr_handle *xengntshr_open(xentoollog_logger *logger,
                                  unsigned open_flags);
@@ -165,11 +293,26 @@ xengntshr_handle *xengntshr_open(xentoollog_logger *logger,
 /*
  * Close a handle previously allocated with xengntshr_open().
  * Never logs errors.
+ *
+ * Under normal circumstances (i.e. not in the child after a fork)
+ * xengntshr_unmap() should be used on all mappings allocated through
+ * a xengnttab_handle prior to closing the handle in order to free up
+ * resources associated with those mappings.
+ *
+ * xengntshr_close() is the only function which may be safely called
+ * on a xengntshr_handle in a child after a fork. xengntshr_unshare()
+ * must not be called under such circumstances.
  */
 int xengntshr_close(xengntshr_handle *xgs);
 
-/*
- * Creates and shares pages with another domain.
+/**
+ * Allocates and shares pages with another domain.
+ *
+ * On failure sets errno and returns NULL. No allocations will be made.
+ *
+ * This library only provides functionality for sharing memory
+ * allocated via this call, memory from elsewhere (malloc, mmap etc)
+ * cannot be shared here.
  *
  * @parm xgs a handle to an open grant sharing instance
  * @parm domid the domain to share memory with
@@ -181,7 +324,7 @@ int xengntshr_close(xengntshr_handle *xgs);
 void *xengntshr_share_pages(xengntshr_handle *xgs, uint32_t domid,
                             int count, uint32_t *refs, int writable);
 
-/*
+/**
  * Creates and shares a page with another domain, with unmap notification.
  *
  * @parm xgs a handle to an open grant sharing instance
@@ -197,9 +340,13 @@ void *xengntshr_share_page_notify(xengntshr_handle *xgs, uint32_t domid,
                                   uint32_t *ref, int writable,
                                   uint32_t notify_offset,
                                   evtchn_port_t notify_port);
-/*
- * Unmaps the @count pages starting at @start_address, which were mapped by a
- * call to xengntshr_share_*. Never logs.
+
+/**
+ * Unmaps the @count pages starting at @start_address, which were
+ * mapped by a call to xengntshr_share_*. Never logs.
+ *
+ * If the mapping was made using xengntshr_share_page_notify() with
+ * either notify_offset or notify_port then the peer will be notified.
  */
 int xengntshr_unshare(xengntshr_handle *xgs, void *start_address, uint32_t count);
 
diff --git a/tools/libs/gnttab/linux.c b/tools/libs/gnttab/linux.c
index 8dbdff8..be04295 100644
--- a/tools/libs/gnttab/linux.c
+++ b/tools/libs/gnttab/linux.c
@@ -132,12 +132,14 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     if (addr == MAP_FAILED && errno == EAGAIN)
     {
         /*
-         * The grant hypercall can return EAGAIN if the granted page is
-         * swapped out. Since the paging daemon may be in the same domain, the
-         * hypercall cannot block without causing a deadlock.
+         * The grant hypercall can return EAGAIN if the granted page
+         * is swapped out. Since the paging daemon may be in the same
+         * domain, the hypercall cannot block without causing a
+         * deadlock.
          *
-         * Because there are no notificaitons when the page is swapped in, wait
-         * a bit before retrying, and hope that the page will arrive eventually.
+         * Because there are no notifications when the page is swapped
+         * in, wait a bit before retrying, and hope that the page will
+         * arrive eventually.
          */
         usleep(1000);
         goto retry;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:17:39 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:17: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 1aONAQ-00010m-Ql; Wed, 27 Jan 2016 10:17:38 +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 1aONAP-00010a-6u
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:37 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	33/A2-13905-04998A65; Wed, 27 Jan 2016 10:17:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1453889851!18179535!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9956 invoked from network); 27 Jan 2016 10:17:32 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:17:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBB-00022j-E9
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAJ-0001Wy-7A
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:31 +0000
Date: Wed, 27 Jan 2016 10:17:31 +0000
Message-Id: <E1aONAJ-0001Wy-7A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/gnttab: Extensive updates
	to API documentation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18d46064c37fc734dd9f488fba0ee64d8f90fe07
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Sep 22 12:12:55 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:20 2016 +0000

    tools/libs/gnttab: Extensive updates to API documentation.
    
    In particular around error handling, behaviour on fork and the unmap
    notification mechanism.
    
    Behaviour of xengnttab_map_*grant_refs and xengntshr_share_pages on
    partial failure has been confirmed/inferred (by inspection) on Linux
    and Mini-os (the only two known implementations. Likewise the
    behaviour of the notification mechanism has been confirmed/inferred
    (by inspection) of the Linux implementation (currently the only
    implementation) and libvchan (primary known user).
    
    These updates are not folded into "tools: Refactor
    /dev/xen/gnt{dev,shr} wrappers into libxengnttab." to try and reduce
    the amount of non-movement changes in that patch.
    
    While I'm not convinced by javadoc/doxygen cause the existing comments
    which appear to use that syntax to have the appropriate /** marker.
    
    Also fix a typo in a code comment.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 tools/libs/gnttab/include/xengnttab.h |  201 ++++++++++++++++++++++++++++-----
 tools/libs/gnttab/linux.c             |   12 +-
 2 files changed, 181 insertions(+), 32 deletions(-)

diff --git a/tools/libs/gnttab/include/xengnttab.h b/tools/libs/gnttab/include/xengnttab.h
index 1e07672..1ca1e70 100644
--- a/tools/libs/gnttab/include/xengnttab.h
+++ b/tools/libs/gnttab/include/xengnttab.h
@@ -31,28 +31,124 @@
 typedef struct xentoollog_logger xentoollog_logger;
 
 /*
+ * PRODUCING AND CONSUMING GRANT REFERENCES
+ * ========================================
+ *
+ * The xengnttab library contains two distinct interfaces, each with
+ * their own distinct handle type and entry points. The represent the
+ * two sides of the grant table interface, producer (gntshr) and
+ * consumer (gnttab).
+ *
+ * The xengnttab_* interfaces take a xengnttab_handle and provide
+ * mechanisms for consuming (i.e. mapping or copying to/from) grant
+ * references provided by a peer.
+ *
+ * The xengntshr_* interfaces take a xengntshr_handle and provide a
+ * mechanism to produce grantable memory and grant references to that
+ * memory, which can be handed to some peer.
+ *
+ * UNMAP NOTIFICATION
+ * ==================
+ *
+ * The xengnt{tab,shr}_*_notify interfaces implement a cooperative
+ * interface which is intended to allow the underlying kernel
+ * interfaces to attempt to notify the peer to perform graceful
+ * teardown upon failure (i.e. crash or exit) of the process on their
+ * end.
+ *
+ * These interfaces operate on a single page only and are intended for
+ * use on the main shared-ring page of a protocol. It is assumed that
+ * on teardown both ends would automatically teardown all grants
+ * associated with the protocol in addition to the shared ring itself.
+ *
+ * Each end is able to optionally nominate a byte offset within the
+ * shared page or an event channel or both. On exit of the process the
+ * underlying kernel driver will zero the byte at the given offset and
+ * signal the event channel.
+ *
+ * The event channel can be the same event channel used for regular
+ * ring progress notifications, or may be a dedicated event channel.
+ *
+ * Both ends may share the same notification byte offset within the
+ * shared page, or may have dedicated "client" and "server" status
+ * bytes.
+ *
+ * Since the byte is cleared on shutdown the protocol must use 0 as
+ * the "closed/dead" status, but is permitted to use any other non-0
+ * values to indicate various other "live" states (waiting for
+ * connection, connected, etc).
+ *
+ * Both ends are permitted to modify (including clear) their
+ * respective status bytes and to signal the event channel themselves
+ * from userspace.
+ *
+ * Depending on the mechanisms which have been registered an
+ * the peer may receive a shutdown notification as:
+ *
+ *   - An event channel notification on a dedicated event channel
+ *   - Observation of the other ends's status byte being cleared
+ *     (whether in response to an explicit notification or in the
+ *     course of normal operation).
+ *
+ * The mechanism should be defined as part of the specific ring
+ * protocol.
+ *
+ * Upon receiving notification of the peer is expected to teardown any
+ * resources (and in particular any grant mappings) in a timely
+ * manner.
+ *
+ * NOTE: this protocol is intended to allow for better error behaviour
+ * and recovery between two cooperating peers. It does not cover the
+ * case of a malicious peer who may continue to hold resources open.
+ */
+
+/*
  * Grant Table Interface (making use of grants from other domains)
  */
 
 typedef struct xengntdev_handle xengnttab_handle;
 
 /*
- * Note:
- * After fork a child process must not use any opened xc gnttab
- * handle inherited from their parent. They must open a new handle if
- * they want to interact with xc.
+ * Returns a handle onto the grant table driver.  Logs errors.
+ *
+ * Note: After fork(2) a child process must not use any opened gnttab
+ * handle inherited from their parent, nor access any grant mapped
+ * areas associated with that handle.
  *
- * Return an fd onto the grant table driver.  Logs errors.
+ * The child must open a new handle if they want to interact with
+ * gnttab.
+ *
+ * Calling exec(2) in a child will safely (and reliably) reclaim any
+ * resources which were allocated via a xengnttab_handle in the parent.
+ *
+ * A child which does not call exec(2) may safely call
+ * xengnttab_close() on a xengnttab_handle inherited from their
+ * parent. This will attempt to reclaim any resources associated with
+ * that handle. Note that in some implementations this reclamation may
+ * not be completely effective, in this case any affected resources
+ * remain allocated.
+ *
+ * Calling xengnttab_close() is the only safe operation on a
+ * xengnttab_handle which has been inherited. xengnttab_unmap() must
+ * not be called under such circumstances.
  */
 xengnttab_handle *xengnttab_open(xentoollog_logger *logger, unsigned open_flags);
 
 /*
- * Close a handle previously allocated with xengnttab_open().
- * Never logs errors.
+ * Close a handle previously allocated with xengnttab_open(),
+ * including unmaping any current grant maps.  Never logs errors.
+ *
+ * Under normal circumstances (i.e. not in the child after a fork)
+ * xengnttab_unmap() should be used on all mappings allocated through
+ * a xengnttab_handle prior to closing the handle in order to free up
+ * resources associated with those mappings.
+ *
+ * This is the only function which may be safely called on a
+ * xengnttab_handle in a child after a fork.
  */
 int xengnttab_close(xengnttab_handle *xgt);
 
-/*
+/**
  * Memory maps a grant reference from one domain to a local address range.
  * Mappings should be unmapped with xengnttab_unmap.  Logs errors.
  *
@@ -71,6 +167,10 @@ void *xengnttab_map_grant_ref(xengnttab_handle *xgt,
  * contiguous local address range. Mappings should be unmapped with
  * xengnttab_unmap.  Logs errors.
  *
+ * On failure (including partial failure) sets errno and returns
+ * NULL. On partial failure no mappings are established (any partial
+ * work is undone).
+ *
  * @parm xgt a handle on an open grant table interface
  * @parm count the number of grant references to be mapped
  * @parm domids an array of @count domain IDs by which the corresponding @refs
@@ -89,6 +189,9 @@ void *xengnttab_map_grant_refs(xengnttab_handle *xgt,
  * contiguous local address range. Mappings should be unmapped with
  * xengnttab_unmap.  Logs errors.
  *
+ * This call is equivalent to calling @xengnttab_map_grant_refs with a
+ * @domids array with every entry set to @domid.
+ *
  * @parm xgt a handle on an open grant table interface
  * @parm count the number of grant references to be mapped
  * @parm domid the domain to map memory from
@@ -109,6 +212,11 @@ void *xengnttab_map_domain_grant_refs(xengnttab_handle *xgt,
  * unmapped, the byte at the given offset will be zeroed and a wakeup will be
  * sent to the given event channel.  Logs errors.
  *
+ * On failure sets errno and returns NULL.
+ *
+ * If notify_offset or notify_port are requested and cannot be set up
+ * an error will be returned and no mapping will be made.
+ *
  * @parm xgt a handle on an open grant table interface
  * @parm domid the domain to map memory from
  * @parm ref the grant reference ID to map
@@ -124,15 +232,20 @@ void *xengnttab_map_grant_ref_notify(xengnttab_handle *xgt,
                                      uint32_t notify_offset,
                                      evtchn_port_t notify_port);
 
-/*
- * Unmaps the @count pages starting at @start_address, which were mapped by a
- * call to xengnttab_map_grant_ref or xengnttab_map_grant_refs. Never logs.
+/**
+ * Unmaps the @count pages starting at @start_address, which were
+ * mapped by a call to xengnttab_map_grant_ref,
+ * xengnttab_map_grant_refs or xengnttab_map_grant_ref_notify. Never
+ * logs.
+ *
+ * If the mapping was made using xengnttab_map_grant_ref_notify() with
+ * either notify_offset or notify_port then the peer will be notified.
  */
 int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count);
 
-/*
- * Sets the maximum number of grants that may be mapped by the given instance
- * to @count.  Never logs.
+/**
+ * Sets the maximum number of grants that may be mapped by the given
+ * instance to @count.  Never logs.
  *
  * N.B. This function must be called after opening the handle, and before any
  *      other functions are invoked on it.
@@ -142,22 +255,37 @@ int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count);
  *      of grants.
  */
 int xengnttab_set_max_grants(xengnttab_handle *xgt,
-                             uint32_t count);
+                             uint32_t nr_grants);
 
 /*
- * Grant Sharing Interface (allocating and granting pages)
+ * Grant Sharing Interface (allocating and granting pages to others)
  */
 
 typedef struct xengntdev_handle xengntshr_handle;
 
 /*
- * Return an fd onto the grant sharing driver.  Logs errors.
+ * Returns a handle onto the grant sharing driver.  Logs errors.
+ *
+ * Note: After fork(2) a child process must not use any opened gntshr
+ * handle inherited from their parent, nor access any grant mapped
+ * areas associated with that handle.
+ *
+ * The child must open a new handle if they want to interact with
+ * gntshr.
  *
- * Note:
- * After fork a child process must not use any opened xc gntshr
- * handle inherited from their parent. They must open a new handle if
- * they want to interact with xc.
+ * Calling exec(2) in a child will safely (and reliably) reclaim any
+ * resources which were allocated via a xengntshr_handle in the
+ * parent.
  *
+ * A child which does not call exec(2) may safely call
+ * xengntshr_close() on a xengntshr_handle inherited from their
+ * parent. This will attempt to reclaim any resources associated with
+ * that handle. Note that in some implementations this reclamation may
+ * not be completely effective, in this case any affected resources
+ * remain allocated.
+ *
+ * Calling xengntshr_close() is the only safe operation on a
+ * xengntshr_handle which has been inherited.
  */
 xengntshr_handle *xengntshr_open(xentoollog_logger *logger,
                                  unsigned open_flags);
@@ -165,11 +293,26 @@ xengntshr_handle *xengntshr_open(xentoollog_logger *logger,
 /*
  * Close a handle previously allocated with xengntshr_open().
  * Never logs errors.
+ *
+ * Under normal circumstances (i.e. not in the child after a fork)
+ * xengntshr_unmap() should be used on all mappings allocated through
+ * a xengnttab_handle prior to closing the handle in order to free up
+ * resources associated with those mappings.
+ *
+ * xengntshr_close() is the only function which may be safely called
+ * on a xengntshr_handle in a child after a fork. xengntshr_unshare()
+ * must not be called under such circumstances.
  */
 int xengntshr_close(xengntshr_handle *xgs);
 
-/*
- * Creates and shares pages with another domain.
+/**
+ * Allocates and shares pages with another domain.
+ *
+ * On failure sets errno and returns NULL. No allocations will be made.
+ *
+ * This library only provides functionality for sharing memory
+ * allocated via this call, memory from elsewhere (malloc, mmap etc)
+ * cannot be shared here.
  *
  * @parm xgs a handle to an open grant sharing instance
  * @parm domid the domain to share memory with
@@ -181,7 +324,7 @@ int xengntshr_close(xengntshr_handle *xgs);
 void *xengntshr_share_pages(xengntshr_handle *xgs, uint32_t domid,
                             int count, uint32_t *refs, int writable);
 
-/*
+/**
  * Creates and shares a page with another domain, with unmap notification.
  *
  * @parm xgs a handle to an open grant sharing instance
@@ -197,9 +340,13 @@ void *xengntshr_share_page_notify(xengntshr_handle *xgs, uint32_t domid,
                                   uint32_t *ref, int writable,
                                   uint32_t notify_offset,
                                   evtchn_port_t notify_port);
-/*
- * Unmaps the @count pages starting at @start_address, which were mapped by a
- * call to xengntshr_share_*. Never logs.
+
+/**
+ * Unmaps the @count pages starting at @start_address, which were
+ * mapped by a call to xengntshr_share_*. Never logs.
+ *
+ * If the mapping was made using xengntshr_share_page_notify() with
+ * either notify_offset or notify_port then the peer will be notified.
  */
 int xengntshr_unshare(xengntshr_handle *xgs, void *start_address, uint32_t count);
 
diff --git a/tools/libs/gnttab/linux.c b/tools/libs/gnttab/linux.c
index 8dbdff8..be04295 100644
--- a/tools/libs/gnttab/linux.c
+++ b/tools/libs/gnttab/linux.c
@@ -132,12 +132,14 @@ void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
     if (addr == MAP_FAILED && errno == EAGAIN)
     {
         /*
-         * The grant hypercall can return EAGAIN if the granted page is
-         * swapped out. Since the paging daemon may be in the same domain, the
-         * hypercall cannot block without causing a deadlock.
+         * The grant hypercall can return EAGAIN if the granted page
+         * is swapped out. Since the paging daemon may be in the same
+         * domain, the hypercall cannot block without causing a
+         * deadlock.
          *
-         * Because there are no notificaitons when the page is swapped in, wait
-         * a bit before retrying, and hope that the page will arrive eventually.
+         * Because there are no notifications when the page is swapped
+         * in, wait a bit before retrying, and hope that the page will
+         * arrive eventually.
          */
         usleep(1000);
         goto retry;
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:17:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:17: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 1aONAT-00011a-V4; Wed, 27 Jan 2016 10:17:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAS-00011G-LV
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:41 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	F4/23-08977-34998A65; Wed, 27 Jan 2016 10:17:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1453889694!10753542!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 43071 invoked from network); 27 Jan 2016 10:15:13 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:13 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8e-0001wT-7T
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7l-0001K9-Ra
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:54 +0000
Date: Wed, 27 Jan 2016 10:14:53 +0000
Message-Id: <E1aON7l-0001K9-Ra@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Refactor /dev/xen/gnt{dev,
	shr} wrappers into libxengnttab.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a71ad0feada081b80beb85702e8039bcbc847b73
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 16:20:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:22:27 2016 +0000

    tools: Refactor /dev/xen/gnt{dev,shr} wrappers into libxengnttab.
    
    libxengnttab will provide a stable API and ABI for accessing the
    grant table devices.
    
    The functions are moved into the xengnt{tab,shr} namespace to make a
    clean break from libxc and avoid ambiguity regarding which interfaces
    are stable.
    
    All in-tree users are updated to use the new names.
    
    Upon request (via #define XC_WANT_COMPAT_GNTTAB_API) libxenctrl will
    provide a compat API for the old names. This is used by qemu-xen for
    the time being. qemu-xen-traditional is updated in lockstep.
    
    This leaves a few grant table related functions which go via privcmd
    (GNTTABOP) rather than ioctls on the /dev/xen/gnt* devices in
    libxenctrl. Specifically:
    
      - xc_gnttab_get_version
      - xc_gnttab_map_table_v1
      - xc_gnttab_map_table_v2
      - xc_gnttab_op
    
    These functions do not appear to be needed by qemu-dm, qemu-pv
    (provision of device model to HVM guests and PV backends respectively)
    or by libvchan suggesting they are not needed by non-toolstack uses of
    event channels.
    
    The new library uses a version script to ensure that only expected
    symbols are exported and to version them such that ABI guarantees can
    be kept in the future.
    
    After this change libxenvchan no longer needs to link against
    libxenctrl. It still needs xenctrl.h in one file for xen_mb and
    friends.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- updated MINIOS_UPSTREAM_REVISION and QEMU_TRADITIONAL_REVISION ]
---
 .gitignore                            |    2 +
 Config.mk                             |   12 +-
 stubdom/Makefile                      |   17 ++-
 tools/Makefile                        |    3 +
 tools/Rules.mk                        |   14 ++-
 tools/console/Makefile                |    5 +-
 tools/console/daemon/io.c             |   21 +-
 tools/libs/Makefile                   |    1 +
 tools/libs/evtchn/minios.c            |    5 +-
 tools/libs/gnttab/Makefile            |   73 ++++++++
 tools/libs/gnttab/gntshr_core.c       |   95 ++++++++++
 tools/libs/gnttab/gntshr_unimp.c      |   62 ++++++
 tools/libs/gnttab/gnttab_core.c       |  124 +++++++++++++
 tools/libs/gnttab/gnttab_unimp.c      |   89 +++++++++
 tools/libs/gnttab/include/xengnttab.h |  216 +++++++++++++++++++++
 tools/libs/gnttab/libxengnttab.map    |   23 +++
 tools/libs/gnttab/linux.c             |  329 +++++++++++++++++++++++++++++++++
 tools/libs/gnttab/minios.c            |  117 ++++++++++++
 tools/libs/gnttab/private.h           |   47 +++++
 tools/libvchan/Makefile               |    8 +-
 tools/libvchan/init.c                 |   26 ++--
 tools/libvchan/io.c                   |    8 +-
 tools/libvchan/libxenvchan.h          |    6 +-
 tools/libxc/Makefile                  |   15 +-
 tools/libxc/include/xenctrl.h         |  168 -----------------
 tools/libxc/include/xenctrl_compat.h  |   48 +++++
 tools/libxc/xc_gnttab.c               |   53 ------
 tools/libxc/xc_gnttab_compat.c        |  111 +++++++++++
 tools/libxc/xc_linux_osdep.c          |  280 ----------------------------
 tools/libxc/xc_minios.c               |   73 --------
 tools/libxc/xc_nogntshr.c             |   46 -----
 tools/libxc/xc_nognttab.c             |   50 -----
 tools/libxc/xc_private.c              |   80 --------
 tools/libxc/xc_private.h              |   24 ---
 tools/xenstore/Makefile               |    4 +-
 tools/xenstore/xenstored_core.h       |    4 +-
 tools/xenstore/xenstored_domain.c     |   24 ++--
 tools/xenstore/xenstored_minios.c     |    5 +-
 38 files changed, 1442 insertions(+), 846 deletions(-)

diff --git a/.gitignore b/.gitignore
index 7340a56..ea75fda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -63,6 +63,7 @@ stubdom/ioemu/
 stubdom/libs-*
 stubdom/libxc-*
 stubdom/libxenevtchn-*
+stubdom/libxengnttab-*
 stubdom/libxentoollog-*
 stubdom/lwip-*
 stubdom/lwip/
@@ -89,6 +90,7 @@ config/Stubdom.mk
 config/Docs.mk
 tools/libs/toollog/headers.chk
 tools/libs/evtchn/headers.chk
+tools/libs/gnttab/headers.chk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff --git a/Config.mk b/Config.mk
index e202d3f..d2f22a3 100644
--- a/Config.mk
+++ b/Config.mk
@@ -251,9 +251,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= fb66c855c983aa07644cb179fd9bfe96d55f317d
-# Fri Jan 15 13:24:00 2016 +0000
-# mini-os: Include libxenevtchn with libxc
+MINIOS_UPSTREAM_REVISION ?= 9faa4c3b862291315912b81fe1d4ccca800f530d
+# Fri Jan 15 13:24:01 2016 +0000
+# mini-os: Include libxengnttab with libxc
 
 SEABIOS_UPSTREAM_REVISION ?= 3403ac4313812752be6e6aac35239ca6888a8cab
 # Mon Dec 28 13:50:41 2015 +0100
@@ -262,9 +262,9 @@ SEABIOS_UPSTREAM_REVISION ?= 3403ac4313812752be6e6aac35239ca6888a8cab
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= ca2ff968de42d47dcda8973aa1528a14f99992d3
-# Fri Jan 15 13:23:53 2016 +0000
-# qemu-xen-traditional: Use libxenevtchn
+QEMU_TRADITIONAL_REVISION ?= d8b5666074fdbc4ddba5283d70898a2edd785028
+# Fri Jan 15 13:23:54 2016 +0000
+# qemu-xen-traditional: Use libxengnttab
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 702d66b..2dbf4a8 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -325,6 +325,12 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
 	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/include/*.h include/ && \
 	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/Makefile . )
+	mkdir -p libs-$(XEN_TARGET_ARCH)/gnttab/include
+	[ -h libs-$(XEN_TARGET_ARCH)/gnttab/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/gnttab && \
+	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/*.h . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/include/*.h include/ && \
+	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/*.c . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/Makefile . )
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
@@ -366,12 +372,21 @@ libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: mk-headers-$(XEN_TARGET_ARCH) $(N
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/evtchn
 
 #######
+# libxengnttab
+#######
+
+.PHONY: libxengnttab
+libxengnttab: libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a
+libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/gnttab
+
+#######
 # libxc
 #######
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn libxengnttab cross-zlib
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
diff --git a/tools/Makefile b/tools/Makefile
index 55b5d44..50ccc75 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -250,9 +250,11 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--includedir=$(LIBEXEC_INC) \
 		--source-path=$$source \
 		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
+		-DXC_WANT_COMPAT_GNTTAB_API=1 \
 		-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libs/toollog/include \
 		-I$(XEN_ROOT)/tools/libs/evtchn/include \
+		-I$(XEN_ROOT)/tools/libs/gnttab/include \
 		-I$(XEN_ROOT)/tools/libxc/include \
 		-I$(XEN_ROOT)/tools/xenstore/include \
 		-I$(XEN_ROOT)/tools/xenstore/compat/include \
@@ -261,6 +263,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-L$(XEN_ROOT)/tools/xenstore \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/evtchn \
+		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/gnttab \
 		$(QEMU_UPSTREAM_RPATH)" \
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 0c83e22..379990f 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -12,6 +12,7 @@ INSTALL = $(XEN_ROOT)/tools/cross-install
 XEN_INCLUDE        = $(XEN_ROOT)/tools/include
 XEN_LIBXENTOOLLOG  = $(XEN_ROOT)/tools/libs/toollog
 XEN_LIBXENEVTCHN   = $(XEN_ROOT)/tools/libs/evtchn
+XEN_LIBXENGNTTAB   = $(XEN_ROOT)/tools/libs/gnttab
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_XENLIGHT       = $(XEN_ROOT)/tools/libxl
 XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
@@ -88,8 +89,17 @@ SHDEPS_libxenevtchn =
 LDLIBS_libxenevtchn = $(XEN_LIBXENEVTCHN)/libxenevtchn$(libextension)
 SHLIB_libxenevtchn  = -Wl,-rpath-link=$(XEN_LIBXENEVTCHN)
 
+CFLAGS_libxengnttab = -I$(XEN_LIBXENGNTTAB)/include $(CFLAGS_xeninclude)
+LDLIBS_libxengnttab = $(XEN_LIBXENGNTTAB)/libxengnttab$(libextension)
+SHLIB_libxengnttab  = -Wl,-rpath-link=$(XEN_LIBXENGNTTAB)
+
+# xengntshr_* interfaces are actually part of libxengnttab.so
+CFLAGS_libxengntshr = -I$(XEN_LIBXENGNTTAB)/include $(CFLAGS_xeninclude)
+LDLIBS_libxengntshr = $(XEN_LIBXENGNTTAB)/libxengnttab$(libextension)
+SHLIB_libxengntshr  = -Wl,-rpath-link=$(XEN_LIBXENGNTTAB)
+
 CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_xeninclude)
-SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn)
+SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxengntshr)
 LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libextension)
 SHLIB_libxenctrl  = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_LIBXC)
 
@@ -109,7 +119,7 @@ LDLIBS_libxenstat  = $(SHDEPS_libxenstat) $(XEN_LIBXENSTAT)/libxenstat$(libexten
 SHLIB_libxenstat   = $(SHDEPS_libxenstat) -Wl,-rpath-link=$(XEN_LIBXENSTAT)
 
 CFLAGS_libxenvchan = -I$(XEN_LIBVCHAN)
-SHDEPS_libxenvchan = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenevtchn)
+SHDEPS_libxenvchan = $(SHLIB_libxentoollog) $(SHLIB_libxenstore) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxengntshr)
 LDLIBS_libxenvchan = $(SHDEPS_libxenvchan) $(XEN_LIBVCHAN)/libxenvchan$(libextension)
 SHLIB_libxenvchan  = $(SHDEPS_libxenvchan) -Wl,-rpath-link=$(XEN_LIBVCHAN)
 
diff --git a/tools/console/Makefile b/tools/console/Makefile
index 4b3a492..6eeac8f 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -3,10 +3,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 CFLAGS  += -Werror
 
-CFLAGS  += $(CFLAGS_libxenevtchn)
 CFLAGS  += $(CFLAGS_libxenctrl)
 CFLAGS  += $(CFLAGS_libxenstore)
-LDLIBS += $(LDLIBS_libxenevtchn)
 LDLIBS += $(LDLIBS_libxenctrl)
 LDLIBS += $(LDLIBS_libxenstore)
 LDLIBS += $(SOCKET_LIBS)
@@ -28,8 +26,9 @@ clean:
 .PHONY: distclean
 distclean: clean
 
+daemon/io.o: CFLAGS += $(CFLAGS_libxenevtchn) $(CFLAGS_libxengnttab)
 xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
-	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
 
 xenconsole: client/_paths.h $(patsubst %.c,%.o,$(wildcard client/*.c))
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsole) $(APPEND_LDFLAGS)
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index 2f2e9c5..e2e7a6b 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -22,6 +22,7 @@
 #include "utils.h"
 #include "io.h"
 #include <xenevtchn.h>
+#include <xengnttab.h>
 #include <xenstore.h>
 #include <xen/io/console.h>
 #include <xen/grant_table.h>
@@ -72,7 +73,7 @@ static int log_time_hv_needts = 1;
 static int log_time_guest_needts = 1;
 static int log_hv_fd = -1;
 
-static xc_gnttab *xcg_handle = NULL;
+static xengnttab_handle *xgt_handle = NULL;
 
 static struct pollfd  *fds;
 static unsigned int current_array_size;
@@ -520,8 +521,8 @@ static void domain_unmap_interface(struct domain *dom)
 {
 	if (dom->interface == NULL)
 		return;
-	if (xcg_handle && dom->ring_ref == -1)
-		xc_gnttab_munmap(xcg_handle, dom->interface, 1);
+	if (xgt_handle && dom->ring_ref == -1)
+		xengnttab_unmap(xgt_handle, dom->interface, 1);
 	else
 		munmap(dom->interface, XC_PAGE_SIZE);
 	dom->interface = NULL;
@@ -552,9 +553,9 @@ static int domain_create_ring(struct domain *dom)
 	if (ring_ref != dom->ring_ref && dom->ring_ref != -1)
 		domain_unmap_interface(dom);
 
-	if (!dom->interface && xcg_handle) {
+	if (!dom->interface && xgt_handle) {
 		/* Prefer using grant table */
-		dom->interface = xc_gnttab_map_grant_ref(xcg_handle,
+		dom->interface = xengnttab_map_grant_ref(xgt_handle,
 			dom->domid, GNTTAB_RESERVED_CONSOLE,
 			PROT_READ|PROT_WRITE);
 		dom->ring_ref = -1;
@@ -1029,8 +1030,8 @@ void handle_io(void)
 		handle_hv_logs(xce_handle, true);
 	}
 
-	xcg_handle = xc_gnttab_open(NULL, 0);
-	if (xcg_handle == NULL) {
+	xgt_handle = xengnttab_open(NULL, 0);
+	if (xgt_handle == NULL) {
 		dolog(LOG_DEBUG, "Failed to open xcg handle: %d (%s)",
 		      errno, strerror(errno));
 	}
@@ -1206,9 +1207,9 @@ void handle_io(void)
 		xenevtchn_close(xce_handle);
 		xce_handle = NULL;
 	}
-	if (xcg_handle != NULL) {
-		xc_gnttab_close(xcg_handle);
-		xcg_handle = NULL;
+	if (xgt_handle != NULL) {
+		xengnttab_close(xgt_handle);
+		xgt_handle = NULL;
 	}
 	log_hv_evtchn = -1;
 }
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index 0e3f523..00156ae 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -4,5 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 SUBDIRS-y :=
 SUBDIRS-y += toollog
 SUBDIRS-y += evtchn
+SUBDIRS-y += gnttab
 
 all clean install distclean: %: subdirs-%
diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
index fb913a2..b839cd0 100644
--- a/tools/libs/evtchn/minios.c
+++ b/tools/libs/evtchn/minios.c
@@ -27,13 +27,12 @@
 #include <mini-os/events.h>
 #include <mini-os/wait.h>
 
-#include <sys/socket.h>
-
 #include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdint.h>
+#include <unistd.h>
 #include <inttypes.h>
 #include <malloc.h>
 
@@ -43,8 +42,6 @@ extern void minios_evtchn_close_fd(int fd);
 
 extern struct wait_queue_head event_queue;
 
-//void minios_evtchn_close_fd(int fd);
-
 /* XXX Note: This is not threadsafe */
 static struct evtchn_port_info* port_alloc(int fd) {
     struct evtchn_port_info *port_info;
diff --git a/tools/libs/gnttab/Makefile b/tools/libs/gnttab/Makefile
new file mode 100644
index 0000000..af64542
--- /dev/null
+++ b/tools/libs/gnttab/Makefile
@@ -0,0 +1,73 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR    = 1
+MINOR    = 0
+SHLIB_LDFLAGS += -Wl,--version-script=libxengnttab.map
+
+CFLAGS   += -Werror -Wmissing-prototypes
+CFLAGS   += -I./include $(CFLAGS_xeninclude)
+CFLAGS   += $(CFLAGS_libxentoollog)
+
+SRCS-GNTTAB            += gnttab_core.c
+SRCS-GNTSHR            += gntshr_core.c
+
+SRCS-$(CONFIG_Linux)   += $(SRCS-GNTTAB) $(SRCS-GNTSHR) linux.c
+SRCS-$(CONFIG_MiniOS)  += $(SRCS-GNTTAB) gntshr_unimp.c minios.c
+SRCS-$(CONFIG_FreeBSD) += gnttab_unimp.c gntshr_unimp.c
+SRCS-$(CONFIG_SunOS)   += gnttab_unimp.c gntshr_unimp.c
+SRCS-$(CONFIG_NetBSD)  += gnttab_unimp.c gntshr_unimp.c
+
+LIB_OBJS := $(patsubst %.c,%.o,$(SRCS-y))
+PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS-y))
+
+LIB := libxengnttab.a
+ifneq ($(nosharedlibs),y)
+LIB += libxengnttab.so
+endif
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build:
+	$(MAKE) libs
+
+.PHONY: libs
+libs: headers.chk $(LIB)
+
+headers.chk: $(wildcard include/*.h)
+
+libxengnttab.a: $(LIB_OBJS)
+	$(AR) rc $@ $^
+
+libxengnttab.so: libxengnttab.so.$(MAJOR)
+	$(SYMLINK_SHLIB) $< $@
+libxengnttab.so.$(MAJOR): libxengnttab.so.$(MAJOR).$(MINOR)
+	$(SYMLINK_SHLIB) $< $@
+
+libxengnttab.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxengnttab.map
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxengnttab.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: build
+	$(INSTALL_DIR) $(DESTDIR)$(libdir)
+	$(INSTALL_DIR) $(DESTDIR)$(includedir)
+	$(INSTALL_SHLIB) libxengnttab.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) libxengnttab.a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) libxengnttab.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxengnttab.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxengnttab.so.$(MAJOR) $(DESTDIR)$(libdir)/libxengnttab.so
+	$(INSTALL_DATA) include/xengnttab.h $(DESTDIR)$(includedir)
+
+.PHONY: TAGS
+TAGS:
+	etags -t *.c *.h
+
+.PHONY: clean
+clean:
+	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -f libxengnttab.so.$(MAJOR).$(MINOR) libxengnttab.so.$(MAJOR)
+	rm -f headers.chk
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/libs/gnttab/gntshr_core.c b/tools/libs/gnttab/gntshr_core.c
new file mode 100644
index 0000000..7f6bf9d
--- /dev/null
+++ b/tools/libs/gnttab/gntshr_core.c
@@ -0,0 +1,95 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_gnttab.c
+ */
+
+#include <stdlib.h>
+
+#include "private.h"
+
+xengntshr_handle *xengntshr_open(xentoollog_logger *logger, unsigned open_flags)
+{
+    xengntshr_handle *xgs = malloc(sizeof(*xgs));
+    int rc;
+
+    if (!xgs) return NULL;
+
+    xgs->fd = -1;
+    xgs->logger = logger;
+    xgs->logger_tofree  = NULL;
+
+    if (!xgs->logger) {
+        xgs->logger = xgs->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xgs->logger) goto err;
+    }
+
+    rc = osdep_gntshr_open(xgs);
+    if ( rc  < 0 ) goto err;
+
+    return xgs;
+
+err:
+    osdep_gntshr_close(xgs);
+    xtl_logger_destroy(xgs->logger_tofree);
+    free(xgs);
+    return NULL;
+}
+
+int xengntshr_close(xengntshr_handle *xgs)
+{
+    int rc;
+
+    if ( !xgs )
+        return 0;
+
+    rc = osdep_gntshr_close(xgs);
+    xtl_logger_destroy(xgs->logger_tofree);
+    free(xgs);
+    return rc;
+}
+void *xengntshr_share_pages(xengntshr_handle *xcg, uint32_t domid,
+                            int count, uint32_t *refs, int writable)
+{
+    return osdep_gntshr_share_pages(xcg, domid, count, refs, writable, -1, -1);
+}
+
+void *xengntshr_share_page_notify(xengntshr_handle *xcg, uint32_t domid,
+                                  uint32_t *ref, int writable,
+                                  uint32_t notify_offset,
+                                  evtchn_port_t notify_port)
+{
+    return osdep_gntshr_share_pages(xcg, domid, 1, ref, writable,
+                                    notify_offset, notify_port);
+}
+
+int xengntshr_unshare(xengntshr_handle *xgs, void *start_address, uint32_t count)
+{
+    return osdep_gntshr_unshare(xgs, start_address, count);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/gntshr_unimp.c b/tools/libs/gnttab/gntshr_unimp.c
new file mode 100644
index 0000000..e210484
--- /dev/null
+++ b/tools/libs/gnttab/gntshr_unimp.c
@@ -0,0 +1,62 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_gnttab.c
+ */
+
+#include <stdlib.h>
+
+#include "private.h"
+
+xengntshr_handle *xengntshr_open(xentoollog_logger *logger, unsigned open_flags)
+{
+    return NULL;
+}
+
+int xengntshr_close(xengntshr_handle *xgs)
+{
+    return 0;
+}
+
+void *xengntshr_share_pages(xengntshr_handle *xcg, uint32_t domid,
+                            int count, uint32_t *refs, int writable)
+{
+    abort();
+}
+
+void *xengntshr_share_page_notify(xengntshr_handle *xcg, uint32_t domid,
+                                  uint32_t *ref, int writable,
+                                  uint32_t notify_offset,
+                                  evtchn_port_t notify_port)
+{
+    abort();
+}
+
+int xengntshr_unshare(xengntshr_handle *xgs, void *start_address, uint32_t count)
+{
+    abort();
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/gnttab_core.c b/tools/libs/gnttab/gnttab_core.c
new file mode 100644
index 0000000..5d0474d
--- /dev/null
+++ b/tools/libs/gnttab/gnttab_core.c
@@ -0,0 +1,124 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_gnttab.c
+ */
+
+#include <stdlib.h>
+
+#include "private.h"
+
+xengnttab_handle *xengnttab_open(xentoollog_logger *logger, unsigned open_flags)
+{
+    xengnttab_handle *xgt = malloc(sizeof(*xgt));
+    int rc;
+
+    if (!xgt) return NULL;
+
+    xgt->fd = -1;
+    xgt->logger = logger;
+    xgt->logger_tofree  = NULL;
+
+    if (!xgt->logger) {
+        xgt->logger = xgt->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xgt->logger) goto err;
+    }
+
+    rc = osdep_gnttab_open(xgt);
+    if ( rc  < 0 ) goto err;
+
+    return xgt;
+
+err:
+    osdep_gnttab_close(xgt);
+    xtl_logger_destroy(xgt->logger_tofree);
+    free(xgt);
+    return NULL;
+}
+
+int xengnttab_close(xengnttab_handle *xgt)
+{
+    int rc;
+
+    if ( !xgt )
+        return 0;
+
+    rc = osdep_gnttab_close(xgt);
+    xtl_logger_destroy(xgt->logger_tofree);
+    free(xgt);
+    return rc;
+}
+
+int xengnttab_set_max_grants(xengnttab_handle *xgt, uint32_t count)
+{
+    return osdep_gnttab_set_max_grants(xgt, count);
+}
+
+void *xengnttab_map_grant_ref(xengnttab_handle *xgt,
+                              uint32_t domid,
+                              uint32_t ref,
+                              int prot)
+{
+    return osdep_gnttab_grant_map(xgt, 1, 0, prot, &domid, &ref, -1, -1);
+}
+
+void *xengnttab_map_grant_refs(xengnttab_handle *xgt,
+                               uint32_t count,
+                               uint32_t *domids,
+                               uint32_t *refs,
+                               int prot)
+{
+    return osdep_gnttab_grant_map(xgt, count, 0, prot, domids, refs, -1, -1);
+}
+
+void *xengnttab_map_domain_grant_refs(xengnttab_handle *xgt,
+                                      uint32_t count,
+                                      uint32_t domid,
+                                      uint32_t *refs,
+                                      int prot)
+{
+    return osdep_gnttab_grant_map(xgt, count, XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN,
+                                  prot, &domid, refs, -1, -1);
+}
+
+void *xengnttab_map_grant_ref_notify(xengnttab_handle *xgt,
+                                     uint32_t domid,
+                                     uint32_t ref,
+                                     int prot,
+                                     uint32_t notify_offset,
+                                     evtchn_port_t notify_port)
+{
+    return osdep_gnttab_grant_map(xgt, 1, 0, prot,  &domid, &ref,
+                                  notify_offset, notify_port);
+}
+
+int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count)
+{
+    return osdep_gnttab_unmap(xgt, start_address, count);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/gnttab_unimp.c b/tools/libs/gnttab/gnttab_unimp.c
new file mode 100644
index 0000000..b3a4a20
--- /dev/null
+++ b/tools/libs/gnttab/gnttab_unimp.c
@@ -0,0 +1,89 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_gnttab.c
+ */
+
+#include <stdlib.h>
+
+#include "private.h"
+
+xengnttab_handle *xengnttab_open(xentoollog_logger *logger, unsigned open_flags)
+{
+    return NULL;
+}
+
+int xengnttab_close(xengnttab_handle *xgt)
+{
+    return 0;
+}
+
+int xengnttab_set_max_grants(xengnttab_handle *xgt, uint32_t count)
+{
+    abort();
+}
+
+void *xengnttab_map_grant_ref(xengnttab_handle *xgt,
+                              uint32_t domid,
+                              uint32_t ref,
+                              int prot)
+{
+    abort();
+}
+
+void *xengnttab_map_grant_refs(xengnttab_handle *xgt,
+                               uint32_t count,
+                               uint32_t *domids,
+                               uint32_t *refs,
+                               int prot)
+{
+    abort();
+}
+
+void *xengnttab_map_domain_grant_refs(xengnttab_handle *xgt,
+                                      uint32_t count,
+                                      uint32_t domid,
+                                      uint32_t *refs,
+                                      int prot)
+{
+    abort();
+}
+
+void *xengnttab_map_grant_ref_notify(xengnttab_handle *xgt,
+                                     uint32_t domid,
+                                     uint32_t ref,
+                                     int prot,
+                                     uint32_t notify_offset,
+                                     evtchn_port_t notify_port)
+{
+    abort();
+}
+
+int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count)
+{
+    abort();
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/include/xengnttab.h b/tools/libs/gnttab/include/xengnttab.h
new file mode 100644
index 0000000..700a5f1
--- /dev/null
+++ b/tools/libs/gnttab/include/xengnttab.h
@@ -0,0 +1,216 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split off from:
+ * xenctrl.h
+ *
+ * A library for low-level access to the Xen control interfaces.
+ *
+ * Copyright (c) 2007-2008, D G Murray <Derek.Murray@cl.cam.ac.uk>
+ */
+#ifndef XENGNTTAB_H
+#define XENGNTTAB_H
+
+#include <stdint.h>
+
+#include <xen/grant_table.h>
+#include <xen/event_channel.h>
+
+/* Callers who don't care don't need to #include <xentoollog.h> */
+typedef struct xentoollog_logger xentoollog_logger;
+
+/*
+ * Grant Table Interface (making use of grants from other domains)
+ */
+
+typedef struct xengntdev_handle xengnttab_handle;
+
+/*
+ * Note:
+ * After fork a child process must not use any opened xc gnttab
+ * handle inherited from their parent. They must open a new handle if
+ * they want to interact with xc.
+ *
+ * Return an fd onto the grant table driver.  Logs errors.
+ */
+xengnttab_handle *xengnttab_open(xentoollog_logger *logger, unsigned open_flags);
+
+/*
+ * Close a handle previously allocated with xengnttab_open().
+ * Never logs errors.
+ */
+int xengnttab_close(xengnttab_handle *xgt);
+
+/*
+ * Memory maps a grant reference from one domain to a local address range.
+ * Mappings should be unmapped with xengnttab_unmap.  Logs errors.
+ *
+ * @parm xgt a handle on an open grant table interface
+ * @parm domid the domain to map memory from
+ * @parm ref the grant reference ID to map
+ * @parm prot same flag as in mmap()
+ */
+void *xengnttab_map_grant_ref(xengnttab_handle *xgt,
+                              uint32_t domid,
+                              uint32_t ref,
+                              int prot);
+
+/**
+ * Memory maps one or more grant references from one or more domains to a
+ * contiguous local address range. Mappings should be unmapped with
+ * xengnttab_unmap.  Logs errors.
+ *
+ * @parm xgt a handle on an open grant table interface
+ * @parm count the number of grant references to be mapped
+ * @parm domids an array of @count domain IDs by which the corresponding @refs
+ *              were granted
+ * @parm refs an array of @count grant references to be mapped
+ * @parm prot same flag as in mmap()
+ */
+void *xengnttab_map_grant_refs(xengnttab_handle *xgt,
+                               uint32_t count,
+                               uint32_t *domids,
+                               uint32_t *refs,
+                               int prot);
+
+/**
+ * Memory maps one or more grant references from one domain to a
+ * contiguous local address range. Mappings should be unmapped with
+ * xengnttab_unmap.  Logs errors.
+ *
+ * @parm xgt a handle on an open grant table interface
+ * @parm count the number of grant references to be mapped
+ * @parm domid the domain to map memory from
+ * @parm refs an array of @count grant references to be mapped
+ * @parm prot same flag as in mmap()
+ */
+void *xengnttab_map_domain_grant_refs(xengnttab_handle *xgt,
+                                      uint32_t count,
+                                      uint32_t domid,
+                                      uint32_t *refs,
+                                      int prot);
+
+/**
+ * Memory maps a grant reference from one domain to a local address range.
+ * Mappings should be unmapped with xengnttab_unmap. If notify_offset or
+ * notify_port are not -1, this version will attempt to set up an unmap
+ * notification at the given offset and event channel. When the page is
+ * unmapped, the byte at the given offset will be zeroed and a wakeup will be
+ * sent to the given event channel.  Logs errors.
+ *
+ * @parm xgt a handle on an open grant table interface
+ * @parm domid the domain to map memory from
+ * @parm ref the grant reference ID to map
+ * @parm prot same flag as in mmap()
+ * @parm notify_offset The byte offset in the page to use for unmap
+ *                     notification; -1 for none.
+ * @parm notify_port The event channel port to use for unmap notify, or -1
+ */
+void *xengnttab_map_grant_ref_notify(xengnttab_handle *xgt,
+                                     uint32_t domid,
+                                     uint32_t ref,
+                                     int prot,
+                                     uint32_t notify_offset,
+                                     evtchn_port_t notify_port);
+
+/*
+ * Unmaps the @count pages starting at @start_address, which were mapped by a
+ * call to xengnttab_map_grant_ref or xengnttab_map_grant_refs. Never logs.
+ */
+int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count);
+
+/*
+ * Sets the maximum number of grants that may be mapped by the given instance
+ * to @count.  Never logs.
+ *
+ * N.B. This function must be called after opening the handle, and before any
+ *      other functions are invoked on it.
+ *
+ * N.B. When variable-length grants are mapped, fragmentation may be observed,
+ *      and it may not be possible to satisfy requests up to the maximum number
+ *      of grants.
+ */
+int xengnttab_set_max_grants(xengnttab_handle *xgt,
+			     uint32_t count);
+
+/*
+ * Grant Sharing Interface (allocating and granting pages)
+ */
+
+typedef struct xengntdev_handle xengntshr_handle;
+
+/*
+ * Return an fd onto the grant sharing driver.  Logs errors.
+ *
+ * Note:
+ * After fork a child process must not use any opened xc gntshr
+ * handle inherited from their parent. They must open a new handle if
+ * they want to interact with xc.
+ *
+ */
+xengntshr_handle *xengntshr_open(xentoollog_logger *logger,
+			  unsigned open_flags);
+
+/*
+ * Close a handle previously allocated with xengntshr_open().
+ * Never logs errors.
+ */
+int xengntshr_close(xengntshr_handle *xgs);
+
+/*
+ * Creates and shares pages with another domain.
+ *
+ * @parm xgs a handle to an open grant sharing instance
+ * @parm domid the domain to share memory with
+ * @parm count the number of pages to share
+ * @parm refs the grant references of the pages (output)
+ * @parm writable true if the other domain can write to the pages
+ * @return local mapping of the pages
+ */
+void *xengntshr_share_pages(xengntshr_handle *xgs, uint32_t domid,
+                            int count, uint32_t *refs, int writable);
+
+/*
+ * Creates and shares a page with another domain, with unmap notification.
+ *
+ * @parm xgs a handle to an open grant sharing instance
+ * @parm domid the domain to share memory with
+ * @parm refs the grant reference of the pages (output)
+ * @parm writable true if the other domain can write to the page
+ * @parm notify_offset The byte offset in the page to use for unmap
+ *                     notification; -1 for none.
+ * @parm notify_port The event channel port to use for unmap notify, or -1
+ * @return local mapping of the page
+ */
+void *xengntshr_share_page_notify(xengntshr_handle *xgs, uint32_t domid,
+                                  uint32_t *ref, int writable,
+                                  uint32_t notify_offset,
+                                  evtchn_port_t notify_port);
+/*
+ * Unmaps the @count pages starting at @start_address, which were mapped by a
+ * call to xengntshr_share_*. Never logs.
+ */
+int xengntshr_unshare(xengntshr_handle *xgs, void *start_address, uint32_t count);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/libxengnttab.map b/tools/libs/gnttab/libxengnttab.map
new file mode 100644
index 0000000..dc737ac
--- /dev/null
+++ b/tools/libs/gnttab/libxengnttab.map
@@ -0,0 +1,23 @@
+VERS_1.0 {
+	global:
+		xengnttab_open;
+		xengnttab_close;
+
+		xengnttab_set_max_grants;
+
+		xengnttab_map_domain_grant_refs;
+		xengnttab_map_grant_ref;
+		xengnttab_map_grant_ref_notify;
+		xengnttab_map_grant_refs;
+
+		xengnttab_unmap;
+
+		xengntshr_open;
+		xengntshr_close;
+
+		xengntshr_share_page_notify;
+		xengntshr_share_pages;
+
+		xengntshr_unshare;
+	local: *; /* Do not expose anything by default */
+};
diff --git a/tools/libs/gnttab/linux.c b/tools/libs/gnttab/linux.c
new file mode 100644
index 0000000..768119a
--- /dev/null
+++ b/tools/libs/gnttab/linux.c
@@ -0,0 +1,329 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_linux_osdep.c
+ */
+
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+
+#include <xen/sys/gntdev.h>
+#include <xen/sys/gntalloc.h>
+
+#include "private.h"
+
+#define DEVXEN "/dev/xen/"
+
+#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
+
+#define GTERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gnttab", _f)
+#define GSERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gntshr", _f)
+
+#define PAGE_SHIFT           12
+#define PAGE_SIZE            (1UL << PAGE_SHIFT)
+#define PAGE_MASK            (~(PAGE_SIZE-1))
+
+int osdep_gnttab_open(xengnttab_handle *xgt)
+{
+    int fd = open(DEVXEN "gntdev", O_RDWR);
+    if ( fd == -1 )
+        return -1;
+    xgt->fd = fd;
+    return 0;
+}
+
+int osdep_gnttab_close(xengnttab_handle *xgt)
+{
+    if ( xgt->fd == -1 )
+        return 0;
+
+    return close(xgt->fd);
+}
+
+int osdep_gnttab_set_max_grants(xengnttab_handle *xgt, uint32_t count)
+{
+    int fd = xgt->fd, rc;
+    struct ioctl_gntdev_set_max_grants max_grants = { .count = count };
+
+    rc = ioctl(fd, IOCTL_GNTDEV_SET_MAX_GRANTS, &max_grants);
+    if (rc) {
+        /*
+         * Newer (e.g. pv-ops) kernels don't implement this IOCTL,
+         * so ignore the resulting specific failure.
+         */
+        if (errno == ENOTTY)
+            rc = 0;
+        else
+            GTERROR(xgt->logger, "ioctl SET_MAX_GRANTS failed");
+    }
+
+    return rc;
+}
+
+void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port)
+{
+    int fd = xgt->fd;
+    struct ioctl_gntdev_map_grant_ref *map;
+    unsigned int map_size = ROUNDUP((sizeof(*map) + (count - 1) *
+                                    sizeof(struct ioctl_gntdev_map_grant_ref)),
+                                    PAGE_SHIFT);
+    void *addr = NULL;
+    int domids_stride = 1;
+    int i;
+
+    if (flags & XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN)
+        domids_stride = 0;
+
+    if ( map_size <= PAGE_SIZE )
+        map = alloca(sizeof(*map) +
+                     (count - 1) * sizeof(struct ioctl_gntdev_map_grant_ref));
+    else
+    {
+        map = mmap(NULL, map_size, PROT_READ | PROT_WRITE,
+                   MAP_PRIVATE | MAP_ANON | MAP_POPULATE, -1, 0);
+        if ( map == MAP_FAILED )
+        {
+            GTERROR(xgt->logger, "mmap of map failed");
+            return NULL;
+        }
+    }
+
+    for ( i = 0; i < count; i++ )
+    {
+        map->refs[i].domid = domids[i * domids_stride];
+        map->refs[i].ref = refs[i];
+    }
+
+    map->count = count;
+
+    if ( ioctl(fd, IOCTL_GNTDEV_MAP_GRANT_REF, map) ) {
+        GTERROR(xgt->logger, "ioctl MAP_GRANT_REF failed");
+        goto out;
+    }
+
+ retry:
+    addr = mmap(NULL, PAGE_SIZE * count, prot, MAP_SHARED, fd,
+                map->index);
+
+    if (addr == MAP_FAILED && errno == EAGAIN)
+    {
+        /*
+         * The grant hypercall can return EAGAIN if the granted page is
+         * swapped out. Since the paging daemon may be in the same domain, the
+         * hypercall cannot block without causing a deadlock.
+         *
+         * Because there are no notificaitons when the page is swapped in, wait
+         * a bit before retrying, and hope that the page will arrive eventually.
+         */
+        usleep(1000);
+        goto retry;
+    }
+
+    if (addr != MAP_FAILED)
+    {
+        int rv = 0;
+        struct ioctl_gntdev_unmap_notify notify;
+        notify.index = map->index;
+        notify.action = 0;
+        if (notify_offset < PAGE_SIZE * count) {
+            notify.index += notify_offset;
+            notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
+        }
+        if (notify_port != -1) {
+            notify.event_channel_port = notify_port;
+            notify.action |= UNMAP_NOTIFY_SEND_EVENT;
+        }
+        if (notify.action)
+            rv = ioctl(fd, IOCTL_GNTDEV_SET_UNMAP_NOTIFY, &notify);
+        if (rv) {
+            GTERROR(xgt->logger, "ioctl SET_UNMAP_NOTIFY failed");
+            munmap(addr, count * PAGE_SIZE);
+            addr = MAP_FAILED;
+        }
+    }
+
+    if (addr == MAP_FAILED)
+    {
+        int saved_errno = errno;
+        struct ioctl_gntdev_unmap_grant_ref unmap_grant;
+
+        /* Unmap the driver slots used to store the grant information. */
+        GTERROR(xgt->logger, "mmap failed");
+        unmap_grant.index = map->index;
+        unmap_grant.count = count;
+        ioctl(fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant);
+        errno = saved_errno;
+        addr = NULL;
+    }
+
+ out:
+    if ( map_size > PAGE_SIZE )
+        munmap(map, map_size);
+
+    return addr;
+}
+
+int osdep_gnttab_unmap(xengnttab_handle *xgt,
+                       void *start_address,
+                       uint32_t count)
+{
+    int fd = xgt->fd;
+    struct ioctl_gntdev_get_offset_for_vaddr get_offset;
+    struct ioctl_gntdev_unmap_grant_ref unmap_grant;
+    int rc;
+
+    if ( start_address == NULL )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+
+    /* First, it is necessary to get the offset which was initially used to
+     * mmap() the pages.
+     */
+    get_offset.vaddr = (unsigned long)start_address;
+    if ( (rc = ioctl(fd, IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR,
+                     &get_offset)) )
+        return rc;
+
+    if ( get_offset.count != count )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+
+    /* Next, unmap the memory. */
+    if ( (rc = munmap(start_address, count * PAGE_SIZE)) )
+        return rc;
+
+    /* Finally, unmap the driver slots used to store the grant information. */
+    unmap_grant.index = get_offset.offset;
+    unmap_grant.count = count;
+    if ( (rc = ioctl(fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant)) )
+        return rc;
+
+    return 0;
+}
+
+int osdep_gntshr_open(xengntshr_handle *xgs)
+{
+    int fd = open(DEVXEN "gntalloc", O_RDWR);
+    if ( fd == -1 )
+        return -1;
+    xgs->fd = fd;
+    return 0;
+}
+
+int osdep_gntshr_close(xengntshr_handle *xgs)
+{
+    if ( xgs->fd == -1 )
+        return 0;
+
+    return close(xgs->fd);
+}
+
+void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
+                               uint32_t domid, int count,
+                               uint32_t *refs, int writable,
+                               uint32_t notify_offset,
+                               evtchn_port_t notify_port)
+{
+    struct ioctl_gntalloc_alloc_gref *gref_info = NULL;
+    struct ioctl_gntalloc_unmap_notify notify;
+    struct ioctl_gntalloc_dealloc_gref gref_drop;
+    int fd = xgs->fd;
+    int err;
+    void *area = NULL;
+    gref_info = malloc(sizeof(*gref_info) + count * sizeof(uint32_t));
+    if (!gref_info)
+        return NULL;
+    gref_info->domid = domid;
+    gref_info->flags = writable ? GNTALLOC_FLAG_WRITABLE : 0;
+    gref_info->count = count;
+
+    err = ioctl(fd, IOCTL_GNTALLOC_ALLOC_GREF, gref_info);
+    if (err) {
+        GSERROR(xgs->logger, "ioctl failed");
+        goto out;
+    }
+
+    area = mmap(NULL, count * PAGE_SIZE, PROT_READ | PROT_WRITE,
+        MAP_SHARED, fd, gref_info->index);
+
+    if (area == MAP_FAILED) {
+        area = NULL;
+        GSERROR(xgs->logger, "mmap failed");
+        goto out_remove_fdmap;
+    }
+
+    notify.index = gref_info->index;
+    notify.action = 0;
+    if (notify_offset < PAGE_SIZE * count) {
+        notify.index += notify_offset;
+        notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
+    }
+    if (notify_port != -1) {
+        notify.event_channel_port = notify_port;
+        notify.action |= UNMAP_NOTIFY_SEND_EVENT;
+    }
+    if (notify.action)
+        err = ioctl(fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &notify);
+    if (err) {
+        GSERROR(xgs->logger, "ioctl SET_UNMAP_NOTIFY failed");
+		munmap(area, count * PAGE_SIZE);
+		area = NULL;
+	}
+
+    memcpy(refs, gref_info->gref_ids, count * sizeof(uint32_t));
+
+ out_remove_fdmap:
+    /* Removing the mapping from the file descriptor does not cause the pages to
+     * be deallocated until the mapping is removed.
+     */
+    gref_drop.index = gref_info->index;
+    gref_drop.count = count;
+    ioctl(fd, IOCTL_GNTALLOC_DEALLOC_GREF, &gref_drop);
+ out:
+    free(gref_info);
+    return area;
+}
+
+int osdep_gntshr_unshare(xengntshr_handle *xgs,
+                         void *start_address, uint32_t count)
+{
+    return munmap(start_address, count * PAGE_SIZE);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/minios.c b/tools/libs/gnttab/minios.c
new file mode 100644
index 0000000..7e04174
--- /dev/null
+++ b/tools/libs/gnttab/minios.c
@@ -0,0 +1,117 @@
+/*
+ *
+ * Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.com>.
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Splitfrom xc_minios.c
+ */
+
+#include <mini-os/types.h>
+#include <mini-os/os.h>
+#include <mini-os/lib.h>
+
+#include <mini-os/gntmap.h>
+#include <sys/mman.h>
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "private.h"
+
+void minios_gnttab_close_fd(int fd);
+
+int osdep_gnttab_open(xengnttab_handle *xgt)
+{
+    int fd = alloc_fd(FTYPE_GNTMAP);
+    if ( fd == -1 )
+        return -1;
+    gntmap_init(&files[fd].gntmap);
+    xgt->fd = fd;
+    return 0;
+}
+
+int osdep_gnttab_close(xengnttab_handle *xgt)
+{
+    if ( xgt->fd == -1 )
+        return 0;
+
+    return close(xgt->fd);
+}
+
+void minios_gnttab_close_fd(int fd)
+{
+    gntmap_fini(&files[fd].gntmap);
+    files[fd].type = FTYPE_NONE;
+}
+
+void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port)
+{
+    int fd = xgt->fd;
+    int stride = 1;
+    if (flags & XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN)
+        stride = 0;
+    if (notify_offset != -1 || notify_port != -1) {
+        errno = ENOSYS;
+        return NULL;
+    }
+    return gntmap_map_grant_refs(&files[fd].gntmap,
+                                 count, domids, stride,
+                                 refs, prot & PROT_WRITE);
+}
+
+int osdep_gnttab_unmap(xengnttab_handle *xgt,
+                       void *start_address,
+                       uint32_t count)
+{
+    int fd = xgt->fd;
+    int ret;
+    ret = gntmap_munmap(&files[fd].gntmap,
+                        (unsigned long) start_address,
+                        count);
+    if (ret < 0) {
+        errno = -ret;
+        return -1;
+    }
+    return ret;
+}
+
+int osdep_gnttab_set_max_grants(xengnttab_handle *xgt, uint32_t count)
+{
+    int fd = xgt->fd;
+    int ret;
+    ret = gntmap_set_max_grants(&files[fd].gntmap,
+                                count);
+    if (ret < 0) {
+        errno = -ret;
+        return -1;
+    }
+    return ret;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/private.h b/tools/libs/gnttab/private.h
new file mode 100644
index 0000000..d286c86
--- /dev/null
+++ b/tools/libs/gnttab/private.h
@@ -0,0 +1,47 @@
+#ifndef XENGNTTAB_PRIVATE_H
+#define XENGNTTAB_PRIVATE_H
+
+#include <xentoollog.h>
+#include <xengnttab.h>
+
+struct xengntdev_handle {
+    xentoollog_logger *logger, *logger_tofree;
+    int fd;
+};
+
+int osdep_gnttab_open(xengnttab_handle *xgt);
+int osdep_gnttab_close(xengnttab_handle *xgt);
+
+int osdep_gnttab_set_max_grants(xengnttab_handle *xgt, uint32_t count);
+
+#define XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN 0x1
+void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port);
+int osdep_gnttab_unmap(xengnttab_handle *xgt,
+                       void *start_address,
+                       uint32_t count);
+int osdep_gntshr_open(xengntshr_handle *xgs);
+int osdep_gntshr_close(xengntshr_handle *xgs);
+
+void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
+                               uint32_t domid, int count,
+                               uint32_t *refs, int writable,
+                               uint32_t notify_offset,
+                               evtchn_port_t notify_port);
+int osdep_gntshr_unshare(xengntshr_handle *xgs,
+                         void *start_address, uint32_t count);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libvchan/Makefile b/tools/libvchan/Makefile
index 84128a3..0573d2f 100644
--- a/tools/libvchan/Makefile
+++ b/tools/libvchan/Makefile
@@ -10,15 +10,17 @@ NODE_OBJS = node.o
 NODE2_OBJS = node-select.o
 
 LIBVCHAN_PIC_OBJS = $(patsubst %.o,%.opic,$(LIBVCHAN_OBJS))
-LIBVCHAN_LIBS = $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenevtchn)
-$(LIBVCHAN_OBJS) $(LIBVCHAN_PIC_OBJS): CFLAGS += $(CFLAGS_libxenstore) $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn)
-$(NODE_OBJS) $(NODE2_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn)
+LIBVCHAN_LIBS = $(LDLIBS_libxenstore) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(LDLIBS_libxenevtchn)
+$(LIBVCHAN_OBJS) $(LIBVCHAN_PIC_OBJS): CFLAGS += $(CFLAGS_libxenstore) $(CFLAGS_libxengnttab) $(CFLAGS_libxengntshr) $(CFLAGS_libxenevtchn)
+$(NODE_OBJS) $(NODE2_OBJS): CFLAGS += $(CFLAGS_libxengnttab) $(CFLAGS_libxengntshr) $(CFLAGS_libxenevtchn)
 
 MAJOR = 1.0
 MINOR = 0
 
 CFLAGS += -I../include -I.
 
+io.o io.opic: CFLAGS += $(CFLAGS_libxenctrl) # for xen_mb et al
+
 .PHONY: all
 all: libxenvchan.so vchan-node1 vchan-node2 libxenvchan.a
 
diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c
index 66cb103..91531b9 100644
--- a/tools/libvchan/init.c
+++ b/tools/libvchan/init.c
@@ -78,7 +78,7 @@ static int init_gnt_srv(struct libxenvchan *ctrl, int domain)
 	uint32_t ring_ref = -1;
 	void *ring;
 
-	ring = xc_gntshr_share_page_notify(ctrl->gntshr, domain,
+	ring = xengntshr_share_page_notify(ctrl->gntshr, domain,
 			&ring_ref, 1, offsetof(struct vchan_interface, srv_live),
 			ctrl->event_port);
 
@@ -104,7 +104,7 @@ static int init_gnt_srv(struct libxenvchan *ctrl, int domain)
 		ctrl->read.buffer = ((void*)ctrl->ring) + LARGE_RING_OFFSET;
 		break;
 	default:
-		ctrl->read.buffer = xc_gntshr_share_pages(ctrl->gntshr, domain,
+		ctrl->read.buffer = xengntshr_share_pages(ctrl->gntshr, domain,
 			pages_left, ctrl->ring->grants, 1);
 		if (!ctrl->read.buffer)
 			goto out_ring;
@@ -118,7 +118,7 @@ static int init_gnt_srv(struct libxenvchan *ctrl, int domain)
 		ctrl->write.buffer = ((void*)ctrl->ring) + LARGE_RING_OFFSET;
 		break;
 	default:
-		ctrl->write.buffer = xc_gntshr_share_pages(ctrl->gntshr, domain,
+		ctrl->write.buffer = xengntshr_share_pages(ctrl->gntshr, domain,
 			pages_right, ctrl->ring->grants + pages_left, 1);
 		if (!ctrl->write.buffer)
 			goto out_unmap_left;
@@ -128,9 +128,9 @@ out:
 	return ring_ref;
 out_unmap_left:
 	if (pages_left)
-		xc_gntshr_munmap(ctrl->gntshr, ctrl->read.buffer, pages_left);
+		xengntshr_unshare(ctrl->gntshr, ctrl->read.buffer, pages_left);
 out_ring:
-	xc_gntshr_munmap(ctrl->gntshr, ring, 1);
+	xengntshr_unshare(ctrl->gntshr, ring, 1);
 	ring_ref = -1;
 	ctrl->ring = NULL;
 	ctrl->write.order = ctrl->read.order = 0;
@@ -142,7 +142,7 @@ static int init_gnt_cli(struct libxenvchan *ctrl, int domain, uint32_t ring_ref)
 	int rv = -1;
 	uint32_t *grants;
 
-	ctrl->ring = xc_gnttab_map_grant_ref_notify(ctrl->gnttab,
+	ctrl->ring = xengnttab_map_grant_ref_notify(ctrl->gnttab,
 		domain, ring_ref, PROT_READ|PROT_WRITE,
 		offsetof(struct vchan_interface, cli_live), ctrl->event_port);
 
@@ -172,7 +172,7 @@ static int init_gnt_cli(struct libxenvchan *ctrl, int domain, uint32_t ring_ref)
 	default:
 		{
 			int pages_left = 1 << (ctrl->write.order - PAGE_SHIFT);
-			ctrl->write.buffer = xc_gnttab_map_domain_grant_refs(ctrl->gnttab,
+			ctrl->write.buffer = xengnttab_map_domain_grant_refs(ctrl->gnttab,
 				pages_left, domain, grants, PROT_READ|PROT_WRITE);
 			if (!ctrl->write.buffer)
 				goto out_unmap_ring;
@@ -190,7 +190,7 @@ static int init_gnt_cli(struct libxenvchan *ctrl, int domain, uint32_t ring_ref)
 	default:
 		{
 			int pages_right = 1 << (ctrl->read.order - PAGE_SHIFT);
-			ctrl->read.buffer = xc_gnttab_map_domain_grant_refs(ctrl->gnttab,
+			ctrl->read.buffer = xengnttab_map_domain_grant_refs(ctrl->gnttab,
 				pages_right, domain, grants, PROT_READ);
 			if (!ctrl->read.buffer)
 				goto out_unmap_left;
@@ -202,10 +202,10 @@ static int init_gnt_cli(struct libxenvchan *ctrl, int domain, uint32_t ring_ref)
 	return rv;
  out_unmap_left:
 	if (ctrl->write.order >= PAGE_SHIFT)
-		xc_gnttab_munmap(ctrl->gnttab, ctrl->write.buffer,
-		                 1 << (ctrl->write.order - PAGE_SHIFT));
+		xengnttab_unmap(ctrl->gnttab, ctrl->write.buffer,
+		                1 << (ctrl->write.order - PAGE_SHIFT));
  out_unmap_ring:
-	xc_gnttab_munmap(ctrl->gnttab, ctrl->ring, 1);
+	xengnttab_unmap(ctrl->gnttab, ctrl->ring, 1);
 	ctrl->ring = 0;
 	ctrl->write.order = ctrl->read.order = 0;
 	rv = -1;
@@ -325,7 +325,7 @@ struct libxenvchan *libxenvchan_server_init(xentoollog_logger *logger, int domai
 		ctrl->write.order = LARGE_RING_SHIFT;
 	}
 
-	ctrl->gntshr = xc_gntshr_open(logger, 0);
+	ctrl->gntshr = xengntshr_open(logger, 0);
 	if (!ctrl->gntshr)
 		goto out;
 
@@ -413,7 +413,7 @@ struct libxenvchan *libxenvchan_client_init(xentoollog_logger *logger, int domai
 	if (!ctrl->event_port)
 		goto fail;
 
-	ctrl->gnttab = xc_gnttab_open(logger, 0);
+	ctrl->gnttab = xengnttab_open(logger, 0);
 	if (!ctrl->gnttab)
 		goto fail;
 
diff --git a/tools/libvchan/io.c b/tools/libvchan/io.c
index 53393a5..da303fb 100644
--- a/tools/libvchan/io.c
+++ b/tools/libvchan/io.c
@@ -366,10 +366,10 @@ void libxenvchan_close(struct libxenvchan *ctrl)
 	if (ctrl->ring) {
 		if (ctrl->is_server) {
 			ctrl->ring->srv_live = 0;
-			xc_gntshr_munmap(ctrl->gntshr, ctrl->ring, 1);
+			xengntshr_unshare(ctrl->gntshr, ctrl->ring, 1);
 		} else {
 			ctrl->ring->cli_live = 0;
-			xc_gnttab_munmap(ctrl->gnttab, ctrl->ring, 1);
+			xengnttab_unmap(ctrl->gnttab, ctrl->ring, 1);
 		}
 	}
 	if (ctrl->event) {
@@ -379,10 +379,10 @@ void libxenvchan_close(struct libxenvchan *ctrl)
 	}
 	if (ctrl->is_server) {
 		if (ctrl->gntshr)
-			xc_gntshr_close(ctrl->gntshr);
+			xengntshr_close(ctrl->gntshr);
 	} else {
 		if (ctrl->gnttab)
-			xc_gnttab_close(ctrl->gnttab);
+			xengnttab_close(ctrl->gnttab);
 	}
 	free(ctrl);
 }
diff --git a/tools/libvchan/libxenvchan.h b/tools/libvchan/libxenvchan.h
index 1544378..341c375 100644
--- a/tools/libvchan/libxenvchan.h
+++ b/tools/libvchan/libxenvchan.h
@@ -45,7 +45,7 @@
 #include <xen/io/libxenvchan.h>
 #include <xen/sys/evtchn.h>
 #include <xenevtchn.h>
-#include <xenctrl.h>
+#include <xengnttab.h>
 
 struct libxenvchan_ring {
 	/* Pointer into the shared page. Offsets into buffer. */
@@ -66,8 +66,8 @@ struct libxenvchan_ring {
 struct libxenvchan {
 	/* Mapping handle for shared ring page */
 	union {
-		xc_gntshr *gntshr; /* for server */
-		xc_gnttab *gnttab; /* for client */
+		xengntshr_handle *gntshr; /* for server */
+		xengnttab_handle *gnttab; /* for client */
 	};
 	/* Pointer to shared ring page */
 	struct vchan_interface *ring;
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 184cbb7..33d18db 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -43,12 +43,13 @@ CTRL_SRCS-y       += xc_resource.c
 CTRL_SRCS-$(CONFIG_X86) += xc_psr.c
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c xc_linux_osdep.c
-CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c xc_freebsd_osdep.c xc_nognttab.c xc_nogntshr.c
-CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c xc_nognttab.c xc_nogntshr.c
-CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c xc_nognttab.c xc_nogntshr.c
-CTRL_SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c xc_nognttab.c xc_nogntshr.c
-CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c xc_nogntshr.c
+CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c xc_freebsd_osdep.c
+CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
+CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
+CTRL_SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c
+CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
 CTRL_SRCS-y       += xc_evtchn_compat.c
+CTRL_SRCS-y       += xc_gnttab_compat.c
 
 GUEST_SRCS-y :=
 GUEST_SRCS-y += xg_private.c xc_suspend.c
@@ -126,6 +127,8 @@ 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
 
+$(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS): CFLAGS += $(CFLAGS_libxengnttab) $(CFLAGS_libxengntshr)
+
 LIB := libxenctrl.a
 ifneq ($(nosharedlibs),y)
 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
@@ -209,7 +212,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 513aaa3..759f9df 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -5,9 +5,6 @@
  *
  * Copyright (c) 2003-2004, K A Fraser.
  *
- * 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;
@@ -117,8 +114,6 @@
  */
 
 typedef struct xc_interface_core xc_interface;
-typedef struct xengntdev_handle xc_gnttab;
-typedef struct xengntdev_handle xc_gntshr;
 
 enum xc_error_code {
   XC_ERROR_NONE = 0,
@@ -1548,116 +1543,6 @@ int xc_domain_subscribe_for_suspend(
  * These functions sometimes log messages as above, but not always.
  */
 
-/*
- * Note:
- * After fork a child process must not use any opened xc gnttab
- * handle inherited from their parent. They must open a new handle if
- * they want to interact with xc.
- *
- * Return an fd onto the grant table driver.  Logs errors.
- */
-xc_gnttab *xc_gnttab_open(xentoollog_logger *logger,
-			  unsigned open_flags);
-
-/*
- * Close a handle previously allocated with xc_gnttab_open().
- * Never logs errors.
- */
-int xc_gnttab_close(xc_gnttab *xcg);
-
-/*
- * Memory maps a grant reference from one domain to a local address range.
- * Mappings should be unmapped with xc_gnttab_munmap.  Logs errors.
- *
- * @parm xcg a handle on an open grant table interface
- * @parm domid the domain to map memory from
- * @parm ref the grant reference ID to map
- * @parm prot same flag as in mmap()
- */
-void *xc_gnttab_map_grant_ref(xc_gnttab *xcg,
-                              uint32_t domid,
-                              uint32_t ref,
-                              int prot);
-
-/**
- * Memory maps one or more grant references from one or more domains to a
- * contiguous local address range. Mappings should be unmapped with
- * xc_gnttab_munmap.  Logs errors.
- *
- * @parm xcg a handle on an open grant table interface
- * @parm count the number of grant references to be mapped
- * @parm domids an array of @count domain IDs by which the corresponding @refs
- *              were granted
- * @parm refs an array of @count grant references to be mapped
- * @parm prot same flag as in mmap()
- */
-void *xc_gnttab_map_grant_refs(xc_gnttab *xcg,
-                               uint32_t count,
-                               uint32_t *domids,
-                               uint32_t *refs,
-                               int prot);
-
-/**
- * Memory maps one or more grant references from one domain to a
- * contiguous local address range. Mappings should be unmapped with
- * xc_gnttab_munmap.  Logs errors.
- *
- * @parm xcg a handle on an open grant table interface
- * @parm count the number of grant references to be mapped
- * @parm domid the domain to map memory from
- * @parm refs an array of @count grant references to be mapped
- * @parm prot same flag as in mmap()
- */
-void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xcg,
-                                      uint32_t count,
-                                      uint32_t domid,
-                                      uint32_t *refs,
-                                      int prot);
-
-/**
- * Memory maps a grant reference from one domain to a local address range.
- * Mappings should be unmapped with xc_gnttab_munmap. If notify_offset or
- * notify_port are not -1, this version will attempt to set up an unmap
- * notification at the given offset and event channel. When the page is
- * unmapped, the byte at the given offset will be zeroed and a wakeup will be
- * sent to the given event channel.  Logs errors.
- *
- * @parm xcg a handle on an open grant table interface
- * @parm domid the domain to map memory from
- * @parm ref the grant reference ID to map
- * @parm prot same flag as in mmap()
- * @parm notify_offset The byte offset in the page to use for unmap
- *                     notification; -1 for none.
- * @parm notify_port The event channel port to use for unmap notify, or -1
- */
-void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xcg,
-                                     uint32_t domid,
-                                     uint32_t ref,
-                                     int prot,
-                                     uint32_t notify_offset,
-                                     evtchn_port_t notify_port);
-
-/*
- * Unmaps the @count pages starting at @start_address, which were mapped by a
- * call to xc_gnttab_map_grant_ref or xc_gnttab_map_grant_refs. Never logs.
- */
-int xc_gnttab_munmap(xc_gnttab *xcg,
-                     void *start_address,
-                     uint32_t count);
-
-/*
- * Sets the maximum number of grants that may be mapped by the given instance
- * to @count.  Never logs.
- *
- * N.B. This function must be called after opening the handle, and before any
- *      other functions are invoked on it.
- *
- * N.B. When variable-length grants are mapped, fragmentation may be observed,
- *      and it may not be possible to satisfy requests up to the maximum number
- *      of grants.
- */
-int xc_gnttab_set_max_grants(xc_gnttab *xcg,
-			     uint32_t count);
 
 int xc_gnttab_op(xc_interface *xch, int cmd,
                  void * op, int op_size, int count);
@@ -1668,59 +1553,6 @@ grant_entry_v1_t *xc_gnttab_map_table_v1(xc_interface *xch, int domid, int *gnt_
 grant_entry_v2_t *xc_gnttab_map_table_v2(xc_interface *xch, int domid, int *gnt_num);
 /* Sometimes these don't set errno [fixme], and sometimes they don't log. */
 
-/*
- * Return an fd onto the grant sharing driver.  Logs errors.
- *
- * Note:
- * After fork a child process must not use any opened xc gntshr
- * handle inherited from their parent. They must open a new handle if
- * they want to interact with xc.
- *
- */
-xc_gntshr *xc_gntshr_open(xentoollog_logger *logger,
-			  unsigned open_flags);
-
-/*
- * Close a handle previously allocated with xc_gntshr_open().
- * Never logs errors.
- */
-int xc_gntshr_close(xc_gntshr *xcg);
-
-/*
- * Creates and shares pages with another domain.
- * 
- * @parm xcg a handle to an open grant sharing instance
- * @parm domid the domain to share memory with
- * @parm count the number of pages to share
- * @parm refs the grant references of the pages (output)
- * @parm writable true if the other domain can write to the pages
- * @return local mapping of the pages
- */
-void *xc_gntshr_share_pages(xc_gntshr *xcg, uint32_t domid,
-                            int count, uint32_t *refs, int writable);
-
-/*
- * Creates and shares a page with another domain, with unmap notification.
- * 
- * @parm xcg a handle to an open grant sharing instance
- * @parm domid the domain to share memory with
- * @parm refs the grant reference of the pages (output)
- * @parm writable true if the other domain can write to the page
- * @parm notify_offset The byte offset in the page to use for unmap
- *                     notification; -1 for none.
- * @parm notify_port The event channel port to use for unmap notify, or -1
- * @return local mapping of the page
- */
-void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
-                                  uint32_t *ref, int writable,
-                                  uint32_t notify_offset,
-                                  evtchn_port_t notify_port);
-/*
- * Unmaps the @count pages starting at @start_address, which were mapped by a
- * call to xc_gntshr_share_*. Never logs.
- */
-int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count);
-
 int xc_physdev_map_pirq(xc_interface *xch,
                         int domid,
                         int index,
diff --git a/tools/libxc/include/xenctrl_compat.h b/tools/libxc/include/xenctrl_compat.h
index 48daeb2..d99fa11 100644
--- a/tools/libxc/include/xenctrl_compat.h
+++ b/tools/libxc/include/xenctrl_compat.h
@@ -35,6 +35,54 @@ int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port);
 
 #endif /* XC_WANT_COMPAT_EVTCHN_API */
 
+#ifdef XC_WANT_COMPAT_GNTTAB_API
+
+typedef struct xengntdev_handle xc_gnttab;
+
+xc_gnttab *xc_gnttab_open(xentoollog_logger *logger,
+                          unsigned open_flags);
+int xc_gnttab_close(xc_gnttab *xcg);
+void *xc_gnttab_map_grant_ref(xc_gnttab *xcg,
+                              uint32_t domid,
+                              uint32_t ref,
+                              int prot);
+void *xc_gnttab_map_grant_refs(xc_gnttab *xcg,
+                               uint32_t count,
+                               uint32_t *domids,
+                               uint32_t *refs,
+                               int prot);
+void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xcg,
+                                      uint32_t count,
+                                      uint32_t domid,
+                                      uint32_t *refs,
+                                      int prot);
+void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xcg,
+                                     uint32_t domid,
+                                     uint32_t ref,
+                                     int prot,
+                                     uint32_t notify_offset,
+                                     evtchn_port_t notify_port);
+int xc_gnttab_munmap(xc_gnttab *xcg,
+                     void *start_address,
+                     uint32_t count);
+int xc_gnttab_set_max_grants(xc_gnttab *xcg,
+                             uint32_t count);
+
+typedef struct xengntdev_handle xc_gntshr;
+
+xc_gntshr *xc_gntshr_open(xentoollog_logger *logger,
+                          unsigned open_flags);
+int xc_gntshr_close(xc_gntshr *xcg);
+void *xc_gntshr_share_pages(xc_gntshr *xcg, uint32_t domid,
+                            int count, uint32_t *refs, int writable);
+void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
+                                  uint32_t *ref, int writable,
+                                  uint32_t notify_offset,
+                                  evtchn_port_t notify_port);
+int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count);
+
+#endif /* XC_WANT_COMPAT_GNTTAB_API */
+
 #endif
 
 /*
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index a51f405..dd32aa2 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -143,59 +143,6 @@ grant_entry_v2_t *xc_gnttab_map_table_v2(xc_interface *xch, int domid,
     return _gnttab_map_table(xch, domid, gnt_num);
 }
 
-void *xc_gnttab_map_grant_ref(xc_gnttab *xgt,
-                              uint32_t domid,
-                              uint32_t ref,
-                              int prot)
-{
-    return osdep_gnttab_grant_map(xgt, 1, 0, prot, &domid, &ref, -1, -1);
-}
-
-void *xc_gnttab_map_grant_refs(xc_gnttab *xgt,
-                               uint32_t count,
-                               uint32_t *domids,
-                               uint32_t *refs,
-                               int prot)
-{
-    return osdep_gnttab_grant_map(xgt, count, 0, prot, domids, refs, -1, -1);
-}
-
-void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xgt,
-                                      uint32_t count,
-                                      uint32_t domid,
-                                      uint32_t *refs,
-                                      int prot)
-{
-    return osdep_gnttab_grant_map(xgt, count, XC_GRANT_MAP_SINGLE_DOMAIN,
-                                  prot, &domid, refs, -1, -1);
-}
-
-void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xgt,
-                                     uint32_t domid,
-                                     uint32_t ref,
-                                     int prot,
-                                     uint32_t notify_offset,
-                                     evtchn_port_t notify_port)
-{
-    return osdep_gnttab_grant_map(xgt, 1, 0, prot,  &domid, &ref,
-                                  notify_offset, notify_port);
-}
-
-void *xc_gntshr_share_pages(xc_gntshr *xcg, uint32_t domid,
-                            int count, uint32_t *refs, int writable)
-{
-    return osdep_gntshr_share_pages(xcg, domid, count, refs, writable, -1, -1);
-}
-
-void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
-                                  uint32_t *ref, int writable,
-                                  uint32_t notify_offset,
-                                  evtchn_port_t notify_port)
-{
-    return osdep_gntshr_share_pages(xcg, domid, 1, ref, writable,
-                                    notify_offset, notify_port);
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_gnttab_compat.c b/tools/libxc/xc_gnttab_compat.c
new file mode 100644
index 0000000..6f036d8
--- /dev/null
+++ b/tools/libxc/xc_gnttab_compat.c
@@ -0,0 +1,111 @@
+/*
+ * Compat shims for use of 3rd party consumers of libxenctrl xc_gnt{tab,shr}
+ * functionality which has been split into separate libraries.
+ */
+
+#include <xengnttab.h>
+
+#define XC_WANT_COMPAT_GNTTAB_API
+#include "xenctrl.h"
+
+xc_gnttab *xc_gnttab_open(xentoollog_logger *logger,
+                          unsigned open_flags)
+{
+    return xengnttab_open(logger, open_flags);
+}
+
+int xc_gnttab_close(xc_gnttab *xcg)
+{
+    return xengnttab_close(xcg);
+}
+
+void *xc_gnttab_map_grant_ref(xc_gnttab *xcg,
+                              uint32_t domid,
+                              uint32_t ref,
+                              int prot)
+{
+    return xengnttab_map_grant_ref(xcg, domid, ref, prot);
+}
+
+void *xc_gnttab_map_grant_refs(xc_gnttab *xcg,
+                               uint32_t count,
+                               uint32_t *domids,
+                               uint32_t *refs,
+                               int prot)
+{
+    return xengnttab_map_grant_refs(xcg, count, domids, refs, prot);
+}
+
+void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xcg,
+                                      uint32_t count,
+                                      uint32_t domid,
+                                      uint32_t *refs,
+                                      int prot)
+{
+    return xengnttab_map_domain_grant_refs(xcg, count, domid, refs, prot);
+}
+
+void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xcg,
+                                     uint32_t domid,
+                                     uint32_t ref,
+                                     int prot,
+                                     uint32_t notify_offset,
+                                     evtchn_port_t notify_port)
+{
+    return xengnttab_map_grant_ref_notify(xcg, domid, ref, prot,
+                                          notify_offset, notify_port);
+}
+
+int xc_gnttab_munmap(xc_gnttab *xcg,
+                     void *start_address,
+                     uint32_t count)
+{
+    return xengnttab_unmap(xcg, start_address, count);
+}
+
+int xc_gnttab_set_max_grants(xc_gnttab *xcg,
+                             uint32_t count)
+{
+    return xengnttab_set_max_grants(xcg, count);
+}
+
+xc_gntshr *xc_gntshr_open(xentoollog_logger *logger,
+                          unsigned open_flags)
+{
+    return xengntshr_open(logger, open_flags);
+}
+
+int xc_gntshr_close(xc_gntshr *xcg)
+{
+    return xengntshr_close(xcg);
+}
+
+void *xc_gntshr_share_pages(xc_gntshr *xcg, uint32_t domid,
+                            int count, uint32_t *refs, int writable)
+{
+    return xengntshr_share_pages(xcg, domid, count, refs, writable);
+}
+
+void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
+                                  uint32_t *ref, int writable,
+                                  uint32_t notify_offset,
+                                  evtchn_port_t notify_port)
+{
+    return xengntshr_share_page_notify(xcg, domid, ref, writable,
+                                       notify_offset, notify_port);
+}
+
+int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count)
+{
+    return xengntshr_unshare(xcg, start_address, count);
+}
+
+/*
+ * 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_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 6b329ce..9c318e0 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -31,8 +31,6 @@
 #include <sys/ioctl.h>
 
 #include <xen/memory.h>
-#include <xen/sys/gntdev.h>
-#include <xen/sys/gntalloc.h>
 
 #include "xenctrl.h"
 #include "xenctrlosdep.h"
@@ -41,9 +39,6 @@
 
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
-#define GTERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gnttab", _f)
-#define GSERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gntshr", _f)
-
 static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
@@ -461,281 +456,6 @@ static struct xc_osdep_ops linux_privcmd_ops = {
     },
 };
 
-#define DEVXEN "/dev/xen/"
-
-int osdep_gnttab_open(xc_gnttab *xgt)
-{
-    int fd = open(DEVXEN "gntdev", O_RDWR);
-    if ( fd == -1 )
-        return -1;
-    xgt->fd = fd;
-    return 0;
-}
-
-int osdep_gnttab_close(xc_gnttab *xgt)
-{
-    if ( xgt->fd == -1 )
-        return 0;
-
-    return close(xgt->fd);
-}
-
-int xc_gnttab_set_max_grants(xc_gnttab *xgt, uint32_t count)
-{
-    int fd = xgt->fd, rc;
-    struct ioctl_gntdev_set_max_grants max_grants = { .count = count };
-
-    rc = ioctl(fd, IOCTL_GNTDEV_SET_MAX_GRANTS, &max_grants);
-    if (rc) {
-        /*
-         * Newer (e.g. pv-ops) kernels don't implement this IOCTL,
-         * so ignore the resulting specific failure.
-         */
-        if (errno == ENOTTY)
-            rc = 0;
-        else
-            GTERROR(xgt->logger, "ioctl SET_MAX_GRANTS failed");
-    }
-
-    return rc;
-}
-
-void *osdep_gnttab_grant_map(xc_gnttab *xgt,
-                             uint32_t count, int flags, int prot,
-                             uint32_t *domids, uint32_t *refs,
-                             uint32_t notify_offset,
-                             evtchn_port_t notify_port)
-{
-    int fd = xgt->fd;
-    struct ioctl_gntdev_map_grant_ref *map;
-    unsigned int map_size = ROUNDUP((sizeof(*map) + (count - 1) *
-                                    sizeof(struct ioctl_gntdev_map_grant_ref)),
-                                    XC_PAGE_SHIFT);
-    void *addr = NULL;
-    int domids_stride = 1;
-    int i;
-
-    if (flags & XC_GRANT_MAP_SINGLE_DOMAIN)
-        domids_stride = 0;
-
-    if ( map_size <= XC_PAGE_SIZE )
-        map = alloca(sizeof(*map) +
-                     (count - 1) * sizeof(struct ioctl_gntdev_map_grant_ref));
-    else
-    {
-        map = mmap(NULL, map_size, PROT_READ | PROT_WRITE,
-                   MAP_PRIVATE | MAP_ANON | MAP_POPULATE, -1, 0);
-        if ( map == MAP_FAILED )
-        {
-            GTERROR(xgt->logger, "mmap of map failed");
-            return NULL;
-        }
-    }
-
-    for ( i = 0; i < count; i++ )
-    {
-        map->refs[i].domid = domids[i * domids_stride];
-        map->refs[i].ref = refs[i];
-    }
-
-    map->count = count;
-
-    if ( ioctl(fd, IOCTL_GNTDEV_MAP_GRANT_REF, map) ) {
-        GTERROR(xgt->logger, "ioctl MAP_GRANT_REF failed");
-        goto out;
-    }
-
- retry:
-    addr = mmap(NULL, XC_PAGE_SIZE * count, prot, MAP_SHARED, fd,
-                map->index);
-
-    if (addr == MAP_FAILED && errno == EAGAIN)
-    {
-        /*
-         * The grant hypercall can return EAGAIN if the granted page is
-         * swapped out. Since the paging daemon may be in the same domain, the
-         * hypercall cannot block without causing a deadlock.
-         *
-         * Because there are no notificaitons when the page is swapped in, wait
-         * a bit before retrying, and hope that the page will arrive eventually.
-         */
-        usleep(1000);
-        goto retry;
-    }
-
-    if (addr != MAP_FAILED)
-    {
-        int rv = 0;
-        struct ioctl_gntdev_unmap_notify notify;
-        notify.index = map->index;
-        notify.action = 0;
-        if (notify_offset < XC_PAGE_SIZE * count) {
-            notify.index += notify_offset;
-            notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
-        }
-        if (notify_port != -1) {
-            notify.event_channel_port = notify_port;
-            notify.action |= UNMAP_NOTIFY_SEND_EVENT;
-        }
-        if (notify.action)
-            rv = ioctl(fd, IOCTL_GNTDEV_SET_UNMAP_NOTIFY, &notify);
-        if (rv) {
-            GTERROR(xgt->logger, "ioctl SET_UNMAP_NOTIFY failed");
-            munmap(addr, count * XC_PAGE_SIZE);
-            addr = MAP_FAILED;
-        }
-    }
-
-    if (addr == MAP_FAILED)
-    {
-        int saved_errno = errno;
-        struct ioctl_gntdev_unmap_grant_ref unmap_grant;
-
-        /* Unmap the driver slots used to store the grant information. */
-        GTERROR(xgt->logger, "mmap failed");
-        unmap_grant.index = map->index;
-        unmap_grant.count = count;
-        ioctl(fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant);
-        errno = saved_errno;
-        addr = NULL;
-    }
-
- out:
-    if ( map_size > XC_PAGE_SIZE )
-        munmap(map, map_size);
-
-    return addr;
-}
-
-int xc_gnttab_munmap(xc_gnttab *xgt, void *start_address, uint32_t count)
-{
-    int fd = xgt->fd;
-    struct ioctl_gntdev_get_offset_for_vaddr get_offset;
-    struct ioctl_gntdev_unmap_grant_ref unmap_grant;
-    int rc;
-
-    if ( start_address == NULL )
-    {
-        errno = EINVAL;
-        return -1;
-    }
-
-    /* First, it is necessary to get the offset which was initially used to
-     * mmap() the pages.
-     */
-    get_offset.vaddr = (unsigned long)start_address;
-    if ( (rc = ioctl(fd, IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR,
-                     &get_offset)) )
-        return rc;
-
-    if ( get_offset.count != count )
-    {
-        errno = EINVAL;
-        return -1;
-    }
-
-    /* Next, unmap the memory. */
-    if ( (rc = munmap(start_address, count * XC_PAGE_SIZE)) )
-        return rc;
-
-    /* Finally, unmap the driver slots used to store the grant information. */
-    unmap_grant.index = get_offset.offset;
-    unmap_grant.count = count;
-    if ( (rc = ioctl(fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant)) )
-        return rc;
-
-    return 0;
-}
-
-int osdep_gntshr_open(xc_gntshr *xgs)
-{
-    int fd = open(DEVXEN "gntalloc", O_RDWR);
-    if ( fd == -1 )
-        return -1;
-    xgs->fd = fd;
-    return 0;
-}
-
-int osdep_gntshr_close(xc_gntshr *xgs)
-{
-    if ( xgs->fd == -1 )
-        return 0;
-
-    return close(xgs->fd);
-}
-
-void *osdep_gntshr_share_pages(xc_gntshr *xgs,
-                               uint32_t domid, int count,
-                               uint32_t *refs, int writable,
-                               uint32_t notify_offset,
-                               evtchn_port_t notify_port)
-{
-    struct ioctl_gntalloc_alloc_gref *gref_info = NULL;
-    struct ioctl_gntalloc_unmap_notify notify;
-    struct ioctl_gntalloc_dealloc_gref gref_drop;
-    int fd = xgs->fd;
-    int err;
-    void *area = NULL;
-    gref_info = malloc(sizeof(*gref_info) + count * sizeof(uint32_t));
-    if (!gref_info)
-        return NULL;
-    gref_info->domid = domid;
-    gref_info->flags = writable ? GNTALLOC_FLAG_WRITABLE : 0;
-    gref_info->count = count;
-
-    err = ioctl(fd, IOCTL_GNTALLOC_ALLOC_GREF, gref_info);
-    if (err) {
-        GSERROR(xgs->logger, "ioctl failed");
-        goto out;
-    }
-
-    area = mmap(NULL, count * XC_PAGE_SIZE, PROT_READ | PROT_WRITE,
-        MAP_SHARED, fd, gref_info->index);
-
-    if (area == MAP_FAILED) {
-        area = NULL;
-        GSERROR(xgs->logger, "mmap failed");
-        goto out_remove_fdmap;
-    }
-
-    notify.index = gref_info->index;
-    notify.action = 0;
-    if (notify_offset < XC_PAGE_SIZE * count) {
-        notify.index += notify_offset;
-        notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
-    }
-    if (notify_port != -1) {
-        notify.event_channel_port = notify_port;
-        notify.action |= UNMAP_NOTIFY_SEND_EVENT;
-    }
-    if (notify.action)
-        err = ioctl(fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &notify);
-    if (err) {
-        GSERROR(xgs->logger, "ioctl SET_UNMAP_NOTIFY failed");
-		munmap(area, count * XC_PAGE_SIZE);
-		area = NULL;
-	}
-
-    memcpy(refs, gref_info->gref_ids, count * sizeof(uint32_t));
-
- out_remove_fdmap:
-    /* Removing the mapping from the file descriptor does not cause the pages to
-     * be deallocated until the mapping is removed.
-     */
-    gref_drop.index = gref_info->index;
-    gref_drop.count = count;
-    ioctl(fd, IOCTL_GNTALLOC_DEALLOC_GREF, &gref_drop);
- out:
-    free(gref_info);
-    return area;
-}
-
-int xc_gntshr_munmap(xc_gntshr *xgs,
-                     void *start_address, uint32_t count)
-{
-    return munmap(start_address, count * XC_PAGE_SIZE);
-}
-
 static struct xc_osdep_ops *linux_osdep_init(xc_interface *xch, enum xc_osdep_type type)
 {
     switch ( type )
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index fd7def6..22d985c 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -23,8 +23,6 @@
 #include <mini-os/os.h>
 #include <mini-os/mm.h>
 #include <mini-os/lib.h>
-#include <mini-os/gntmap.h>
-#include <sys/mman.h>
 
 #include <xen/memory.h>
 #include <unistd.h>
@@ -38,7 +36,6 @@
 #include "xc_private.h"
 
 void minios_interface_close_fd(int fd);
-void minios_gnttab_close_fd(int fd);
 
 extern void minios_interface_close_fd(int fd);
 
@@ -202,76 +199,6 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return memalign(alignment, size);
 }
 
-int osdep_gnttab_open(xc_gnttab *xgt)
-{
-    int fd = alloc_fd(FTYPE_GNTMAP);
-    if ( fd == -1 )
-        return -1;
-    gntmap_init(&files[fd].gntmap);
-    xgt->fd = fd;
-    return 0;
-}
-
-int osdep_gnttab_close(xc_gnttab *xgt)
-{
-    if ( xgt->fd == -1 )
-        return 0;
-
-    return close(xgt->fd);
-}
-
-void minios_gnttab_close_fd(int fd)
-{
-    gntmap_fini(&files[fd].gntmap);
-    files[fd].type = FTYPE_NONE;
-}
-
-void *osdep_gnttab_grant_map(xc_gnttab *xgt,
-                             uint32_t count, int flags, int prot,
-                             uint32_t *domids, uint32_t *refs,
-                             uint32_t notify_offset,
-                             evtchn_port_t notify_port)
-{
-    int fd = xgt->fd;
-    int stride = 1;
-    if (flags & XC_GRANT_MAP_SINGLE_DOMAIN)
-        stride = 0;
-    if (notify_offset != -1 || notify_port != -1) {
-        errno = ENOSYS;
-        return NULL;
-    }
-    return gntmap_map_grant_refs(&files[fd].gntmap,
-                                 count, domids, stride,
-                                 refs, prot & PROT_WRITE);
-}
-
-int xc_gnttab_munmap(xc_gnttab *xgt, void *start_address, uint32_t count)
-{
-    int fd = xgt->fd;
-    int ret;
-    ret = gntmap_munmap(&files[fd].gntmap,
-                        (unsigned long) start_address,
-                        count);
-    if (ret < 0) {
-        errno = -ret;
-        return -1;
-    }
-    return ret;
-}
-
-int xc_gnttab_set_max_grants(xc_gnttab *xgt, uint32_t count)
-{
-    int fd = xgt->fd;
-    int ret;
-    ret = gntmap_set_max_grants(&files[fd].gntmap,
-                                count);
-    if (ret < 0) {
-        errno = -ret;
-        return -1;
-    }
-    return ret;
-}
-
 static struct xc_osdep_ops *minios_osdep_init(xc_interface *xch, enum xc_osdep_type type)
 {
     switch ( type )
diff --git a/tools/libxc/xc_nogntshr.c b/tools/libxc/xc_nogntshr.c
deleted file mode 100644
index 9aa6064..0000000
--- a/tools/libxc/xc_nogntshr.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/******************************************************************************
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <stdlib.h>
-
-#include "xc_private.h"
-
-int osdep_gntshr_open(xc_gnttab *xgt)
-{
-    return -1;
-}
-
-int osdep_gntshr_close(xc_gnttab *xgt)
-{
-    return 0;
-}
-
-void *osdep_gntshr_share_pages(xc_gntshr *xgs,
-                               uint32_t domid, int count,
-                               uint32_t *refs, int writable,
-                               uint32_t notify_offset,
-                               evtchn_port_t notify_port)
-{
-    abort()
-}
-
-int xc_gntshr_munmap(xc_gntshr *xgs,
-                     void *start_address, uint32_t count)
-{
-    abort();
-}
diff --git a/tools/libxc/xc_nognttab.c b/tools/libxc/xc_nognttab.c
deleted file mode 100644
index e8a0fcb..0000000
--- a/tools/libxc/xc_nognttab.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/******************************************************************************
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <stdlib.h>
-
-#include "xc_private.h"
-
-int osdep_gnttab_open(xc_gnttab *xgt)
-{
-    return -1;
-}
-
-int osdep_gnttab_close(xc_gnttab *xgt)
-{
-    return 0;
-}
-
-int xc_gnttab_set_max_grants(xc_gnttab *xgt, uint32_t count)
-{
-    abort();
-}
-
-void *osdep_gnttab_grant_map(xc_gnttab *xgt,
-                             uint32_t count, int flags, int prot,
-                             uint32_t *domids, uint32_t *refs,
-                             uint32_t notify_offset,
-                             evtchn_port_t notify_port)
-{
-    abort();
-}
-
-int xc_gnttab_munmap(xc_gnttab *xgt, void *start_address, uint32_t count)
-{
-    abort();
-}
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 7f52a5d..85e6f02 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -249,86 +249,6 @@ int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
     return xch->ops->u.privcmd.hypercall(xch, xch->ops_handle, hypercall);
 }
 
-xc_gnttab *xc_gnttab_open(xentoollog_logger *logger, unsigned open_flags)
-{
-    xc_gnttab *xgt = malloc(sizeof(*xgt));
-    int rc;
-
-    if (!xgt) return NULL;
-
-    xgt->fd = -1;
-    xgt->logger = logger;
-    xgt->logger_tofree  = NULL;
-
-    if (!xgt->logger) {
-        xgt->logger = xgt->logger_tofree =
-            (xentoollog_logger*)
-            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
-        if (!xgt->logger) goto err;
-    }
-
-    rc = osdep_gnttab_open(xgt);
-    if ( rc  < 0 ) goto err;
-
-    return xgt;
-
-err:
-    osdep_gnttab_close(xgt);
-    xtl_logger_destroy(xgt->logger_tofree);
-    free(xgt);
-    return NULL;
-}
-
-int xc_gnttab_close(xc_gnttab *xgt)
-{
-    int rc;
-
-    rc = osdep_gnttab_close(xgt);
-    xtl_logger_destroy(xgt->logger_tofree);
-    free(xgt);
-    return rc;
-}
-
-xc_gntshr *xc_gntshr_open(xentoollog_logger *logger, unsigned open_flags)
-{
-    xc_gntshr *xgs = malloc(sizeof(*xgs));
-    int rc;
-
-    if (!xgs) return NULL;
-
-    xgs->fd = -1;
-    xgs->logger = logger;
-    xgs->logger_tofree  = NULL;
-
-    if (!xgs->logger) {
-        xgs->logger = xgs->logger_tofree =
-            (xentoollog_logger*)
-            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
-        if (!xgs->logger) goto err;
-    }
-
-    rc = osdep_gntshr_open(xgs);
-    if ( rc  < 0 ) goto err;
-
-    return xgs;
-
-err:
-    osdep_gntshr_close(xgs);
-    xtl_logger_destroy(xgs->logger_tofree);
-    free(xgs);
-    return NULL;
-}
-
-int xc_gntshr_close(xc_gntshr *xgs)
-{
-    int rc;
-
-    rc = osdep_gntshr_close(xgs);
-    xtl_logger_destroy(xgs->logger_tofree);
-    free(xgs);
-    return rc;
-}
-
 static pthread_key_t errbuf_pkey;
 static pthread_once_t errbuf_pkey_once = PTHREAD_ONCE_INIT;
 
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 35c99e0..a32accb 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -123,30 +123,6 @@ struct xc_interface_core {
     xc_osdep_handle  ops_handle; /* opaque data for xc_osdep_ops */
 };
 
-struct xengntdev_handle {
-    xentoollog_logger *logger, *logger_tofree;
-    int fd;
-};
-
-int osdep_gnttab_open(xc_gnttab *xgt);
-int osdep_gnttab_close(xc_gnttab *xgt);
-
-#define XC_GRANT_MAP_SINGLE_DOMAIN 0x1
-void *osdep_gnttab_grant_map(xc_gnttab *xgt,
-                             uint32_t count, int flags, int prot,
-                             uint32_t *domids, uint32_t *refs,
-                             uint32_t notify_offset,
-                             evtchn_port_t notify_port);
-
-int osdep_gntshr_open(xc_gntshr *xgs);
-int osdep_gntshr_close(xc_gntshr *xgs);
-
-void *osdep_gntshr_share_pages(xc_gntshr *xgs,
-                               uint32_t domid, int count,
-                               uint32_t *refs, int writable,
-                               uint32_t notify_offset,
-                               evtchn_port_t notify_port);
-
 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,
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 5970fde..d691b78 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -69,8 +69,10 @@ xenstored_probes.o: xenstored_solaris.o
 CFLAGS += -DHAVE_DTRACE=1
 endif
 
+$(XENSTORED_OBJS): CFLAGS += $(CFLAGS_libxengnttab)
+
 xenstored: $(XENSTORED_OBJS)
-	$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
+	$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
 
 xenstored.a: $(XENSTORED_OBJS)
 	$(AR) cr $@ $^
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 8c853c9..624737d 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -20,12 +20,14 @@
 #define _XENSTORED_CORE_H
 
 #include <xenctrl.h>
+#include <xengnttab.h>
 
 #include <sys/types.h>
 #include <dirent.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <errno.h>
+
 #include "xenstore_lib.h"
 #include "list.h"
 #include "tdb.h"
@@ -196,7 +198,7 @@ void finish_daemonize(void);
 /* Open a pipe for signal handling */
 void init_pipe(int reopen_log_pipe[2]);
 
-xc_gnttab **xcg_handle;
+xengnttab_handle **xgt_handle;
 
 #endif /* _XENSTORED_CORE_H */
 
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 0384817..47b4f03 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -34,7 +34,7 @@
 #include <xen/grant_table.h>
 
 static xc_interface **xc_handle;
-xc_gnttab **xcg_handle;
+xengnttab_handle **xgt_handle;
 static evtchn_port_t virq_port;
 
 xenevtchn_handle *xce_handle = NULL;
@@ -166,9 +166,9 @@ static int readchn(struct connection *conn, void *data, unsigned int len)
 
 static void *map_interface(domid_t domid, unsigned long mfn)
 {
-	if (*xcg_handle != NULL) {
+	if (*xgt_handle != NULL) {
 		/* this is the preferred method */
-		return xc_gnttab_map_grant_ref(*xcg_handle, domid,
+		return xengnttab_map_grant_ref(*xgt_handle, domid,
 			GNTTAB_RESERVED_XENSTORE, PROT_READ|PROT_WRITE);
 	} else {
 		return xc_map_foreign_range(*xc_handle, domid,
@@ -178,8 +178,8 @@ static void *map_interface(domid_t domid, unsigned long mfn)
 
 static void unmap_interface(void *interface)
 {
-	if (*xcg_handle != NULL)
-		xc_gnttab_munmap(*xcg_handle, interface, 1);
+	if (*xgt_handle != NULL)
+		xengnttab_unmap(*xgt_handle, interface, 1);
 	else
 		munmap(interface, XC_PAGE_SIZE);
 }
@@ -577,9 +577,9 @@ static int close_xc_handle(void *_handle)
 	return 0;
 }
 
-static int close_xcg_handle(void *_handle)
+static int close_xgt_handle(void *_handle)
 {

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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:17:42 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:17: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 1aONAT-00011a-V4; Wed, 27 Jan 2016 10:17:41 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAS-00011G-LV
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:41 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	F4/23-08977-34998A65; Wed, 27 Jan 2016 10:17:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1453889694!10753542!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 43071 invoked from network); 27 Jan 2016 10:15:13 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:15:13 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON8e-0001wT-7T
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:15:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aON7l-0001K9-Ra
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:14:54 +0000
Date: Wed, 27 Jan 2016 10:14:53 +0000
Message-Id: <E1aON7l-0001K9-Ra@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Refactor /dev/xen/gnt{dev,
	shr} wrappers into libxengnttab.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a71ad0feada081b80beb85702e8039bcbc847b73
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 1 16:20:09 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:22:27 2016 +0000

    tools: Refactor /dev/xen/gnt{dev,shr} wrappers into libxengnttab.
    
    libxengnttab will provide a stable API and ABI for accessing the
    grant table devices.
    
    The functions are moved into the xengnt{tab,shr} namespace to make a
    clean break from libxc and avoid ambiguity regarding which interfaces
    are stable.
    
    All in-tree users are updated to use the new names.
    
    Upon request (via #define XC_WANT_COMPAT_GNTTAB_API) libxenctrl will
    provide a compat API for the old names. This is used by qemu-xen for
    the time being. qemu-xen-traditional is updated in lockstep.
    
    This leaves a few grant table related functions which go via privcmd
    (GNTTABOP) rather than ioctls on the /dev/xen/gnt* devices in
    libxenctrl. Specifically:
    
      - xc_gnttab_get_version
      - xc_gnttab_map_table_v1
      - xc_gnttab_map_table_v2
      - xc_gnttab_op
    
    These functions do not appear to be needed by qemu-dm, qemu-pv
    (provision of device model to HVM guests and PV backends respectively)
    or by libvchan suggesting they are not needed by non-toolstack uses of
    event channels.
    
    The new library uses a version script to ensure that only expected
    symbols are exported and to version them such that ABI guarantees can
    be kept in the future.
    
    After this change libxenvchan no longer needs to link against
    libxenctrl. It still needs xenctrl.h in one file for xen_mb and
    friends.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    [ ijc -- updated MINIOS_UPSTREAM_REVISION and QEMU_TRADITIONAL_REVISION ]
---
 .gitignore                            |    2 +
 Config.mk                             |   12 +-
 stubdom/Makefile                      |   17 ++-
 tools/Makefile                        |    3 +
 tools/Rules.mk                        |   14 ++-
 tools/console/Makefile                |    5 +-
 tools/console/daemon/io.c             |   21 +-
 tools/libs/Makefile                   |    1 +
 tools/libs/evtchn/minios.c            |    5 +-
 tools/libs/gnttab/Makefile            |   73 ++++++++
 tools/libs/gnttab/gntshr_core.c       |   95 ++++++++++
 tools/libs/gnttab/gntshr_unimp.c      |   62 ++++++
 tools/libs/gnttab/gnttab_core.c       |  124 +++++++++++++
 tools/libs/gnttab/gnttab_unimp.c      |   89 +++++++++
 tools/libs/gnttab/include/xengnttab.h |  216 +++++++++++++++++++++
 tools/libs/gnttab/libxengnttab.map    |   23 +++
 tools/libs/gnttab/linux.c             |  329 +++++++++++++++++++++++++++++++++
 tools/libs/gnttab/minios.c            |  117 ++++++++++++
 tools/libs/gnttab/private.h           |   47 +++++
 tools/libvchan/Makefile               |    8 +-
 tools/libvchan/init.c                 |   26 ++--
 tools/libvchan/io.c                   |    8 +-
 tools/libvchan/libxenvchan.h          |    6 +-
 tools/libxc/Makefile                  |   15 +-
 tools/libxc/include/xenctrl.h         |  168 -----------------
 tools/libxc/include/xenctrl_compat.h  |   48 +++++
 tools/libxc/xc_gnttab.c               |   53 ------
 tools/libxc/xc_gnttab_compat.c        |  111 +++++++++++
 tools/libxc/xc_linux_osdep.c          |  280 ----------------------------
 tools/libxc/xc_minios.c               |   73 --------
 tools/libxc/xc_nogntshr.c             |   46 -----
 tools/libxc/xc_nognttab.c             |   50 -----
 tools/libxc/xc_private.c              |   80 --------
 tools/libxc/xc_private.h              |   24 ---
 tools/xenstore/Makefile               |    4 +-
 tools/xenstore/xenstored_core.h       |    4 +-
 tools/xenstore/xenstored_domain.c     |   24 ++--
 tools/xenstore/xenstored_minios.c     |    5 +-
 38 files changed, 1442 insertions(+), 846 deletions(-)

diff --git a/.gitignore b/.gitignore
index 7340a56..ea75fda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -63,6 +63,7 @@ stubdom/ioemu/
 stubdom/libs-*
 stubdom/libxc-*
 stubdom/libxenevtchn-*
+stubdom/libxengnttab-*
 stubdom/libxentoollog-*
 stubdom/lwip-*
 stubdom/lwip/
@@ -89,6 +90,7 @@ config/Stubdom.mk
 config/Docs.mk
 tools/libs/toollog/headers.chk
 tools/libs/evtchn/headers.chk
+tools/libs/gnttab/headers.chk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff --git a/Config.mk b/Config.mk
index e202d3f..d2f22a3 100644
--- a/Config.mk
+++ b/Config.mk
@@ -251,9 +251,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= fb66c855c983aa07644cb179fd9bfe96d55f317d
-# Fri Jan 15 13:24:00 2016 +0000
-# mini-os: Include libxenevtchn with libxc
+MINIOS_UPSTREAM_REVISION ?= 9faa4c3b862291315912b81fe1d4ccca800f530d
+# Fri Jan 15 13:24:01 2016 +0000
+# mini-os: Include libxengnttab with libxc
 
 SEABIOS_UPSTREAM_REVISION ?= 3403ac4313812752be6e6aac35239ca6888a8cab
 # Mon Dec 28 13:50:41 2015 +0100
@@ -262,9 +262,9 @@ SEABIOS_UPSTREAM_REVISION ?= 3403ac4313812752be6e6aac35239ca6888a8cab
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= ca2ff968de42d47dcda8973aa1528a14f99992d3
-# Fri Jan 15 13:23:53 2016 +0000
-# qemu-xen-traditional: Use libxenevtchn
+QEMU_TRADITIONAL_REVISION ?= d8b5666074fdbc4ddba5283d70898a2edd785028
+# Fri Jan 15 13:23:54 2016 +0000
+# qemu-xen-traditional: Use libxengnttab
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 702d66b..2dbf4a8 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -325,6 +325,12 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
 	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/include/*.h include/ && \
 	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/libs/evtchn/Makefile . )
+	mkdir -p libs-$(XEN_TARGET_ARCH)/gnttab/include
+	[ -h libs-$(XEN_TARGET_ARCH)/gnttab/Makefile ] || ( cd libs-$(XEN_TARGET_ARCH)/gnttab && \
+	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/*.h . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/include/*.h include/ && \
+	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/*.c . && \
+	  ln -sf $(XEN_ROOT)/tools/libs/gnttab/Makefile . )
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
@@ -366,12 +372,21 @@ libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: mk-headers-$(XEN_TARGET_ARCH) $(N
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/evtchn
 
 #######
+# libxengnttab
+#######
+
+.PHONY: libxengnttab
+libxengnttab: libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a
+libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/gnttab
+
+#######
 # libxc
 #######
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoollog libxenevtchn libxengnttab cross-zlib
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
diff --git a/tools/Makefile b/tools/Makefile
index 55b5d44..50ccc75 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -250,9 +250,11 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--includedir=$(LIBEXEC_INC) \
 		--source-path=$$source \
 		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
+		-DXC_WANT_COMPAT_GNTTAB_API=1 \
 		-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libs/toollog/include \
 		-I$(XEN_ROOT)/tools/libs/evtchn/include \
+		-I$(XEN_ROOT)/tools/libs/gnttab/include \
 		-I$(XEN_ROOT)/tools/libxc/include \
 		-I$(XEN_ROOT)/tools/xenstore/include \
 		-I$(XEN_ROOT)/tools/xenstore/compat/include \
@@ -261,6 +263,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-L$(XEN_ROOT)/tools/xenstore \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/evtchn \
+		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/gnttab \
 		$(QEMU_UPSTREAM_RPATH)" \
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 0c83e22..379990f 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -12,6 +12,7 @@ INSTALL = $(XEN_ROOT)/tools/cross-install
 XEN_INCLUDE        = $(XEN_ROOT)/tools/include
 XEN_LIBXENTOOLLOG  = $(XEN_ROOT)/tools/libs/toollog
 XEN_LIBXENEVTCHN   = $(XEN_ROOT)/tools/libs/evtchn
+XEN_LIBXENGNTTAB   = $(XEN_ROOT)/tools/libs/gnttab
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_XENLIGHT       = $(XEN_ROOT)/tools/libxl
 XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
@@ -88,8 +89,17 @@ SHDEPS_libxenevtchn =
 LDLIBS_libxenevtchn = $(XEN_LIBXENEVTCHN)/libxenevtchn$(libextension)
 SHLIB_libxenevtchn  = -Wl,-rpath-link=$(XEN_LIBXENEVTCHN)
 
+CFLAGS_libxengnttab = -I$(XEN_LIBXENGNTTAB)/include $(CFLAGS_xeninclude)
+LDLIBS_libxengnttab = $(XEN_LIBXENGNTTAB)/libxengnttab$(libextension)
+SHLIB_libxengnttab  = -Wl,-rpath-link=$(XEN_LIBXENGNTTAB)
+
+# xengntshr_* interfaces are actually part of libxengnttab.so
+CFLAGS_libxengntshr = -I$(XEN_LIBXENGNTTAB)/include $(CFLAGS_xeninclude)
+LDLIBS_libxengntshr = $(XEN_LIBXENGNTTAB)/libxengnttab$(libextension)
+SHLIB_libxengntshr  = -Wl,-rpath-link=$(XEN_LIBXENGNTTAB)
+
 CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) $(CFLAGS_xeninclude)
-SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn)
+SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxengntshr)
 LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libextension)
 SHLIB_libxenctrl  = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_LIBXC)
 
@@ -109,7 +119,7 @@ LDLIBS_libxenstat  = $(SHDEPS_libxenstat) $(XEN_LIBXENSTAT)/libxenstat$(libexten
 SHLIB_libxenstat   = $(SHDEPS_libxenstat) -Wl,-rpath-link=$(XEN_LIBXENSTAT)
 
 CFLAGS_libxenvchan = -I$(XEN_LIBVCHAN)
-SHDEPS_libxenvchan = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenevtchn)
+SHDEPS_libxenvchan = $(SHLIB_libxentoollog) $(SHLIB_libxenstore) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxengntshr)
 LDLIBS_libxenvchan = $(SHDEPS_libxenvchan) $(XEN_LIBVCHAN)/libxenvchan$(libextension)
 SHLIB_libxenvchan  = $(SHDEPS_libxenvchan) -Wl,-rpath-link=$(XEN_LIBVCHAN)
 
diff --git a/tools/console/Makefile b/tools/console/Makefile
index 4b3a492..6eeac8f 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -3,10 +3,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 CFLAGS  += -Werror
 
-CFLAGS  += $(CFLAGS_libxenevtchn)
 CFLAGS  += $(CFLAGS_libxenctrl)
 CFLAGS  += $(CFLAGS_libxenstore)
-LDLIBS += $(LDLIBS_libxenevtchn)
 LDLIBS += $(LDLIBS_libxenctrl)
 LDLIBS += $(LDLIBS_libxenstore)
 LDLIBS += $(SOCKET_LIBS)
@@ -28,8 +26,9 @@ clean:
 .PHONY: distclean
 distclean: clean
 
+daemon/io.o: CFLAGS += $(CFLAGS_libxenevtchn) $(CFLAGS_libxengnttab)
 xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
-	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS)
 
 xenconsole: client/_paths.h $(patsubst %.c,%.o,$(wildcard client/*.c))
 	$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsole) $(APPEND_LDFLAGS)
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index 2f2e9c5..e2e7a6b 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -22,6 +22,7 @@
 #include "utils.h"
 #include "io.h"
 #include <xenevtchn.h>
+#include <xengnttab.h>
 #include <xenstore.h>
 #include <xen/io/console.h>
 #include <xen/grant_table.h>
@@ -72,7 +73,7 @@ static int log_time_hv_needts = 1;
 static int log_time_guest_needts = 1;
 static int log_hv_fd = -1;
 
-static xc_gnttab *xcg_handle = NULL;
+static xengnttab_handle *xgt_handle = NULL;
 
 static struct pollfd  *fds;
 static unsigned int current_array_size;
@@ -520,8 +521,8 @@ static void domain_unmap_interface(struct domain *dom)
 {
 	if (dom->interface == NULL)
 		return;
-	if (xcg_handle && dom->ring_ref == -1)
-		xc_gnttab_munmap(xcg_handle, dom->interface, 1);
+	if (xgt_handle && dom->ring_ref == -1)
+		xengnttab_unmap(xgt_handle, dom->interface, 1);
 	else
 		munmap(dom->interface, XC_PAGE_SIZE);
 	dom->interface = NULL;
@@ -552,9 +553,9 @@ static int domain_create_ring(struct domain *dom)
 	if (ring_ref != dom->ring_ref && dom->ring_ref != -1)
 		domain_unmap_interface(dom);
 
-	if (!dom->interface && xcg_handle) {
+	if (!dom->interface && xgt_handle) {
 		/* Prefer using grant table */
-		dom->interface = xc_gnttab_map_grant_ref(xcg_handle,
+		dom->interface = xengnttab_map_grant_ref(xgt_handle,
 			dom->domid, GNTTAB_RESERVED_CONSOLE,
 			PROT_READ|PROT_WRITE);
 		dom->ring_ref = -1;
@@ -1029,8 +1030,8 @@ void handle_io(void)
 		handle_hv_logs(xce_handle, true);
 	}
 
-	xcg_handle = xc_gnttab_open(NULL, 0);
-	if (xcg_handle == NULL) {
+	xgt_handle = xengnttab_open(NULL, 0);
+	if (xgt_handle == NULL) {
 		dolog(LOG_DEBUG, "Failed to open xcg handle: %d (%s)",
 		      errno, strerror(errno));
 	}
@@ -1206,9 +1207,9 @@ void handle_io(void)
 		xenevtchn_close(xce_handle);
 		xce_handle = NULL;
 	}
-	if (xcg_handle != NULL) {
-		xc_gnttab_close(xcg_handle);
-		xcg_handle = NULL;
+	if (xgt_handle != NULL) {
+		xengnttab_close(xgt_handle);
+		xgt_handle = NULL;
 	}
 	log_hv_evtchn = -1;
 }
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index 0e3f523..00156ae 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -4,5 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 SUBDIRS-y :=
 SUBDIRS-y += toollog
 SUBDIRS-y += evtchn
+SUBDIRS-y += gnttab
 
 all clean install distclean: %: subdirs-%
diff --git a/tools/libs/evtchn/minios.c b/tools/libs/evtchn/minios.c
index fb913a2..b839cd0 100644
--- a/tools/libs/evtchn/minios.c
+++ b/tools/libs/evtchn/minios.c
@@ -27,13 +27,12 @@
 #include <mini-os/events.h>
 #include <mini-os/wait.h>
 
-#include <sys/socket.h>
-
 #include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdint.h>
+#include <unistd.h>
 #include <inttypes.h>
 #include <malloc.h>
 
@@ -43,8 +42,6 @@ extern void minios_evtchn_close_fd(int fd);
 
 extern struct wait_queue_head event_queue;
 
-//void minios_evtchn_close_fd(int fd);
-
 /* XXX Note: This is not threadsafe */
 static struct evtchn_port_info* port_alloc(int fd) {
     struct evtchn_port_info *port_info;
diff --git a/tools/libs/gnttab/Makefile b/tools/libs/gnttab/Makefile
new file mode 100644
index 0000000..af64542
--- /dev/null
+++ b/tools/libs/gnttab/Makefile
@@ -0,0 +1,73 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR    = 1
+MINOR    = 0
+SHLIB_LDFLAGS += -Wl,--version-script=libxengnttab.map
+
+CFLAGS   += -Werror -Wmissing-prototypes
+CFLAGS   += -I./include $(CFLAGS_xeninclude)
+CFLAGS   += $(CFLAGS_libxentoollog)
+
+SRCS-GNTTAB            += gnttab_core.c
+SRCS-GNTSHR            += gntshr_core.c
+
+SRCS-$(CONFIG_Linux)   += $(SRCS-GNTTAB) $(SRCS-GNTSHR) linux.c
+SRCS-$(CONFIG_MiniOS)  += $(SRCS-GNTTAB) gntshr_unimp.c minios.c
+SRCS-$(CONFIG_FreeBSD) += gnttab_unimp.c gntshr_unimp.c
+SRCS-$(CONFIG_SunOS)   += gnttab_unimp.c gntshr_unimp.c
+SRCS-$(CONFIG_NetBSD)  += gnttab_unimp.c gntshr_unimp.c
+
+LIB_OBJS := $(patsubst %.c,%.o,$(SRCS-y))
+PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS-y))
+
+LIB := libxengnttab.a
+ifneq ($(nosharedlibs),y)
+LIB += libxengnttab.so
+endif
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build:
+	$(MAKE) libs
+
+.PHONY: libs
+libs: headers.chk $(LIB)
+
+headers.chk: $(wildcard include/*.h)
+
+libxengnttab.a: $(LIB_OBJS)
+	$(AR) rc $@ $^
+
+libxengnttab.so: libxengnttab.so.$(MAJOR)
+	$(SYMLINK_SHLIB) $< $@
+libxengnttab.so.$(MAJOR): libxengnttab.so.$(MAJOR).$(MINOR)
+	$(SYMLINK_SHLIB) $< $@
+
+libxengnttab.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxengnttab.map
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxengnttab.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: build
+	$(INSTALL_DIR) $(DESTDIR)$(libdir)
+	$(INSTALL_DIR) $(DESTDIR)$(includedir)
+	$(INSTALL_SHLIB) libxengnttab.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) libxengnttab.a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) libxengnttab.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxengnttab.so.$(MAJOR)
+	$(SYMLINK_SHLIB) libxengnttab.so.$(MAJOR) $(DESTDIR)$(libdir)/libxengnttab.so
+	$(INSTALL_DATA) include/xengnttab.h $(DESTDIR)$(includedir)
+
+.PHONY: TAGS
+TAGS:
+	etags -t *.c *.h
+
+.PHONY: clean
+clean:
+	rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+	rm -f libxengnttab.so.$(MAJOR).$(MINOR) libxengnttab.so.$(MAJOR)
+	rm -f headers.chk
+
+.PHONY: distclean
+distclean: clean
diff --git a/tools/libs/gnttab/gntshr_core.c b/tools/libs/gnttab/gntshr_core.c
new file mode 100644
index 0000000..7f6bf9d
--- /dev/null
+++ b/tools/libs/gnttab/gntshr_core.c
@@ -0,0 +1,95 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_gnttab.c
+ */
+
+#include <stdlib.h>
+
+#include "private.h"
+
+xengntshr_handle *xengntshr_open(xentoollog_logger *logger, unsigned open_flags)
+{
+    xengntshr_handle *xgs = malloc(sizeof(*xgs));
+    int rc;
+
+    if (!xgs) return NULL;
+
+    xgs->fd = -1;
+    xgs->logger = logger;
+    xgs->logger_tofree  = NULL;
+
+    if (!xgs->logger) {
+        xgs->logger = xgs->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xgs->logger) goto err;
+    }
+
+    rc = osdep_gntshr_open(xgs);
+    if ( rc  < 0 ) goto err;
+
+    return xgs;
+
+err:
+    osdep_gntshr_close(xgs);
+    xtl_logger_destroy(xgs->logger_tofree);
+    free(xgs);
+    return NULL;
+}
+
+int xengntshr_close(xengntshr_handle *xgs)
+{
+    int rc;
+
+    if ( !xgs )
+        return 0;
+
+    rc = osdep_gntshr_close(xgs);
+    xtl_logger_destroy(xgs->logger_tofree);
+    free(xgs);
+    return rc;
+}
+void *xengntshr_share_pages(xengntshr_handle *xcg, uint32_t domid,
+                            int count, uint32_t *refs, int writable)
+{
+    return osdep_gntshr_share_pages(xcg, domid, count, refs, writable, -1, -1);
+}
+
+void *xengntshr_share_page_notify(xengntshr_handle *xcg, uint32_t domid,
+                                  uint32_t *ref, int writable,
+                                  uint32_t notify_offset,
+                                  evtchn_port_t notify_port)
+{
+    return osdep_gntshr_share_pages(xcg, domid, 1, ref, writable,
+                                    notify_offset, notify_port);
+}
+
+int xengntshr_unshare(xengntshr_handle *xgs, void *start_address, uint32_t count)
+{
+    return osdep_gntshr_unshare(xgs, start_address, count);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/gntshr_unimp.c b/tools/libs/gnttab/gntshr_unimp.c
new file mode 100644
index 0000000..e210484
--- /dev/null
+++ b/tools/libs/gnttab/gntshr_unimp.c
@@ -0,0 +1,62 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_gnttab.c
+ */
+
+#include <stdlib.h>
+
+#include "private.h"
+
+xengntshr_handle *xengntshr_open(xentoollog_logger *logger, unsigned open_flags)
+{
+    return NULL;
+}
+
+int xengntshr_close(xengntshr_handle *xgs)
+{
+    return 0;
+}
+
+void *xengntshr_share_pages(xengntshr_handle *xcg, uint32_t domid,
+                            int count, uint32_t *refs, int writable)
+{
+    abort();
+}
+
+void *xengntshr_share_page_notify(xengntshr_handle *xcg, uint32_t domid,
+                                  uint32_t *ref, int writable,
+                                  uint32_t notify_offset,
+                                  evtchn_port_t notify_port)
+{
+    abort();
+}
+
+int xengntshr_unshare(xengntshr_handle *xgs, void *start_address, uint32_t count)
+{
+    abort();
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/gnttab_core.c b/tools/libs/gnttab/gnttab_core.c
new file mode 100644
index 0000000..5d0474d
--- /dev/null
+++ b/tools/libs/gnttab/gnttab_core.c
@@ -0,0 +1,124 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_gnttab.c
+ */
+
+#include <stdlib.h>
+
+#include "private.h"
+
+xengnttab_handle *xengnttab_open(xentoollog_logger *logger, unsigned open_flags)
+{
+    xengnttab_handle *xgt = malloc(sizeof(*xgt));
+    int rc;
+
+    if (!xgt) return NULL;
+
+    xgt->fd = -1;
+    xgt->logger = logger;
+    xgt->logger_tofree  = NULL;
+
+    if (!xgt->logger) {
+        xgt->logger = xgt->logger_tofree =
+            (xentoollog_logger*)
+            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
+        if (!xgt->logger) goto err;
+    }
+
+    rc = osdep_gnttab_open(xgt);
+    if ( rc  < 0 ) goto err;
+
+    return xgt;
+
+err:
+    osdep_gnttab_close(xgt);
+    xtl_logger_destroy(xgt->logger_tofree);
+    free(xgt);
+    return NULL;
+}
+
+int xengnttab_close(xengnttab_handle *xgt)
+{
+    int rc;
+
+    if ( !xgt )
+        return 0;
+
+    rc = osdep_gnttab_close(xgt);
+    xtl_logger_destroy(xgt->logger_tofree);
+    free(xgt);
+    return rc;
+}
+
+int xengnttab_set_max_grants(xengnttab_handle *xgt, uint32_t count)
+{
+    return osdep_gnttab_set_max_grants(xgt, count);
+}
+
+void *xengnttab_map_grant_ref(xengnttab_handle *xgt,
+                              uint32_t domid,
+                              uint32_t ref,
+                              int prot)
+{
+    return osdep_gnttab_grant_map(xgt, 1, 0, prot, &domid, &ref, -1, -1);
+}
+
+void *xengnttab_map_grant_refs(xengnttab_handle *xgt,
+                               uint32_t count,
+                               uint32_t *domids,
+                               uint32_t *refs,
+                               int prot)
+{
+    return osdep_gnttab_grant_map(xgt, count, 0, prot, domids, refs, -1, -1);
+}
+
+void *xengnttab_map_domain_grant_refs(xengnttab_handle *xgt,
+                                      uint32_t count,
+                                      uint32_t domid,
+                                      uint32_t *refs,
+                                      int prot)
+{
+    return osdep_gnttab_grant_map(xgt, count, XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN,
+                                  prot, &domid, refs, -1, -1);
+}
+
+void *xengnttab_map_grant_ref_notify(xengnttab_handle *xgt,
+                                     uint32_t domid,
+                                     uint32_t ref,
+                                     int prot,
+                                     uint32_t notify_offset,
+                                     evtchn_port_t notify_port)
+{
+    return osdep_gnttab_grant_map(xgt, 1, 0, prot,  &domid, &ref,
+                                  notify_offset, notify_port);
+}
+
+int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count)
+{
+    return osdep_gnttab_unmap(xgt, start_address, count);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/gnttab_unimp.c b/tools/libs/gnttab/gnttab_unimp.c
new file mode 100644
index 0000000..b3a4a20
--- /dev/null
+++ b/tools/libs/gnttab/gnttab_unimp.c
@@ -0,0 +1,89 @@
+/******************************************************************************
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_gnttab.c
+ */
+
+#include <stdlib.h>
+
+#include "private.h"
+
+xengnttab_handle *xengnttab_open(xentoollog_logger *logger, unsigned open_flags)
+{
+    return NULL;
+}
+
+int xengnttab_close(xengnttab_handle *xgt)
+{
+    return 0;
+}
+
+int xengnttab_set_max_grants(xengnttab_handle *xgt, uint32_t count)
+{
+    abort();
+}
+
+void *xengnttab_map_grant_ref(xengnttab_handle *xgt,
+                              uint32_t domid,
+                              uint32_t ref,
+                              int prot)
+{
+    abort();
+}
+
+void *xengnttab_map_grant_refs(xengnttab_handle *xgt,
+                               uint32_t count,
+                               uint32_t *domids,
+                               uint32_t *refs,
+                               int prot)
+{
+    abort();
+}
+
+void *xengnttab_map_domain_grant_refs(xengnttab_handle *xgt,
+                                      uint32_t count,
+                                      uint32_t domid,
+                                      uint32_t *refs,
+                                      int prot)
+{
+    abort();
+}
+
+void *xengnttab_map_grant_ref_notify(xengnttab_handle *xgt,
+                                     uint32_t domid,
+                                     uint32_t ref,
+                                     int prot,
+                                     uint32_t notify_offset,
+                                     evtchn_port_t notify_port)
+{
+    abort();
+}
+
+int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count)
+{
+    abort();
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/include/xengnttab.h b/tools/libs/gnttab/include/xengnttab.h
new file mode 100644
index 0000000..700a5f1
--- /dev/null
+++ b/tools/libs/gnttab/include/xengnttab.h
@@ -0,0 +1,216 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split off from:
+ * xenctrl.h
+ *
+ * A library for low-level access to the Xen control interfaces.
+ *
+ * Copyright (c) 2007-2008, D G Murray <Derek.Murray@cl.cam.ac.uk>
+ */
+#ifndef XENGNTTAB_H
+#define XENGNTTAB_H
+
+#include <stdint.h>
+
+#include <xen/grant_table.h>
+#include <xen/event_channel.h>
+
+/* Callers who don't care don't need to #include <xentoollog.h> */
+typedef struct xentoollog_logger xentoollog_logger;
+
+/*
+ * Grant Table Interface (making use of grants from other domains)
+ */
+
+typedef struct xengntdev_handle xengnttab_handle;
+
+/*
+ * Note:
+ * After fork a child process must not use any opened xc gnttab
+ * handle inherited from their parent. They must open a new handle if
+ * they want to interact with xc.
+ *
+ * Return an fd onto the grant table driver.  Logs errors.
+ */
+xengnttab_handle *xengnttab_open(xentoollog_logger *logger, unsigned open_flags);
+
+/*
+ * Close a handle previously allocated with xengnttab_open().
+ * Never logs errors.
+ */
+int xengnttab_close(xengnttab_handle *xgt);
+
+/*
+ * Memory maps a grant reference from one domain to a local address range.
+ * Mappings should be unmapped with xengnttab_unmap.  Logs errors.
+ *
+ * @parm xgt a handle on an open grant table interface
+ * @parm domid the domain to map memory from
+ * @parm ref the grant reference ID to map
+ * @parm prot same flag as in mmap()
+ */
+void *xengnttab_map_grant_ref(xengnttab_handle *xgt,
+                              uint32_t domid,
+                              uint32_t ref,
+                              int prot);
+
+/**
+ * Memory maps one or more grant references from one or more domains to a
+ * contiguous local address range. Mappings should be unmapped with
+ * xengnttab_unmap.  Logs errors.
+ *
+ * @parm xgt a handle on an open grant table interface
+ * @parm count the number of grant references to be mapped
+ * @parm domids an array of @count domain IDs by which the corresponding @refs
+ *              were granted
+ * @parm refs an array of @count grant references to be mapped
+ * @parm prot same flag as in mmap()
+ */
+void *xengnttab_map_grant_refs(xengnttab_handle *xgt,
+                               uint32_t count,
+                               uint32_t *domids,
+                               uint32_t *refs,
+                               int prot);
+
+/**
+ * Memory maps one or more grant references from one domain to a
+ * contiguous local address range. Mappings should be unmapped with
+ * xengnttab_unmap.  Logs errors.
+ *
+ * @parm xgt a handle on an open grant table interface
+ * @parm count the number of grant references to be mapped
+ * @parm domid the domain to map memory from
+ * @parm refs an array of @count grant references to be mapped
+ * @parm prot same flag as in mmap()
+ */
+void *xengnttab_map_domain_grant_refs(xengnttab_handle *xgt,
+                                      uint32_t count,
+                                      uint32_t domid,
+                                      uint32_t *refs,
+                                      int prot);
+
+/**
+ * Memory maps a grant reference from one domain to a local address range.
+ * Mappings should be unmapped with xengnttab_unmap. If notify_offset or
+ * notify_port are not -1, this version will attempt to set up an unmap
+ * notification at the given offset and event channel. When the page is
+ * unmapped, the byte at the given offset will be zeroed and a wakeup will be
+ * sent to the given event channel.  Logs errors.
+ *
+ * @parm xgt a handle on an open grant table interface
+ * @parm domid the domain to map memory from
+ * @parm ref the grant reference ID to map
+ * @parm prot same flag as in mmap()
+ * @parm notify_offset The byte offset in the page to use for unmap
+ *                     notification; -1 for none.
+ * @parm notify_port The event channel port to use for unmap notify, or -1
+ */
+void *xengnttab_map_grant_ref_notify(xengnttab_handle *xgt,
+                                     uint32_t domid,
+                                     uint32_t ref,
+                                     int prot,
+                                     uint32_t notify_offset,
+                                     evtchn_port_t notify_port);
+
+/*
+ * Unmaps the @count pages starting at @start_address, which were mapped by a
+ * call to xengnttab_map_grant_ref or xengnttab_map_grant_refs. Never logs.
+ */
+int xengnttab_unmap(xengnttab_handle *xgt, void *start_address, uint32_t count);
+
+/*
+ * Sets the maximum number of grants that may be mapped by the given instance
+ * to @count.  Never logs.
+ *
+ * N.B. This function must be called after opening the handle, and before any
+ *      other functions are invoked on it.
+ *
+ * N.B. When variable-length grants are mapped, fragmentation may be observed,
+ *      and it may not be possible to satisfy requests up to the maximum number
+ *      of grants.
+ */
+int xengnttab_set_max_grants(xengnttab_handle *xgt,
+			     uint32_t count);
+
+/*
+ * Grant Sharing Interface (allocating and granting pages)
+ */
+
+typedef struct xengntdev_handle xengntshr_handle;
+
+/*
+ * Return an fd onto the grant sharing driver.  Logs errors.
+ *
+ * Note:
+ * After fork a child process must not use any opened xc gntshr
+ * handle inherited from their parent. They must open a new handle if
+ * they want to interact with xc.
+ *
+ */
+xengntshr_handle *xengntshr_open(xentoollog_logger *logger,
+			  unsigned open_flags);
+
+/*
+ * Close a handle previously allocated with xengntshr_open().
+ * Never logs errors.
+ */
+int xengntshr_close(xengntshr_handle *xgs);
+
+/*
+ * Creates and shares pages with another domain.
+ *
+ * @parm xgs a handle to an open grant sharing instance
+ * @parm domid the domain to share memory with
+ * @parm count the number of pages to share
+ * @parm refs the grant references of the pages (output)
+ * @parm writable true if the other domain can write to the pages
+ * @return local mapping of the pages
+ */
+void *xengntshr_share_pages(xengntshr_handle *xgs, uint32_t domid,
+                            int count, uint32_t *refs, int writable);
+
+/*
+ * Creates and shares a page with another domain, with unmap notification.
+ *
+ * @parm xgs a handle to an open grant sharing instance
+ * @parm domid the domain to share memory with
+ * @parm refs the grant reference of the pages (output)
+ * @parm writable true if the other domain can write to the page
+ * @parm notify_offset The byte offset in the page to use for unmap
+ *                     notification; -1 for none.
+ * @parm notify_port The event channel port to use for unmap notify, or -1
+ * @return local mapping of the page
+ */
+void *xengntshr_share_page_notify(xengntshr_handle *xgs, uint32_t domid,
+                                  uint32_t *ref, int writable,
+                                  uint32_t notify_offset,
+                                  evtchn_port_t notify_port);
+/*
+ * Unmaps the @count pages starting at @start_address, which were mapped by a
+ * call to xengntshr_share_*. Never logs.
+ */
+int xengntshr_unshare(xengntshr_handle *xgs, void *start_address, uint32_t count);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/libxengnttab.map b/tools/libs/gnttab/libxengnttab.map
new file mode 100644
index 0000000..dc737ac
--- /dev/null
+++ b/tools/libs/gnttab/libxengnttab.map
@@ -0,0 +1,23 @@
+VERS_1.0 {
+	global:
+		xengnttab_open;
+		xengnttab_close;
+
+		xengnttab_set_max_grants;
+
+		xengnttab_map_domain_grant_refs;
+		xengnttab_map_grant_ref;
+		xengnttab_map_grant_ref_notify;
+		xengnttab_map_grant_refs;
+
+		xengnttab_unmap;
+
+		xengntshr_open;
+		xengntshr_close;
+
+		xengntshr_share_page_notify;
+		xengntshr_share_pages;
+
+		xengntshr_unshare;
+	local: *; /* Do not expose anything by default */
+};
diff --git a/tools/libs/gnttab/linux.c b/tools/libs/gnttab/linux.c
new file mode 100644
index 0000000..768119a
--- /dev/null
+++ b/tools/libs/gnttab/linux.c
@@ -0,0 +1,329 @@
+/*
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Split out from xc_linux_osdep.c
+ */
+
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+
+#include <xen/sys/gntdev.h>
+#include <xen/sys/gntalloc.h>
+
+#include "private.h"
+
+#define DEVXEN "/dev/xen/"
+
+#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
+
+#define GTERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gnttab", _f)
+#define GSERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gntshr", _f)
+
+#define PAGE_SHIFT           12
+#define PAGE_SIZE            (1UL << PAGE_SHIFT)
+#define PAGE_MASK            (~(PAGE_SIZE-1))
+
+int osdep_gnttab_open(xengnttab_handle *xgt)
+{
+    int fd = open(DEVXEN "gntdev", O_RDWR);
+    if ( fd == -1 )
+        return -1;
+    xgt->fd = fd;
+    return 0;
+}
+
+int osdep_gnttab_close(xengnttab_handle *xgt)
+{
+    if ( xgt->fd == -1 )
+        return 0;
+
+    return close(xgt->fd);
+}
+
+int osdep_gnttab_set_max_grants(xengnttab_handle *xgt, uint32_t count)
+{
+    int fd = xgt->fd, rc;
+    struct ioctl_gntdev_set_max_grants max_grants = { .count = count };
+
+    rc = ioctl(fd, IOCTL_GNTDEV_SET_MAX_GRANTS, &max_grants);
+    if (rc) {
+        /*
+         * Newer (e.g. pv-ops) kernels don't implement this IOCTL,
+         * so ignore the resulting specific failure.
+         */
+        if (errno == ENOTTY)
+            rc = 0;
+        else
+            GTERROR(xgt->logger, "ioctl SET_MAX_GRANTS failed");
+    }
+
+    return rc;
+}
+
+void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port)
+{
+    int fd = xgt->fd;
+    struct ioctl_gntdev_map_grant_ref *map;
+    unsigned int map_size = ROUNDUP((sizeof(*map) + (count - 1) *
+                                    sizeof(struct ioctl_gntdev_map_grant_ref)),
+                                    PAGE_SHIFT);
+    void *addr = NULL;
+    int domids_stride = 1;
+    int i;
+
+    if (flags & XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN)
+        domids_stride = 0;
+
+    if ( map_size <= PAGE_SIZE )
+        map = alloca(sizeof(*map) +
+                     (count - 1) * sizeof(struct ioctl_gntdev_map_grant_ref));
+    else
+    {
+        map = mmap(NULL, map_size, PROT_READ | PROT_WRITE,
+                   MAP_PRIVATE | MAP_ANON | MAP_POPULATE, -1, 0);
+        if ( map == MAP_FAILED )
+        {
+            GTERROR(xgt->logger, "mmap of map failed");
+            return NULL;
+        }
+    }
+
+    for ( i = 0; i < count; i++ )
+    {
+        map->refs[i].domid = domids[i * domids_stride];
+        map->refs[i].ref = refs[i];
+    }
+
+    map->count = count;
+
+    if ( ioctl(fd, IOCTL_GNTDEV_MAP_GRANT_REF, map) ) {
+        GTERROR(xgt->logger, "ioctl MAP_GRANT_REF failed");
+        goto out;
+    }
+
+ retry:
+    addr = mmap(NULL, PAGE_SIZE * count, prot, MAP_SHARED, fd,
+                map->index);
+
+    if (addr == MAP_FAILED && errno == EAGAIN)
+    {
+        /*
+         * The grant hypercall can return EAGAIN if the granted page is
+         * swapped out. Since the paging daemon may be in the same domain, the
+         * hypercall cannot block without causing a deadlock.
+         *
+         * Because there are no notificaitons when the page is swapped in, wait
+         * a bit before retrying, and hope that the page will arrive eventually.
+         */
+        usleep(1000);
+        goto retry;
+    }
+
+    if (addr != MAP_FAILED)
+    {
+        int rv = 0;
+        struct ioctl_gntdev_unmap_notify notify;
+        notify.index = map->index;
+        notify.action = 0;
+        if (notify_offset < PAGE_SIZE * count) {
+            notify.index += notify_offset;
+            notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
+        }
+        if (notify_port != -1) {
+            notify.event_channel_port = notify_port;
+            notify.action |= UNMAP_NOTIFY_SEND_EVENT;
+        }
+        if (notify.action)
+            rv = ioctl(fd, IOCTL_GNTDEV_SET_UNMAP_NOTIFY, &notify);
+        if (rv) {
+            GTERROR(xgt->logger, "ioctl SET_UNMAP_NOTIFY failed");
+            munmap(addr, count * PAGE_SIZE);
+            addr = MAP_FAILED;
+        }
+    }
+
+    if (addr == MAP_FAILED)
+    {
+        int saved_errno = errno;
+        struct ioctl_gntdev_unmap_grant_ref unmap_grant;
+
+        /* Unmap the driver slots used to store the grant information. */
+        GTERROR(xgt->logger, "mmap failed");
+        unmap_grant.index = map->index;
+        unmap_grant.count = count;
+        ioctl(fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant);
+        errno = saved_errno;
+        addr = NULL;
+    }
+
+ out:
+    if ( map_size > PAGE_SIZE )
+        munmap(map, map_size);
+
+    return addr;
+}
+
+int osdep_gnttab_unmap(xengnttab_handle *xgt,
+                       void *start_address,
+                       uint32_t count)
+{
+    int fd = xgt->fd;
+    struct ioctl_gntdev_get_offset_for_vaddr get_offset;
+    struct ioctl_gntdev_unmap_grant_ref unmap_grant;
+    int rc;
+
+    if ( start_address == NULL )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+
+    /* First, it is necessary to get the offset which was initially used to
+     * mmap() the pages.
+     */
+    get_offset.vaddr = (unsigned long)start_address;
+    if ( (rc = ioctl(fd, IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR,
+                     &get_offset)) )
+        return rc;
+
+    if ( get_offset.count != count )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+
+    /* Next, unmap the memory. */
+    if ( (rc = munmap(start_address, count * PAGE_SIZE)) )
+        return rc;
+
+    /* Finally, unmap the driver slots used to store the grant information. */
+    unmap_grant.index = get_offset.offset;
+    unmap_grant.count = count;
+    if ( (rc = ioctl(fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant)) )
+        return rc;
+
+    return 0;
+}
+
+int osdep_gntshr_open(xengntshr_handle *xgs)
+{
+    int fd = open(DEVXEN "gntalloc", O_RDWR);
+    if ( fd == -1 )
+        return -1;
+    xgs->fd = fd;
+    return 0;
+}
+
+int osdep_gntshr_close(xengntshr_handle *xgs)
+{
+    if ( xgs->fd == -1 )
+        return 0;
+
+    return close(xgs->fd);
+}
+
+void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
+                               uint32_t domid, int count,
+                               uint32_t *refs, int writable,
+                               uint32_t notify_offset,
+                               evtchn_port_t notify_port)
+{
+    struct ioctl_gntalloc_alloc_gref *gref_info = NULL;
+    struct ioctl_gntalloc_unmap_notify notify;
+    struct ioctl_gntalloc_dealloc_gref gref_drop;
+    int fd = xgs->fd;
+    int err;
+    void *area = NULL;
+    gref_info = malloc(sizeof(*gref_info) + count * sizeof(uint32_t));
+    if (!gref_info)
+        return NULL;
+    gref_info->domid = domid;
+    gref_info->flags = writable ? GNTALLOC_FLAG_WRITABLE : 0;
+    gref_info->count = count;
+
+    err = ioctl(fd, IOCTL_GNTALLOC_ALLOC_GREF, gref_info);
+    if (err) {
+        GSERROR(xgs->logger, "ioctl failed");
+        goto out;
+    }
+
+    area = mmap(NULL, count * PAGE_SIZE, PROT_READ | PROT_WRITE,
+        MAP_SHARED, fd, gref_info->index);
+
+    if (area == MAP_FAILED) {
+        area = NULL;
+        GSERROR(xgs->logger, "mmap failed");
+        goto out_remove_fdmap;
+    }
+
+    notify.index = gref_info->index;
+    notify.action = 0;
+    if (notify_offset < PAGE_SIZE * count) {
+        notify.index += notify_offset;
+        notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
+    }
+    if (notify_port != -1) {
+        notify.event_channel_port = notify_port;
+        notify.action |= UNMAP_NOTIFY_SEND_EVENT;
+    }
+    if (notify.action)
+        err = ioctl(fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &notify);
+    if (err) {
+        GSERROR(xgs->logger, "ioctl SET_UNMAP_NOTIFY failed");
+		munmap(area, count * PAGE_SIZE);
+		area = NULL;
+	}
+
+    memcpy(refs, gref_info->gref_ids, count * sizeof(uint32_t));
+
+ out_remove_fdmap:
+    /* Removing the mapping from the file descriptor does not cause the pages to
+     * be deallocated until the mapping is removed.
+     */
+    gref_drop.index = gref_info->index;
+    gref_drop.count = count;
+    ioctl(fd, IOCTL_GNTALLOC_DEALLOC_GREF, &gref_drop);
+ out:
+    free(gref_info);
+    return area;
+}
+
+int osdep_gntshr_unshare(xengntshr_handle *xgs,
+                         void *start_address, uint32_t count)
+{
+    return munmap(start_address, count * PAGE_SIZE);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/minios.c b/tools/libs/gnttab/minios.c
new file mode 100644
index 0000000..7e04174
--- /dev/null
+++ b/tools/libs/gnttab/minios.c
@@ -0,0 +1,117 @@
+/*
+ *
+ * Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.com>.
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Splitfrom xc_minios.c
+ */
+
+#include <mini-os/types.h>
+#include <mini-os/os.h>
+#include <mini-os/lib.h>
+
+#include <mini-os/gntmap.h>
+#include <sys/mman.h>
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "private.h"
+
+void minios_gnttab_close_fd(int fd);
+
+int osdep_gnttab_open(xengnttab_handle *xgt)
+{
+    int fd = alloc_fd(FTYPE_GNTMAP);
+    if ( fd == -1 )
+        return -1;
+    gntmap_init(&files[fd].gntmap);
+    xgt->fd = fd;
+    return 0;
+}
+
+int osdep_gnttab_close(xengnttab_handle *xgt)
+{
+    if ( xgt->fd == -1 )
+        return 0;
+
+    return close(xgt->fd);
+}
+
+void minios_gnttab_close_fd(int fd)
+{
+    gntmap_fini(&files[fd].gntmap);
+    files[fd].type = FTYPE_NONE;
+}
+
+void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port)
+{
+    int fd = xgt->fd;
+    int stride = 1;
+    if (flags & XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN)
+        stride = 0;
+    if (notify_offset != -1 || notify_port != -1) {
+        errno = ENOSYS;
+        return NULL;
+    }
+    return gntmap_map_grant_refs(&files[fd].gntmap,
+                                 count, domids, stride,
+                                 refs, prot & PROT_WRITE);
+}
+
+int osdep_gnttab_unmap(xengnttab_handle *xgt,
+                       void *start_address,
+                       uint32_t count)
+{
+    int fd = xgt->fd;
+    int ret;
+    ret = gntmap_munmap(&files[fd].gntmap,
+                        (unsigned long) start_address,
+                        count);
+    if (ret < 0) {
+        errno = -ret;
+        return -1;
+    }
+    return ret;
+}
+
+int osdep_gnttab_set_max_grants(xengnttab_handle *xgt, uint32_t count)
+{
+    int fd = xgt->fd;
+    int ret;
+    ret = gntmap_set_max_grants(&files[fd].gntmap,
+                                count);
+    if (ret < 0) {
+        errno = -ret;
+        return -1;
+    }
+    return ret;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/gnttab/private.h b/tools/libs/gnttab/private.h
new file mode 100644
index 0000000..d286c86
--- /dev/null
+++ b/tools/libs/gnttab/private.h
@@ -0,0 +1,47 @@
+#ifndef XENGNTTAB_PRIVATE_H
+#define XENGNTTAB_PRIVATE_H
+
+#include <xentoollog.h>
+#include <xengnttab.h>
+
+struct xengntdev_handle {
+    xentoollog_logger *logger, *logger_tofree;
+    int fd;
+};
+
+int osdep_gnttab_open(xengnttab_handle *xgt);
+int osdep_gnttab_close(xengnttab_handle *xgt);
+
+int osdep_gnttab_set_max_grants(xengnttab_handle *xgt, uint32_t count);
+
+#define XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN 0x1
+void *osdep_gnttab_grant_map(xengnttab_handle *xgt,
+                             uint32_t count, int flags, int prot,
+                             uint32_t *domids, uint32_t *refs,
+                             uint32_t notify_offset,
+                             evtchn_port_t notify_port);
+int osdep_gnttab_unmap(xengnttab_handle *xgt,
+                       void *start_address,
+                       uint32_t count);
+int osdep_gntshr_open(xengntshr_handle *xgs);
+int osdep_gntshr_close(xengntshr_handle *xgs);
+
+void *osdep_gntshr_share_pages(xengntshr_handle *xgs,
+                               uint32_t domid, int count,
+                               uint32_t *refs, int writable,
+                               uint32_t notify_offset,
+                               evtchn_port_t notify_port);
+int osdep_gntshr_unshare(xengntshr_handle *xgs,
+                         void *start_address, uint32_t count);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libvchan/Makefile b/tools/libvchan/Makefile
index 84128a3..0573d2f 100644
--- a/tools/libvchan/Makefile
+++ b/tools/libvchan/Makefile
@@ -10,15 +10,17 @@ NODE_OBJS = node.o
 NODE2_OBJS = node-select.o
 
 LIBVCHAN_PIC_OBJS = $(patsubst %.o,%.opic,$(LIBVCHAN_OBJS))
-LIBVCHAN_LIBS = $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenevtchn)
-$(LIBVCHAN_OBJS) $(LIBVCHAN_PIC_OBJS): CFLAGS += $(CFLAGS_libxenstore) $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn)
-$(NODE_OBJS) $(NODE2_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn)
+LIBVCHAN_LIBS = $(LDLIBS_libxenstore) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(LDLIBS_libxenevtchn)
+$(LIBVCHAN_OBJS) $(LIBVCHAN_PIC_OBJS): CFLAGS += $(CFLAGS_libxenstore) $(CFLAGS_libxengnttab) $(CFLAGS_libxengntshr) $(CFLAGS_libxenevtchn)
+$(NODE_OBJS) $(NODE2_OBJS): CFLAGS += $(CFLAGS_libxengnttab) $(CFLAGS_libxengntshr) $(CFLAGS_libxenevtchn)
 
 MAJOR = 1.0
 MINOR = 0
 
 CFLAGS += -I../include -I.
 
+io.o io.opic: CFLAGS += $(CFLAGS_libxenctrl) # for xen_mb et al
+
 .PHONY: all
 all: libxenvchan.so vchan-node1 vchan-node2 libxenvchan.a
 
diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c
index 66cb103..91531b9 100644
--- a/tools/libvchan/init.c
+++ b/tools/libvchan/init.c
@@ -78,7 +78,7 @@ static int init_gnt_srv(struct libxenvchan *ctrl, int domain)
 	uint32_t ring_ref = -1;
 	void *ring;
 
-	ring = xc_gntshr_share_page_notify(ctrl->gntshr, domain,
+	ring = xengntshr_share_page_notify(ctrl->gntshr, domain,
 			&ring_ref, 1, offsetof(struct vchan_interface, srv_live),
 			ctrl->event_port);
 
@@ -104,7 +104,7 @@ static int init_gnt_srv(struct libxenvchan *ctrl, int domain)
 		ctrl->read.buffer = ((void*)ctrl->ring) + LARGE_RING_OFFSET;
 		break;
 	default:
-		ctrl->read.buffer = xc_gntshr_share_pages(ctrl->gntshr, domain,
+		ctrl->read.buffer = xengntshr_share_pages(ctrl->gntshr, domain,
 			pages_left, ctrl->ring->grants, 1);
 		if (!ctrl->read.buffer)
 			goto out_ring;
@@ -118,7 +118,7 @@ static int init_gnt_srv(struct libxenvchan *ctrl, int domain)
 		ctrl->write.buffer = ((void*)ctrl->ring) + LARGE_RING_OFFSET;
 		break;
 	default:
-		ctrl->write.buffer = xc_gntshr_share_pages(ctrl->gntshr, domain,
+		ctrl->write.buffer = xengntshr_share_pages(ctrl->gntshr, domain,
 			pages_right, ctrl->ring->grants + pages_left, 1);
 		if (!ctrl->write.buffer)
 			goto out_unmap_left;
@@ -128,9 +128,9 @@ out:
 	return ring_ref;
 out_unmap_left:
 	if (pages_left)
-		xc_gntshr_munmap(ctrl->gntshr, ctrl->read.buffer, pages_left);
+		xengntshr_unshare(ctrl->gntshr, ctrl->read.buffer, pages_left);
 out_ring:
-	xc_gntshr_munmap(ctrl->gntshr, ring, 1);
+	xengntshr_unshare(ctrl->gntshr, ring, 1);
 	ring_ref = -1;
 	ctrl->ring = NULL;
 	ctrl->write.order = ctrl->read.order = 0;
@@ -142,7 +142,7 @@ static int init_gnt_cli(struct libxenvchan *ctrl, int domain, uint32_t ring_ref)
 	int rv = -1;
 	uint32_t *grants;
 
-	ctrl->ring = xc_gnttab_map_grant_ref_notify(ctrl->gnttab,
+	ctrl->ring = xengnttab_map_grant_ref_notify(ctrl->gnttab,
 		domain, ring_ref, PROT_READ|PROT_WRITE,
 		offsetof(struct vchan_interface, cli_live), ctrl->event_port);
 
@@ -172,7 +172,7 @@ static int init_gnt_cli(struct libxenvchan *ctrl, int domain, uint32_t ring_ref)
 	default:
 		{
 			int pages_left = 1 << (ctrl->write.order - PAGE_SHIFT);
-			ctrl->write.buffer = xc_gnttab_map_domain_grant_refs(ctrl->gnttab,
+			ctrl->write.buffer = xengnttab_map_domain_grant_refs(ctrl->gnttab,
 				pages_left, domain, grants, PROT_READ|PROT_WRITE);
 			if (!ctrl->write.buffer)
 				goto out_unmap_ring;
@@ -190,7 +190,7 @@ static int init_gnt_cli(struct libxenvchan *ctrl, int domain, uint32_t ring_ref)
 	default:
 		{
 			int pages_right = 1 << (ctrl->read.order - PAGE_SHIFT);
-			ctrl->read.buffer = xc_gnttab_map_domain_grant_refs(ctrl->gnttab,
+			ctrl->read.buffer = xengnttab_map_domain_grant_refs(ctrl->gnttab,
 				pages_right, domain, grants, PROT_READ);
 			if (!ctrl->read.buffer)
 				goto out_unmap_left;
@@ -202,10 +202,10 @@ static int init_gnt_cli(struct libxenvchan *ctrl, int domain, uint32_t ring_ref)
 	return rv;
  out_unmap_left:
 	if (ctrl->write.order >= PAGE_SHIFT)
-		xc_gnttab_munmap(ctrl->gnttab, ctrl->write.buffer,
-		                 1 << (ctrl->write.order - PAGE_SHIFT));
+		xengnttab_unmap(ctrl->gnttab, ctrl->write.buffer,
+		                1 << (ctrl->write.order - PAGE_SHIFT));
  out_unmap_ring:
-	xc_gnttab_munmap(ctrl->gnttab, ctrl->ring, 1);
+	xengnttab_unmap(ctrl->gnttab, ctrl->ring, 1);
 	ctrl->ring = 0;
 	ctrl->write.order = ctrl->read.order = 0;
 	rv = -1;
@@ -325,7 +325,7 @@ struct libxenvchan *libxenvchan_server_init(xentoollog_logger *logger, int domai
 		ctrl->write.order = LARGE_RING_SHIFT;
 	}
 
-	ctrl->gntshr = xc_gntshr_open(logger, 0);
+	ctrl->gntshr = xengntshr_open(logger, 0);
 	if (!ctrl->gntshr)
 		goto out;
 
@@ -413,7 +413,7 @@ struct libxenvchan *libxenvchan_client_init(xentoollog_logger *logger, int domai
 	if (!ctrl->event_port)
 		goto fail;
 
-	ctrl->gnttab = xc_gnttab_open(logger, 0);
+	ctrl->gnttab = xengnttab_open(logger, 0);
 	if (!ctrl->gnttab)
 		goto fail;
 
diff --git a/tools/libvchan/io.c b/tools/libvchan/io.c
index 53393a5..da303fb 100644
--- a/tools/libvchan/io.c
+++ b/tools/libvchan/io.c
@@ -366,10 +366,10 @@ void libxenvchan_close(struct libxenvchan *ctrl)
 	if (ctrl->ring) {
 		if (ctrl->is_server) {
 			ctrl->ring->srv_live = 0;
-			xc_gntshr_munmap(ctrl->gntshr, ctrl->ring, 1);
+			xengntshr_unshare(ctrl->gntshr, ctrl->ring, 1);
 		} else {
 			ctrl->ring->cli_live = 0;
-			xc_gnttab_munmap(ctrl->gnttab, ctrl->ring, 1);
+			xengnttab_unmap(ctrl->gnttab, ctrl->ring, 1);
 		}
 	}
 	if (ctrl->event) {
@@ -379,10 +379,10 @@ void libxenvchan_close(struct libxenvchan *ctrl)
 	}
 	if (ctrl->is_server) {
 		if (ctrl->gntshr)
-			xc_gntshr_close(ctrl->gntshr);
+			xengntshr_close(ctrl->gntshr);
 	} else {
 		if (ctrl->gnttab)
-			xc_gnttab_close(ctrl->gnttab);
+			xengnttab_close(ctrl->gnttab);
 	}
 	free(ctrl);
 }
diff --git a/tools/libvchan/libxenvchan.h b/tools/libvchan/libxenvchan.h
index 1544378..341c375 100644
--- a/tools/libvchan/libxenvchan.h
+++ b/tools/libvchan/libxenvchan.h
@@ -45,7 +45,7 @@
 #include <xen/io/libxenvchan.h>
 #include <xen/sys/evtchn.h>
 #include <xenevtchn.h>
-#include <xenctrl.h>
+#include <xengnttab.h>
 
 struct libxenvchan_ring {
 	/* Pointer into the shared page. Offsets into buffer. */
@@ -66,8 +66,8 @@ struct libxenvchan_ring {
 struct libxenvchan {
 	/* Mapping handle for shared ring page */
 	union {
-		xc_gntshr *gntshr; /* for server */
-		xc_gnttab *gnttab; /* for client */
+		xengntshr_handle *gntshr; /* for server */
+		xengnttab_handle *gnttab; /* for client */
 	};
 	/* Pointer to shared ring page */
 	struct vchan_interface *ring;
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 184cbb7..33d18db 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -43,12 +43,13 @@ CTRL_SRCS-y       += xc_resource.c
 CTRL_SRCS-$(CONFIG_X86) += xc_psr.c
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c xc_linux_osdep.c
-CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c xc_freebsd_osdep.c xc_nognttab.c xc_nogntshr.c
-CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c xc_nognttab.c xc_nogntshr.c
-CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c xc_nognttab.c xc_nogntshr.c
-CTRL_SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c xc_nognttab.c xc_nogntshr.c
-CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c xc_nogntshr.c
+CTRL_SRCS-$(CONFIG_FreeBSD) += xc_freebsd.c xc_freebsd_osdep.c
+CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
+CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
+CTRL_SRCS-$(CONFIG_NetBSDRump) += xc_netbsd.c
+CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
 CTRL_SRCS-y       += xc_evtchn_compat.c
+CTRL_SRCS-y       += xc_gnttab_compat.c
 
 GUEST_SRCS-y :=
 GUEST_SRCS-y += xg_private.c xc_suspend.c
@@ -126,6 +127,8 @@ 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
 
+$(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS): CFLAGS += $(CFLAGS_libxengnttab) $(CFLAGS_libxengntshr)
+
 LIB := libxenctrl.a
 ifneq ($(nosharedlibs),y)
 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
@@ -209,7 +212,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 513aaa3..759f9df 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -5,9 +5,6 @@
  *
  * Copyright (c) 2003-2004, K A Fraser.
  *
- * 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;
@@ -117,8 +114,6 @@
  */
 
 typedef struct xc_interface_core xc_interface;
-typedef struct xengntdev_handle xc_gnttab;
-typedef struct xengntdev_handle xc_gntshr;
 
 enum xc_error_code {
   XC_ERROR_NONE = 0,
@@ -1548,116 +1543,6 @@ int xc_domain_subscribe_for_suspend(
  * These functions sometimes log messages as above, but not always.
  */
 
-/*
- * Note:
- * After fork a child process must not use any opened xc gnttab
- * handle inherited from their parent. They must open a new handle if
- * they want to interact with xc.
- *
- * Return an fd onto the grant table driver.  Logs errors.
- */
-xc_gnttab *xc_gnttab_open(xentoollog_logger *logger,
-			  unsigned open_flags);
-
-/*
- * Close a handle previously allocated with xc_gnttab_open().
- * Never logs errors.
- */
-int xc_gnttab_close(xc_gnttab *xcg);
-
-/*
- * Memory maps a grant reference from one domain to a local address range.
- * Mappings should be unmapped with xc_gnttab_munmap.  Logs errors.
- *
- * @parm xcg a handle on an open grant table interface
- * @parm domid the domain to map memory from
- * @parm ref the grant reference ID to map
- * @parm prot same flag as in mmap()
- */
-void *xc_gnttab_map_grant_ref(xc_gnttab *xcg,
-                              uint32_t domid,
-                              uint32_t ref,
-                              int prot);
-
-/**
- * Memory maps one or more grant references from one or more domains to a
- * contiguous local address range. Mappings should be unmapped with
- * xc_gnttab_munmap.  Logs errors.
- *
- * @parm xcg a handle on an open grant table interface
- * @parm count the number of grant references to be mapped
- * @parm domids an array of @count domain IDs by which the corresponding @refs
- *              were granted
- * @parm refs an array of @count grant references to be mapped
- * @parm prot same flag as in mmap()
- */
-void *xc_gnttab_map_grant_refs(xc_gnttab *xcg,
-                               uint32_t count,
-                               uint32_t *domids,
-                               uint32_t *refs,
-                               int prot);
-
-/**
- * Memory maps one or more grant references from one domain to a
- * contiguous local address range. Mappings should be unmapped with
- * xc_gnttab_munmap.  Logs errors.
- *
- * @parm xcg a handle on an open grant table interface
- * @parm count the number of grant references to be mapped
- * @parm domid the domain to map memory from
- * @parm refs an array of @count grant references to be mapped
- * @parm prot same flag as in mmap()
- */
-void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xcg,
-                                      uint32_t count,
-                                      uint32_t domid,
-                                      uint32_t *refs,
-                                      int prot);
-
-/**
- * Memory maps a grant reference from one domain to a local address range.
- * Mappings should be unmapped with xc_gnttab_munmap. If notify_offset or
- * notify_port are not -1, this version will attempt to set up an unmap
- * notification at the given offset and event channel. When the page is
- * unmapped, the byte at the given offset will be zeroed and a wakeup will be
- * sent to the given event channel.  Logs errors.
- *
- * @parm xcg a handle on an open grant table interface
- * @parm domid the domain to map memory from
- * @parm ref the grant reference ID to map
- * @parm prot same flag as in mmap()
- * @parm notify_offset The byte offset in the page to use for unmap
- *                     notification; -1 for none.
- * @parm notify_port The event channel port to use for unmap notify, or -1
- */
-void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xcg,
-                                     uint32_t domid,
-                                     uint32_t ref,
-                                     int prot,
-                                     uint32_t notify_offset,
-                                     evtchn_port_t notify_port);
-
-/*
- * Unmaps the @count pages starting at @start_address, which were mapped by a
- * call to xc_gnttab_map_grant_ref or xc_gnttab_map_grant_refs. Never logs.
- */
-int xc_gnttab_munmap(xc_gnttab *xcg,
-                     void *start_address,
-                     uint32_t count);
-
-/*
- * Sets the maximum number of grants that may be mapped by the given instance
- * to @count.  Never logs.
- *
- * N.B. This function must be called after opening the handle, and before any
- *      other functions are invoked on it.
- *
- * N.B. When variable-length grants are mapped, fragmentation may be observed,
- *      and it may not be possible to satisfy requests up to the maximum number
- *      of grants.
- */
-int xc_gnttab_set_max_grants(xc_gnttab *xcg,
-			     uint32_t count);
 
 int xc_gnttab_op(xc_interface *xch, int cmd,
                  void * op, int op_size, int count);
@@ -1668,59 +1553,6 @@ grant_entry_v1_t *xc_gnttab_map_table_v1(xc_interface *xch, int domid, int *gnt_
 grant_entry_v2_t *xc_gnttab_map_table_v2(xc_interface *xch, int domid, int *gnt_num);
 /* Sometimes these don't set errno [fixme], and sometimes they don't log. */
 
-/*
- * Return an fd onto the grant sharing driver.  Logs errors.
- *
- * Note:
- * After fork a child process must not use any opened xc gntshr
- * handle inherited from their parent. They must open a new handle if
- * they want to interact with xc.
- *
- */
-xc_gntshr *xc_gntshr_open(xentoollog_logger *logger,
-			  unsigned open_flags);
-
-/*
- * Close a handle previously allocated with xc_gntshr_open().
- * Never logs errors.
- */
-int xc_gntshr_close(xc_gntshr *xcg);
-
-/*
- * Creates and shares pages with another domain.
- * 
- * @parm xcg a handle to an open grant sharing instance
- * @parm domid the domain to share memory with
- * @parm count the number of pages to share
- * @parm refs the grant references of the pages (output)
- * @parm writable true if the other domain can write to the pages
- * @return local mapping of the pages
- */
-void *xc_gntshr_share_pages(xc_gntshr *xcg, uint32_t domid,
-                            int count, uint32_t *refs, int writable);
-
-/*
- * Creates and shares a page with another domain, with unmap notification.
- * 
- * @parm xcg a handle to an open grant sharing instance
- * @parm domid the domain to share memory with
- * @parm refs the grant reference of the pages (output)
- * @parm writable true if the other domain can write to the page
- * @parm notify_offset The byte offset in the page to use for unmap
- *                     notification; -1 for none.
- * @parm notify_port The event channel port to use for unmap notify, or -1
- * @return local mapping of the page
- */
-void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
-                                  uint32_t *ref, int writable,
-                                  uint32_t notify_offset,
-                                  evtchn_port_t notify_port);
-/*
- * Unmaps the @count pages starting at @start_address, which were mapped by a
- * call to xc_gntshr_share_*. Never logs.
- */
-int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count);
-
 int xc_physdev_map_pirq(xc_interface *xch,
                         int domid,
                         int index,
diff --git a/tools/libxc/include/xenctrl_compat.h b/tools/libxc/include/xenctrl_compat.h
index 48daeb2..d99fa11 100644
--- a/tools/libxc/include/xenctrl_compat.h
+++ b/tools/libxc/include/xenctrl_compat.h
@@ -35,6 +35,54 @@ int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port);
 
 #endif /* XC_WANT_COMPAT_EVTCHN_API */
 
+#ifdef XC_WANT_COMPAT_GNTTAB_API
+
+typedef struct xengntdev_handle xc_gnttab;
+
+xc_gnttab *xc_gnttab_open(xentoollog_logger *logger,
+                          unsigned open_flags);
+int xc_gnttab_close(xc_gnttab *xcg);
+void *xc_gnttab_map_grant_ref(xc_gnttab *xcg,
+                              uint32_t domid,
+                              uint32_t ref,
+                              int prot);
+void *xc_gnttab_map_grant_refs(xc_gnttab *xcg,
+                               uint32_t count,
+                               uint32_t *domids,
+                               uint32_t *refs,
+                               int prot);
+void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xcg,
+                                      uint32_t count,
+                                      uint32_t domid,
+                                      uint32_t *refs,
+                                      int prot);
+void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xcg,
+                                     uint32_t domid,
+                                     uint32_t ref,
+                                     int prot,
+                                     uint32_t notify_offset,
+                                     evtchn_port_t notify_port);
+int xc_gnttab_munmap(xc_gnttab *xcg,
+                     void *start_address,
+                     uint32_t count);
+int xc_gnttab_set_max_grants(xc_gnttab *xcg,
+                             uint32_t count);
+
+typedef struct xengntdev_handle xc_gntshr;
+
+xc_gntshr *xc_gntshr_open(xentoollog_logger *logger,
+                          unsigned open_flags);
+int xc_gntshr_close(xc_gntshr *xcg);
+void *xc_gntshr_share_pages(xc_gntshr *xcg, uint32_t domid,
+                            int count, uint32_t *refs, int writable);
+void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
+                                  uint32_t *ref, int writable,
+                                  uint32_t notify_offset,
+                                  evtchn_port_t notify_port);
+int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count);
+
+#endif /* XC_WANT_COMPAT_GNTTAB_API */
+
 #endif
 
 /*
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index a51f405..dd32aa2 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -143,59 +143,6 @@ grant_entry_v2_t *xc_gnttab_map_table_v2(xc_interface *xch, int domid,
     return _gnttab_map_table(xch, domid, gnt_num);
 }
 
-void *xc_gnttab_map_grant_ref(xc_gnttab *xgt,
-                              uint32_t domid,
-                              uint32_t ref,
-                              int prot)
-{
-    return osdep_gnttab_grant_map(xgt, 1, 0, prot, &domid, &ref, -1, -1);
-}
-
-void *xc_gnttab_map_grant_refs(xc_gnttab *xgt,
-                               uint32_t count,
-                               uint32_t *domids,
-                               uint32_t *refs,
-                               int prot)
-{
-    return osdep_gnttab_grant_map(xgt, count, 0, prot, domids, refs, -1, -1);
-}
-
-void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xgt,
-                                      uint32_t count,
-                                      uint32_t domid,
-                                      uint32_t *refs,
-                                      int prot)
-{
-    return osdep_gnttab_grant_map(xgt, count, XC_GRANT_MAP_SINGLE_DOMAIN,
-                                  prot, &domid, refs, -1, -1);
-}
-
-void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xgt,
-                                     uint32_t domid,
-                                     uint32_t ref,
-                                     int prot,
-                                     uint32_t notify_offset,
-                                     evtchn_port_t notify_port)
-{
-    return osdep_gnttab_grant_map(xgt, 1, 0, prot,  &domid, &ref,
-                                  notify_offset, notify_port);
-}
-
-void *xc_gntshr_share_pages(xc_gntshr *xcg, uint32_t domid,
-                            int count, uint32_t *refs, int writable)
-{
-    return osdep_gntshr_share_pages(xcg, domid, count, refs, writable, -1, -1);
-}
-
-void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
-                                  uint32_t *ref, int writable,
-                                  uint32_t notify_offset,
-                                  evtchn_port_t notify_port)
-{
-    return osdep_gntshr_share_pages(xcg, domid, 1, ref, writable,
-                                    notify_offset, notify_port);
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xc_gnttab_compat.c b/tools/libxc/xc_gnttab_compat.c
new file mode 100644
index 0000000..6f036d8
--- /dev/null
+++ b/tools/libxc/xc_gnttab_compat.c
@@ -0,0 +1,111 @@
+/*
+ * Compat shims for use of 3rd party consumers of libxenctrl xc_gnt{tab,shr}
+ * functionality which has been split into separate libraries.
+ */
+
+#include <xengnttab.h>
+
+#define XC_WANT_COMPAT_GNTTAB_API
+#include "xenctrl.h"
+
+xc_gnttab *xc_gnttab_open(xentoollog_logger *logger,
+                          unsigned open_flags)
+{
+    return xengnttab_open(logger, open_flags);
+}
+
+int xc_gnttab_close(xc_gnttab *xcg)
+{
+    return xengnttab_close(xcg);
+}
+
+void *xc_gnttab_map_grant_ref(xc_gnttab *xcg,
+                              uint32_t domid,
+                              uint32_t ref,
+                              int prot)
+{
+    return xengnttab_map_grant_ref(xcg, domid, ref, prot);
+}
+
+void *xc_gnttab_map_grant_refs(xc_gnttab *xcg,
+                               uint32_t count,
+                               uint32_t *domids,
+                               uint32_t *refs,
+                               int prot)
+{
+    return xengnttab_map_grant_refs(xcg, count, domids, refs, prot);
+}
+
+void *xc_gnttab_map_domain_grant_refs(xc_gnttab *xcg,
+                                      uint32_t count,
+                                      uint32_t domid,
+                                      uint32_t *refs,
+                                      int prot)
+{
+    return xengnttab_map_domain_grant_refs(xcg, count, domid, refs, prot);
+}
+
+void *xc_gnttab_map_grant_ref_notify(xc_gnttab *xcg,
+                                     uint32_t domid,
+                                     uint32_t ref,
+                                     int prot,
+                                     uint32_t notify_offset,
+                                     evtchn_port_t notify_port)
+{
+    return xengnttab_map_grant_ref_notify(xcg, domid, ref, prot,
+                                          notify_offset, notify_port);
+}
+
+int xc_gnttab_munmap(xc_gnttab *xcg,
+                     void *start_address,
+                     uint32_t count)
+{
+    return xengnttab_unmap(xcg, start_address, count);
+}
+
+int xc_gnttab_set_max_grants(xc_gnttab *xcg,
+                             uint32_t count)
+{
+    return xengnttab_set_max_grants(xcg, count);
+}
+
+xc_gntshr *xc_gntshr_open(xentoollog_logger *logger,
+                          unsigned open_flags)
+{
+    return xengntshr_open(logger, open_flags);
+}
+
+int xc_gntshr_close(xc_gntshr *xcg)
+{
+    return xengntshr_close(xcg);
+}
+
+void *xc_gntshr_share_pages(xc_gntshr *xcg, uint32_t domid,
+                            int count, uint32_t *refs, int writable)
+{
+    return xengntshr_share_pages(xcg, domid, count, refs, writable);
+}
+
+void *xc_gntshr_share_page_notify(xc_gntshr *xcg, uint32_t domid,
+                                  uint32_t *ref, int writable,
+                                  uint32_t notify_offset,
+                                  evtchn_port_t notify_port)
+{
+    return xengntshr_share_page_notify(xcg, domid, ref, writable,
+                                       notify_offset, notify_port);
+}
+
+int xc_gntshr_munmap(xc_gntshr *xcg, void *start_address, uint32_t count)
+{
+    return xengntshr_unshare(xcg, start_address, count);
+}
+
+/*
+ * 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_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 6b329ce..9c318e0 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -31,8 +31,6 @@
 #include <sys/ioctl.h>
 
 #include <xen/memory.h>
-#include <xen/sys/gntdev.h>
-#include <xen/sys/gntalloc.h>
 
 #include "xenctrl.h"
 #include "xenctrlosdep.h"
@@ -41,9 +39,6 @@
 
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
-#define GTERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gnttab", _f)
-#define GSERROR(_l, _f...) xtl_log(_l, XTL_ERROR, errno, "gntshr", _f)
-
 static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
 {
     int flags, saved_errno;
@@ -461,281 +456,6 @@ static struct xc_osdep_ops linux_privcmd_ops = {
     },
 };
 
-#define DEVXEN "/dev/xen/"
-
-int osdep_gnttab_open(xc_gnttab *xgt)
-{
-    int fd = open(DEVXEN "gntdev", O_RDWR);
-    if ( fd == -1 )
-        return -1;
-    xgt->fd = fd;
-    return 0;
-}
-
-int osdep_gnttab_close(xc_gnttab *xgt)
-{
-    if ( xgt->fd == -1 )
-        return 0;
-
-    return close(xgt->fd);
-}
-
-int xc_gnttab_set_max_grants(xc_gnttab *xgt, uint32_t count)
-{
-    int fd = xgt->fd, rc;
-    struct ioctl_gntdev_set_max_grants max_grants = { .count = count };
-
-    rc = ioctl(fd, IOCTL_GNTDEV_SET_MAX_GRANTS, &max_grants);
-    if (rc) {
-        /*
-         * Newer (e.g. pv-ops) kernels don't implement this IOCTL,
-         * so ignore the resulting specific failure.
-         */
-        if (errno == ENOTTY)
-            rc = 0;
-        else
-            GTERROR(xgt->logger, "ioctl SET_MAX_GRANTS failed");
-    }
-
-    return rc;
-}
-
-void *osdep_gnttab_grant_map(xc_gnttab *xgt,
-                             uint32_t count, int flags, int prot,
-                             uint32_t *domids, uint32_t *refs,
-                             uint32_t notify_offset,
-                             evtchn_port_t notify_port)
-{
-    int fd = xgt->fd;
-    struct ioctl_gntdev_map_grant_ref *map;
-    unsigned int map_size = ROUNDUP((sizeof(*map) + (count - 1) *
-                                    sizeof(struct ioctl_gntdev_map_grant_ref)),
-                                    XC_PAGE_SHIFT);
-    void *addr = NULL;
-    int domids_stride = 1;
-    int i;
-
-    if (flags & XC_GRANT_MAP_SINGLE_DOMAIN)
-        domids_stride = 0;
-
-    if ( map_size <= XC_PAGE_SIZE )
-        map = alloca(sizeof(*map) +
-                     (count - 1) * sizeof(struct ioctl_gntdev_map_grant_ref));
-    else
-    {
-        map = mmap(NULL, map_size, PROT_READ | PROT_WRITE,
-                   MAP_PRIVATE | MAP_ANON | MAP_POPULATE, -1, 0);
-        if ( map == MAP_FAILED )
-        {
-            GTERROR(xgt->logger, "mmap of map failed");
-            return NULL;
-        }
-    }
-
-    for ( i = 0; i < count; i++ )
-    {
-        map->refs[i].domid = domids[i * domids_stride];
-        map->refs[i].ref = refs[i];
-    }
-
-    map->count = count;
-
-    if ( ioctl(fd, IOCTL_GNTDEV_MAP_GRANT_REF, map) ) {
-        GTERROR(xgt->logger, "ioctl MAP_GRANT_REF failed");
-        goto out;
-    }
-
- retry:
-    addr = mmap(NULL, XC_PAGE_SIZE * count, prot, MAP_SHARED, fd,
-                map->index);
-
-    if (addr == MAP_FAILED && errno == EAGAIN)
-    {
-        /*
-         * The grant hypercall can return EAGAIN if the granted page is
-         * swapped out. Since the paging daemon may be in the same domain, the
-         * hypercall cannot block without causing a deadlock.
-         *
-         * Because there are no notificaitons when the page is swapped in, wait
-         * a bit before retrying, and hope that the page will arrive eventually.
-         */
-        usleep(1000);
-        goto retry;
-    }
-
-    if (addr != MAP_FAILED)
-    {
-        int rv = 0;
-        struct ioctl_gntdev_unmap_notify notify;
-        notify.index = map->index;
-        notify.action = 0;
-        if (notify_offset < XC_PAGE_SIZE * count) {
-            notify.index += notify_offset;
-            notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
-        }
-        if (notify_port != -1) {
-            notify.event_channel_port = notify_port;
-            notify.action |= UNMAP_NOTIFY_SEND_EVENT;
-        }
-        if (notify.action)
-            rv = ioctl(fd, IOCTL_GNTDEV_SET_UNMAP_NOTIFY, &notify);
-        if (rv) {
-            GTERROR(xgt->logger, "ioctl SET_UNMAP_NOTIFY failed");
-            munmap(addr, count * XC_PAGE_SIZE);
-            addr = MAP_FAILED;
-        }
-    }
-
-    if (addr == MAP_FAILED)
-    {
-        int saved_errno = errno;
-        struct ioctl_gntdev_unmap_grant_ref unmap_grant;
-
-        /* Unmap the driver slots used to store the grant information. */
-        GTERROR(xgt->logger, "mmap failed");
-        unmap_grant.index = map->index;
-        unmap_grant.count = count;
-        ioctl(fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant);
-        errno = saved_errno;
-        addr = NULL;
-    }
-
- out:
-    if ( map_size > XC_PAGE_SIZE )
-        munmap(map, map_size);
-
-    return addr;
-}
-
-int xc_gnttab_munmap(xc_gnttab *xgt, void *start_address, uint32_t count)
-{
-    int fd = xgt->fd;
-    struct ioctl_gntdev_get_offset_for_vaddr get_offset;
-    struct ioctl_gntdev_unmap_grant_ref unmap_grant;
-    int rc;
-
-    if ( start_address == NULL )
-    {
-        errno = EINVAL;
-        return -1;
-    }
-
-    /* First, it is necessary to get the offset which was initially used to
-     * mmap() the pages.
-     */
-    get_offset.vaddr = (unsigned long)start_address;
-    if ( (rc = ioctl(fd, IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR,
-                     &get_offset)) )
-        return rc;
-
-    if ( get_offset.count != count )
-    {
-        errno = EINVAL;
-        return -1;
-    }
-
-    /* Next, unmap the memory. */
-    if ( (rc = munmap(start_address, count * XC_PAGE_SIZE)) )
-        return rc;
-
-    /* Finally, unmap the driver slots used to store the grant information. */
-    unmap_grant.index = get_offset.offset;
-    unmap_grant.count = count;
-    if ( (rc = ioctl(fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant)) )
-        return rc;
-
-    return 0;
-}
-
-int osdep_gntshr_open(xc_gntshr *xgs)
-{
-    int fd = open(DEVXEN "gntalloc", O_RDWR);
-    if ( fd == -1 )
-        return -1;
-    xgs->fd = fd;
-    return 0;
-}
-
-int osdep_gntshr_close(xc_gntshr *xgs)
-{
-    if ( xgs->fd == -1 )
-        return 0;
-
-    return close(xgs->fd);
-}
-
-void *osdep_gntshr_share_pages(xc_gntshr *xgs,
-                               uint32_t domid, int count,
-                               uint32_t *refs, int writable,
-                               uint32_t notify_offset,
-                               evtchn_port_t notify_port)
-{
-    struct ioctl_gntalloc_alloc_gref *gref_info = NULL;
-    struct ioctl_gntalloc_unmap_notify notify;
-    struct ioctl_gntalloc_dealloc_gref gref_drop;
-    int fd = xgs->fd;
-    int err;
-    void *area = NULL;
-    gref_info = malloc(sizeof(*gref_info) + count * sizeof(uint32_t));
-    if (!gref_info)
-        return NULL;
-    gref_info->domid = domid;
-    gref_info->flags = writable ? GNTALLOC_FLAG_WRITABLE : 0;
-    gref_info->count = count;
-
-    err = ioctl(fd, IOCTL_GNTALLOC_ALLOC_GREF, gref_info);
-    if (err) {
-        GSERROR(xgs->logger, "ioctl failed");
-        goto out;
-    }
-
-    area = mmap(NULL, count * XC_PAGE_SIZE, PROT_READ | PROT_WRITE,
-        MAP_SHARED, fd, gref_info->index);
-
-    if (area == MAP_FAILED) {
-        area = NULL;
-        GSERROR(xgs->logger, "mmap failed");
-        goto out_remove_fdmap;
-    }
-
-    notify.index = gref_info->index;
-    notify.action = 0;
-    if (notify_offset < XC_PAGE_SIZE * count) {
-        notify.index += notify_offset;
-        notify.action |= UNMAP_NOTIFY_CLEAR_BYTE;
-    }
-    if (notify_port != -1) {
-        notify.event_channel_port = notify_port;
-        notify.action |= UNMAP_NOTIFY_SEND_EVENT;
-    }
-    if (notify.action)
-        err = ioctl(fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &notify);
-    if (err) {
-        GSERROR(xgs->logger, "ioctl SET_UNMAP_NOTIFY failed");
-		munmap(area, count * XC_PAGE_SIZE);
-		area = NULL;
-	}
-
-    memcpy(refs, gref_info->gref_ids, count * sizeof(uint32_t));
-
- out_remove_fdmap:
-    /* Removing the mapping from the file descriptor does not cause the pages to
-     * be deallocated until the mapping is removed.
-     */
-    gref_drop.index = gref_info->index;
-    gref_drop.count = count;
-    ioctl(fd, IOCTL_GNTALLOC_DEALLOC_GREF, &gref_drop);
- out:
-    free(gref_info);
-    return area;
-}
-
-int xc_gntshr_munmap(xc_gntshr *xgs,
-                     void *start_address, uint32_t count)
-{
-    return munmap(start_address, count * XC_PAGE_SIZE);
-}
-
 static struct xc_osdep_ops *linux_osdep_init(xc_interface *xch, enum xc_osdep_type type)
 {
     switch ( type )
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index fd7def6..22d985c 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -23,8 +23,6 @@
 #include <mini-os/os.h>
 #include <mini-os/mm.h>
 #include <mini-os/lib.h>
-#include <mini-os/gntmap.h>
-#include <sys/mman.h>
 
 #include <xen/memory.h>
 #include <unistd.h>
@@ -38,7 +36,6 @@
 #include "xc_private.h"
 
 void minios_interface_close_fd(int fd);
-void minios_gnttab_close_fd(int fd);
 
 extern void minios_interface_close_fd(int fd);
 
@@ -202,76 +199,6 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return memalign(alignment, size);
 }
 
-int osdep_gnttab_open(xc_gnttab *xgt)
-{
-    int fd = alloc_fd(FTYPE_GNTMAP);
-    if ( fd == -1 )
-        return -1;
-    gntmap_init(&files[fd].gntmap);
-    xgt->fd = fd;
-    return 0;
-}
-
-int osdep_gnttab_close(xc_gnttab *xgt)
-{
-    if ( xgt->fd == -1 )
-        return 0;
-
-    return close(xgt->fd);
-}
-
-void minios_gnttab_close_fd(int fd)
-{
-    gntmap_fini(&files[fd].gntmap);
-    files[fd].type = FTYPE_NONE;
-}
-
-void *osdep_gnttab_grant_map(xc_gnttab *xgt,
-                             uint32_t count, int flags, int prot,
-                             uint32_t *domids, uint32_t *refs,
-                             uint32_t notify_offset,
-                             evtchn_port_t notify_port)
-{
-    int fd = xgt->fd;
-    int stride = 1;
-    if (flags & XC_GRANT_MAP_SINGLE_DOMAIN)
-        stride = 0;
-    if (notify_offset != -1 || notify_port != -1) {
-        errno = ENOSYS;
-        return NULL;
-    }
-    return gntmap_map_grant_refs(&files[fd].gntmap,
-                                 count, domids, stride,
-                                 refs, prot & PROT_WRITE);
-}
-
-int xc_gnttab_munmap(xc_gnttab *xgt, void *start_address, uint32_t count)
-{
-    int fd = xgt->fd;
-    int ret;
-    ret = gntmap_munmap(&files[fd].gntmap,
-                        (unsigned long) start_address,
-                        count);
-    if (ret < 0) {
-        errno = -ret;
-        return -1;
-    }
-    return ret;
-}
-
-int xc_gnttab_set_max_grants(xc_gnttab *xgt, uint32_t count)
-{
-    int fd = xgt->fd;
-    int ret;
-    ret = gntmap_set_max_grants(&files[fd].gntmap,
-                                count);
-    if (ret < 0) {
-        errno = -ret;
-        return -1;
-    }
-    return ret;
-}
-
 static struct xc_osdep_ops *minios_osdep_init(xc_interface *xch, enum xc_osdep_type type)
 {
     switch ( type )
diff --git a/tools/libxc/xc_nogntshr.c b/tools/libxc/xc_nogntshr.c
deleted file mode 100644
index 9aa6064..0000000
--- a/tools/libxc/xc_nogntshr.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/******************************************************************************
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <stdlib.h>
-
-#include "xc_private.h"
-
-int osdep_gntshr_open(xc_gnttab *xgt)
-{
-    return -1;
-}
-
-int osdep_gntshr_close(xc_gnttab *xgt)
-{
-    return 0;
-}
-
-void *osdep_gntshr_share_pages(xc_gntshr *xgs,
-                               uint32_t domid, int count,
-                               uint32_t *refs, int writable,
-                               uint32_t notify_offset,
-                               evtchn_port_t notify_port)
-{
-    abort()
-}
-
-int xc_gntshr_munmap(xc_gntshr *xgs,
-                     void *start_address, uint32_t count)
-{
-    abort();
-}
diff --git a/tools/libxc/xc_nognttab.c b/tools/libxc/xc_nognttab.c
deleted file mode 100644
index e8a0fcb..0000000
--- a/tools/libxc/xc_nognttab.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/******************************************************************************
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <stdlib.h>
-
-#include "xc_private.h"
-
-int osdep_gnttab_open(xc_gnttab *xgt)
-{
-    return -1;
-}
-
-int osdep_gnttab_close(xc_gnttab *xgt)
-{
-    return 0;
-}
-
-int xc_gnttab_set_max_grants(xc_gnttab *xgt, uint32_t count)
-{
-    abort();
-}
-
-void *osdep_gnttab_grant_map(xc_gnttab *xgt,
-                             uint32_t count, int flags, int prot,
-                             uint32_t *domids, uint32_t *refs,
-                             uint32_t notify_offset,
-                             evtchn_port_t notify_port)
-{
-    abort();
-}
-
-int xc_gnttab_munmap(xc_gnttab *xgt, void *start_address, uint32_t count)
-{
-    abort();
-}
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 7f52a5d..85e6f02 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -249,86 +249,6 @@ int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
     return xch->ops->u.privcmd.hypercall(xch, xch->ops_handle, hypercall);
 }
 
-xc_gnttab *xc_gnttab_open(xentoollog_logger *logger, unsigned open_flags)
-{
-    xc_gnttab *xgt = malloc(sizeof(*xgt));
-    int rc;
-
-    if (!xgt) return NULL;
-
-    xgt->fd = -1;
-    xgt->logger = logger;
-    xgt->logger_tofree  = NULL;
-
-    if (!xgt->logger) {
-        xgt->logger = xgt->logger_tofree =
-            (xentoollog_logger*)
-            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
-        if (!xgt->logger) goto err;
-    }
-
-    rc = osdep_gnttab_open(xgt);
-    if ( rc  < 0 ) goto err;
-
-    return xgt;
-
-err:
-    osdep_gnttab_close(xgt);
-    xtl_logger_destroy(xgt->logger_tofree);
-    free(xgt);
-    return NULL;
-}
-
-int xc_gnttab_close(xc_gnttab *xgt)
-{
-    int rc;
-
-    rc = osdep_gnttab_close(xgt);
-    xtl_logger_destroy(xgt->logger_tofree);
-    free(xgt);
-    return rc;
-}
-
-xc_gntshr *xc_gntshr_open(xentoollog_logger *logger, unsigned open_flags)
-{
-    xc_gntshr *xgs = malloc(sizeof(*xgs));
-    int rc;
-
-    if (!xgs) return NULL;
-
-    xgs->fd = -1;
-    xgs->logger = logger;
-    xgs->logger_tofree  = NULL;
-
-    if (!xgs->logger) {
-        xgs->logger = xgs->logger_tofree =
-            (xentoollog_logger*)
-            xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
-        if (!xgs->logger) goto err;
-    }
-
-    rc = osdep_gntshr_open(xgs);
-    if ( rc  < 0 ) goto err;
-
-    return xgs;
-
-err:
-    osdep_gntshr_close(xgs);
-    xtl_logger_destroy(xgs->logger_tofree);
-    free(xgs);
-    return NULL;
-}
-
-int xc_gntshr_close(xc_gntshr *xgs)
-{
-    int rc;
-
-    rc = osdep_gntshr_close(xgs);
-    xtl_logger_destroy(xgs->logger_tofree);
-    free(xgs);
-    return rc;
-}
-
 static pthread_key_t errbuf_pkey;
 static pthread_once_t errbuf_pkey_once = PTHREAD_ONCE_INIT;
 
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 35c99e0..a32accb 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -123,30 +123,6 @@ struct xc_interface_core {
     xc_osdep_handle  ops_handle; /* opaque data for xc_osdep_ops */
 };
 
-struct xengntdev_handle {
-    xentoollog_logger *logger, *logger_tofree;
-    int fd;
-};
-
-int osdep_gnttab_open(xc_gnttab *xgt);
-int osdep_gnttab_close(xc_gnttab *xgt);
-
-#define XC_GRANT_MAP_SINGLE_DOMAIN 0x1
-void *osdep_gnttab_grant_map(xc_gnttab *xgt,
-                             uint32_t count, int flags, int prot,
-                             uint32_t *domids, uint32_t *refs,
-                             uint32_t notify_offset,
-                             evtchn_port_t notify_port);
-
-int osdep_gntshr_open(xc_gntshr *xgs);
-int osdep_gntshr_close(xc_gntshr *xgs);
-
-void *osdep_gntshr_share_pages(xc_gntshr *xgs,
-                               uint32_t domid, int count,
-                               uint32_t *refs, int writable,
-                               uint32_t notify_offset,
-                               evtchn_port_t notify_port);
-
 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,
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 5970fde..d691b78 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -69,8 +69,10 @@ xenstored_probes.o: xenstored_solaris.o
 CFLAGS += -DHAVE_DTRACE=1
 endif
 
+$(XENSTORED_OBJS): CFLAGS += $(CFLAGS_libxengnttab)
+
 xenstored: $(XENSTORED_OBJS)
-	$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
+	$(CC) $^ $(LDFLAGS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
 
 xenstored.a: $(XENSTORED_OBJS)
 	$(AR) cr $@ $^
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 8c853c9..624737d 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -20,12 +20,14 @@
 #define _XENSTORED_CORE_H
 
 #include <xenctrl.h>
+#include <xengnttab.h>
 
 #include <sys/types.h>
 #include <dirent.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <errno.h>
+
 #include "xenstore_lib.h"
 #include "list.h"
 #include "tdb.h"
@@ -196,7 +198,7 @@ void finish_daemonize(void);
 /* Open a pipe for signal handling */
 void init_pipe(int reopen_log_pipe[2]);
 
-xc_gnttab **xcg_handle;
+xengnttab_handle **xgt_handle;
 
 #endif /* _XENSTORED_CORE_H */
 
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 0384817..47b4f03 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -34,7 +34,7 @@
 #include <xen/grant_table.h>
 
 static xc_interface **xc_handle;
-xc_gnttab **xcg_handle;
+xengnttab_handle **xgt_handle;
 static evtchn_port_t virq_port;
 
 xenevtchn_handle *xce_handle = NULL;
@@ -166,9 +166,9 @@ static int readchn(struct connection *conn, void *data, unsigned int len)
 
 static void *map_interface(domid_t domid, unsigned long mfn)
 {
-	if (*xcg_handle != NULL) {
+	if (*xgt_handle != NULL) {
 		/* this is the preferred method */
-		return xc_gnttab_map_grant_ref(*xcg_handle, domid,
+		return xengnttab_map_grant_ref(*xgt_handle, domid,
 			GNTTAB_RESERVED_XENSTORE, PROT_READ|PROT_WRITE);
 	} else {
 		return xc_map_foreign_range(*xc_handle, domid,
@@ -178,8 +178,8 @@ static void *map_interface(domid_t domid, unsigned long mfn)
 
 static void unmap_interface(void *interface)
 {
-	if (*xcg_handle != NULL)
-		xc_gnttab_munmap(*xcg_handle, interface, 1);
+	if (*xgt_handle != NULL)
+		xengnttab_unmap(*xgt_handle, interface, 1);
 	else
 		munmap(interface, XC_PAGE_SIZE);
 }
@@ -577,9 +577,9 @@ static int close_xc_handle(void *_handle)
 	return 0;
 }
 
-static int close_xcg_handle(void *_handle)
+static int close_xgt_handle(void *_handle)
 {

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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:17:46 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:17: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 1aONAY-00013g-FG; Wed, 27 Jan 2016 10:17:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAW-00013C-Nn
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:44 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	55/04-31443-74998A65; Wed, 27 Jan 2016 10:17:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1453889861!17891722!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64483 invoked from network); 27 Jan 2016 10:17:43 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:17:43 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBL-00022n-PA
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAT-0001Xa-IY
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:41 +0000
Date: Wed, 27 Jan 2016 10:17:41 +0000
Message-Id: <E1aONAT-0001Xa-IY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/call: Update some log
	messages to not refer to xc.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9eb88fad0df7de017a52a634649c294f7a2561f7
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Sep 22 12:37:16 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:20 2016 +0000

    tools/libs/call: Update some log messages to not refer to xc.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/call/linux.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libs/call/linux.c b/tools/libs/call/linux.c
index 55e1e83..3641e41 100644
--- a/tools/libs/call/linux.c
+++ b/tools/libs/call/linux.c
@@ -94,7 +94,7 @@ void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
     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");
+        PERROR("alloc_pages: mmap failed");
         return NULL;
     }
 
@@ -103,7 +103,7 @@ void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
     rc = madvise(p, npages * PAGE_SIZE, MADV_DONTFORK);
     if ( rc < 0 )
     {
-        PERROR("xc_alloc_hypercall_buffer: madvise failed");
+        PERROR("alloc_pages: madvise failed");
         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 Wed Jan 27 10:17:46 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:17: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 1aONAY-00013g-FG; Wed, 27 Jan 2016 10:17:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAW-00013C-Nn
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:44 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	55/04-31443-74998A65; Wed, 27 Jan 2016 10:17:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1453889861!17891722!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64483 invoked from network); 27 Jan 2016 10:17:43 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:17:43 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBL-00022n-PA
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAT-0001Xa-IY
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:41 +0000
Date: Wed, 27 Jan 2016 10:17:41 +0000
Message-Id: <E1aONAT-0001Xa-IY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/call: Update some log
	messages to not refer to xc.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9eb88fad0df7de017a52a634649c294f7a2561f7
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Sep 22 12:37:16 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:20 2016 +0000

    tools/libs/call: Update some log messages to not refer to xc.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/call/linux.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libs/call/linux.c b/tools/libs/call/linux.c
index 55e1e83..3641e41 100644
--- a/tools/libs/call/linux.c
+++ b/tools/libs/call/linux.c
@@ -94,7 +94,7 @@ void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
     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");
+        PERROR("alloc_pages: mmap failed");
         return NULL;
     }
 
@@ -103,7 +103,7 @@ void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
     rc = madvise(p, npages * PAGE_SIZE, MADV_DONTFORK);
     if ( rc < 0 )
     {
-        PERROR("xc_alloc_hypercall_buffer: madvise failed");
+        PERROR("alloc_pages: madvise failed");
         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 Wed Jan 27 10:17:56 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10: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 1aONAh-00015y-KW; Wed, 27 Jan 2016 10:17:55 +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 1aONAg-00015Z-CM
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:54 +0000
Content-Length: 2755
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	1E/2C-29478-15998A65; Wed, 27 Jan 2016 10:17:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453889872!18194170!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18553 invoked from network); 27 Jan 2016 10:17:53 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:17:53 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBW-00022z-3M
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAd-0001YB-T1
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:51 +0000
Date: Wed, 27 Jan 2016 10:17:51 +0000
Message-Id: <E1aONAd-0001YB-T1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/call: Describe return
	values and error semantics for xencall*
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4867941717096717774=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4867941717096717774==
Content-Length: 2358
Content-Transfer-Encoding: quoted-printable

commit 139ff8ffc94d173531610e093c9a40c4688fa593
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Nov 27 12:08:32 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:20 2016 +0000

    tools/libs/call: Describe return values and error semantics for xencall*
    
    This behaviour has been confirmed by inspection on:
    
     - Linux
     - NetBSD & FreeBSD (NB: hcall->retval is the hypercall return value
       only for values >=3D 0. For negative values the underlying privcmd
       driver translates the value from Xen to {Net,Free}BSD errno space
       and returns it as the result of the ioctl, which becomes
       ret=3D-1/errno=3DEFOO in userspace)
     - MiniOS (which takes care of errno in this library)
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
---
 tools/libs/call/include/xencall.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/tools/libs/call/include/xencall.h b/tools/libs/call/include/xencall.h
index 0d91aa8..3f325f0 100644
--- a/tools/libs/call/include/xencall.h
+++ b/tools/libs/call/include/xencall.h
@@ -46,6 +46,21 @@ int xencall_close(xencall_handle *xcall);
 
 /*
  * Call hypercalls with varying numbers of arguments.
+ *
+ * On success the return value of the hypercall is the return value of
+ * the xencall function.  On error these functions set errno and
+ * return -1.
+ *
+ * The errno values will be either:
+ * - The Xen hypercall error return (from xen/include/public/errno.h)
+ *   translated into the corresponding local value for that POSIX error.
+ * - An errno value produced by the OS driver or the library
+ *   implementation. Such values may be defined by POSIX or by the OS.
+ *
+ * Note that under some circumstances it will not be possible to tell
+ * whether an error came from Xen or from the OS/library.
+ *
+ * These functions never log.
  */
 int xencall0(xencall_handle *xcall, unsigned int op);
 int xencall1(xencall_handle *xcall, unsigned int op,
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:17:56 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10: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 1aONAh-00015y-KW; Wed, 27 Jan 2016 10:17:55 +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 1aONAg-00015Z-CM
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:54 +0000
Content-Length: 2755
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	1E/2C-29478-15998A65; Wed, 27 Jan 2016 10:17:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1453889872!18194170!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18553 invoked from network); 27 Jan 2016 10:17:53 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:17:53 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBW-00022z-3M
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAd-0001YB-T1
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:17:51 +0000
Date: Wed, 27 Jan 2016 10:17:51 +0000
Message-Id: <E1aONAd-0001YB-T1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/call: Describe return
	values and error semantics for xencall*
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4867941717096717774=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4867941717096717774==
Content-Length: 2358
Content-Transfer-Encoding: quoted-printable

commit 139ff8ffc94d173531610e093c9a40c4688fa593
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Nov 27 12:08:32 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:20 2016 +0000

    tools/libs/call: Describe return values and error semantics for xencall*
    
    This behaviour has been confirmed by inspection on:
    
     - Linux
     - NetBSD & FreeBSD (NB: hcall->retval is the hypercall return value
       only for values >=3D 0. For negative values the underlying privcmd
       driver translates the value from Xen to {Net,Free}BSD errno space
       and returns it as the result of the ioctl, which becomes
       ret=3D-1/errno=3DEFOO in userspace)
     - MiniOS (which takes care of errno in this library)
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
---
 tools/libs/call/include/xencall.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/tools/libs/call/include/xencall.h b/tools/libs/call/include/xencall.h
index 0d91aa8..3f325f0 100644
--- a/tools/libs/call/include/xencall.h
+++ b/tools/libs/call/include/xencall.h
@@ -46,6 +46,21 @@ int xencall_close(xencall_handle *xcall);
 
 /*
  * Call hypercalls with varying numbers of arguments.
+ *
+ * On success the return value of the hypercall is the return value of
+ * the xencall function.  On error these functions set errno and
+ * return -1.
+ *
+ * The errno values will be either:
+ * - The Xen hypercall error return (from xen/include/public/errno.h)
+ *   translated into the corresponding local value for that POSIX error.
+ * - An errno value produced by the OS driver or the library
+ *   implementation. Such values may be defined by POSIX or by the OS.
+ *
+ * Note that under some circumstances it will not be possible to tell
+ * whether an error came from Xen or from the OS/library.
+ *
+ * These functions never log.
  */
 int xencall0(xencall_handle *xcall, unsigned int op);
 int xencall1(xencall_handle *xcall, unsigned int op,
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:18:07 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:18: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 1aONAt-00018d-PI; Wed, 27 Jan 2016 10:18: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 1aONAr-00018J-Qc
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:05 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	6B/70-02745-C5998A65; Wed, 27 Jan 2016 10:18:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1453889882!18561851!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23672 invoked from network); 27 Jan 2016 10:18:03 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:18:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBg-00023v-Gv
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAo-0001Yt-7O
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:02 +0000
Date: Wed, 27 Jan 2016 10:18:02 +0000
Message-Id: <E1aONAo-0001Yt-7O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/call: Avoid xc_memalign in
	netbsd and solaris backends
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf8f8fdeb4195badf2ebb9049825ea9da200d447
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Sep 22 12:40:51 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:21 2016 +0000

    tools/libs/call: Avoid xc_memalign in netbsd and solaris backends
    
    These are already arch specific, so just use the appropriate
    interfaces (as determined by looking at the xc_memalign backend).
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/call/netbsd.c  |    4 ++--
 tools/libs/call/solaris.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libs/call/netbsd.c b/tools/libs/call/netbsd.c
index 2aa02f1..e96fbf1 100644
--- a/tools/libs/call/netbsd.c
+++ b/tools/libs/call/netbsd.c
@@ -74,8 +74,8 @@ void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, size_t npages)
     size_t size = npages * XC_PAGE_SIZE;
     void *p;
 
-    p = xc_memalign(xcall, XC_PAGE_SIZE, size);
-    if (!p)
+    ret = posix_memalign(&p, XC_PAGE_SIZE, size);
+    if ( ret != 0 || !p )
         return NULL;
 
     if ( mlock(p, size) < 0 )
diff --git a/tools/libs/call/solaris.c b/tools/libs/call/solaris.c
index 945d867..5aa330e 100644
--- a/tools/libs/call/solaris.c
+++ b/tools/libs/call/solaris.c
@@ -71,7 +71,7 @@ int osdep_xencall_close(xencall_handle *xcall)
 
 void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, size_t npages)
 {
-    return xc_memalign(xcall, XC_PAGE_SIZE, npages * XC_PAGE_SIZE);
+    return memalign(XC_PAGE_SIZE, npages * XC_PAGE_SIZE);
 }
 
 void osdep_free_hypercall_buffer(xencall_handle *xcall, void *ptr,
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:18:07 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:18: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 1aONAt-00018d-PI; Wed, 27 Jan 2016 10:18: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 1aONAr-00018J-Qc
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:05 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	6B/70-02745-C5998A65; Wed, 27 Jan 2016 10:18:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1453889882!18561851!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23672 invoked from network); 27 Jan 2016 10:18:03 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:18:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBg-00023v-Gv
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAo-0001Yt-7O
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:02 +0000
Date: Wed, 27 Jan 2016 10:18:02 +0000
Message-Id: <E1aONAo-0001Yt-7O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/call: Avoid xc_memalign in
	netbsd and solaris backends
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf8f8fdeb4195badf2ebb9049825ea9da200d447
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Sep 22 12:40:51 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:21 2016 +0000

    tools/libs/call: Avoid xc_memalign in netbsd and solaris backends
    
    These are already arch specific, so just use the appropriate
    interfaces (as determined by looking at the xc_memalign backend).
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/call/netbsd.c  |    4 ++--
 tools/libs/call/solaris.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libs/call/netbsd.c b/tools/libs/call/netbsd.c
index 2aa02f1..e96fbf1 100644
--- a/tools/libs/call/netbsd.c
+++ b/tools/libs/call/netbsd.c
@@ -74,8 +74,8 @@ void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, size_t npages)
     size_t size = npages * XC_PAGE_SIZE;
     void *p;
 
-    p = xc_memalign(xcall, XC_PAGE_SIZE, size);
-    if (!p)
+    ret = posix_memalign(&p, XC_PAGE_SIZE, size);
+    if ( ret != 0 || !p )
         return NULL;
 
     if ( mlock(p, size) < 0 )
diff --git a/tools/libs/call/solaris.c b/tools/libs/call/solaris.c
index 945d867..5aa330e 100644
--- a/tools/libs/call/solaris.c
+++ b/tools/libs/call/solaris.c
@@ -71,7 +71,7 @@ int osdep_xencall_close(xencall_handle *xcall)
 
 void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, size_t npages)
 {
-    return xc_memalign(xcall, XC_PAGE_SIZE, npages * XC_PAGE_SIZE);
+    return memalign(XC_PAGE_SIZE, npages * XC_PAGE_SIZE);
 }
 
 void osdep_free_hypercall_buffer(xencall_handle *xcall, void *ptr,
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:18:16 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:18: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 1aONB2-0001AZ-U6; Wed, 27 Jan 2016 10:18: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 1aONB1-0001A4-70
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:15 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	EF/BB-03225-66998A65; Wed, 27 Jan 2016 10:18:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1453889893!18141288!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5099 invoked from network); 27 Jan 2016 10:18:13 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:18:13 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBq-00024V-TR
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAy-0001Zx-Jz
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:12 +0000
Date: Wed, 27 Jan 2016 10:18:12 +0000
Message-Id: <E1aONAy-0001Zx-Jz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/call: linux: touch newly
	allocated pages after madvise lockdown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b0074ce6a10fd7d6734c4bbb6d6e04910db92152
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 14 16:46:26 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:21 2016 +0000

    tools/libs/call: linux: touch newly allocated pages after madvise lockdown
    
    This avoids a potential issue with a fork after allocation but before
    madvise.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/call/linux.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/tools/libs/call/linux.c b/tools/libs/call/linux.c
index 3641e41..651f380 100644
--- a/tools/libs/call/linux.c
+++ b/tools/libs/call/linux.c
@@ -88,7 +88,7 @@ void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
 {
     size_t size = npages * PAGE_SIZE;
     void *p;
-    int rc, saved_errno;
+    int rc, i, 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);
@@ -107,6 +107,18 @@ void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
         goto out;
     }
 
+    /*
+     * Touch each page in turn to force them to be un-CoWed, in case a
+     * fork happened in another thread at an inopportune moment
+     * above. The madvise() will prevent any subsequent fork calls from
+     * causing the same problem.
+     */
+    for ( i = 0; i < npages ; i++ )
+    {
+        char *c = (char *)p + (i*PAGE_SIZE);
+        *c = 0;
+    }
+
     return p;
 
 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 Wed Jan 27 10:18:16 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:18: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 1aONB2-0001AZ-U6; Wed, 27 Jan 2016 10:18: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 1aONB1-0001A4-70
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:15 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	EF/BB-03225-66998A65; Wed, 27 Jan 2016 10:18:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1453889893!18141288!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5099 invoked from network); 27 Jan 2016 10:18:13 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:18:13 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBq-00024V-TR
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONAy-0001Zx-Jz
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:12 +0000
Date: Wed, 27 Jan 2016 10:18:12 +0000
Message-Id: <E1aONAy-0001Zx-Jz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/call: linux: touch newly
	allocated pages after madvise lockdown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b0074ce6a10fd7d6734c4bbb6d6e04910db92152
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 14 16:46:26 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:21 2016 +0000

    tools/libs/call: linux: touch newly allocated pages after madvise lockdown
    
    This avoids a potential issue with a fork after allocation but before
    madvise.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/call/linux.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/tools/libs/call/linux.c b/tools/libs/call/linux.c
index 3641e41..651f380 100644
--- a/tools/libs/call/linux.c
+++ b/tools/libs/call/linux.c
@@ -88,7 +88,7 @@ void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
 {
     size_t size = npages * PAGE_SIZE;
     void *p;
-    int rc, saved_errno;
+    int rc, i, 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);
@@ -107,6 +107,18 @@ void *osdep_alloc_pages(xencall_handle *xcall, size_t npages)
         goto out;
     }
 
+    /*
+     * Touch each page in turn to force them to be un-CoWed, in case a
+     * fork happened in another thread at an inopportune moment
+     * above. The madvise() will prevent any subsequent fork calls from
+     * causing the same problem.
+     */
+    for ( i = 0; i < npages ; i++ )
+    {
+        char *c = (char *)p + (i*PAGE_SIZE);
+        *c = 0;
+    }
+
     return p;
 
 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 Wed Jan 27 10:18:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:18: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 1aONBE-0001Cf-7Q; Wed, 27 Jan 2016 10:18: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 1aONBC-0001CI-KZ
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:26 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	3A/06-08479-17998A65; Wed, 27 Jan 2016 10:18:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1453889903!10943943!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 63047 invoked from network); 27 Jan 2016 10:18:24 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:18:24 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONC1-00024d-Ad
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONB9-0001aS-0h
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:23 +0000
Date: Wed, 27 Jan 2016 10:18:23 +0000
Message-Id: <E1aONB9-0001aS-0h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/{call,
	evtchn}: Document requirements around forking.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0bd2a73ef234ce28dda1e990de2724a36765ec6e
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Dec 11 17:31:26 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:21 2016 +0000

    tools/libs/{call,evtchn}: Document requirements around forking.
    
    Much like for gnttab and foreignmemory xencall hypercall buffers need
    care.
    
    Evtchn is a bit simpler (no magic mappings) but may not work from
    parent + child simultaneously, document "parent only" since it is
    consistent with the others.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/call/include/xencall.h     |   28 ++++++++++++++++++++++++++++
 tools/libs/evtchn/include/xenevtchn.h |   23 +++++++++++++++++++----
 2 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/tools/libs/call/include/xencall.h b/tools/libs/call/include/xencall.h
index 3f325f0..559624a 100644
--- a/tools/libs/call/include/xencall.h
+++ b/tools/libs/call/include/xencall.h
@@ -36,11 +36,39 @@ typedef struct xencall_handle xencall_handle;
 
 /*
  * Return a handle onto the hypercall driver.  Logs errors.
+ * *
+ * Note: After fork(2) a child process must not use any opened
+ * xencall handle inherited from their parent, nor access any
+ * hypercall argument buffers associated with that handle.
+ *
+ * The child must open a new handle if they want to interact with
+ * xencall.
+ *
+ * Calling exec(2) in a child will safely (and reliably) reclaim any
+ * resources which were allocated via a xencall_handle in the parent.
+ *
+ * A child which does not call exec(2) may safely call xencall_close()
+ * on a xencall_handle inherited from their parent. This will attempt
+ * to reclaim any resources associated with that handle. Note that in
+ * some implementations this reclamation may not be completely
+ * effective, in this case any affected resources remain allocated.
+ *
+ * Calling xencall_close() is the only safe operation on a
+ * xencall_handle which has been inherited.
  */
 xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags);
 
 /*
  * Close a handle previously allocated with xencall_open().
+ *
+ * Under normal circumstances (i.e. not in the child after a fork) any
+ * allocated hypercall argument buffers should be freed using the
+ * appropriate xencall_free_*() prior to closing the handle in order
+ * to free up resources associated with those mappings.
+ *
+ * This is the only function which may be safely called on a
+ * xencall_handle in a child after a fork. xencall_free_*() must not
+ * be called under such circumstances.
  */
 int xencall_close(xencall_handle *xcall);
 
diff --git a/tools/libs/evtchn/include/xenevtchn.h b/tools/libs/evtchn/include/xenevtchn.h
index 428d54c..4d26161 100644
--- a/tools/libs/evtchn/include/xenevtchn.h
+++ b/tools/libs/evtchn/include/xenevtchn.h
@@ -45,10 +45,25 @@ typedef struct xentoollog_logger xentoollog_logger;
  * Return a handle to the event channel driver, or NULL on failure, in
  * which case errno will be set appropriately.
  *
- * Note:
- * After fork a child process must not use any opened evtchn
- * handle inherited from their parent. They must open a new handle if
- * they want to interact with evtchn.
+ * Note: After fork(2) a child process must not use any opened evtchn
+ * handle inherited from their parent, nor access any grant mapped
+ * areas associated with that handle.
+ *
+ * The child must open a new handle if they want to interact with
+ * evtchn.
+ *
+ * Calling exec(2) in a child will safely (and reliably) reclaim any
+ * allocated resources via a xenevtchn_handle in the parent.
+ *
+ * A child which does not call exec(2) may safely call
+ * xenevtchn_close() on a xenevtchn_handle inherited from their
+ * parent. This will attempt to reclaim any resources associated with
+ * that handle. Note that in some implementations this reclamation may
+ * not be completely effective, in this case any affected resources
+ * remain allocated.
+ *
+ * Calling xenevtchn_close() is the only safe operation on a
+ * xenevtchn_handle which has been inherited.
  */
 /* Currently no flags are defined */
 xenevtchn_handle *xenevtchn_open(xentoollog_logger *logger, unsigned open_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 Wed Jan 27 10:18:28 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:18: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 1aONBE-0001Cf-7Q; Wed, 27 Jan 2016 10:18: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 1aONBC-0001CI-KZ
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:26 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	3A/06-08479-17998A65; Wed, 27 Jan 2016 10:18:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1453889903!10943943!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 63047 invoked from network); 27 Jan 2016 10:18:24 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:18:24 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONC1-00024d-Ad
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONB9-0001aS-0h
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:23 +0000
Date: Wed, 27 Jan 2016 10:18:23 +0000
Message-Id: <E1aONB9-0001aS-0h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/{call,
	evtchn}: Document requirements around forking.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0bd2a73ef234ce28dda1e990de2724a36765ec6e
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Dec 11 17:31:26 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:21 2016 +0000

    tools/libs/{call,evtchn}: Document requirements around forking.
    
    Much like for gnttab and foreignmemory xencall hypercall buffers need
    care.
    
    Evtchn is a bit simpler (no magic mappings) but may not work from
    parent + child simultaneously, document "parent only" since it is
    consistent with the others.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/call/include/xencall.h     |   28 ++++++++++++++++++++++++++++
 tools/libs/evtchn/include/xenevtchn.h |   23 +++++++++++++++++++----
 2 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/tools/libs/call/include/xencall.h b/tools/libs/call/include/xencall.h
index 3f325f0..559624a 100644
--- a/tools/libs/call/include/xencall.h
+++ b/tools/libs/call/include/xencall.h
@@ -36,11 +36,39 @@ typedef struct xencall_handle xencall_handle;
 
 /*
  * Return a handle onto the hypercall driver.  Logs errors.
+ * *
+ * Note: After fork(2) a child process must not use any opened
+ * xencall handle inherited from their parent, nor access any
+ * hypercall argument buffers associated with that handle.
+ *
+ * The child must open a new handle if they want to interact with
+ * xencall.
+ *
+ * Calling exec(2) in a child will safely (and reliably) reclaim any
+ * resources which were allocated via a xencall_handle in the parent.
+ *
+ * A child which does not call exec(2) may safely call xencall_close()
+ * on a xencall_handle inherited from their parent. This will attempt
+ * to reclaim any resources associated with that handle. Note that in
+ * some implementations this reclamation may not be completely
+ * effective, in this case any affected resources remain allocated.
+ *
+ * Calling xencall_close() is the only safe operation on a
+ * xencall_handle which has been inherited.
  */
 xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags);
 
 /*
  * Close a handle previously allocated with xencall_open().
+ *
+ * Under normal circumstances (i.e. not in the child after a fork) any
+ * allocated hypercall argument buffers should be freed using the
+ * appropriate xencall_free_*() prior to closing the handle in order
+ * to free up resources associated with those mappings.
+ *
+ * This is the only function which may be safely called on a
+ * xencall_handle in a child after a fork. xencall_free_*() must not
+ * be called under such circumstances.
  */
 int xencall_close(xencall_handle *xcall);
 
diff --git a/tools/libs/evtchn/include/xenevtchn.h b/tools/libs/evtchn/include/xenevtchn.h
index 428d54c..4d26161 100644
--- a/tools/libs/evtchn/include/xenevtchn.h
+++ b/tools/libs/evtchn/include/xenevtchn.h
@@ -45,10 +45,25 @@ typedef struct xentoollog_logger xentoollog_logger;
  * Return a handle to the event channel driver, or NULL on failure, in
  * which case errno will be set appropriately.
  *
- * Note:
- * After fork a child process must not use any opened evtchn
- * handle inherited from their parent. They must open a new handle if
- * they want to interact with evtchn.
+ * Note: After fork(2) a child process must not use any opened evtchn
+ * handle inherited from their parent, nor access any grant mapped
+ * areas associated with that handle.
+ *
+ * The child must open a new handle if they want to interact with
+ * evtchn.
+ *
+ * Calling exec(2) in a child will safely (and reliably) reclaim any
+ * allocated resources via a xenevtchn_handle in the parent.
+ *
+ * A child which does not call exec(2) may safely call
+ * xenevtchn_close() on a xenevtchn_handle inherited from their
+ * parent. This will attempt to reclaim any resources associated with
+ * that handle. Note that in some implementations this reclamation may
+ * not be completely effective, in this case any affected resources
+ * remain allocated.
+ *
+ * Calling xenevtchn_close() is the only safe operation on a
+ * xenevtchn_handle which has been inherited.
  */
 /* Currently no flags are defined */
 xenevtchn_handle *xenevtchn_open(xentoollog_logger *logger, unsigned open_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 Wed Jan 27 10:18:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:18: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 1aONBO-0001EM-BF; Wed, 27 Jan 2016 10:18:38 +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 1aONBN-0001E8-LR
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:37 +0000
Content-Length: 9735
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	36/F1-02745-C7998A65; Wed, 27 Jan 2016 10:18:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453889913!8807650!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12345 invoked from network); 27 Jan 2016 10:18:35 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:18:35 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCB-00024p-Ky
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBJ-0001cd-En
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:33 +0000
Date: Wed, 27 Jan 2016 10:18:33 +0000
Message-Id: <E1aONBJ-0001cd-En@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/*: Use O_CLOEXEC on Linux
	and 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="===============1565863326435979451=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1565863326435979451==
Content-Length: 9592
Content-Transfer-Encoding: quoted-printable

commit 0831774c8188584e2a48a7c8070d56ba744ca279
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 2 16:21:41 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:22 2016 +0000

    tools/libs/*: Use O_CLOEXEC on Linux and FreeBSD
    
    In some cases this replaces an FD_CLOEXEC dance, in others it is new.
    
    Linux has had O_CLOEXEC since 2.6.23 (October 2007), so we can rely on
    it from Xen 4.7 I think. Some libc headers may still lack the
    definition, so we take care of that if need be by defining to 0 (on
    the premise that such an old glibc might barf on O_CLOEXEC even if the
    kernel may or may not be so old).
    
    All stable versions of FreeBSD support O_CLOEXEC (10.2, 9.3 and 8.4),
    and we assume the libc there does too.
    
    Remove various comments about having to take responsibility for this
    (since really it is just hygiene, politeness, not a requirement) and
    the reasons for using O_CLOEXEC seem pretty straightforward.
    
    Backends for other OSes are untouched.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Roger.Pau@citrix.com
    Cc: jbeulich@suse.com
---
 tools/libs/call/freebsd.c          |   30 +++++++--------------------
 tools/libs/call/linux.c            |   38 ++++++++++-------------------------
 tools/libs/evtchn/freebsd.c        |    2 +-
 tools/libs/evtchn/linux.c          |    6 ++++-
 tools/libs/foreignmemory/freebsd.c |   24 +--------------------
 tools/libs/foreignmemory/linux.c   |   36 ++++++++-------------------------
 tools/libs/gnttab/linux.c          |    6 ++++-
 7 files changed, 41 insertions(+), 101 deletions(-)

diff --git a/tools/libs/call/freebsd.c b/tools/libs/call/freebsd.c
index 2413966..b3cbccd 100644
--- a/tools/libs/call/freebsd.c
+++ b/tools/libs/call/freebsd.c
@@ -35,8 +35,14 @@
 
 int osdep_xencall_open(xencall_handle *xcall)
 {
-    int flags, saved_errno;
-    int fd =3D open(PRIVCMD_DEV, O_RDWR);
+    int saved_errno;
+    int fd =3D open(PRIVCMD_DEV, O_RDWR|O_CLOEXEC);
+
+    /*
+     * This file descriptor is opaque to the caller, thus we are
+     * polite and try and ensure it doesn't propagate (ie leak)
+     * outside the process, by using O_CLOEXEC.
+     */
 
     if ( fd =3D=3D -1 )
     {
@@ -45,26 +51,6 @@ int osdep_xencall_open(xencall_handle *xcall)
         return -1;
     }
 
-    /*
-     * 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;
-    }
-
     xcall->fd =3D fd;
     return 0;
 
diff --git a/tools/libs/call/linux.c b/tools/libs/call/linux.c
index 651f380..e8e0311 100644
--- a/tools/libs/call/linux.c
+++ b/tools/libs/call/linux.c
@@ -26,15 +26,23 @@
 
 #include "private.h"
 
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
 int osdep_xencall_open(xencall_handle *xcall)
 {
-    int flags, saved_errno;
-    int fd =3D open("/dev/xen/privcmd", O_RDWR); /* prefer this newer interface */
+    int fd;
+
+    /*
+     * Prefer the newer interface.
+     */
+    fd =3D open("/dev/xen/privcmd", O_RDWR|O_CLOEXEC);
 
     if ( fd =3D=3D -1 && ( errno =3D=3D ENOENT || errno =3D=3D ENXIO || errno =3D=3D ENODEV ))
     {
         /* Fallback to /proc/xen/privcmd */
-        fd =3D open("/proc/xen/privcmd", O_RDWR);
+        fd =3D open("/proc/xen/privcmd", O_RDWR|O_CLOEXEC);
     }
 
     if ( fd =3D=3D -1 )
@@ -43,32 +51,8 @@ int osdep_xencall_open(xencall_handle *xcall)
         return -1;
     }
 
-    /* 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;
-    }
-
     xcall->fd =3D fd;
     return 0;
-
- error:
-    saved_errno =3D errno;
-    close(fd);
-    errno =3D saved_errno;
-    return -1;
 }
 
 int osdep_xencall_close(xencall_handle *xcall)
diff --git a/tools/libs/evtchn/freebsd.c b/tools/libs/evtchn/freebsd.c
index 6479f7c..ddf221d 100644
--- a/tools/libs/evtchn/freebsd.c
+++ b/tools/libs/evtchn/freebsd.c
@@ -32,7 +32,7 @@
 
 int osdep_evtchn_open(xenevtchn_handle *xce)
 {
-    int fd =3D open(EVTCHN_DEV, O_RDWR);
+    int fd =3D open(EVTCHN_DEV, O_RDWR|O_CLOEXEC);
     if ( fd =3D=3D -1 )
         return -1;
     xce->fd =3D fd;
diff --git a/tools/libs/evtchn/linux.c b/tools/libs/evtchn/linux.c
index 76cf0ac..0a3c6e1 100644
--- a/tools/libs/evtchn/linux.c
+++ b/tools/libs/evtchn/linux.c
@@ -28,9 +28,13 @@
 
 #include "private.h"
 
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
 int osdep_evtchn_open(xenevtchn_handle *xce)
 {
-    int fd =3D open("/dev/xen/evtchn", O_RDWR);
+    int fd =3D open("/dev/xen/evtchn", O_RDWR|O_CLOEXEC);
     if ( fd =3D=3D -1 )
         return -1;
     xce->fd =3D fd;
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index 38138dc..7bf3939 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -33,8 +33,8 @@
 
 int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
 {
-    int flags, saved_errno;
-    int fd =3D open(PRIVCMD_DEV, O_RDWR);
+    int saved_errno;
+    int fd =3D open(PRIVCMD_DEV, O_RDWR|O_CLOEXEC);
 
     if ( fd =3D=3D -1 )
     {
@@ -43,26 +43,6 @@ int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
         return -1;
     }
 
-    /*
-     * 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;
-    }
-
     fmem->fd =3D fd;
     return 0;
 
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
index 32b6def..423c744 100644
--- a/tools/libs/foreignmemory/linux.c
+++ b/tools/libs/foreignmemory/linux.c
@@ -30,15 +30,21 @@
 
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
 int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
 {
-    int flags, saved_errno;
-    int fd =3D open("/dev/xen/privcmd", O_RDWR); /* prefer this newer interface */
+    int fd;
+
+    /* prefer this newer interface */
+    fd =3D open("/dev/xen/privcmd", O_RDWR|O_CLOEXEC);
 
     if ( fd =3D=3D -1 && ( errno =3D=3D ENOENT || errno =3D=3D ENXIO || errno =3D=3D ENODEV ))
     {
         /* Fallback to /proc/xen/privcmd */
-        fd =3D open("/proc/xen/privcmd", O_RDWR);
+        fd =3D open("/proc/xen/privcmd", O_RDWR|O_CLOEXEC);
     }
 
     if ( fd =3D=3D -1 )
@@ -47,32 +53,8 @@ int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
         return -1;
     }
 
-    /* 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;
-    }
-
     fmem->fd =3D fd;
     return 0;
-
- error:
-    saved_errno =3D errno;
-    close(fd);
-    errno =3D saved_errno;
-    return -1;
 }
 
 int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
diff --git a/tools/libs/gnttab/linux.c b/tools/libs/gnttab/linux.c
index be04295..7b0fba4 100644
--- a/tools/libs/gnttab/linux.c
+++ b/tools/libs/gnttab/linux.c
@@ -43,9 +43,13 @@
 #define PAGE_SIZE            (1UL << PAGE_SHIFT)
 #define PAGE_MASK            (~(PAGE_SIZE-1))
 
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
 int osdep_gnttab_open(xengnttab_handle *xgt)
 {
-    int fd =3D open(DEVXEN "gntdev", O_RDWR);
+    int fd =3D open(DEVXEN "gntdev", O_RDWR|O_CLOEXEC);
     if ( fd =3D=3D -1 )
         return -1;
     xgt->fd =3D fd;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:18:38 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:18: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 1aONBO-0001EM-BF; Wed, 27 Jan 2016 10:18:38 +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 1aONBN-0001E8-LR
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:37 +0000
Content-Length: 9735
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	36/F1-02745-C7998A65; Wed, 27 Jan 2016 10:18:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453889913!8807650!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12345 invoked from network); 27 Jan 2016 10:18:35 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:18:35 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCB-00024p-Ky
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBJ-0001cd-En
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:33 +0000
Date: Wed, 27 Jan 2016 10:18:33 +0000
Message-Id: <E1aONBJ-0001cd-En@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libs/*: Use O_CLOEXEC on Linux
	and 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="===============1565863326435979451=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1565863326435979451==
Content-Length: 9592
Content-Transfer-Encoding: quoted-printable

commit 0831774c8188584e2a48a7c8070d56ba744ca279
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 2 16:21:41 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:22 2016 +0000

    tools/libs/*: Use O_CLOEXEC on Linux and FreeBSD
    
    In some cases this replaces an FD_CLOEXEC dance, in others it is new.
    
    Linux has had O_CLOEXEC since 2.6.23 (October 2007), so we can rely on
    it from Xen 4.7 I think. Some libc headers may still lack the
    definition, so we take care of that if need be by defining to 0 (on
    the premise that such an old glibc might barf on O_CLOEXEC even if the
    kernel may or may not be so old).
    
    All stable versions of FreeBSD support O_CLOEXEC (10.2, 9.3 and 8.4),
    and we assume the libc there does too.
    
    Remove various comments about having to take responsibility for this
    (since really it is just hygiene, politeness, not a requirement) and
    the reasons for using O_CLOEXEC seem pretty straightforward.
    
    Backends for other OSes are untouched.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Roger.Pau@citrix.com
    Cc: jbeulich@suse.com
---
 tools/libs/call/freebsd.c          |   30 +++++++--------------------
 tools/libs/call/linux.c            |   38 ++++++++++-------------------------
 tools/libs/evtchn/freebsd.c        |    2 +-
 tools/libs/evtchn/linux.c          |    6 ++++-
 tools/libs/foreignmemory/freebsd.c |   24 +--------------------
 tools/libs/foreignmemory/linux.c   |   36 ++++++++-------------------------
 tools/libs/gnttab/linux.c          |    6 ++++-
 7 files changed, 41 insertions(+), 101 deletions(-)

diff --git a/tools/libs/call/freebsd.c b/tools/libs/call/freebsd.c
index 2413966..b3cbccd 100644
--- a/tools/libs/call/freebsd.c
+++ b/tools/libs/call/freebsd.c
@@ -35,8 +35,14 @@
 
 int osdep_xencall_open(xencall_handle *xcall)
 {
-    int flags, saved_errno;
-    int fd =3D open(PRIVCMD_DEV, O_RDWR);
+    int saved_errno;
+    int fd =3D open(PRIVCMD_DEV, O_RDWR|O_CLOEXEC);
+
+    /*
+     * This file descriptor is opaque to the caller, thus we are
+     * polite and try and ensure it doesn't propagate (ie leak)
+     * outside the process, by using O_CLOEXEC.
+     */
 
     if ( fd =3D=3D -1 )
     {
@@ -45,26 +51,6 @@ int osdep_xencall_open(xencall_handle *xcall)
         return -1;
     }
 
-    /*
-     * 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;
-    }
-
     xcall->fd =3D fd;
     return 0;
 
diff --git a/tools/libs/call/linux.c b/tools/libs/call/linux.c
index 651f380..e8e0311 100644
--- a/tools/libs/call/linux.c
+++ b/tools/libs/call/linux.c
@@ -26,15 +26,23 @@
 
 #include "private.h"
 
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
 int osdep_xencall_open(xencall_handle *xcall)
 {
-    int flags, saved_errno;
-    int fd =3D open("/dev/xen/privcmd", O_RDWR); /* prefer this newer interface */
+    int fd;
+
+    /*
+     * Prefer the newer interface.
+     */
+    fd =3D open("/dev/xen/privcmd", O_RDWR|O_CLOEXEC);
 
     if ( fd =3D=3D -1 && ( errno =3D=3D ENOENT || errno =3D=3D ENXIO || errno =3D=3D ENODEV ))
     {
         /* Fallback to /proc/xen/privcmd */
-        fd =3D open("/proc/xen/privcmd", O_RDWR);
+        fd =3D open("/proc/xen/privcmd", O_RDWR|O_CLOEXEC);
     }
 
     if ( fd =3D=3D -1 )
@@ -43,32 +51,8 @@ int osdep_xencall_open(xencall_handle *xcall)
         return -1;
     }
 
-    /* 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;
-    }
-
     xcall->fd =3D fd;
     return 0;
-
- error:
-    saved_errno =3D errno;
-    close(fd);
-    errno =3D saved_errno;
-    return -1;
 }
 
 int osdep_xencall_close(xencall_handle *xcall)
diff --git a/tools/libs/evtchn/freebsd.c b/tools/libs/evtchn/freebsd.c
index 6479f7c..ddf221d 100644
--- a/tools/libs/evtchn/freebsd.c
+++ b/tools/libs/evtchn/freebsd.c
@@ -32,7 +32,7 @@
 
 int osdep_evtchn_open(xenevtchn_handle *xce)
 {
-    int fd =3D open(EVTCHN_DEV, O_RDWR);
+    int fd =3D open(EVTCHN_DEV, O_RDWR|O_CLOEXEC);
     if ( fd =3D=3D -1 )
         return -1;
     xce->fd =3D fd;
diff --git a/tools/libs/evtchn/linux.c b/tools/libs/evtchn/linux.c
index 76cf0ac..0a3c6e1 100644
--- a/tools/libs/evtchn/linux.c
+++ b/tools/libs/evtchn/linux.c
@@ -28,9 +28,13 @@
 
 #include "private.h"
 
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
 int osdep_evtchn_open(xenevtchn_handle *xce)
 {
-    int fd =3D open("/dev/xen/evtchn", O_RDWR);
+    int fd =3D open("/dev/xen/evtchn", O_RDWR|O_CLOEXEC);
     if ( fd =3D=3D -1 )
         return -1;
     xce->fd =3D fd;
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index 38138dc..7bf3939 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -33,8 +33,8 @@
 
 int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
 {
-    int flags, saved_errno;
-    int fd =3D open(PRIVCMD_DEV, O_RDWR);
+    int saved_errno;
+    int fd =3D open(PRIVCMD_DEV, O_RDWR|O_CLOEXEC);
 
     if ( fd =3D=3D -1 )
     {
@@ -43,26 +43,6 @@ int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
         return -1;
     }
 
-    /*
-     * 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;
-    }
-
     fmem->fd =3D fd;
     return 0;
 
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
index 32b6def..423c744 100644
--- a/tools/libs/foreignmemory/linux.c
+++ b/tools/libs/foreignmemory/linux.c
@@ -30,15 +30,21 @@
 
 #define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
 int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
 {
-    int flags, saved_errno;
-    int fd =3D open("/dev/xen/privcmd", O_RDWR); /* prefer this newer interface */
+    int fd;
+
+    /* prefer this newer interface */
+    fd =3D open("/dev/xen/privcmd", O_RDWR|O_CLOEXEC);
 
     if ( fd =3D=3D -1 && ( errno =3D=3D ENOENT || errno =3D=3D ENXIO || errno =3D=3D ENODEV ))
     {
         /* Fallback to /proc/xen/privcmd */
-        fd =3D open("/proc/xen/privcmd", O_RDWR);
+        fd =3D open("/proc/xen/privcmd", O_RDWR|O_CLOEXEC);
     }
 
     if ( fd =3D=3D -1 )
@@ -47,32 +53,8 @@ int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
         return -1;
     }
 
-    /* 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;
-    }
-
     fmem->fd =3D fd;
     return 0;
-
- error:
-    saved_errno =3D errno;
-    close(fd);
-    errno =3D saved_errno;
-    return -1;
 }
 
 int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
diff --git a/tools/libs/gnttab/linux.c b/tools/libs/gnttab/linux.c
index be04295..7b0fba4 100644
--- a/tools/libs/gnttab/linux.c
+++ b/tools/libs/gnttab/linux.c
@@ -43,9 +43,13 @@
 #define PAGE_SIZE            (1UL << PAGE_SHIFT)
 #define PAGE_MASK            (~(PAGE_SIZE-1))
 
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
 int osdep_gnttab_open(xengnttab_handle *xgt)
 {
-    int fd =3D open(DEVXEN "gntdev", O_RDWR);
+    int fd =3D open(DEVXEN "gntdev", O_RDWR|O_CLOEXEC);
     if ( fd =3D=3D -1 )
         return -1;
     xgt->fd =3D fd;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:18:47 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:18: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 1aONBX-0001Gn-LS; Wed, 27 Jan 2016 10:18: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 1aONBW-0001GU-8O
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:46 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	B6/2C-21594-58998A65; Wed, 27 Jan 2016 10:18:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1453889924!18441348!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29058 invoked from network); 27 Jan 2016 10:18:44 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:18:44 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCL-00024x-UI
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBT-0001i6-MW
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:43 +0000
Date: Wed, 27 Jan 2016 10:18:43 +0000
Message-Id: <E1aONBT-0001i6-MW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Update CFLAGS for qemu-xen to
	allow it to use new 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 5757c7067ee1cd0f520142e4f3aa86e8e5b010ba
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Sep 22 15:16:05 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:22 2016 +0000

    tools: Update CFLAGS for qemu-xen to allow it to use new libraries
    
    This means adding -L for libxen{evtchn,gnttab,foreignmemory} so that
    it can link them directly (rather than using the libxenctrl compat
    layer exposed via -rpath-link). Also add -I for libxenforeignmemory.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/Makefile |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 61785d7..15680a5 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -256,12 +256,16 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-I$(XEN_ROOT)/tools/libs/toollog/include \
 		-I$(XEN_ROOT)/tools/libs/evtchn/include \
 		-I$(XEN_ROOT)/tools/libs/gnttab/include \
+		-I$(XEN_ROOT)/tools/libs/foreignmemory/include \
 		-I$(XEN_ROOT)/tools/libxc/include \
 		-I$(XEN_ROOT)/tools/xenstore/include \
 		-I$(XEN_ROOT)/tools/xenstore/compat/include \
 		$(EXTRA_CFLAGS_QEMU_XEN)" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore \
+		-L$(XEN_ROOT)/tools/libs/evtchn \
+		-L$(XEN_ROOT)/tools/libs/gnttab \
+		-L$(XEN_ROOT)/tools/libs/foreignmemory \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/evtchn \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/gnttab \
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:18:47 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:18: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 1aONBX-0001Gn-LS; Wed, 27 Jan 2016 10:18: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 1aONBW-0001GU-8O
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:46 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	B6/2C-21594-58998A65; Wed, 27 Jan 2016 10:18:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1453889924!18441348!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29058 invoked from network); 27 Jan 2016 10:18:44 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:18:44 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCL-00024x-UI
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBT-0001i6-MW
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:43 +0000
Date: Wed, 27 Jan 2016 10:18:43 +0000
Message-Id: <E1aONBT-0001i6-MW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Update CFLAGS for qemu-xen to
	allow it to use new 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 5757c7067ee1cd0f520142e4f3aa86e8e5b010ba
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Sep 22 15:16:05 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jan 22 12:24:22 2016 +0000

    tools: Update CFLAGS for qemu-xen to allow it to use new libraries
    
    This means adding -L for libxen{evtchn,gnttab,foreignmemory} so that
    it can link them directly (rather than using the libxenctrl compat
    layer exposed via -rpath-link). Also add -I for libxenforeignmemory.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/Makefile |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 61785d7..15680a5 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -256,12 +256,16 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-I$(XEN_ROOT)/tools/libs/toollog/include \
 		-I$(XEN_ROOT)/tools/libs/evtchn/include \
 		-I$(XEN_ROOT)/tools/libs/gnttab/include \
+		-I$(XEN_ROOT)/tools/libs/foreignmemory/include \
 		-I$(XEN_ROOT)/tools/libxc/include \
 		-I$(XEN_ROOT)/tools/xenstore/include \
 		-I$(XEN_ROOT)/tools/xenstore/compat/include \
 		$(EXTRA_CFLAGS_QEMU_XEN)" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore \
+		-L$(XEN_ROOT)/tools/libs/evtchn \
+		-L$(XEN_ROOT)/tools/libs/gnttab \
+		-L$(XEN_ROOT)/tools/libs/foreignmemory \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/evtchn \
 		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/gnttab \
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:19:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:19: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 1aONBu-0001JP-Qr; Wed, 27 Jan 2016 10:19: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 1aONBt-0001JJ-0R
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:09 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	24/3C-09478-C9998A65; Wed, 27 Jan 2016 10:19:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1453889944!18180143!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31764 invoked from network); 27 Jan 2016 10:19:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:19:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCg-00025o-MR
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBo-0001kd-BK
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:04 +0000
Date: Wed, 27 Jan 2016 10:19:04 +0000
Message-Id: <E1aONBo-0001kd-BK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] grant_table: convert grant table
	rwlock to percpu rwlock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eede22972fefa02100226252c430ffcca99025eb
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Fri Jan 22 16:16:05 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 22 16:16:05 2016 +0100

    grant_table: convert grant table rwlock to percpu rwlock
    
    The per domain grant table read lock suffers from significant contention when
    performance multi-queue block or network IO due to the parallel
    grant map/unmaps/copies occurring on the DomU's grant table.
    
    On multi-socket systems, the contention results in the locked compare swap
    operation failing frequently which results in a tight loop of retries of the
    compare swap operation. As the coherency fabric can only support a specific
    rate of compare swap operations for a particular data location then taking
    the read lock itself becomes a bottleneck for grant operations.
    
    Standard rwlock performance of a single VIF VM-VM transfer with 16 queues
    configured was limited to approximately 15 gbit/s on a 2 socket Haswell-EP
    host.
    
    Percpu rwlock performance with the same configuration is approximately
    48 gbit/s.
    
    Oprofile was used to determine the initial overhead of the read-write locks
    and to confirm the overhead was dramatically reduced by the percpu rwlocks.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c             |    4 +-
 xen/arch/x86/mm.c             |    4 +-
 xen/common/grant_table.c      |  124 +++++++++++++++++++++++------------------
 xen/include/xen/grant_table.h |   24 ++++++++-
 4 files changed, 96 insertions(+), 60 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 47bfb27..81f9e2e 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1055,7 +1055,7 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        write_lock(&d->grant_table->lock);
+        grant_write_lock(d->grant_table);
 
         if ( d->grant_table->gt_version == 0 )
             d->grant_table->gt_version = 1;
@@ -1085,7 +1085,7 @@ int xenmem_add_to_physmap_one(
 
         t = p2m_ram_rw;
 
-        write_unlock(&d->grant_table->lock);
+        grant_write_unlock(d->grant_table);
         break;
     case XENMAPSPACE_shared_info:
         if ( idx != 0 )
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 83f82b8..1ee431e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4671,7 +4671,7 @@ int xenmem_add_to_physmap_one(
                 mfn = virt_to_mfn(d->shared_info);
             break;
         case XENMAPSPACE_grant_table:
-            write_lock(&d->grant_table->lock);
+            grant_write_lock(d->grant_table);
 
             if ( d->grant_table->gt_version == 0 )
                 d->grant_table->gt_version = 1;
@@ -4693,7 +4693,7 @@ int xenmem_add_to_physmap_one(
                     mfn = virt_to_mfn(d->grant_table->shared_raw[idx]);
             }
 
-            write_unlock(&d->grant_table->lock);
+            grant_write_unlock(d->grant_table);
             break;
         case XENMAPSPACE_gmfn_range:
         case XENMAPSPACE_gmfn:
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 5d52d1e..8b22299 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -178,6 +178,8 @@ struct active_grant_entry {
 #define _active_entry(t, e) \
     ((t)->active[(e)/ACGNT_PER_PAGE][(e)%ACGNT_PER_PAGE])
 
+DEFINE_PERCPU_RWLOCK_GLOBAL(grant_rwlock);
+
 static inline void gnttab_flush_tlb(const struct domain *d)
 {
     if ( !paging_mode_external(d) )
@@ -208,7 +210,13 @@ active_entry_acquire(struct grant_table *t, grant_ref_t e)
 {
     struct active_grant_entry *act;
 
-    ASSERT(rw_is_locked(&t->lock));
+    /*
+     * The grant table for the active entry should be locked but the
+     * percpu rwlock cannot be checked for read lock without race conditions
+     * or high overhead so we cannot use an ASSERT
+     *
+     *   ASSERT(rw_is_locked(&t->lock));
+     */
 
     act = &_active_entry(t, e);
     spin_lock(&act->lock);
@@ -270,23 +278,23 @@ double_gt_lock(struct grant_table *lgt, struct grant_table *rgt)
      */
     if ( lgt < rgt )
     {
-        write_lock(&lgt->lock);
-        write_lock(&rgt->lock);
+        grant_write_lock(lgt);
+        grant_write_lock(rgt);
     }
     else
     {
         if ( lgt != rgt )
-            write_lock(&rgt->lock);
-        write_lock(&lgt->lock);
+            grant_write_lock(rgt);
+        grant_write_lock(lgt);
     }
 }
 
 static inline void
 double_gt_unlock(struct grant_table *lgt, struct grant_table *rgt)
 {
-    write_unlock(&lgt->lock);
+    grant_write_unlock(lgt);
     if ( lgt != rgt )
-        write_unlock(&rgt->lock);
+        grant_write_unlock(rgt);
 }
 
 static inline int
@@ -660,7 +668,13 @@ static int grant_map_exists(const struct domain *ld,
 {
     unsigned int ref, max_iter;
     
-    ASSERT(rw_is_locked(&rgt->lock));
+    /*
+     * The remote grant table should be locked but the percpu rwlock
+     * cannot be checked for read lock without race conditions or high
+     * overhead so we cannot use an ASSERT
+     *
+     *   ASSERT(rw_is_locked(&rgt->lock));
+     */
 
     max_iter = min(*ref_count + (1 << GNTTABOP_CONTINUATION_ARG_SHIFT),
                    nr_grant_entries(rgt));
@@ -703,12 +717,12 @@ static unsigned int mapkind(
      * Must have the local domain's grant table write lock when
      * iterating over its maptrack entries.
      */
-    ASSERT(rw_is_write_locked(&lgt->lock));
+    ASSERT(percpu_rw_is_write_locked(&lgt->lock));
     /*
      * Must have the remote domain's grant table write lock while
      * counting its active entries.
      */
-    ASSERT(rw_is_write_locked(&rd->grant_table->lock));
+    ASSERT(percpu_rw_is_write_locked(&rd->grant_table->lock));
 
     for ( handle = 0; !(kind & MAPKIND_WRITE) &&
                       handle < lgt->maptrack_limit; handle++ )
@@ -796,7 +810,7 @@ __gnttab_map_grant_ref(
     }
 
     rgt = rd->grant_table;
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
 
     /* Bounds check on the grant ref */
     if ( unlikely(op->ref >= nr_grant_entries(rgt)))
@@ -859,7 +873,7 @@ __gnttab_map_grant_ref(
     cache_flags = (shah->flags & (GTF_PAT | GTF_PWT | GTF_PCD) );
 
     active_entry_release(act);
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
 
     /* pg may be set, with a refcount included, from __get_paged_frame */
     if ( !pg )
@@ -1006,7 +1020,7 @@ __gnttab_map_grant_ref(
         put_page(pg);
     }
 
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
 
     act = active_entry_acquire(rgt, op->ref);
 
@@ -1029,7 +1043,7 @@ __gnttab_map_grant_ref(
     active_entry_release(act);
 
  unlock_out:
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
     op->status = rc;
     put_maptrack_handle(lgt, handle);
     rcu_unlock_domain(rd);
@@ -1080,18 +1094,18 @@ __gnttab_unmap_common(
 
     op->map = &maptrack_entry(lgt, op->handle);
 
-    read_lock(&lgt->lock);
+    grant_read_lock(lgt);
 
     if ( unlikely(!read_atomic(&op->map->flags)) )
     {
-        read_unlock(&lgt->lock);
+        grant_read_unlock(lgt);
         gdprintk(XENLOG_INFO, "Zero flags for handle (%d).\n", op->handle);
         op->status = GNTST_bad_handle;
         return;
     }
 
     dom = op->map->domid;
-    read_unlock(&lgt->lock);
+    grant_read_unlock(lgt);
 
     if ( unlikely((rd = rcu_lock_domain_by_id(dom)) == NULL) )
     {
@@ -1113,7 +1127,7 @@ __gnttab_unmap_common(
 
     rgt = rd->grant_table;
 
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
 
     op->flags = read_atomic(&op->map->flags);
     if ( unlikely(!op->flags) || unlikely(op->map->domid != dom) )
@@ -1165,7 +1179,7 @@ __gnttab_unmap_common(
  act_release_out:
     active_entry_release(act);
  unmap_out:
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
 
     if ( rc == GNTST_okay && gnttab_need_iommu_mapping(ld) )
     {
@@ -1220,7 +1234,7 @@ __gnttab_unmap_common_complete(struct gnttab_unmap_common *op)
     rcu_lock_domain(rd);
     rgt = rd->grant_table;
 
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
     if ( rgt->gt_version == 0 )
         goto unlock_out;
 
@@ -1286,7 +1300,7 @@ __gnttab_unmap_common_complete(struct gnttab_unmap_common *op)
  act_release_out:
     active_entry_release(act);
  unlock_out:
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
 
     if ( put_handle )
     {
@@ -1585,7 +1599,7 @@ gnttab_setup_table(
     }
 
     gt = d->grant_table;
-    write_lock(&gt->lock);
+    grant_write_lock(gt);
 
     if ( gt->gt_version == 0 )
         gt->gt_version = 1;
@@ -1613,7 +1627,7 @@ gnttab_setup_table(
     }
 
  out3:
-    write_unlock(&gt->lock);
+    grant_write_unlock(gt);
  out2:
     rcu_unlock_domain(d);
  out1:
@@ -1655,13 +1669,13 @@ gnttab_query_size(
         goto query_out_unlock;
     }
 
-    read_lock(&d->grant_table->lock);
+    grant_read_lock(d->grant_table);
 
     op.nr_frames     = nr_grant_frames(d->grant_table);
     op.max_nr_frames = max_grant_frames;
     op.status        = GNTST_okay;
 
-    read_unlock(&d->grant_table->lock);
+    grant_read_unlock(d->grant_table);
 
  
  query_out_unlock:
@@ -1687,7 +1701,7 @@ gnttab_prepare_for_transfer(
     union grant_combo   scombo, prev_scombo, new_scombo;
     int                 retries = 0;
 
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
 
     if ( unlikely(ref >= nr_grant_entries(rgt)) )
     {
@@ -1730,11 +1744,11 @@ gnttab_prepare_for_transfer(
         scombo = prev_scombo;
     }
 
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
     return 1;
 
  fail:
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
     return 0;
 }
 
@@ -1925,7 +1939,7 @@ gnttab_transfer(
         TRACE_1D(TRC_MEM_PAGE_GRANT_TRANSFER, e->domain_id);
 
         /* Tell the guest about its new page frame. */
-        read_lock(&e->grant_table->lock);
+        grant_read_lock(e->grant_table);
         act = active_entry_acquire(e->grant_table, gop.ref);
 
         if ( e->grant_table->gt_version == 1 )
@@ -1949,7 +1963,7 @@ gnttab_transfer(
             GTF_transfer_completed;
 
         active_entry_release(act);
-        read_unlock(&e->grant_table->lock);
+        grant_read_unlock(e->grant_table);
 
         rcu_unlock_domain(e);
 
@@ -1987,7 +2001,7 @@ __release_grant_for_copy(
     released_read = 0;
     released_write = 0;
 
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
 
     act = active_entry_acquire(rgt, gref);
     sha = shared_entry_header(rgt, gref);
@@ -2029,7 +2043,7 @@ __release_grant_for_copy(
     }
 
     active_entry_release(act);
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
 
     if ( td != rd )
     {
@@ -2086,7 +2100,7 @@ __acquire_grant_for_copy(
 
     *page = NULL;
 
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
 
     if ( unlikely(gref >= nr_grant_entries(rgt)) )
         PIN_FAIL(gt_unlock_out, GNTST_bad_gntref,
@@ -2168,20 +2182,20 @@ __acquire_grant_for_copy(
              * here and reacquire
              */
             active_entry_release(act);
-            read_unlock(&rgt->lock);
+            grant_read_unlock(rgt);
 
             rc = __acquire_grant_for_copy(td, trans_gref, rd->domain_id,
                                           readonly, &grant_frame, page,
                                           &trans_page_off, &trans_length, 0);
 
-            read_lock(&rgt->lock);
+            grant_read_lock(rgt);
             act = active_entry_acquire(rgt, gref);
 
             if ( rc != GNTST_okay ) {
                 __fixup_status_for_copy_pin(act, status);
                 rcu_unlock_domain(td);
                 active_entry_release(act);
-                read_unlock(&rgt->lock);
+                grant_read_unlock(rgt);
                 return rc;
             }
 
@@ -2194,7 +2208,7 @@ __acquire_grant_for_copy(
                 __fixup_status_for_copy_pin(act, status);
                 rcu_unlock_domain(td);
                 active_entry_release(act);
-                read_unlock(&rgt->lock);
+                grant_read_unlock(rgt);
                 put_page(*page);
                 return __acquire_grant_for_copy(rd, gref, ldom, readonly,
                                                 frame, page, page_off, length,
@@ -2258,7 +2272,7 @@ __acquire_grant_for_copy(
     *frame = act->frame;
 
     active_entry_release(act);
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
     return rc;
  
  unlock_out_clear:
@@ -2273,7 +2287,7 @@ __acquire_grant_for_copy(
     active_entry_release(act);
 
  gt_unlock_out:
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
 
     return rc;
 }
@@ -2589,7 +2603,7 @@ gnttab_set_version(XEN_GUEST_HANDLE_PARAM(gnttab_set_version_t) uop)
     if ( gt->gt_version == op.version )
         goto out;
 
-    write_lock(&gt->lock);
+    grant_write_lock(gt);
     /*
      * Make sure that the grant table isn't currently in use when we
      * change the version number, except for the first 8 entries which
@@ -2702,7 +2716,7 @@ gnttab_set_version(XEN_GUEST_HANDLE_PARAM(gnttab_set_version_t) uop)
     gt->gt_version = op.version;
 
  out_unlock:
-    write_unlock(&gt->lock);
+    grant_write_unlock(gt);
 
  out:
     op.version = gt->gt_version;
@@ -2758,7 +2772,7 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
 
     op.status = GNTST_okay;
 
-    read_lock(&gt->lock);
+    grant_read_lock(gt);
 
     for ( i = 0; i < op.nr_frames; i++ )
     {
@@ -2767,7 +2781,7 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
             op.status = GNTST_bad_virt_addr;
     }
 
-    read_unlock(&gt->lock);
+    grant_read_unlock(gt);
 out2:
     rcu_unlock_domain(d);
 out1:
@@ -2817,7 +2831,7 @@ __gnttab_swap_grant_ref(grant_ref_t ref_a, grant_ref_t ref_b)
     struct active_grant_entry *act_b = NULL;
     s16 rc = GNTST_okay;
 
-    write_lock(&gt->lock);
+    grant_write_lock(gt);
 
     /* Bounds check on the grant refs */
     if ( unlikely(ref_a >= nr_grant_entries(d->grant_table)))
@@ -2865,7 +2879,7 @@ out:
         active_entry_release(act_b);
     if ( act_a != NULL )
         active_entry_release(act_a);
-    write_unlock(&gt->lock);
+    grant_write_unlock(gt);
 
     rcu_unlock_domain(d);
 
@@ -2936,12 +2950,12 @@ static int __gnttab_cache_flush(gnttab_cache_flush_t *cflush,
 
     if ( d != owner )
     {
-        read_lock(&owner->grant_table->lock);
+        grant_read_lock(owner->grant_table);
 
         ret = grant_map_exists(d, owner->grant_table, mfn, ref_count);
         if ( ret != 0 )
         {
-            read_unlock(&owner->grant_table->lock);
+            grant_read_unlock(owner->grant_table);
             rcu_unlock_domain(d);
             put_page(page);
             return ret;
@@ -2961,7 +2975,7 @@ static int __gnttab_cache_flush(gnttab_cache_flush_t *cflush,
         ret = 0;
 
     if ( d != owner )
-        read_unlock(&owner->grant_table->lock);
+        grant_read_unlock(owner->grant_table);
     unmap_domain_page(v);
     put_page(page);
 
@@ -3180,7 +3194,7 @@ grant_table_create(
         goto no_mem_0;
 
     /* Simple stuff. */
-    rwlock_init(&t->lock);
+    percpu_rwlock_resource_init(&t->lock, grant_rwlock);
     spin_lock_init(&t->maptrack_lock);
     t->nr_grant_frames = INITIAL_NR_GRANT_FRAMES;
 
@@ -3282,7 +3296,7 @@ gnttab_release_mappings(
         }
 
         rgt = rd->grant_table;
-        read_lock(&rgt->lock);
+        grant_read_lock(rgt);
 
         act = active_entry_acquire(rgt, ref);
         sha = shared_entry_header(rgt, ref);
@@ -3343,7 +3357,7 @@ gnttab_release_mappings(
             gnttab_clear_flag(_GTF_reading, status);
 
         active_entry_release(act);
-        read_unlock(&rgt->lock);
+        grant_read_unlock(rgt);
 
         rcu_unlock_domain(rd);
 
@@ -3360,7 +3374,7 @@ void grant_table_warn_active_grants(struct domain *d)
 
 #define WARN_GRANT_MAX 10
 
-    read_lock(&gt->lock);
+    grant_read_lock(gt);
 
     for ( ref = 0; ref != nr_grant_entries(gt); ref++ )
     {
@@ -3382,7 +3396,7 @@ void grant_table_warn_active_grants(struct domain *d)
         printk(XENLOG_G_DEBUG "Dom%d has too many (%d) active grants to report\n",
                d->domain_id, nr_active);
 
-    read_unlock(&gt->lock);
+    grant_read_unlock(gt);
 
 #undef WARN_GRANT_MAX
 }
@@ -3432,7 +3446,7 @@ static void gnttab_usage_print(struct domain *rd)
     printk("      -------- active --------       -------- shared --------\n");
     printk("[ref] localdom mfn      pin          localdom gmfn     flags\n");
 
-    read_lock(&gt->lock);
+    grant_read_lock(gt);
 
     for ( ref = 0; ref != nr_grant_entries(gt); ref++ )
     {
@@ -3475,7 +3489,7 @@ static void gnttab_usage_print(struct domain *rd)
         active_entry_release(act);
     }
 
-    read_unlock(&gt->lock);
+    grant_read_unlock(gt);
 
     if ( first )
         printk("grant-table for remote domain:%5d ... "
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 1c29cee..b4f064e 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -51,13 +51,15 @@
 /* The maximum size of a grant table. */
 extern unsigned int max_grant_frames;
 
+DECLARE_PERCPU_RWLOCK_GLOBAL(grant_rwlock);
+
 /* Per-domain grant information. */
 struct grant_table {
     /*
      * Lock protecting updates to grant table state (version, active
      * entry list, etc.)
      */
-    rwlock_t              lock;
+    percpu_rwlock_t       lock;
     /* Table size. Number of frames shared with guest */
     unsigned int          nr_grant_frames;
     /* Shared grant table (see include/public/grant_table.h). */
@@ -82,6 +84,26 @@ struct grant_table {
     unsigned              gt_version;
 };
 
+static inline void grant_read_lock(struct grant_table *gt)
+{
+    percpu_read_lock(grant_rwlock, &gt->lock);
+}
+
+static inline void grant_read_unlock(struct grant_table *gt)
+{
+    percpu_read_unlock(grant_rwlock, &gt->lock);
+}
+
+static inline void grant_write_lock(struct grant_table *gt)
+{
+    percpu_write_lock(grant_rwlock, &gt->lock);
+}
+
+static inline void grant_write_unlock(struct grant_table *gt)
+{
+    percpu_write_unlock(grant_rwlock, &gt->lock);
+}
+
 /* Create/destroy per-domain grant table context. */
 int grant_table_create(
     struct domain *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 Wed Jan 27 10:19:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:19: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 1aONBu-0001JP-Qr; Wed, 27 Jan 2016 10:19: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 1aONBt-0001JJ-0R
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:09 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	24/3C-09478-C9998A65; Wed, 27 Jan 2016 10:19:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1453889944!18180143!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31764 invoked from network); 27 Jan 2016 10:19:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:19:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCg-00025o-MR
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBo-0001kd-BK
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:04 +0000
Date: Wed, 27 Jan 2016 10:19:04 +0000
Message-Id: <E1aONBo-0001kd-BK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] grant_table: convert grant table
	rwlock to percpu rwlock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eede22972fefa02100226252c430ffcca99025eb
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Fri Jan 22 16:16:05 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 22 16:16:05 2016 +0100

    grant_table: convert grant table rwlock to percpu rwlock
    
    The per domain grant table read lock suffers from significant contention when
    performance multi-queue block or network IO due to the parallel
    grant map/unmaps/copies occurring on the DomU's grant table.
    
    On multi-socket systems, the contention results in the locked compare swap
    operation failing frequently which results in a tight loop of retries of the
    compare swap operation. As the coherency fabric can only support a specific
    rate of compare swap operations for a particular data location then taking
    the read lock itself becomes a bottleneck for grant operations.
    
    Standard rwlock performance of a single VIF VM-VM transfer with 16 queues
    configured was limited to approximately 15 gbit/s on a 2 socket Haswell-EP
    host.
    
    Percpu rwlock performance with the same configuration is approximately
    48 gbit/s.
    
    Oprofile was used to determine the initial overhead of the read-write locks
    and to confirm the overhead was dramatically reduced by the percpu rwlocks.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c             |    4 +-
 xen/arch/x86/mm.c             |    4 +-
 xen/common/grant_table.c      |  124 +++++++++++++++++++++++------------------
 xen/include/xen/grant_table.h |   24 ++++++++-
 4 files changed, 96 insertions(+), 60 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 47bfb27..81f9e2e 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1055,7 +1055,7 @@ int xenmem_add_to_physmap_one(
     switch ( space )
     {
     case XENMAPSPACE_grant_table:
-        write_lock(&d->grant_table->lock);
+        grant_write_lock(d->grant_table);
 
         if ( d->grant_table->gt_version == 0 )
             d->grant_table->gt_version = 1;
@@ -1085,7 +1085,7 @@ int xenmem_add_to_physmap_one(
 
         t = p2m_ram_rw;
 
-        write_unlock(&d->grant_table->lock);
+        grant_write_unlock(d->grant_table);
         break;
     case XENMAPSPACE_shared_info:
         if ( idx != 0 )
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 83f82b8..1ee431e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4671,7 +4671,7 @@ int xenmem_add_to_physmap_one(
                 mfn = virt_to_mfn(d->shared_info);
             break;
         case XENMAPSPACE_grant_table:
-            write_lock(&d->grant_table->lock);
+            grant_write_lock(d->grant_table);
 
             if ( d->grant_table->gt_version == 0 )
                 d->grant_table->gt_version = 1;
@@ -4693,7 +4693,7 @@ int xenmem_add_to_physmap_one(
                     mfn = virt_to_mfn(d->grant_table->shared_raw[idx]);
             }
 
-            write_unlock(&d->grant_table->lock);
+            grant_write_unlock(d->grant_table);
             break;
         case XENMAPSPACE_gmfn_range:
         case XENMAPSPACE_gmfn:
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 5d52d1e..8b22299 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -178,6 +178,8 @@ struct active_grant_entry {
 #define _active_entry(t, e) \
     ((t)->active[(e)/ACGNT_PER_PAGE][(e)%ACGNT_PER_PAGE])
 
+DEFINE_PERCPU_RWLOCK_GLOBAL(grant_rwlock);
+
 static inline void gnttab_flush_tlb(const struct domain *d)
 {
     if ( !paging_mode_external(d) )
@@ -208,7 +210,13 @@ active_entry_acquire(struct grant_table *t, grant_ref_t e)
 {
     struct active_grant_entry *act;
 
-    ASSERT(rw_is_locked(&t->lock));
+    /*
+     * The grant table for the active entry should be locked but the
+     * percpu rwlock cannot be checked for read lock without race conditions
+     * or high overhead so we cannot use an ASSERT
+     *
+     *   ASSERT(rw_is_locked(&t->lock));
+     */
 
     act = &_active_entry(t, e);
     spin_lock(&act->lock);
@@ -270,23 +278,23 @@ double_gt_lock(struct grant_table *lgt, struct grant_table *rgt)
      */
     if ( lgt < rgt )
     {
-        write_lock(&lgt->lock);
-        write_lock(&rgt->lock);
+        grant_write_lock(lgt);
+        grant_write_lock(rgt);
     }
     else
     {
         if ( lgt != rgt )
-            write_lock(&rgt->lock);
-        write_lock(&lgt->lock);
+            grant_write_lock(rgt);
+        grant_write_lock(lgt);
     }
 }
 
 static inline void
 double_gt_unlock(struct grant_table *lgt, struct grant_table *rgt)
 {
-    write_unlock(&lgt->lock);
+    grant_write_unlock(lgt);
     if ( lgt != rgt )
-        write_unlock(&rgt->lock);
+        grant_write_unlock(rgt);
 }
 
 static inline int
@@ -660,7 +668,13 @@ static int grant_map_exists(const struct domain *ld,
 {
     unsigned int ref, max_iter;
     
-    ASSERT(rw_is_locked(&rgt->lock));
+    /*
+     * The remote grant table should be locked but the percpu rwlock
+     * cannot be checked for read lock without race conditions or high
+     * overhead so we cannot use an ASSERT
+     *
+     *   ASSERT(rw_is_locked(&rgt->lock));
+     */
 
     max_iter = min(*ref_count + (1 << GNTTABOP_CONTINUATION_ARG_SHIFT),
                    nr_grant_entries(rgt));
@@ -703,12 +717,12 @@ static unsigned int mapkind(
      * Must have the local domain's grant table write lock when
      * iterating over its maptrack entries.
      */
-    ASSERT(rw_is_write_locked(&lgt->lock));
+    ASSERT(percpu_rw_is_write_locked(&lgt->lock));
     /*
      * Must have the remote domain's grant table write lock while
      * counting its active entries.
      */
-    ASSERT(rw_is_write_locked(&rd->grant_table->lock));
+    ASSERT(percpu_rw_is_write_locked(&rd->grant_table->lock));
 
     for ( handle = 0; !(kind & MAPKIND_WRITE) &&
                       handle < lgt->maptrack_limit; handle++ )
@@ -796,7 +810,7 @@ __gnttab_map_grant_ref(
     }
 
     rgt = rd->grant_table;
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
 
     /* Bounds check on the grant ref */
     if ( unlikely(op->ref >= nr_grant_entries(rgt)))
@@ -859,7 +873,7 @@ __gnttab_map_grant_ref(
     cache_flags = (shah->flags & (GTF_PAT | GTF_PWT | GTF_PCD) );
 
     active_entry_release(act);
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
 
     /* pg may be set, with a refcount included, from __get_paged_frame */
     if ( !pg )
@@ -1006,7 +1020,7 @@ __gnttab_map_grant_ref(
         put_page(pg);
     }
 
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
 
     act = active_entry_acquire(rgt, op->ref);
 
@@ -1029,7 +1043,7 @@ __gnttab_map_grant_ref(
     active_entry_release(act);
 
  unlock_out:
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
     op->status = rc;
     put_maptrack_handle(lgt, handle);
     rcu_unlock_domain(rd);
@@ -1080,18 +1094,18 @@ __gnttab_unmap_common(
 
     op->map = &maptrack_entry(lgt, op->handle);
 
-    read_lock(&lgt->lock);
+    grant_read_lock(lgt);
 
     if ( unlikely(!read_atomic(&op->map->flags)) )
     {
-        read_unlock(&lgt->lock);
+        grant_read_unlock(lgt);
         gdprintk(XENLOG_INFO, "Zero flags for handle (%d).\n", op->handle);
         op->status = GNTST_bad_handle;
         return;
     }
 
     dom = op->map->domid;
-    read_unlock(&lgt->lock);
+    grant_read_unlock(lgt);
 
     if ( unlikely((rd = rcu_lock_domain_by_id(dom)) == NULL) )
     {
@@ -1113,7 +1127,7 @@ __gnttab_unmap_common(
 
     rgt = rd->grant_table;
 
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
 
     op->flags = read_atomic(&op->map->flags);
     if ( unlikely(!op->flags) || unlikely(op->map->domid != dom) )
@@ -1165,7 +1179,7 @@ __gnttab_unmap_common(
  act_release_out:
     active_entry_release(act);
  unmap_out:
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
 
     if ( rc == GNTST_okay && gnttab_need_iommu_mapping(ld) )
     {
@@ -1220,7 +1234,7 @@ __gnttab_unmap_common_complete(struct gnttab_unmap_common *op)
     rcu_lock_domain(rd);
     rgt = rd->grant_table;
 
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
     if ( rgt->gt_version == 0 )
         goto unlock_out;
 
@@ -1286,7 +1300,7 @@ __gnttab_unmap_common_complete(struct gnttab_unmap_common *op)
  act_release_out:
     active_entry_release(act);
  unlock_out:
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
 
     if ( put_handle )
     {
@@ -1585,7 +1599,7 @@ gnttab_setup_table(
     }
 
     gt = d->grant_table;
-    write_lock(&gt->lock);
+    grant_write_lock(gt);
 
     if ( gt->gt_version == 0 )
         gt->gt_version = 1;
@@ -1613,7 +1627,7 @@ gnttab_setup_table(
     }
 
  out3:
-    write_unlock(&gt->lock);
+    grant_write_unlock(gt);
  out2:
     rcu_unlock_domain(d);
  out1:
@@ -1655,13 +1669,13 @@ gnttab_query_size(
         goto query_out_unlock;
     }
 
-    read_lock(&d->grant_table->lock);
+    grant_read_lock(d->grant_table);
 
     op.nr_frames     = nr_grant_frames(d->grant_table);
     op.max_nr_frames = max_grant_frames;
     op.status        = GNTST_okay;
 
-    read_unlock(&d->grant_table->lock);
+    grant_read_unlock(d->grant_table);
 
  
  query_out_unlock:
@@ -1687,7 +1701,7 @@ gnttab_prepare_for_transfer(
     union grant_combo   scombo, prev_scombo, new_scombo;
     int                 retries = 0;
 
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
 
     if ( unlikely(ref >= nr_grant_entries(rgt)) )
     {
@@ -1730,11 +1744,11 @@ gnttab_prepare_for_transfer(
         scombo = prev_scombo;
     }
 
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
     return 1;
 
  fail:
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
     return 0;
 }
 
@@ -1925,7 +1939,7 @@ gnttab_transfer(
         TRACE_1D(TRC_MEM_PAGE_GRANT_TRANSFER, e->domain_id);
 
         /* Tell the guest about its new page frame. */
-        read_lock(&e->grant_table->lock);
+        grant_read_lock(e->grant_table);
         act = active_entry_acquire(e->grant_table, gop.ref);
 
         if ( e->grant_table->gt_version == 1 )
@@ -1949,7 +1963,7 @@ gnttab_transfer(
             GTF_transfer_completed;
 
         active_entry_release(act);
-        read_unlock(&e->grant_table->lock);
+        grant_read_unlock(e->grant_table);
 
         rcu_unlock_domain(e);
 
@@ -1987,7 +2001,7 @@ __release_grant_for_copy(
     released_read = 0;
     released_write = 0;
 
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
 
     act = active_entry_acquire(rgt, gref);
     sha = shared_entry_header(rgt, gref);
@@ -2029,7 +2043,7 @@ __release_grant_for_copy(
     }
 
     active_entry_release(act);
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
 
     if ( td != rd )
     {
@@ -2086,7 +2100,7 @@ __acquire_grant_for_copy(
 
     *page = NULL;
 
-    read_lock(&rgt->lock);
+    grant_read_lock(rgt);
 
     if ( unlikely(gref >= nr_grant_entries(rgt)) )
         PIN_FAIL(gt_unlock_out, GNTST_bad_gntref,
@@ -2168,20 +2182,20 @@ __acquire_grant_for_copy(
              * here and reacquire
              */
             active_entry_release(act);
-            read_unlock(&rgt->lock);
+            grant_read_unlock(rgt);
 
             rc = __acquire_grant_for_copy(td, trans_gref, rd->domain_id,
                                           readonly, &grant_frame, page,
                                           &trans_page_off, &trans_length, 0);
 
-            read_lock(&rgt->lock);
+            grant_read_lock(rgt);
             act = active_entry_acquire(rgt, gref);
 
             if ( rc != GNTST_okay ) {
                 __fixup_status_for_copy_pin(act, status);
                 rcu_unlock_domain(td);
                 active_entry_release(act);
-                read_unlock(&rgt->lock);
+                grant_read_unlock(rgt);
                 return rc;
             }
 
@@ -2194,7 +2208,7 @@ __acquire_grant_for_copy(
                 __fixup_status_for_copy_pin(act, status);
                 rcu_unlock_domain(td);
                 active_entry_release(act);
-                read_unlock(&rgt->lock);
+                grant_read_unlock(rgt);
                 put_page(*page);
                 return __acquire_grant_for_copy(rd, gref, ldom, readonly,
                                                 frame, page, page_off, length,
@@ -2258,7 +2272,7 @@ __acquire_grant_for_copy(
     *frame = act->frame;
 
     active_entry_release(act);
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
     return rc;
  
  unlock_out_clear:
@@ -2273,7 +2287,7 @@ __acquire_grant_for_copy(
     active_entry_release(act);
 
  gt_unlock_out:
-    read_unlock(&rgt->lock);
+    grant_read_unlock(rgt);
 
     return rc;
 }
@@ -2589,7 +2603,7 @@ gnttab_set_version(XEN_GUEST_HANDLE_PARAM(gnttab_set_version_t) uop)
     if ( gt->gt_version == op.version )
         goto out;
 
-    write_lock(&gt->lock);
+    grant_write_lock(gt);
     /*
      * Make sure that the grant table isn't currently in use when we
      * change the version number, except for the first 8 entries which
@@ -2702,7 +2716,7 @@ gnttab_set_version(XEN_GUEST_HANDLE_PARAM(gnttab_set_version_t) uop)
     gt->gt_version = op.version;
 
  out_unlock:
-    write_unlock(&gt->lock);
+    grant_write_unlock(gt);
 
  out:
     op.version = gt->gt_version;
@@ -2758,7 +2772,7 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
 
     op.status = GNTST_okay;
 
-    read_lock(&gt->lock);
+    grant_read_lock(gt);
 
     for ( i = 0; i < op.nr_frames; i++ )
     {
@@ -2767,7 +2781,7 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop,
             op.status = GNTST_bad_virt_addr;
     }
 
-    read_unlock(&gt->lock);
+    grant_read_unlock(gt);
 out2:
     rcu_unlock_domain(d);
 out1:
@@ -2817,7 +2831,7 @@ __gnttab_swap_grant_ref(grant_ref_t ref_a, grant_ref_t ref_b)
     struct active_grant_entry *act_b = NULL;
     s16 rc = GNTST_okay;
 
-    write_lock(&gt->lock);
+    grant_write_lock(gt);
 
     /* Bounds check on the grant refs */
     if ( unlikely(ref_a >= nr_grant_entries(d->grant_table)))
@@ -2865,7 +2879,7 @@ out:
         active_entry_release(act_b);
     if ( act_a != NULL )
         active_entry_release(act_a);
-    write_unlock(&gt->lock);
+    grant_write_unlock(gt);
 
     rcu_unlock_domain(d);
 
@@ -2936,12 +2950,12 @@ static int __gnttab_cache_flush(gnttab_cache_flush_t *cflush,
 
     if ( d != owner )
     {
-        read_lock(&owner->grant_table->lock);
+        grant_read_lock(owner->grant_table);
 
         ret = grant_map_exists(d, owner->grant_table, mfn, ref_count);
         if ( ret != 0 )
         {
-            read_unlock(&owner->grant_table->lock);
+            grant_read_unlock(owner->grant_table);
             rcu_unlock_domain(d);
             put_page(page);
             return ret;
@@ -2961,7 +2975,7 @@ static int __gnttab_cache_flush(gnttab_cache_flush_t *cflush,
         ret = 0;
 
     if ( d != owner )
-        read_unlock(&owner->grant_table->lock);
+        grant_read_unlock(owner->grant_table);
     unmap_domain_page(v);
     put_page(page);
 
@@ -3180,7 +3194,7 @@ grant_table_create(
         goto no_mem_0;
 
     /* Simple stuff. */
-    rwlock_init(&t->lock);
+    percpu_rwlock_resource_init(&t->lock, grant_rwlock);
     spin_lock_init(&t->maptrack_lock);
     t->nr_grant_frames = INITIAL_NR_GRANT_FRAMES;
 
@@ -3282,7 +3296,7 @@ gnttab_release_mappings(
         }
 
         rgt = rd->grant_table;
-        read_lock(&rgt->lock);
+        grant_read_lock(rgt);
 
         act = active_entry_acquire(rgt, ref);
         sha = shared_entry_header(rgt, ref);
@@ -3343,7 +3357,7 @@ gnttab_release_mappings(
             gnttab_clear_flag(_GTF_reading, status);
 
         active_entry_release(act);
-        read_unlock(&rgt->lock);
+        grant_read_unlock(rgt);
 
         rcu_unlock_domain(rd);
 
@@ -3360,7 +3374,7 @@ void grant_table_warn_active_grants(struct domain *d)
 
 #define WARN_GRANT_MAX 10
 
-    read_lock(&gt->lock);
+    grant_read_lock(gt);
 
     for ( ref = 0; ref != nr_grant_entries(gt); ref++ )
     {
@@ -3382,7 +3396,7 @@ void grant_table_warn_active_grants(struct domain *d)
         printk(XENLOG_G_DEBUG "Dom%d has too many (%d) active grants to report\n",
                d->domain_id, nr_active);
 
-    read_unlock(&gt->lock);
+    grant_read_unlock(gt);
 
 #undef WARN_GRANT_MAX
 }
@@ -3432,7 +3446,7 @@ static void gnttab_usage_print(struct domain *rd)
     printk("      -------- active --------       -------- shared --------\n");
     printk("[ref] localdom mfn      pin          localdom gmfn     flags\n");
 
-    read_lock(&gt->lock);
+    grant_read_lock(gt);
 
     for ( ref = 0; ref != nr_grant_entries(gt); ref++ )
     {
@@ -3475,7 +3489,7 @@ static void gnttab_usage_print(struct domain *rd)
         active_entry_release(act);
     }
 
-    read_unlock(&gt->lock);
+    grant_read_unlock(gt);
 
     if ( first )
         printk("grant-table for remote domain:%5d ... "
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 1c29cee..b4f064e 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -51,13 +51,15 @@
 /* The maximum size of a grant table. */
 extern unsigned int max_grant_frames;
 
+DECLARE_PERCPU_RWLOCK_GLOBAL(grant_rwlock);
+
 /* Per-domain grant information. */
 struct grant_table {
     /*
      * Lock protecting updates to grant table state (version, active
      * entry list, etc.)
      */
-    rwlock_t              lock;
+    percpu_rwlock_t       lock;
     /* Table size. Number of frames shared with guest */
     unsigned int          nr_grant_frames;
     /* Shared grant table (see include/public/grant_table.h). */
@@ -82,6 +84,26 @@ struct grant_table {
     unsigned              gt_version;
 };
 
+static inline void grant_read_lock(struct grant_table *gt)
+{
+    percpu_read_lock(grant_rwlock, &gt->lock);
+}
+
+static inline void grant_read_unlock(struct grant_table *gt)
+{
+    percpu_read_unlock(grant_rwlock, &gt->lock);
+}
+
+static inline void grant_write_lock(struct grant_table *gt)
+{
+    percpu_write_lock(grant_rwlock, &gt->lock);
+}
+
+static inline void grant_write_unlock(struct grant_table *gt)
+{
+    percpu_write_unlock(grant_rwlock, &gt->lock);
+}
+
 /* Create/destroy per-domain grant table context. */
 int grant_table_create(
     struct domain *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 Wed Jan 27 10:19:19 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:19: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 1aONC3-0001KS-02; Wed, 27 Jan 2016 10:19: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 1aONC1-0001KE-CG
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:17 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	5B/6C-09708-4A998A65; Wed, 27 Jan 2016 10:19:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1453889934!12346181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4425 invoked from network); 27 Jan 2016 10:19:12 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:19:12 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCW-00025b-5M
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBd-0001io-UJ
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:53 +0000
Date: Wed, 27 Jan 2016 10:18:53 +0000
Message-Id: <E1aONBd-0001io-UJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] rwlock: add per-cpu reader-writer lock
	infrastructure
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef9dd43dddc0a31a4343a58072935c1b5c0cbbee
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Fri Jan 22 16:04:41 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 22 16:04:41 2016 +0100

    rwlock: add per-cpu reader-writer lock infrastructure
    
    Per-cpu read-write locks allow for the fast path read case to have
    low overhead by only setting/clearing a per-cpu variable for using
    the read lock. The per-cpu read fast path also avoids locked
    compare swap operations which can be particularly slow on coherent
    multi-socket systems, particularly if there is heavy usage of the
    read lock itself.
    
    The per-cpu reader-writer lock uses a local variable to control
    the read lock fast path. This allows a writer to disable the fast
    path and ensures the readers switch to using the underlying
    read-write lock implementation instead of the per-cpu variable.
    
    Once the writer has taken the write lock and disabled the fast path,
    it must poll the per-cpu variable for all CPU's which have entered
    the critical section for the specific read-write lock the writer is
    attempting to take. This design allows for a single per-cpu variable
    to be used for read/write locks belonging to seperate data structures.
    If a two or more different per-cpu read lock(s) are taken
    simultaneously then the per-cpu data structure is not used and the
    implementation takes the read lock of the underlying read-write lock,
    this behaviour is equivalent to the slow path in terms of performance.
    The per-cpu rwlock is not recursion safe for taking the per-cpu
    read lock because there is no recursion count variable, this is
    functionally equivalent to standard spin locks.
    
    Slow path readers which are unblocked, set the per-cpu variable and
    drop the read lock. This simplifies the implementation and allows
    for fairness in the underlying read-write lock to be taken
    advantage of.
    
    There is more overhead on the per-cpu write lock path due to checking
    each CPUs fast path per-cpu variable but this overhead is likely be
    hidden by the required delay of waiting for readers to exit the
    critical section. The loop is optimised to only iterate over
    the per-cpu data of active readers of the rwlock. The cpumask_t for
    tracking the active readers is stored in a single per-cpu data
    location and thus the write lock is not pre-emption safe. Therefore
    the per-cpu write lock can only be used with interrupts disabled.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/spinlock.c        |   45 ++++++++++++++++
 xen/include/asm-arm/percpu.h |    5 ++
 xen/include/asm-x86/percpu.h |    6 ++
 xen/include/xen/percpu.h     |    4 ++
 xen/include/xen/spinlock.h   |  116 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 176 insertions(+), 0 deletions(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 7b0cf6c..bab1f95 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -10,6 +10,8 @@
 #include <asm/processor.h>
 #include <asm/atomic.h>
 
+static DEFINE_PER_CPU(cpumask_t, percpu_rwlock_readers);
+
 #ifndef NDEBUG
 
 static atomic_t spin_debug __read_mostly = ATOMIC_INIT(0);
@@ -492,6 +494,49 @@ int _rw_is_write_locked(rwlock_t *lock)
     return (lock->lock == RW_WRITE_FLAG); /* writer in critical section? */
 }
 
+void _percpu_write_lock(percpu_rwlock_t **per_cpudata,
+                percpu_rwlock_t *percpu_rwlock)
+{
+    unsigned int cpu;
+    cpumask_t *rwlock_readers = &this_cpu(percpu_rwlock_readers);
+
+    /* Validate the correct per_cpudata variable has been provided. */
+    _percpu_rwlock_owner_check(per_cpudata, percpu_rwlock);
+
+    /* 
+     * First take the write lock to protect against other writers or slow 
+     * path readers.
+     */
+    write_lock(&percpu_rwlock->rwlock);
+
+    /* Now set the global variable so that readers start using read_lock. */
+    percpu_rwlock->writer_activating = 1;
+    smp_mb();
+
+    /* Using a per cpu cpumask is only safe if there is no nesting. */
+    ASSERT(!in_irq());
+    cpumask_copy(rwlock_readers, &cpu_online_map);
+
+    /* Check if there are any percpu readers in progress on this rwlock. */
+    for ( ; ; )
+    {
+        for_each_cpu(cpu, rwlock_readers)
+        {
+            /* 
+             * Remove any percpu readers not contending on this rwlock
+             * from our check mask.
+             */
+            if ( per_cpu_ptr(per_cpudata, cpu) != percpu_rwlock )
+                __cpumask_clear_cpu(cpu, rwlock_readers);
+        }
+        /* Check if we've cleared all percpu readers from check mask. */
+        if ( cpumask_empty(rwlock_readers) )
+            break;
+        /* Give the coherency fabric a break. */
+        cpu_relax();
+    };
+}
+
 #ifdef LOCK_PROFILE
 
 struct lock_profile_anc {
diff --git a/xen/include/asm-arm/percpu.h b/xen/include/asm-arm/percpu.h
index 71e7649..7968532 100644
--- a/xen/include/asm-arm/percpu.h
+++ b/xen/include/asm-arm/percpu.h
@@ -27,6 +27,11 @@ void percpu_init_areas(void);
 #define __get_cpu_var(var) \
     (*RELOC_HIDE(&per_cpu__##var, READ_SYSREG(TPIDR_EL2)))
 
+#define per_cpu_ptr(var, cpu)  \
+    (*RELOC_HIDE(var, __per_cpu_offset[cpu]))
+#define __get_cpu_ptr(var) \
+    (*RELOC_HIDE(var, READ_SYSREG(TPIDR_EL2)))
+
 #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
 
 DECLARE_PER_CPU(unsigned int, cpu_id);
diff --git a/xen/include/asm-x86/percpu.h b/xen/include/asm-x86/percpu.h
index 604ff0d..51562b9 100644
--- a/xen/include/asm-x86/percpu.h
+++ b/xen/include/asm-x86/percpu.h
@@ -20,4 +20,10 @@ void percpu_init_areas(void);
 
 #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
 
+#define __get_cpu_ptr(var) \
+    (*RELOC_HIDE(var, get_cpu_info()->per_cpu_offset))
+
+#define per_cpu_ptr(var, cpu)  \
+    (*RELOC_HIDE(var, __per_cpu_offset[cpu]))
+
 #endif /* __X86_PERCPU_H__ */
diff --git a/xen/include/xen/percpu.h b/xen/include/xen/percpu.h
index abe0b11..c896863 100644
--- a/xen/include/xen/percpu.h
+++ b/xen/include/xen/percpu.h
@@ -16,6 +16,10 @@
 /* Preferred on Xen. Also see arch-defined per_cpu(). */
 #define this_cpu(var)    __get_cpu_var(var)
 
+#define this_cpu_ptr(ptr)    __get_cpu_ptr(ptr)
+
+#define get_per_cpu_var(var)  (per_cpu__##var)
+
 /* Linux compatibility. */
 #define get_cpu_var(var) this_cpu(var)
 #define put_cpu_var(var)
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 9555c53..8b2590f 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -3,6 +3,8 @@
 
 #include <asm/system.h>
 #include <asm/spinlock.h>
+#include <asm/types.h>
+#include <xen/percpu.h>
 
 #ifndef NDEBUG
 struct lock_debug {
@@ -263,4 +265,118 @@ int _rw_is_write_locked(rwlock_t *lock);
 #define rw_is_locked(l)               _rw_is_locked(l)
 #define rw_is_write_locked(l)         _rw_is_write_locked(l)
 
+typedef struct percpu_rwlock percpu_rwlock_t;
+
+struct percpu_rwlock {
+    rwlock_t            rwlock;
+    bool_t              writer_activating;
+#ifndef NDEBUG
+    percpu_rwlock_t     **percpu_owner;
+#endif
+};
+
+#ifndef NDEBUG
+#define PERCPU_RW_LOCK_UNLOCKED(owner) { RW_LOCK_UNLOCKED, 0, owner }
+static inline void _percpu_rwlock_owner_check(percpu_rwlock_t **per_cpudata,
+                                         percpu_rwlock_t *percpu_rwlock)
+{
+    ASSERT(per_cpudata == percpu_rwlock->percpu_owner);
+}
+#else
+#define PERCPU_RW_LOCK_UNLOCKED(owner) { RW_LOCK_UNLOCKED, 0 }
+#define _percpu_rwlock_owner_check(data, lock) ((void)0)
+#endif
+
+#define DEFINE_PERCPU_RWLOCK_RESOURCE(l, owner) \
+    percpu_rwlock_t l = PERCPU_RW_LOCK_UNLOCKED(&get_per_cpu_var(owner))
+#define percpu_rwlock_resource_init(l, owner) \
+    (*(l) = (percpu_rwlock_t)PERCPU_RW_LOCK_UNLOCKED(&get_per_cpu_var(owner)))
+
+static inline void _percpu_read_lock(percpu_rwlock_t **per_cpudata,
+                                         percpu_rwlock_t *percpu_rwlock)
+{
+    /* Validate the correct per_cpudata variable has been provided. */
+    _percpu_rwlock_owner_check(per_cpudata, percpu_rwlock);
+
+    /* We cannot support recursion on the same lock. */
+    ASSERT(this_cpu_ptr(per_cpudata) != percpu_rwlock);
+    /* 
+     * Detect using a second percpu_rwlock_t simulatenously and fallback
+     * to standard read_lock.
+     */
+    if ( unlikely(this_cpu_ptr(per_cpudata) != NULL ) )
+    {
+        read_lock(&percpu_rwlock->rwlock);
+        return;
+    }
+
+    /* Indicate this cpu is reading. */
+    this_cpu_ptr(per_cpudata) = percpu_rwlock;
+    smp_mb();
+    /* Check if a writer is waiting. */
+    if ( unlikely(percpu_rwlock->writer_activating) )
+    {
+        /* Let the waiting writer know we aren't holding the lock. */
+        this_cpu_ptr(per_cpudata) = NULL;
+        /* Wait using the read lock to keep the lock fair. */
+        read_lock(&percpu_rwlock->rwlock);
+        /* Set the per CPU data again and continue. */
+        this_cpu_ptr(per_cpudata) = percpu_rwlock;
+        /* Drop the read lock because we don't need it anymore. */
+        read_unlock(&percpu_rwlock->rwlock);
+    }
+}
+
+static inline void _percpu_read_unlock(percpu_rwlock_t **per_cpudata,
+                percpu_rwlock_t *percpu_rwlock)
+{
+    /* Validate the correct per_cpudata variable has been provided. */
+    _percpu_rwlock_owner_check(per_cpudata, percpu_rwlock);
+
+    /* Verify the read lock was taken for this lock */
+    ASSERT(this_cpu_ptr(per_cpudata) != NULL);
+    /* 
+     * Detect using a second percpu_rwlock_t simulatenously and fallback
+     * to standard read_unlock.
+     */
+    if ( unlikely(this_cpu_ptr(per_cpudata) != percpu_rwlock ) )
+    {
+        read_unlock(&percpu_rwlock->rwlock);
+        return;
+    }
+    this_cpu_ptr(per_cpudata) = NULL;
+    smp_wmb();
+}
+
+/* Don't inline percpu write lock as it's a complex function. */
+void _percpu_write_lock(percpu_rwlock_t **per_cpudata,
+                        percpu_rwlock_t *percpu_rwlock);
+
+static inline void _percpu_write_unlock(percpu_rwlock_t **per_cpudata,
+                percpu_rwlock_t *percpu_rwlock)
+{
+    /* Validate the correct per_cpudata variable has been provided. */
+    _percpu_rwlock_owner_check(per_cpudata, percpu_rwlock);
+
+    ASSERT(percpu_rwlock->writer_activating);
+    percpu_rwlock->writer_activating = 0;
+    write_unlock(&percpu_rwlock->rwlock);
+}
+
+#define percpu_rw_is_write_locked(l)         _rw_is_write_locked(&((l)->rwlock))
+
+#define percpu_read_lock(percpu, lock) \
+    _percpu_read_lock(&get_per_cpu_var(percpu), lock)
+#define percpu_read_unlock(percpu, lock) \
+    _percpu_read_unlock(&get_per_cpu_var(percpu), lock)
+#define percpu_write_lock(percpu, lock) \
+    _percpu_write_lock(&get_per_cpu_var(percpu), lock)
+#define percpu_write_unlock(percpu, lock) \
+    _percpu_write_unlock(&get_per_cpu_var(percpu), lock)
+
+#define DEFINE_PERCPU_RWLOCK_GLOBAL(name) DEFINE_PER_CPU(percpu_rwlock_t *, \
+                                                         name)
+#define DECLARE_PERCPU_RWLOCK_GLOBAL(name) DECLARE_PER_CPU(percpu_rwlock_t *, \
+                                                         name)
+
 #endif /* __SPINLOCK_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 Wed Jan 27 10:19:19 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:19: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 1aONC3-0001KS-02; Wed, 27 Jan 2016 10:19: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 1aONC1-0001KE-CG
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:17 +0000
Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id
	5B/6C-09708-4A998A65; Wed, 27 Jan 2016 10:19:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1453889934!12346181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4425 invoked from network); 27 Jan 2016 10:19:12 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:19:12 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCW-00025b-5M
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBd-0001io-UJ
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:18:53 +0000
Date: Wed, 27 Jan 2016 10:18:53 +0000
Message-Id: <E1aONBd-0001io-UJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] rwlock: add per-cpu reader-writer lock
	infrastructure
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef9dd43dddc0a31a4343a58072935c1b5c0cbbee
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Fri Jan 22 16:04:41 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 22 16:04:41 2016 +0100

    rwlock: add per-cpu reader-writer lock infrastructure
    
    Per-cpu read-write locks allow for the fast path read case to have
    low overhead by only setting/clearing a per-cpu variable for using
    the read lock. The per-cpu read fast path also avoids locked
    compare swap operations which can be particularly slow on coherent
    multi-socket systems, particularly if there is heavy usage of the
    read lock itself.
    
    The per-cpu reader-writer lock uses a local variable to control
    the read lock fast path. This allows a writer to disable the fast
    path and ensures the readers switch to using the underlying
    read-write lock implementation instead of the per-cpu variable.
    
    Once the writer has taken the write lock and disabled the fast path,
    it must poll the per-cpu variable for all CPU's which have entered
    the critical section for the specific read-write lock the writer is
    attempting to take. This design allows for a single per-cpu variable
    to be used for read/write locks belonging to seperate data structures.
    If a two or more different per-cpu read lock(s) are taken
    simultaneously then the per-cpu data structure is not used and the
    implementation takes the read lock of the underlying read-write lock,
    this behaviour is equivalent to the slow path in terms of performance.
    The per-cpu rwlock is not recursion safe for taking the per-cpu
    read lock because there is no recursion count variable, this is
    functionally equivalent to standard spin locks.
    
    Slow path readers which are unblocked, set the per-cpu variable and
    drop the read lock. This simplifies the implementation and allows
    for fairness in the underlying read-write lock to be taken
    advantage of.
    
    There is more overhead on the per-cpu write lock path due to checking
    each CPUs fast path per-cpu variable but this overhead is likely be
    hidden by the required delay of waiting for readers to exit the
    critical section. The loop is optimised to only iterate over
    the per-cpu data of active readers of the rwlock. The cpumask_t for
    tracking the active readers is stored in a single per-cpu data
    location and thus the write lock is not pre-emption safe. Therefore
    the per-cpu write lock can only be used with interrupts disabled.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/spinlock.c        |   45 ++++++++++++++++
 xen/include/asm-arm/percpu.h |    5 ++
 xen/include/asm-x86/percpu.h |    6 ++
 xen/include/xen/percpu.h     |    4 ++
 xen/include/xen/spinlock.h   |  116 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 176 insertions(+), 0 deletions(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 7b0cf6c..bab1f95 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -10,6 +10,8 @@
 #include <asm/processor.h>
 #include <asm/atomic.h>
 
+static DEFINE_PER_CPU(cpumask_t, percpu_rwlock_readers);
+
 #ifndef NDEBUG
 
 static atomic_t spin_debug __read_mostly = ATOMIC_INIT(0);
@@ -492,6 +494,49 @@ int _rw_is_write_locked(rwlock_t *lock)
     return (lock->lock == RW_WRITE_FLAG); /* writer in critical section? */
 }
 
+void _percpu_write_lock(percpu_rwlock_t **per_cpudata,
+                percpu_rwlock_t *percpu_rwlock)
+{
+    unsigned int cpu;
+    cpumask_t *rwlock_readers = &this_cpu(percpu_rwlock_readers);
+
+    /* Validate the correct per_cpudata variable has been provided. */
+    _percpu_rwlock_owner_check(per_cpudata, percpu_rwlock);
+
+    /* 
+     * First take the write lock to protect against other writers or slow 
+     * path readers.
+     */
+    write_lock(&percpu_rwlock->rwlock);
+
+    /* Now set the global variable so that readers start using read_lock. */
+    percpu_rwlock->writer_activating = 1;
+    smp_mb();
+
+    /* Using a per cpu cpumask is only safe if there is no nesting. */
+    ASSERT(!in_irq());
+    cpumask_copy(rwlock_readers, &cpu_online_map);
+
+    /* Check if there are any percpu readers in progress on this rwlock. */
+    for ( ; ; )
+    {
+        for_each_cpu(cpu, rwlock_readers)
+        {
+            /* 
+             * Remove any percpu readers not contending on this rwlock
+             * from our check mask.
+             */
+            if ( per_cpu_ptr(per_cpudata, cpu) != percpu_rwlock )
+                __cpumask_clear_cpu(cpu, rwlock_readers);
+        }
+        /* Check if we've cleared all percpu readers from check mask. */
+        if ( cpumask_empty(rwlock_readers) )
+            break;
+        /* Give the coherency fabric a break. */
+        cpu_relax();
+    };
+}
+
 #ifdef LOCK_PROFILE
 
 struct lock_profile_anc {
diff --git a/xen/include/asm-arm/percpu.h b/xen/include/asm-arm/percpu.h
index 71e7649..7968532 100644
--- a/xen/include/asm-arm/percpu.h
+++ b/xen/include/asm-arm/percpu.h
@@ -27,6 +27,11 @@ void percpu_init_areas(void);
 #define __get_cpu_var(var) \
     (*RELOC_HIDE(&per_cpu__##var, READ_SYSREG(TPIDR_EL2)))
 
+#define per_cpu_ptr(var, cpu)  \
+    (*RELOC_HIDE(var, __per_cpu_offset[cpu]))
+#define __get_cpu_ptr(var) \
+    (*RELOC_HIDE(var, READ_SYSREG(TPIDR_EL2)))
+
 #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
 
 DECLARE_PER_CPU(unsigned int, cpu_id);
diff --git a/xen/include/asm-x86/percpu.h b/xen/include/asm-x86/percpu.h
index 604ff0d..51562b9 100644
--- a/xen/include/asm-x86/percpu.h
+++ b/xen/include/asm-x86/percpu.h
@@ -20,4 +20,10 @@ void percpu_init_areas(void);
 
 #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
 
+#define __get_cpu_ptr(var) \
+    (*RELOC_HIDE(var, get_cpu_info()->per_cpu_offset))
+
+#define per_cpu_ptr(var, cpu)  \
+    (*RELOC_HIDE(var, __per_cpu_offset[cpu]))
+
 #endif /* __X86_PERCPU_H__ */
diff --git a/xen/include/xen/percpu.h b/xen/include/xen/percpu.h
index abe0b11..c896863 100644
--- a/xen/include/xen/percpu.h
+++ b/xen/include/xen/percpu.h
@@ -16,6 +16,10 @@
 /* Preferred on Xen. Also see arch-defined per_cpu(). */
 #define this_cpu(var)    __get_cpu_var(var)
 
+#define this_cpu_ptr(ptr)    __get_cpu_ptr(ptr)
+
+#define get_per_cpu_var(var)  (per_cpu__##var)
+
 /* Linux compatibility. */
 #define get_cpu_var(var) this_cpu(var)
 #define put_cpu_var(var)
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 9555c53..8b2590f 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -3,6 +3,8 @@
 
 #include <asm/system.h>
 #include <asm/spinlock.h>
+#include <asm/types.h>
+#include <xen/percpu.h>
 
 #ifndef NDEBUG
 struct lock_debug {
@@ -263,4 +265,118 @@ int _rw_is_write_locked(rwlock_t *lock);
 #define rw_is_locked(l)               _rw_is_locked(l)
 #define rw_is_write_locked(l)         _rw_is_write_locked(l)
 
+typedef struct percpu_rwlock percpu_rwlock_t;
+
+struct percpu_rwlock {
+    rwlock_t            rwlock;
+    bool_t              writer_activating;
+#ifndef NDEBUG
+    percpu_rwlock_t     **percpu_owner;
+#endif
+};
+
+#ifndef NDEBUG
+#define PERCPU_RW_LOCK_UNLOCKED(owner) { RW_LOCK_UNLOCKED, 0, owner }
+static inline void _percpu_rwlock_owner_check(percpu_rwlock_t **per_cpudata,
+                                         percpu_rwlock_t *percpu_rwlock)
+{
+    ASSERT(per_cpudata == percpu_rwlock->percpu_owner);
+}
+#else
+#define PERCPU_RW_LOCK_UNLOCKED(owner) { RW_LOCK_UNLOCKED, 0 }
+#define _percpu_rwlock_owner_check(data, lock) ((void)0)
+#endif
+
+#define DEFINE_PERCPU_RWLOCK_RESOURCE(l, owner) \
+    percpu_rwlock_t l = PERCPU_RW_LOCK_UNLOCKED(&get_per_cpu_var(owner))
+#define percpu_rwlock_resource_init(l, owner) \
+    (*(l) = (percpu_rwlock_t)PERCPU_RW_LOCK_UNLOCKED(&get_per_cpu_var(owner)))
+
+static inline void _percpu_read_lock(percpu_rwlock_t **per_cpudata,
+                                         percpu_rwlock_t *percpu_rwlock)
+{
+    /* Validate the correct per_cpudata variable has been provided. */
+    _percpu_rwlock_owner_check(per_cpudata, percpu_rwlock);
+
+    /* We cannot support recursion on the same lock. */
+    ASSERT(this_cpu_ptr(per_cpudata) != percpu_rwlock);
+    /* 
+     * Detect using a second percpu_rwlock_t simulatenously and fallback
+     * to standard read_lock.
+     */
+    if ( unlikely(this_cpu_ptr(per_cpudata) != NULL ) )
+    {
+        read_lock(&percpu_rwlock->rwlock);
+        return;
+    }
+
+    /* Indicate this cpu is reading. */
+    this_cpu_ptr(per_cpudata) = percpu_rwlock;
+    smp_mb();
+    /* Check if a writer is waiting. */
+    if ( unlikely(percpu_rwlock->writer_activating) )
+    {
+        /* Let the waiting writer know we aren't holding the lock. */
+        this_cpu_ptr(per_cpudata) = NULL;
+        /* Wait using the read lock to keep the lock fair. */
+        read_lock(&percpu_rwlock->rwlock);
+        /* Set the per CPU data again and continue. */
+        this_cpu_ptr(per_cpudata) = percpu_rwlock;
+        /* Drop the read lock because we don't need it anymore. */
+        read_unlock(&percpu_rwlock->rwlock);
+    }
+}
+
+static inline void _percpu_read_unlock(percpu_rwlock_t **per_cpudata,
+                percpu_rwlock_t *percpu_rwlock)
+{
+    /* Validate the correct per_cpudata variable has been provided. */
+    _percpu_rwlock_owner_check(per_cpudata, percpu_rwlock);
+
+    /* Verify the read lock was taken for this lock */
+    ASSERT(this_cpu_ptr(per_cpudata) != NULL);
+    /* 
+     * Detect using a second percpu_rwlock_t simulatenously and fallback
+     * to standard read_unlock.
+     */
+    if ( unlikely(this_cpu_ptr(per_cpudata) != percpu_rwlock ) )
+    {
+        read_unlock(&percpu_rwlock->rwlock);
+        return;
+    }
+    this_cpu_ptr(per_cpudata) = NULL;
+    smp_wmb();
+}
+
+/* Don't inline percpu write lock as it's a complex function. */
+void _percpu_write_lock(percpu_rwlock_t **per_cpudata,
+                        percpu_rwlock_t *percpu_rwlock);
+
+static inline void _percpu_write_unlock(percpu_rwlock_t **per_cpudata,
+                percpu_rwlock_t *percpu_rwlock)
+{
+    /* Validate the correct per_cpudata variable has been provided. */
+    _percpu_rwlock_owner_check(per_cpudata, percpu_rwlock);
+
+    ASSERT(percpu_rwlock->writer_activating);
+    percpu_rwlock->writer_activating = 0;
+    write_unlock(&percpu_rwlock->rwlock);
+}
+
+#define percpu_rw_is_write_locked(l)         _rw_is_write_locked(&((l)->rwlock))
+
+#define percpu_read_lock(percpu, lock) \
+    _percpu_read_lock(&get_per_cpu_var(percpu), lock)
+#define percpu_read_unlock(percpu, lock) \
+    _percpu_read_unlock(&get_per_cpu_var(percpu), lock)
+#define percpu_write_lock(percpu, lock) \
+    _percpu_write_lock(&get_per_cpu_var(percpu), lock)
+#define percpu_write_unlock(percpu, lock) \
+    _percpu_write_unlock(&get_per_cpu_var(percpu), lock)
+
+#define DEFINE_PERCPU_RWLOCK_GLOBAL(name) DEFINE_PER_CPU(percpu_rwlock_t *, \
+                                                         name)
+#define DECLARE_PERCPU_RWLOCK_GLOBAL(name) DECLARE_PER_CPU(percpu_rwlock_t *, \
+                                                         name)
+
 #endif /* __SPINLOCK_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 Wed Jan 27 10:19:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:19: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 1aONC4-0001LH-9V; Wed, 27 Jan 2016 10:19: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 1aONC2-0001KQ-Pr
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:19 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	26/D5-07451-5A998A65; Wed, 27 Jan 2016 10:19:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1453889955!18438204!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25905 invoked from network); 27 Jan 2016 10:19:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:19:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCr-00026N-1G
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:20:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBy-0001rm-Qr
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:14 +0000
Date: Wed, 27 Jan 2016 10:19:14 +0000
Message-Id: <E1aONBy-0001rm-Qr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] p2m: convert p2m rwlock to percpu
	rwlock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 66ea5ed478e020b410ea56ad2fcfd63ab3a03165
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Fri Jan 22 16:17:13 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 22 16:17:13 2016 +0100

    p2m: convert p2m rwlock to percpu rwlock
    
    The per domain p2m read lock suffers from significant contention when
    performance multi-queue block or network IO due to the parallel
    grant map/unmaps/copies occuring on the DomU's p2m.
    
    On multi-socket systems, the contention results in the locked compare swap
    operation failing frequently which results in a tight loop of retries of the
    compare swap operation. As the coherency fabric can only support a specific
    rate of compare swap operations for a particular data location then taking
    the read lock itself becomes a bottleneck for p2m operations.
    
    Percpu rwlock p2m performance with the same configuration is approximately
    64 gbit/s vs the 48 gbit/s with grant table percpu rwlocks only.
    
    Oprofile was used to determine the initial overhead of the read-write locks
    and to confirm the overhead was dramatically reduced by the percpu rwlocks.
    
    Note: altp2m users will not achieve a gain if they take an altp2m read lock
    simultaneously with the main p2m lock.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/mm-locks.h |   12 +++++++-----
 xen/arch/x86/mm/p2m.c      |    1 +
 xen/include/asm-x86/mm.h   |    2 +-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/mm-locks.h b/xen/arch/x86/mm/mm-locks.h
index 76c7217..8a40986 100644
--- a/xen/arch/x86/mm/mm-locks.h
+++ b/xen/arch/x86/mm/mm-locks.h
@@ -31,6 +31,8 @@
 DECLARE_PER_CPU(int, mm_lock_level);
 #define __get_lock_level()  (this_cpu(mm_lock_level))
 
+DECLARE_PERCPU_RWLOCK_GLOBAL(p2m_percpu_rwlock);
+
 static inline void mm_lock_init(mm_lock_t *l)
 {
     spin_lock_init(&l->lock);
@@ -99,7 +101,7 @@ static inline void _mm_enforce_order_lock_post(int level, int *unlock_level,
 
 static inline void mm_rwlock_init(mm_rwlock_t *l)
 {
-    rwlock_init(&l->lock);
+    percpu_rwlock_resource_init(&l->lock, p2m_percpu_rwlock);
     l->locker = -1;
     l->locker_function = "nobody";
     l->unlock_level = 0;
@@ -115,7 +117,7 @@ static inline void _mm_write_lock(mm_rwlock_t *l, const char *func, int level)
     if ( !mm_write_locked_by_me(l) )
     {
         __check_lock_level(level);
-        write_lock(&l->lock);
+        percpu_write_lock(p2m_percpu_rwlock, &l->lock);
         l->locker = get_processor_id();
         l->locker_function = func;
         l->unlock_level = __get_lock_level();
@@ -131,20 +133,20 @@ static inline void mm_write_unlock(mm_rwlock_t *l)
     l->locker = -1;
     l->locker_function = "nobody";
     __set_lock_level(l->unlock_level);
-    write_unlock(&l->lock);
+    percpu_write_unlock(p2m_percpu_rwlock, &l->lock);
 }
 
 static inline void _mm_read_lock(mm_rwlock_t *l, int level)
 {
     __check_lock_level(level);
-    read_lock(&l->lock);
+    percpu_read_lock(p2m_percpu_rwlock, &l->lock);
     /* There's nowhere to store the per-CPU unlock level so we can't
      * set the lock level. */
 }
 
 static inline void mm_read_unlock(mm_rwlock_t *l)
 {
-    read_unlock(&l->lock);
+    percpu_read_unlock(p2m_percpu_rwlock, &l->lock);
 }
 
 /* This wrapper uses the line number to express the locking order below */
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index ed0bbd7..a45ee35 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -54,6 +54,7 @@ boolean_param("hap_2mb", opt_hap_2mb);
 #undef page_to_mfn
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
+DEFINE_PERCPU_RWLOCK_GLOBAL(p2m_percpu_rwlock);
 
 /* Init the datastructures for later use by the p2m code */
 static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index de3f973..7598414 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -584,7 +584,7 @@ typedef struct mm_lock {
 } mm_lock_t;
 
 typedef struct mm_rwlock {
-    rwlock_t           lock;
+    percpu_rwlock_t    lock;
     int                unlock_level;
     int                recurse_count;
     int                locker; /* CPU that holds the write lock */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:19:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:19: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 1aONC4-0001LH-9V; Wed, 27 Jan 2016 10:19: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 1aONC2-0001KQ-Pr
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:19 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	26/D5-07451-5A998A65; Wed, 27 Jan 2016 10:19:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1453889955!18438204!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25905 invoked from network); 27 Jan 2016 10:19:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:19:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCr-00026N-1G
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:20:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONBy-0001rm-Qr
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:14 +0000
Date: Wed, 27 Jan 2016 10:19:14 +0000
Message-Id: <E1aONBy-0001rm-Qr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] p2m: convert p2m rwlock to percpu
	rwlock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 66ea5ed478e020b410ea56ad2fcfd63ab3a03165
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Fri Jan 22 16:17:13 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 22 16:17:13 2016 +0100

    p2m: convert p2m rwlock to percpu rwlock
    
    The per domain p2m read lock suffers from significant contention when
    performance multi-queue block or network IO due to the parallel
    grant map/unmaps/copies occuring on the DomU's p2m.
    
    On multi-socket systems, the contention results in the locked compare swap
    operation failing frequently which results in a tight loop of retries of the
    compare swap operation. As the coherency fabric can only support a specific
    rate of compare swap operations for a particular data location then taking
    the read lock itself becomes a bottleneck for p2m operations.
    
    Percpu rwlock p2m performance with the same configuration is approximately
    64 gbit/s vs the 48 gbit/s with grant table percpu rwlocks only.
    
    Oprofile was used to determine the initial overhead of the read-write locks
    and to confirm the overhead was dramatically reduced by the percpu rwlocks.
    
    Note: altp2m users will not achieve a gain if they take an altp2m read lock
    simultaneously with the main p2m lock.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/mm-locks.h |   12 +++++++-----
 xen/arch/x86/mm/p2m.c      |    1 +
 xen/include/asm-x86/mm.h   |    2 +-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/mm-locks.h b/xen/arch/x86/mm/mm-locks.h
index 76c7217..8a40986 100644
--- a/xen/arch/x86/mm/mm-locks.h
+++ b/xen/arch/x86/mm/mm-locks.h
@@ -31,6 +31,8 @@
 DECLARE_PER_CPU(int, mm_lock_level);
 #define __get_lock_level()  (this_cpu(mm_lock_level))
 
+DECLARE_PERCPU_RWLOCK_GLOBAL(p2m_percpu_rwlock);
+
 static inline void mm_lock_init(mm_lock_t *l)
 {
     spin_lock_init(&l->lock);
@@ -99,7 +101,7 @@ static inline void _mm_enforce_order_lock_post(int level, int *unlock_level,
 
 static inline void mm_rwlock_init(mm_rwlock_t *l)
 {
-    rwlock_init(&l->lock);
+    percpu_rwlock_resource_init(&l->lock, p2m_percpu_rwlock);
     l->locker = -1;
     l->locker_function = "nobody";
     l->unlock_level = 0;
@@ -115,7 +117,7 @@ static inline void _mm_write_lock(mm_rwlock_t *l, const char *func, int level)
     if ( !mm_write_locked_by_me(l) )
     {
         __check_lock_level(level);
-        write_lock(&l->lock);
+        percpu_write_lock(p2m_percpu_rwlock, &l->lock);
         l->locker = get_processor_id();
         l->locker_function = func;
         l->unlock_level = __get_lock_level();
@@ -131,20 +133,20 @@ static inline void mm_write_unlock(mm_rwlock_t *l)
     l->locker = -1;
     l->locker_function = "nobody";
     __set_lock_level(l->unlock_level);
-    write_unlock(&l->lock);
+    percpu_write_unlock(p2m_percpu_rwlock, &l->lock);
 }
 
 static inline void _mm_read_lock(mm_rwlock_t *l, int level)
 {
     __check_lock_level(level);
-    read_lock(&l->lock);
+    percpu_read_lock(p2m_percpu_rwlock, &l->lock);
     /* There's nowhere to store the per-CPU unlock level so we can't
      * set the lock level. */
 }
 
 static inline void mm_read_unlock(mm_rwlock_t *l)
 {
-    read_unlock(&l->lock);
+    percpu_read_unlock(p2m_percpu_rwlock, &l->lock);
 }
 
 /* This wrapper uses the line number to express the locking order below */
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index ed0bbd7..a45ee35 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -54,6 +54,7 @@ boolean_param("hap_2mb", opt_hap_2mb);
 #undef page_to_mfn
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
+DEFINE_PERCPU_RWLOCK_GLOBAL(p2m_percpu_rwlock);
 
 /* Init the datastructures for later use by the p2m code */
 static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index de3f973..7598414 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -584,7 +584,7 @@ typedef struct mm_lock {
 } mm_lock_t;
 
 typedef struct mm_rwlock {
-    rwlock_t           lock;
+    percpu_rwlock_t    lock;
     int                unlock_level;
     int                recurse_count;
     int                locker; /* CPU that holds the write lock */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:19:30 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:19: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 1aONCE-0001NM-Dz; Wed, 27 Jan 2016 10:19: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 1aONCD-0001N1-3J
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:29 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	23/18-02499-0B998A65; Wed, 27 Jan 2016 10:19:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453889965!8807996!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23767 invoked from network); 27 Jan 2016 10:19:27 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:19:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aOND1-00026Z-Hb
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:20:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONC9-0001tA-4Q
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:25 +0000
Date: Wed, 27 Jan 2016 10:19:25 +0000
Message-Id: <E1aONC9-0001tA-4Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/domctl: break out logic to update
	domain state from cpuid information
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 277df04ba9635d698c9189dbf893e12b0cb73cf2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 22 16:18:02 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 22 16:18:02 2016 +0100

    x86/domctl: break out logic to update domain state from cpuid information
    
    Later changes will add to this logic.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c |   66 ++++++++++++++++++++++++++----------------------
 1 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 95b0747..1d71216 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -47,6 +47,40 @@ static int gdbsx_guest_mem_io(domid_t domid, struct xen_domctl_gdbsx_memio *iop)
     return iop->remain ? -EFAULT : 0;
 }
 
+static void update_domain_cpuid_info(struct domain *d,
+                                     const xen_domctl_cpuid_t *ctl)
+{
+    switch ( ctl->input[0] )
+    {
+    case 0: {
+        union {
+            typeof(boot_cpu_data.x86_vendor_id) str;
+            struct {
+                uint32_t ebx, edx, ecx;
+            } reg;
+        } vendor_id = {
+            .reg = {
+                .ebx = ctl->ebx,
+                .edx = ctl->edx,
+                .ecx = ctl->ecx
+            }
+        };
+
+        d->arch.x86_vendor = get_cpu_vendor(vendor_id.str, gcv_guest);
+        break;
+    }
+
+    case 1:
+        d->arch.x86 = (ctl->eax >> 8) & 0xf;
+        if ( d->arch.x86 == 0xf )
+            d->arch.x86 += (ctl->eax >> 20) & 0xff;
+        d->arch.x86_model = (ctl->eax >> 4) & 0xf;
+        if ( d->arch.x86 >= 0x6 )
+            d->arch.x86_model |= (ctl->eax >> 12) & 0xf0;
+        break;
+    }
+}
+
 #define MAX_IOPORTS 0x10000
 
 long arch_do_domctl(
@@ -698,36 +732,8 @@ long arch_do_domctl(
             ret = -ENOENT;
 
         if ( !ret )
-        {
-            switch ( ctl->input[0] )
-            {
-            case 0: {
-                union {
-                    typeof(boot_cpu_data.x86_vendor_id) str;
-                    struct {
-                        uint32_t ebx, edx, ecx;
-                    } reg;
-                } vendor_id = {
-                    .reg = {
-                        .ebx = ctl->ebx,
-                        .edx = ctl->edx,
-                        .ecx = ctl->ecx
-                    }
-                };
+            update_domain_cpuid_info(d, ctl);
 
-                d->arch.x86_vendor = get_cpu_vendor(vendor_id.str, gcv_guest);
-                break;
-            }
-            case 1:
-                d->arch.x86 = (ctl->eax >> 8) & 0xf;
-                if ( d->arch.x86 == 0xf )
-                    d->arch.x86 += (ctl->eax >> 20) & 0xff;
-                d->arch.x86_model = (ctl->eax >> 4) & 0xf;
-                if ( d->arch.x86 >= 0x6 )
-                    d->arch.x86_model |= (ctl->eax >> 12) & 0xf0;
-                break;
-            }
-        }
         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 Wed Jan 27 10:19:30 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:19: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 1aONCE-0001NM-Dz; Wed, 27 Jan 2016 10:19: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 1aONCD-0001N1-3J
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:29 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	23/18-02499-0B998A65; Wed, 27 Jan 2016 10:19:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1453889965!8807996!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23767 invoked from network); 27 Jan 2016 10:19:27 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:19:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aOND1-00026Z-Hb
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:20:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONC9-0001tA-4Q
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:25 +0000
Date: Wed, 27 Jan 2016 10:19:25 +0000
Message-Id: <E1aONC9-0001tA-4Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/domctl: break out logic to update
	domain state from cpuid information
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 277df04ba9635d698c9189dbf893e12b0cb73cf2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 22 16:18:02 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 22 16:18:02 2016 +0100

    x86/domctl: break out logic to update domain state from cpuid information
    
    Later changes will add to this logic.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c |   66 ++++++++++++++++++++++++++----------------------
 1 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 95b0747..1d71216 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -47,6 +47,40 @@ static int gdbsx_guest_mem_io(domid_t domid, struct xen_domctl_gdbsx_memio *iop)
     return iop->remain ? -EFAULT : 0;
 }
 
+static void update_domain_cpuid_info(struct domain *d,
+                                     const xen_domctl_cpuid_t *ctl)
+{
+    switch ( ctl->input[0] )
+    {
+    case 0: {
+        union {
+            typeof(boot_cpu_data.x86_vendor_id) str;
+            struct {
+                uint32_t ebx, edx, ecx;
+            } reg;
+        } vendor_id = {
+            .reg = {
+                .ebx = ctl->ebx,
+                .edx = ctl->edx,
+                .ecx = ctl->ecx
+            }
+        };
+
+        d->arch.x86_vendor = get_cpu_vendor(vendor_id.str, gcv_guest);
+        break;
+    }
+
+    case 1:
+        d->arch.x86 = (ctl->eax >> 8) & 0xf;
+        if ( d->arch.x86 == 0xf )
+            d->arch.x86 += (ctl->eax >> 20) & 0xff;
+        d->arch.x86_model = (ctl->eax >> 4) & 0xf;
+        if ( d->arch.x86 >= 0x6 )
+            d->arch.x86_model |= (ctl->eax >> 12) & 0xf0;
+        break;
+    }
+}
+
 #define MAX_IOPORTS 0x10000
 
 long arch_do_domctl(
@@ -698,36 +732,8 @@ long arch_do_domctl(
             ret = -ENOENT;
 
         if ( !ret )
-        {
-            switch ( ctl->input[0] )
-            {
-            case 0: {
-                union {
-                    typeof(boot_cpu_data.x86_vendor_id) str;
-                    struct {
-                        uint32_t ebx, edx, ecx;
-                    } reg;
-                } vendor_id = {
-                    .reg = {
-                        .ebx = ctl->ebx,
-                        .edx = ctl->edx,
-                        .ecx = ctl->ecx
-                    }
-                };
+            update_domain_cpuid_info(d, ctl);
 
-                d->arch.x86_vendor = get_cpu_vendor(vendor_id.str, gcv_guest);
-                break;
-            }
-            case 1:
-                d->arch.x86 = (ctl->eax >> 8) & 0xf;
-                if ( d->arch.x86 == 0xf )
-                    d->arch.x86 += (ctl->eax >> 20) & 0xff;
-                d->arch.x86_model = (ctl->eax >> 4) & 0xf;
-                if ( d->arch.x86 >= 0x6 )
-                    d->arch.x86_model |= (ctl->eax >> 12) & 0xf0;
-                break;
-            }
-        }
         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 Wed Jan 27 10:19:39 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:19: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 1aONCN-0001PD-Hd; Wed, 27 Jan 2016 10:19: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 1aONCM-0001Op-0e
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:38 +0000
Content-Length: 2580
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	F6/62-29478-9B998A65; Wed, 27 Jan 2016 10:19:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1453889975!18385931!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23782 invoked from network); 27 Jan 2016 10:19:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:19:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONDB-00026l-Sj
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:20:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCJ-0001tj-M3
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:35 +0000
Date: Wed, 27 Jan 2016 10:19:35 +0000
Message-Id: <E1aONCJ-0001tj-M3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PV: allow PV guests to have an
	emulated PIT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============7840621544988600820=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7840621544988600820==
Content-Length: 2181
Content-Transfer-Encoding: quoted-printable

commit bce296364e6ec320a33fc8770b20f552d6163af6
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Fri Jan 22 16:18:29 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 22 16:18:29 2016 +0100

    x86/PV: allow PV guests to have an emulated PIT
    
    This fixes the fallout from the HVMlite series, that removed the emulated
    PIT from PV(H) guests. Also, this patch forces the hardware domain to
    always have an emulated PIT, regardless of whether the toolstack specified
    one or not.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain.c    |    5 ++++-
 xen/arch/x86/hvm/i8254.c |    3 +++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index e70c125..352c194 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -542,8 +542,11 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags,
                    d->domain_id, config->emulation_flags);
             return -EINVAL;
         }
+        if ( is_hardware_domain(d) )
+            config->emulation_flags |=3D XEN_X86_EMU_PIT;
         if ( config->emulation_flags !=3D 0 &&
-             (!is_hvm_domain(d) || config->emulation_flags !=3D XEN_X86_EMU_ALL) )
+             (config->emulation_flags !=3D
+              (is_hvm_domain(d) =3F XEN_X86_EMU_ALL : XEN_X86_EMU_PIT)) )
         {
             printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation "
                    "with the current selection of emulators: %#x\n",
diff --git a/xen/arch/x86/hvm/i8254.c b/xen/arch/x86/hvm/i8254.c
index b517cd6..577b43c 100644
--- a/xen/arch/x86/hvm/i8254.c
+++ b/xen/arch/x86/hvm/i8254.c
@@ -568,6 +568,9 @@ int pv_pit_handler(int port, int data, int write)
         .data =3D data
     };
 
+    if ( !has_vpit(current->domain) )
+        return ~0;
+
     if ( is_hardware_domain(current->domain) && hwdom_pit_access(&ioreq) )
     {
         /* nothing to do */;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:19:39 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:19: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 1aONCN-0001PD-Hd; Wed, 27 Jan 2016 10:19: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 1aONCM-0001Op-0e
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:38 +0000
Content-Length: 2580
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	F6/62-29478-9B998A65; Wed, 27 Jan 2016 10:19:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1453889975!18385931!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23782 invoked from network); 27 Jan 2016 10:19:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:19:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONDB-00026l-Sj
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:20:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCJ-0001tj-M3
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:35 +0000
Date: Wed, 27 Jan 2016 10:19:35 +0000
Message-Id: <E1aONCJ-0001tj-M3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PV: allow PV guests to have an
	emulated PIT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============7840621544988600820=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7840621544988600820==
Content-Length: 2181
Content-Transfer-Encoding: quoted-printable

commit bce296364e6ec320a33fc8770b20f552d6163af6
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Fri Jan 22 16:18:29 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 22 16:18:29 2016 +0100

    x86/PV: allow PV guests to have an emulated PIT
    
    This fixes the fallout from the HVMlite series, that removed the emulated
    PIT from PV(H) guests. Also, this patch forces the hardware domain to
    always have an emulated PIT, regardless of whether the toolstack specified
    one or not.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain.c    |    5 ++++-
 xen/arch/x86/hvm/i8254.c |    3 +++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index e70c125..352c194 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -542,8 +542,11 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags,
                    d->domain_id, config->emulation_flags);
             return -EINVAL;
         }
+        if ( is_hardware_domain(d) )
+            config->emulation_flags |=3D XEN_X86_EMU_PIT;
         if ( config->emulation_flags !=3D 0 &&
-             (!is_hvm_domain(d) || config->emulation_flags !=3D XEN_X86_EMU_ALL) )
+             (config->emulation_flags !=3D
+              (is_hvm_domain(d) =3F XEN_X86_EMU_ALL : XEN_X86_EMU_PIT)) )
         {
             printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation "
                    "with the current selection of emulators: %#x\n",
diff --git a/xen/arch/x86/hvm/i8254.c b/xen/arch/x86/hvm/i8254.c
index b517cd6..577b43c 100644
--- a/xen/arch/x86/hvm/i8254.c
+++ b/xen/arch/x86/hvm/i8254.c
@@ -568,6 +568,9 @@ int pv_pit_handler(int port, int data, int write)
         .data =3D data
     };
 
+    if ( !has_vpit(current->domain) )
+        return ~0;
+
     if ( is_hardware_domain(current->domain) && hwdom_pit_access(&ioreq) )
     {
         /* nothing to do */;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Jan 27 10:19:50 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:19: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 1aONCY-0001Rt-MN; Wed, 27 Jan 2016 10:19: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 1aONCX-0001Ra-0Y
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:49 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	99/A5-02745-4C998A65; Wed, 27 Jan 2016 10:19:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1453889986!18364434!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4931 invoked from network); 27 Jan 2016 10:19:47 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:19:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONDM-00026q-5c
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:20:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCT-0001uU-Vn
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:45 +0000
Date: Wed, 27 Jan 2016 10:19:45 +0000
Message-Id: <E1aONCT-0001uU-Vn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mce: fix misleading indentation in
	init_nonfatal_mce_checker()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2e46e3f2539d026594ec1618e7df2c2bc8785b42
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 22 16:19:51 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 22 16:19:51 2016 +0100

    x86/mce: fix misleading indentation in init_nonfatal_mce_checker()
    
    Debian bug 812166[0] reported this build failure due to
    Wmisleading-indentation with gcc-6:
    
    non-fatal.c: In function 'init_nonfatal_mce_checker':
    non-fatal.c:103:2: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
      switch (c->x86_vendor) {
      ^~~~~~
    
    non-fatal.c:97:5: note: ...this 'if' clause, but it is not
         if ( __get_cpu_var(poll_bankmask) == NULL )
         ^~
    
    I was unable to reproduce (xen builds cleanly for me with "6.0.0 20160117
    (experimental) [trunk revision 232481]") but looking at the code the issue
    above is clearly real.
    
    Correctly reindent the if statement.
    
    This file uses Linux coding style (infact the use of Xen style for
    this line is the root cause of the wanring) so use tabs and while
    there remove the whitespace inside the if as Linux does.
    
    [0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812166
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/mcheck/non-fatal.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/non-fatal.c b/xen/arch/x86/cpu/mcheck/non-fatal.c
index 526864e..8cd6635 100644
--- a/xen/arch/x86/cpu/mcheck/non-fatal.c
+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c
@@ -94,8 +94,8 @@ static int __init init_nonfatal_mce_checker(void)
 	if (mce_disabled || !mce_available(c))
 		return -ENODEV;
 
-    if ( __get_cpu_var(poll_bankmask) == NULL )
-        return -EINVAL;
+	if (__get_cpu_var(poll_bankmask) == NULL)
+		return -EINVAL;
 
 	/*
 	 * Check for non-fatal errors every MCE_RATE s
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 27 10:19:50 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 Jan 2016 10:19: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 1aONCY-0001Rt-MN; Wed, 27 Jan 2016 10:19: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 1aONCX-0001Ra-0Y
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:49 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	99/A5-02745-4C998A65; Wed, 27 Jan 2016 10:19:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1453889986!18364434!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4931 invoked from network); 27 Jan 2016 10:19:47 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jan 2016 10:19:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONDM-00026q-5c
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:20:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aONCT-0001uU-Vn
	for xen-changelog@lists.xensource.com; Wed, 27 Jan 2016 10:19:45 +0000
Date: Wed, 27 Jan 2016 10:19:45 +0000
Message-Id: <E1aONCT-0001uU-Vn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mce: fix misleading indentation in
	init_nonfatal_mce_checker()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2e46e3f2539d026594ec1618e7df2c2bc8785b42
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 22 16:19:51 2016 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jan 22 16:19:51 2016 +0100

    x86/mce: fix misleading indentation in init_nonfatal_mce_checker()
    
    Debian bug 812166[0] reported this build failure due to
    Wmisleading-indentation with gcc-6:
    
    non-fatal.c: In function 'init_nonfatal_mce_checker':
    non-fatal.c:103:2: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
      switch (c->x86_vendor) {
      ^~~~~~
    
    non-fatal.c:97:5: note: ...this 'if' clause, but it is not
         if ( __get_cpu_var(poll_bankmask) == NULL )
         ^~
    
    I was unable to reproduce (xen builds cleanly for me with "6.0.0 20160117
    (experimental) [trunk revision 232481]") but looking at the code the issue
    above is clearly real.
    
    Correctly reindent the if statement.
    
    This file uses Linux coding style (infact the use of Xen style for
    this line is the root cause of the wanring) so use tabs and while
    there remove the whitespace inside the if as Linux does.
    
    [0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812166
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/mcheck/non-fatal.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/non-fatal.c b/xen/arch/x86/cpu/mcheck/non-fatal.c
index 526864e..8cd6635 100644
--- a/xen/arch/x86/cpu/mcheck/non-fatal.c
+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c
@@ -94,8 +94,8 @@ static int __init init_nonfatal_mce_checker(void)
 	if (mce_disabled || !mce_available(c))
 		return -ENODEV;
 
-    if ( __get_cpu_var(poll_bankmask) == NULL )
-        return -EINVAL;
+	if (__get_cpu_var(poll_bankmask) == NULL)
+		return -EINVAL;
 
 	/*
 	 * Check for non-fatal errors every MCE_RATE s
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:55:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aP9W0-0005Yz-GQ; Fri, 29 Jan 2016 13:55: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 1aP9Vz-0005Yu-5z
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:07 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	82/49-08479-A3F6BA65; Fri, 29 Jan 2016 13:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1454075704!18996021!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5429 invoked from network); 29 Jan 2016 13:55:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:55:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Wt-0007sM-VM
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Vw-0002bf-C6
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9Vw-0002bf-C6@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:55:04 +0000
Subject: [Xen-changelog] [xen master] kdd: Opt in to libxc compat
	xc_map_foreign_* intefaces.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc825dde070e2e4a0810ddaaaa08fe5199323581
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 25 12:45:32 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 25 14:18:24 2016 +0000

    kdd: Opt in to libxc compat xc_map_foreign_* intefaces.
    
    This:
    
    kdd-xen.c: In function 'kdd_access_physical_page':
    kdd-xen.c:508:9: warning: implicit declaration of function 'xc_map_foreign_range' [-Wimplicit-function-declaration]
             map = xc_map_foreign_range(g->xc_handle,
             ^
    kdd-xen.c:508:13: warning: assignment makes pointer from integer without a cast
             map = xc_map_foreign_range(g->xc_handle,
                 ^
    
    was caused by the refactoring of this functionality into
    libxenforeignmemory.
    
    Reported by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Tested-by: Olaf Hering <olaf@aepfle.de>
---
 tools/debugger/kdd/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/debugger/kdd/Makefile b/tools/debugger/kdd/Makefile
index a79d7cf..72ad1b9 100644
--- a/tools/debugger/kdd/Makefile
+++ b/tools/debugger/kdd/Makefile
@@ -2,6 +2,7 @@ XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 CFLAGS  += $(CFLAGS_libxenctrl)
+CFLAGS  += -DXC_WANT_COMPAT_MAP_FOREIGN_API
 LDLIBS  += $(LDLIBS_libxenctrl)
 
 CFILES  := kdd.c kdd-xen.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 Jan 29 13:55:13 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aP9W0-0005Yz-GQ; Fri, 29 Jan 2016 13:55: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 1aP9Vz-0005Yu-5z
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:07 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	82/49-08479-A3F6BA65; Fri, 29 Jan 2016 13:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1454075704!18996021!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5429 invoked from network); 29 Jan 2016 13:55:05 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:55:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Wt-0007sM-VM
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Vw-0002bf-C6
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9Vw-0002bf-C6@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:55:04 +0000
Subject: [Xen-changelog] [xen master] kdd: Opt in to libxc compat
	xc_map_foreign_* intefaces.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc825dde070e2e4a0810ddaaaa08fe5199323581
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 25 12:45:32 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 25 14:18:24 2016 +0000

    kdd: Opt in to libxc compat xc_map_foreign_* intefaces.
    
    This:
    
    kdd-xen.c: In function 'kdd_access_physical_page':
    kdd-xen.c:508:9: warning: implicit declaration of function 'xc_map_foreign_range' [-Wimplicit-function-declaration]
             map = xc_map_foreign_range(g->xc_handle,
             ^
    kdd-xen.c:508:13: warning: assignment makes pointer from integer without a cast
             map = xc_map_foreign_range(g->xc_handle,
                 ^
    
    was caused by the refactoring of this functionality into
    libxenforeignmemory.
    
    Reported by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Tested-by: Olaf Hering <olaf@aepfle.de>
---
 tools/debugger/kdd/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/debugger/kdd/Makefile b/tools/debugger/kdd/Makefile
index a79d7cf..72ad1b9 100644
--- a/tools/debugger/kdd/Makefile
+++ b/tools/debugger/kdd/Makefile
@@ -2,6 +2,7 @@ XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 CFLAGS  += $(CFLAGS_libxenctrl)
+CFLAGS  += -DXC_WANT_COMPAT_MAP_FOREIGN_API
 LDLIBS  += $(LDLIBS_libxenctrl)
 
 CFILES  := kdd.c kdd-xen.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 Jan 29 13:55:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aP9WA-0005aK-Ki; Fri, 29 Jan 2016 13:55:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9W9-0005a8-Gn
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:17 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	44/0E-25435-44F6BA65; Fri, 29 Jan 2016 13:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1454075715!20131736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34779 invoked from network); 29 Jan 2016 13:55:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:55:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9X4-0007t9-BU
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9W6-0002cS-NZ
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9W6-0002cS-NZ@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:55:14 +0000
Subject: [Xen-changelog] [xen master] kdd: build using Werror
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5e0da2ac71845529034ce4034a5b5b2e351316cb
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 25 13:18:11 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 25 14:18:24 2016 +0000

    kdd: build using Werror
    
    We build most of tools using Werror and there seems to be no
    deliberate reason for this to be an exception.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Tim Deegan <tim@xen.org>
---
 tools/debugger/kdd/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/debugger/kdd/Makefile b/tools/debugger/kdd/Makefile
index 72ad1b9..f3a597d 100644
--- a/tools/debugger/kdd/Makefile
+++ b/tools/debugger/kdd/Makefile
@@ -1,6 +1,7 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
+CFLAGS  += -Werror
 CFLAGS  += $(CFLAGS_libxenctrl)
 CFLAGS  += -DXC_WANT_COMPAT_MAP_FOREIGN_API
 LDLIBS  += $(LDLIBS_libxenctrl)
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:55:18 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aP9WA-0005aK-Ki; Fri, 29 Jan 2016 13:55:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9W9-0005a8-Gn
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:17 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	44/0E-25435-44F6BA65; Fri, 29 Jan 2016 13:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1454075715!20131736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34779 invoked from network); 29 Jan 2016 13:55:16 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:55:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9X4-0007t9-BU
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9W6-0002cS-NZ
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9W6-0002cS-NZ@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:55:14 +0000
Subject: [Xen-changelog] [xen master] kdd: build using Werror
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5e0da2ac71845529034ce4034a5b5b2e351316cb
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 25 13:18:11 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 25 14:18:24 2016 +0000

    kdd: build using Werror
    
    We build most of tools using Werror and there seems to be no
    deliberate reason for this to be an exception.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Tim Deegan <tim@xen.org>
---
 tools/debugger/kdd/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/debugger/kdd/Makefile b/tools/debugger/kdd/Makefile
index 72ad1b9..f3a597d 100644
--- a/tools/debugger/kdd/Makefile
+++ b/tools/debugger/kdd/Makefile
@@ -1,6 +1,7 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
+CFLAGS  += -Werror
 CFLAGS  += $(CFLAGS_libxenctrl)
 CFLAGS  += -DXC_WANT_COMPAT_MAP_FOREIGN_API
 LDLIBS  += $(LDLIBS_libxenctrl)
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:55:29 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aP9WL-0005bR-Oe; Fri, 29 Jan 2016 13:55: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 1aP9WK-0005bI-4Z
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:28 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	BF/FF-13475-F4F6BA65; Fri, 29 Jan 2016 13:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1454075725!20131793!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37017 invoked from network); 29 Jan 2016 13:55:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:55:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9XE-0007tT-Pv
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9WH-0002cq-4W
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9WH-0002cq-4W@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:55:25 +0000
Subject: [Xen-changelog] [xen master] tools/libs/*: freebsd remove unused
	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 d322b7f4c28ac5733a02a2d1ce64dbc8bc1f30b2
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 25 13:14:34 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 25 14:20:08 2016 +0000

    tools/libs/*: freebsd remove unused code
    
    "tools/libs/*: Use O_CLOEXEC on Linux and FreeBSD" left some dead code
    in the FreeBSD case, which breaks the build on that platform.
    
    Also fix a typo "uint_32".
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/call/freebsd.c          | 8 --------
 tools/libs/evtchn/freebsd.c        | 2 +-
 tools/libs/foreignmemory/freebsd.c | 8 --------
 3 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/tools/libs/call/freebsd.c b/tools/libs/call/freebsd.c
index b3cbccd..cadd313 100644
--- a/tools/libs/call/freebsd.c
+++ b/tools/libs/call/freebsd.c
@@ -35,7 +35,6 @@
 
 int osdep_xencall_open(xencall_handle *xcall)
 {
-    int saved_errno;
     int fd = open(PRIVCMD_DEV, O_RDWR|O_CLOEXEC);
 
     /*
@@ -53,13 +52,6 @@ int osdep_xencall_open(xencall_handle *xcall)
 
     xcall->fd = fd;
     return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-
-    return -1;
 }
 
 int osdep_xencall_close(xencall_handle *xcall)
diff --git a/tools/libs/evtchn/freebsd.c b/tools/libs/evtchn/freebsd.c
index ddf221d..ead2e71 100644
--- a/tools/libs/evtchn/freebsd.c
+++ b/tools/libs/evtchn/freebsd.c
@@ -74,7 +74,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32
 }
 
 evtchn_port_or_error_t
-xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint_32 domid, evtchn_port_t remote_port)
+xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid, evtchn_port_t remote_port)
 {
     int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index 7bf3939..ef08b6c 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -33,7 +33,6 @@
 
 int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
 {
-    int saved_errno;
     int fd = open(PRIVCMD_DEV, O_RDWR|O_CLOEXEC);
 
     if ( fd == -1 )
@@ -45,13 +44,6 @@ int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
 
     fmem->fd = fd;
     return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-
-    return -1;
 }
 
 int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:55:29 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aP9WL-0005bR-Oe; Fri, 29 Jan 2016 13:55: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 1aP9WK-0005bI-4Z
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:28 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	BF/FF-13475-F4F6BA65; Fri, 29 Jan 2016 13:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1454075725!20131793!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37017 invoked from network); 29 Jan 2016 13:55:26 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:55:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9XE-0007tT-Pv
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9WH-0002cq-4W
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9WH-0002cq-4W@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:55:25 +0000
Subject: [Xen-changelog] [xen master] tools/libs/*: freebsd remove unused
	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 d322b7f4c28ac5733a02a2d1ce64dbc8bc1f30b2
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 25 13:14:34 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jan 25 14:20:08 2016 +0000

    tools/libs/*: freebsd remove unused code
    
    "tools/libs/*: Use O_CLOEXEC on Linux and FreeBSD" left some dead code
    in the FreeBSD case, which breaks the build on that platform.
    
    Also fix a typo "uint_32".
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libs/call/freebsd.c          | 8 --------
 tools/libs/evtchn/freebsd.c        | 2 +-
 tools/libs/foreignmemory/freebsd.c | 8 --------
 3 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/tools/libs/call/freebsd.c b/tools/libs/call/freebsd.c
index b3cbccd..cadd313 100644
--- a/tools/libs/call/freebsd.c
+++ b/tools/libs/call/freebsd.c
@@ -35,7 +35,6 @@
 
 int osdep_xencall_open(xencall_handle *xcall)
 {
-    int saved_errno;
     int fd = open(PRIVCMD_DEV, O_RDWR|O_CLOEXEC);
 
     /*
@@ -53,13 +52,6 @@ int osdep_xencall_open(xencall_handle *xcall)
 
     xcall->fd = fd;
     return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-
-    return -1;
 }
 
 int osdep_xencall_close(xencall_handle *xcall)
diff --git a/tools/libs/evtchn/freebsd.c b/tools/libs/evtchn/freebsd.c
index ddf221d..ead2e71 100644
--- a/tools/libs/evtchn/freebsd.c
+++ b/tools/libs/evtchn/freebsd.c
@@ -74,7 +74,7 @@ evtchn_port_or_error_t xenevtchn_bind_unbound_port(xenevtchn_handle *xce, uint32
 }
 
 evtchn_port_or_error_t
-xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint_32 domid, evtchn_port_t remote_port)
+xenevtchn_bind_interdomain(xenevtchn_handle *xce, uint32_t domid, evtchn_port_t remote_port)
 {
     int ret, fd = xce->fd;
     struct ioctl_evtchn_bind_interdomain bind;
diff --git a/tools/libs/foreignmemory/freebsd.c b/tools/libs/foreignmemory/freebsd.c
index 7bf3939..ef08b6c 100644
--- a/tools/libs/foreignmemory/freebsd.c
+++ b/tools/libs/foreignmemory/freebsd.c
@@ -33,7 +33,6 @@
 
 int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
 {
-    int saved_errno;
     int fd = open(PRIVCMD_DEV, O_RDWR|O_CLOEXEC);
 
     if ( fd == -1 )
@@ -45,13 +44,6 @@ int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem)
 
     fmem->fd = fd;
     return 0;
-
- error:
-    saved_errno = errno;
-    close(fd);
-    errno = saved_errno;
-
-    return -1;
 }
 
 int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem)
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:55:39 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:55: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 1aP9WV-0005cp-Tj; Fri, 29 Jan 2016 13:55: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 1aP9WU-0005cW-FD
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:38 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	3B/0C-07451-95F6BA65; Fri, 29 Jan 2016 13:55:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1454075736!19068729!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 693 invoked from network); 29 Jan 2016 13:55:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:55:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9XP-0007tb-76
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9WR-0002dx-Im
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9WR-0002dx-Im@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:55:35 +0000
Subject: [Xen-changelog] [xen master] tools: avoid redefinition of typedefs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84e0616a50f3799cdd5ae41e40b236390cb6b860
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 25 15:29:21 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 25 15:45:52 2016 +0000

    tools: avoid redefinition of typedefs
    
    When splitting out various functionality from libxc into tools/libs/*
    I attempted to make it possible to avoid callers being unnecessarily
    exposed to the xentoollog interface by providing a typedef of the
    xentoollog_logger handle in each of the headers.
    
    However such typedefs are not allowed in C, instead it is necessary to
    forward declare the struct and then use the struct xentoollog_logger
    variant in the prototypes.
    
    It appears that older gcc (e.g. 4.4) complains about this issue while
    newer ones (e.g. 4.9) are more tolerant unless -pedantic-errors is
    used, this was a deliberate change
    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=ce3765bf44e49ef0568a1ad4a0b7f807591d6412
    
    As well as tools/libs/* it is also now necessary to give libvchan the
    same treatment, since it previously inhereted the typedef via one of
    tools/libs/*.
    
    Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libs/call/include/xencall.h                   |  5 +++--
 tools/libs/evtchn/include/xenevtchn.h               |  5 +++--
 tools/libs/foreignmemory/include/xenforeignmemory.h |  4 ++--
 tools/libs/gnttab/include/xengnttab.h               |  7 ++++---
 tools/libvchan/init.c                               | 13 +++++++++----
 tools/libvchan/libxenvchan.h                        | 10 ++++++++--
 6 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/tools/libs/call/include/xencall.h b/tools/libs/call/include/xencall.h
index 559624a..bafacdd 100644
--- a/tools/libs/call/include/xencall.h
+++ b/tools/libs/call/include/xencall.h
@@ -26,7 +26,7 @@
 #include <stddef.h>
 
 /* Callers who don't care don't need to #include <xentoollog.h> */
-typedef struct xentoollog_logger xentoollog_logger;
+struct xentoollog_logger;
 
 typedef struct xencall_handle xencall_handle;
 
@@ -56,7 +56,8 @@ typedef struct xencall_handle xencall_handle;
  * Calling xencall_close() is the only safe operation on a
  * xencall_handle which has been inherited.
  */
-xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags);
+xencall_handle *xencall_open(struct xentoollog_logger *logger,
+                             unsigned open_flags);
 
 /*
  * Close a handle previously allocated with xencall_open().
diff --git a/tools/libs/evtchn/include/xenevtchn.h b/tools/libs/evtchn/include/xenevtchn.h
index 4d26161..0fa3f84 100644
--- a/tools/libs/evtchn/include/xenevtchn.h
+++ b/tools/libs/evtchn/include/xenevtchn.h
@@ -33,7 +33,7 @@ typedef int evtchn_port_or_error_t;
 typedef struct xenevtchn_handle xenevtchn_handle;
 
 /* Callers who don't care don't need to #include <xentoollog.h> */
-typedef struct xentoollog_logger xentoollog_logger;
+struct xentoollog_logger;
 
 /*
  * EVENT CHANNEL FUNCTIONS
@@ -66,7 +66,8 @@ typedef struct xentoollog_logger xentoollog_logger;
  * xenevtchn_handle which has been inherited.
  */
 /* Currently no flags are defined */
-xenevtchn_handle *xenevtchn_open(xentoollog_logger *logger, unsigned open_flags);
+xenevtchn_handle *xenevtchn_open(struct xentoollog_logger *logger,
+                                 unsigned open_flags);
 
 /*
  * Close a handle previously allocated with xenevtchn_open().
diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
index 3724c63..92b9277 100644
--- a/tools/libs/foreignmemory/include/xenforeignmemory.h
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -27,7 +27,7 @@
 #include <xen/xen.h>
 
 /* Callers who don't care don't need to #include <xentoollog.h> */
-typedef struct xentoollog_logger xentoollog_logger;
+struct xentoollog_logger;
 
 typedef struct xenforeignmemory_handle xenforeignmemory_handle;
 
@@ -55,7 +55,7 @@ typedef struct xenforeignmemory_handle xenforeignmemory_handle;
  * Calling xenforeignmemory_close() is the only safe operation on a
  * xenforeignmemory_handle which has been inherited.
  */
-xenforeignmemory_handle *xenforeignmemory_open(xentoollog_logger *logger,
+xenforeignmemory_handle *xenforeignmemory_open(struct xentoollog_logger *logger,
                                                unsigned open_flags);
 
 /*
diff --git a/tools/libs/gnttab/include/xengnttab.h b/tools/libs/gnttab/include/xengnttab.h
index 1ca1e70..0431dcf 100644
--- a/tools/libs/gnttab/include/xengnttab.h
+++ b/tools/libs/gnttab/include/xengnttab.h
@@ -28,7 +28,7 @@
 #include <xen/event_channel.h>
 
 /* Callers who don't care don't need to #include <xentoollog.h> */
-typedef struct xentoollog_logger xentoollog_logger;
+struct xentoollog_logger;
 
 /*
  * PRODUCING AND CONSUMING GRANT REFERENCES
@@ -132,7 +132,8 @@ typedef struct xengntdev_handle xengnttab_handle;
  * xengnttab_handle which has been inherited. xengnttab_unmap() must
  * not be called under such circumstances.
  */
-xengnttab_handle *xengnttab_open(xentoollog_logger *logger, unsigned open_flags);
+xengnttab_handle *xengnttab_open(struct xentoollog_logger *logger,
+                                 unsigned open_flags);
 
 /*
  * Close a handle previously allocated with xengnttab_open(),
@@ -287,7 +288,7 @@ typedef struct xengntdev_handle xengntshr_handle;
  * Calling xengntshr_close() is the only safe operation on a
  * xengntshr_handle which has been inherited.
  */
-xengntshr_handle *xengntshr_open(xentoollog_logger *logger,
+xengntshr_handle *xengntshr_open(struct xentoollog_logger *logger,
                                  unsigned open_flags);
 
 /*
diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c
index 91531b9..cadd12c 100644
--- a/tools/libvchan/init.c
+++ b/tools/libvchan/init.c
@@ -212,7 +212,8 @@ static int init_gnt_cli(struct libxenvchan *ctrl, int domain, uint32_t ring_ref)
 	goto out;
 }
 
-static int init_evt_srv(struct libxenvchan *ctrl, int domain, xentoollog_logger *logger)
+static int init_evt_srv(struct libxenvchan *ctrl, int domain,
+                        struct xentoollog_logger *logger)
 {
 	evtchn_port_or_error_t port;
 
@@ -293,7 +294,9 @@ static int min_order(size_t siz)
 	return rv;
 }
 
-struct libxenvchan *libxenvchan_server_init(xentoollog_logger *logger, int domain, const char* xs_path, size_t left_min, size_t right_min)
+struct libxenvchan *libxenvchan_server_init(struct xentoollog_logger *logger,
+                                            int domain, const char* xs_path,
+                                            size_t left_min, size_t right_min)
 {
 	struct libxenvchan *ctrl;
 	int ring_ref;
@@ -342,7 +345,8 @@ out:
 	return 0;
 }
 
-static int init_evt_cli(struct libxenvchan *ctrl, int domain, xentoollog_logger *logger)
+static int init_evt_cli(struct libxenvchan *ctrl, int domain,
+                        struct xentoollog_logger *logger)
 {
 	evtchn_port_or_error_t port;
 
@@ -372,7 +376,8 @@ fail:
 }
 
 
-struct libxenvchan *libxenvchan_client_init(xentoollog_logger *logger, int domain, const char* xs_path)
+struct libxenvchan *libxenvchan_client_init(struct xentoollog_logger *logger,
+                                            int domain, const char* xs_path)
 {
 	struct libxenvchan *ctrl = malloc(sizeof(struct libxenvchan));
 	struct xs_handle *xs = NULL;
diff --git a/tools/libvchan/libxenvchan.h b/tools/libvchan/libxenvchan.h
index 341c375..2adbdfe 100644
--- a/tools/libvchan/libxenvchan.h
+++ b/tools/libvchan/libxenvchan.h
@@ -47,6 +47,9 @@
 #include <xenevtchn.h>
 #include <xengnttab.h>
 
+/* Callers who don't care don't need to #include <xentoollog.h> */
+struct xentoollog_logger;
+
 struct libxenvchan_ring {
 	/* Pointer into the shared page. Offsets into buffer. */
 	struct ring_shared* shr;
@@ -93,7 +96,9 @@ struct libxenvchan {
  * @param recv_min The minimum size (in bytes) of the receive ring (right)
  * @return The structure, or NULL in case of an error
  */
-struct libxenvchan *libxenvchan_server_init(xentoollog_logger *logger, int domain, const char* xs_path, size_t read_min, size_t write_min);
+struct libxenvchan *libxenvchan_server_init(struct xentoollog_logger *logger,
+                                            int domain, const char* xs_path,
+                                            size_t read_min, size_t write_min);
 /**
  * Connect to an existing vchan. Note: you can reconnect to an existing vchan
  * safely, however no locking is performed, so you must prevent multiple clients
@@ -104,7 +109,8 @@ struct libxenvchan *libxenvchan_server_init(xentoollog_logger *logger, int domai
  * @param xs_path Base xenstore path for storing ring/event data
  * @return The structure, or NULL in case of an error
  */
-struct libxenvchan *libxenvchan_client_init(xentoollog_logger *logger, int domain, const char* xs_path);
+struct libxenvchan *libxenvchan_client_init(struct xentoollog_logger *logger,
+                                            int domain, const char* xs_path);
 /**
  * Close a vchan. This deallocates the vchan and attempts to free its
  * resources. The other side is notified of the close, but can still read any
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:55:39 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:55: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 1aP9WV-0005cp-Tj; Fri, 29 Jan 2016 13:55: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 1aP9WU-0005cW-FD
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:38 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	3B/0C-07451-95F6BA65; Fri, 29 Jan 2016 13:55:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1454075736!19068729!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 693 invoked from network); 29 Jan 2016 13:55:36 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:55:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9XP-0007tb-76
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9WR-0002dx-Im
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9WR-0002dx-Im@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:55:35 +0000
Subject: [Xen-changelog] [xen master] tools: avoid redefinition of typedefs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84e0616a50f3799cdd5ae41e40b236390cb6b860
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 25 15:29:21 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 25 15:45:52 2016 +0000

    tools: avoid redefinition of typedefs
    
    When splitting out various functionality from libxc into tools/libs/*
    I attempted to make it possible to avoid callers being unnecessarily
    exposed to the xentoollog interface by providing a typedef of the
    xentoollog_logger handle in each of the headers.
    
    However such typedefs are not allowed in C, instead it is necessary to
    forward declare the struct and then use the struct xentoollog_logger
    variant in the prototypes.
    
    It appears that older gcc (e.g. 4.4) complains about this issue while
    newer ones (e.g. 4.9) are more tolerant unless -pedantic-errors is
    used, this was a deliberate change
    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=ce3765bf44e49ef0568a1ad4a0b7f807591d6412
    
    As well as tools/libs/* it is also now necessary to give libvchan the
    same treatment, since it previously inhereted the typedef via one of
    tools/libs/*.
    
    Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libs/call/include/xencall.h                   |  5 +++--
 tools/libs/evtchn/include/xenevtchn.h               |  5 +++--
 tools/libs/foreignmemory/include/xenforeignmemory.h |  4 ++--
 tools/libs/gnttab/include/xengnttab.h               |  7 ++++---
 tools/libvchan/init.c                               | 13 +++++++++----
 tools/libvchan/libxenvchan.h                        | 10 ++++++++--
 6 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/tools/libs/call/include/xencall.h b/tools/libs/call/include/xencall.h
index 559624a..bafacdd 100644
--- a/tools/libs/call/include/xencall.h
+++ b/tools/libs/call/include/xencall.h
@@ -26,7 +26,7 @@
 #include <stddef.h>
 
 /* Callers who don't care don't need to #include <xentoollog.h> */
-typedef struct xentoollog_logger xentoollog_logger;
+struct xentoollog_logger;
 
 typedef struct xencall_handle xencall_handle;
 
@@ -56,7 +56,8 @@ typedef struct xencall_handle xencall_handle;
  * Calling xencall_close() is the only safe operation on a
  * xencall_handle which has been inherited.
  */
-xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags);
+xencall_handle *xencall_open(struct xentoollog_logger *logger,
+                             unsigned open_flags);
 
 /*
  * Close a handle previously allocated with xencall_open().
diff --git a/tools/libs/evtchn/include/xenevtchn.h b/tools/libs/evtchn/include/xenevtchn.h
index 4d26161..0fa3f84 100644
--- a/tools/libs/evtchn/include/xenevtchn.h
+++ b/tools/libs/evtchn/include/xenevtchn.h
@@ -33,7 +33,7 @@ typedef int evtchn_port_or_error_t;
 typedef struct xenevtchn_handle xenevtchn_handle;
 
 /* Callers who don't care don't need to #include <xentoollog.h> */
-typedef struct xentoollog_logger xentoollog_logger;
+struct xentoollog_logger;
 
 /*
  * EVENT CHANNEL FUNCTIONS
@@ -66,7 +66,8 @@ typedef struct xentoollog_logger xentoollog_logger;
  * xenevtchn_handle which has been inherited.
  */
 /* Currently no flags are defined */
-xenevtchn_handle *xenevtchn_open(xentoollog_logger *logger, unsigned open_flags);
+xenevtchn_handle *xenevtchn_open(struct xentoollog_logger *logger,
+                                 unsigned open_flags);
 
 /*
  * Close a handle previously allocated with xenevtchn_open().
diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/foreignmemory/include/xenforeignmemory.h
index 3724c63..92b9277 100644
--- a/tools/libs/foreignmemory/include/xenforeignmemory.h
+++ b/tools/libs/foreignmemory/include/xenforeignmemory.h
@@ -27,7 +27,7 @@
 #include <xen/xen.h>
 
 /* Callers who don't care don't need to #include <xentoollog.h> */
-typedef struct xentoollog_logger xentoollog_logger;
+struct xentoollog_logger;
 
 typedef struct xenforeignmemory_handle xenforeignmemory_handle;
 
@@ -55,7 +55,7 @@ typedef struct xenforeignmemory_handle xenforeignmemory_handle;
  * Calling xenforeignmemory_close() is the only safe operation on a
  * xenforeignmemory_handle which has been inherited.
  */
-xenforeignmemory_handle *xenforeignmemory_open(xentoollog_logger *logger,
+xenforeignmemory_handle *xenforeignmemory_open(struct xentoollog_logger *logger,
                                                unsigned open_flags);
 
 /*
diff --git a/tools/libs/gnttab/include/xengnttab.h b/tools/libs/gnttab/include/xengnttab.h
index 1ca1e70..0431dcf 100644
--- a/tools/libs/gnttab/include/xengnttab.h
+++ b/tools/libs/gnttab/include/xengnttab.h
@@ -28,7 +28,7 @@
 #include <xen/event_channel.h>
 
 /* Callers who don't care don't need to #include <xentoollog.h> */
-typedef struct xentoollog_logger xentoollog_logger;
+struct xentoollog_logger;
 
 /*
  * PRODUCING AND CONSUMING GRANT REFERENCES
@@ -132,7 +132,8 @@ typedef struct xengntdev_handle xengnttab_handle;
  * xengnttab_handle which has been inherited. xengnttab_unmap() must
  * not be called under such circumstances.
  */
-xengnttab_handle *xengnttab_open(xentoollog_logger *logger, unsigned open_flags);
+xengnttab_handle *xengnttab_open(struct xentoollog_logger *logger,
+                                 unsigned open_flags);
 
 /*
  * Close a handle previously allocated with xengnttab_open(),
@@ -287,7 +288,7 @@ typedef struct xengntdev_handle xengntshr_handle;
  * Calling xengntshr_close() is the only safe operation on a
  * xengntshr_handle which has been inherited.
  */
-xengntshr_handle *xengntshr_open(xentoollog_logger *logger,
+xengntshr_handle *xengntshr_open(struct xentoollog_logger *logger,
                                  unsigned open_flags);
 
 /*
diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c
index 91531b9..cadd12c 100644
--- a/tools/libvchan/init.c
+++ b/tools/libvchan/init.c
@@ -212,7 +212,8 @@ static int init_gnt_cli(struct libxenvchan *ctrl, int domain, uint32_t ring_ref)
 	goto out;
 }
 
-static int init_evt_srv(struct libxenvchan *ctrl, int domain, xentoollog_logger *logger)
+static int init_evt_srv(struct libxenvchan *ctrl, int domain,
+                        struct xentoollog_logger *logger)
 {
 	evtchn_port_or_error_t port;
 
@@ -293,7 +294,9 @@ static int min_order(size_t siz)
 	return rv;
 }
 
-struct libxenvchan *libxenvchan_server_init(xentoollog_logger *logger, int domain, const char* xs_path, size_t left_min, size_t right_min)
+struct libxenvchan *libxenvchan_server_init(struct xentoollog_logger *logger,
+                                            int domain, const char* xs_path,
+                                            size_t left_min, size_t right_min)
 {
 	struct libxenvchan *ctrl;
 	int ring_ref;
@@ -342,7 +345,8 @@ out:
 	return 0;
 }
 
-static int init_evt_cli(struct libxenvchan *ctrl, int domain, xentoollog_logger *logger)
+static int init_evt_cli(struct libxenvchan *ctrl, int domain,
+                        struct xentoollog_logger *logger)
 {
 	evtchn_port_or_error_t port;
 
@@ -372,7 +376,8 @@ fail:
 }
 
 
-struct libxenvchan *libxenvchan_client_init(xentoollog_logger *logger, int domain, const char* xs_path)
+struct libxenvchan *libxenvchan_client_init(struct xentoollog_logger *logger,
+                                            int domain, const char* xs_path)
 {
 	struct libxenvchan *ctrl = malloc(sizeof(struct libxenvchan));
 	struct xs_handle *xs = NULL;
diff --git a/tools/libvchan/libxenvchan.h b/tools/libvchan/libxenvchan.h
index 341c375..2adbdfe 100644
--- a/tools/libvchan/libxenvchan.h
+++ b/tools/libvchan/libxenvchan.h
@@ -47,6 +47,9 @@
 #include <xenevtchn.h>
 #include <xengnttab.h>
 
+/* Callers who don't care don't need to #include <xentoollog.h> */
+struct xentoollog_logger;
+
 struct libxenvchan_ring {
 	/* Pointer into the shared page. Offsets into buffer. */
 	struct ring_shared* shr;
@@ -93,7 +96,9 @@ struct libxenvchan {
  * @param recv_min The minimum size (in bytes) of the receive ring (right)
  * @return The structure, or NULL in case of an error
  */
-struct libxenvchan *libxenvchan_server_init(xentoollog_logger *logger, int domain, const char* xs_path, size_t read_min, size_t write_min);
+struct libxenvchan *libxenvchan_server_init(struct xentoollog_logger *logger,
+                                            int domain, const char* xs_path,
+                                            size_t read_min, size_t write_min);
 /**
  * Connect to an existing vchan. Note: you can reconnect to an existing vchan
  * safely, however no locking is performed, so you must prevent multiple clients
@@ -104,7 +109,8 @@ struct libxenvchan *libxenvchan_server_init(xentoollog_logger *logger, int domai
  * @param xs_path Base xenstore path for storing ring/event data
  * @return The structure, or NULL in case of an error
  */
-struct libxenvchan *libxenvchan_client_init(xentoollog_logger *logger, int domain, const char* xs_path);
+struct libxenvchan *libxenvchan_client_init(struct xentoollog_logger *logger,
+                                            int domain, const char* xs_path);
 /**
  * Close a vchan. This deallocates the vchan and attempts to free its
  * resources. The other side is notified of the close, but can still read any
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:55:50 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:55:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aP9Wg-0005jf-1S; Fri, 29 Jan 2016 13:55: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 1aP9We-0005jD-JG
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:48 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	6F/47-08977-36F6BA65; Fri, 29 Jan 2016 13:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1454075746!12860470!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25809 invoked from network); 29 Jan 2016 13:55:47 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:55:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9XZ-0007tj-LZ
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Wc-0002eL-1L
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9Wc-0002eL-1L@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:55:46 +0000
Subject: [Xen-changelog] [xen master] tools: rename libxc's
	evtchn_port_or_error_t with an xc_ prefix
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d2f7895774a5ecb1600fd18f147fc7e1a515c38
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 25 17:10:48 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 25 17:21:24 2016 +0000

    tools: rename libxc's evtchn_port_or_error_t with an xc_ prefix
    
    This is used only for xc_evtchn_alloc_unbound and the legacy/compat
    versions of the old interfaces and avoids redefining the typedef. The
    evtchn_port_or_error_t name is now used only be libxenevtchn.
    
    None of the callers of xc_evtchn_alloc_unbound use the type
    themselves.
    
    NB xc_evtchn_alloc_unbound differs from xc_evtchn_bind_unbound_port
    and the underlying xenevtchn_bind_unbound_port in that it allows the
    specification of the local domain rather than assuming self. This is
    only useful during domain build.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/include/xenctrl.h        | 4 ++--
 tools/libxc/include/xenctrl_compat.h | 8 ++++----
 tools/libxc/xc_evtchn.c              | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index e632b1e..1d656ac 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1077,7 +1077,7 @@ xc_cpumap_t xc_cpupool_freeinfo(xc_interface *xch);
  */
 
 /* A port identifier is guaranteed to fit in 31 bits. */
-typedef int evtchn_port_or_error_t;
+typedef int xc_evtchn_port_or_error_t;
 
 /**
  * This function allocates an unbound port.  Ports are named endpoints used for
@@ -1093,7 +1093,7 @@ typedef int evtchn_port_or_error_t;
  * @parm remote_dom the ID of the domain who will later bind
  * @return allocated port (in @dom) on success, -1 on failure
  */
-evtchn_port_or_error_t
+xc_evtchn_port_or_error_t
 xc_evtchn_alloc_unbound(xc_interface *xch,
                         uint32_t dom,
                         uint32_t remote_dom);
diff --git a/tools/libxc/include/xenctrl_compat.h b/tools/libxc/include/xenctrl_compat.h
index 54c23a4..dc513a3 100644
--- a/tools/libxc/include/xenctrl_compat.h
+++ b/tools/libxc/include/xenctrl_compat.h
@@ -57,15 +57,15 @@ xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
 int xc_evtchn_close(xc_evtchn *xce);
 int xc_evtchn_fd(xc_evtchn *xce);
 int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port);
-evtchn_port_or_error_t
+xc_evtchn_port_or_error_t
 xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid);
-evtchn_port_or_error_t
+xc_evtchn_port_or_error_t
 xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
                            evtchn_port_t remote_port);
-evtchn_port_or_error_t
+xc_evtchn_port_or_error_t
 xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq);
 int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port);
-evtchn_port_or_error_t
+xc_evtchn_port_or_error_t
 xc_evtchn_pending(xc_evtchn *xce);
 int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port);
 
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index 53f7605..8d4fcc1 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -43,7 +43,7 @@ static int do_evtchn_op(xc_interface *xch, int cmd, void *arg,
     return ret;
 }
 
-evtchn_port_or_error_t
+xc_evtchn_port_or_error_t
 xc_evtchn_alloc_unbound(xc_interface *xch,
                         uint32_t dom,
                         uint32_t remote_dom)
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:55:50 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:55:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aP9Wg-0005jf-1S; Fri, 29 Jan 2016 13:55: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 1aP9We-0005jD-JG
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:48 +0000
Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id
	6F/47-08977-36F6BA65; Fri, 29 Jan 2016 13:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1454075746!12860470!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25809 invoked from network); 29 Jan 2016 13:55:47 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:55:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9XZ-0007tj-LZ
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Wc-0002eL-1L
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9Wc-0002eL-1L@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:55:46 +0000
Subject: [Xen-changelog] [xen master] tools: rename libxc's
	evtchn_port_or_error_t with an xc_ prefix
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d2f7895774a5ecb1600fd18f147fc7e1a515c38
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 25 17:10:48 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 25 17:21:24 2016 +0000

    tools: rename libxc's evtchn_port_or_error_t with an xc_ prefix
    
    This is used only for xc_evtchn_alloc_unbound and the legacy/compat
    versions of the old interfaces and avoids redefining the typedef. The
    evtchn_port_or_error_t name is now used only be libxenevtchn.
    
    None of the callers of xc_evtchn_alloc_unbound use the type
    themselves.
    
    NB xc_evtchn_alloc_unbound differs from xc_evtchn_bind_unbound_port
    and the underlying xenevtchn_bind_unbound_port in that it allows the
    specification of the local domain rather than assuming self. This is
    only useful during domain build.
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/include/xenctrl.h        | 4 ++--
 tools/libxc/include/xenctrl_compat.h | 8 ++++----
 tools/libxc/xc_evtchn.c              | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index e632b1e..1d656ac 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1077,7 +1077,7 @@ xc_cpumap_t xc_cpupool_freeinfo(xc_interface *xch);
  */
 
 /* A port identifier is guaranteed to fit in 31 bits. */
-typedef int evtchn_port_or_error_t;
+typedef int xc_evtchn_port_or_error_t;
 
 /**
  * This function allocates an unbound port.  Ports are named endpoints used for
@@ -1093,7 +1093,7 @@ typedef int evtchn_port_or_error_t;
  * @parm remote_dom the ID of the domain who will later bind
  * @return allocated port (in @dom) on success, -1 on failure
  */
-evtchn_port_or_error_t
+xc_evtchn_port_or_error_t
 xc_evtchn_alloc_unbound(xc_interface *xch,
                         uint32_t dom,
                         uint32_t remote_dom);
diff --git a/tools/libxc/include/xenctrl_compat.h b/tools/libxc/include/xenctrl_compat.h
index 54c23a4..dc513a3 100644
--- a/tools/libxc/include/xenctrl_compat.h
+++ b/tools/libxc/include/xenctrl_compat.h
@@ -57,15 +57,15 @@ xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
 int xc_evtchn_close(xc_evtchn *xce);
 int xc_evtchn_fd(xc_evtchn *xce);
 int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port);
-evtchn_port_or_error_t
+xc_evtchn_port_or_error_t
 xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid);
-evtchn_port_or_error_t
+xc_evtchn_port_or_error_t
 xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
                            evtchn_port_t remote_port);
-evtchn_port_or_error_t
+xc_evtchn_port_or_error_t
 xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq);
 int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port);
-evtchn_port_or_error_t
+xc_evtchn_port_or_error_t
 xc_evtchn_pending(xc_evtchn *xce);
 int xc_evtchn_unmask(xc_evtchn *xce, evtchn_port_t port);
 
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index 53f7605..8d4fcc1 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -43,7 +43,7 @@ static int do_evtchn_op(xc_interface *xch, int cmd, void *arg,
     return ret;
 }
 
-evtchn_port_or_error_t
+xc_evtchn_port_or_error_t
 xc_evtchn_alloc_unbound(xc_interface *xch,
                         uint32_t dom,
                         uint32_t remote_dom)
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:56:00 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:56: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 1aP9Wq-0005kz-76; Fri, 29 Jan 2016 13:56: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 1aP9Wp-0005ko-6W
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:59 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	11/7A-31443-E6F6BA65; Fri, 29 Jan 2016 13:55:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1454075756!9437204!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62069 invoked from network); 29 Jan 2016 13:55:57 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:55:57 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Xk-0007tq-0B
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Wm-0002f8-Dj
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9Wm-0002f8-Dj@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:55:56 +0000
Subject: [Xen-changelog] [xen master] tools: avoid redefinining
	xenevtchn_handle typedef for xc_suspend_*
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3b971de7f1cc595ae7ef03fb6f500295a8b82630
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 25 17:10:49 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 25 17:21:45 2016 +0000

    tools: avoid redefinining xenevtchn_handle typedef for xc_suspend_*
    
    Similar to the previous xentoollog case this is not allowed. Switch to
    a forward decl of the struct and use of it in the APIs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/include/xenguest.h | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index 050a537..d48b3ff 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -38,7 +38,7 @@
  * User not using xc_suspend_* / xc_await_suspent may not want to
  * include the full libxenevtchn API here.
  */
-typedef struct xenevtchn_handle xenevtchn_handle;
+struct xenevtchn_handle;
 
 /* callbacks provided by xc_domain_save */
 struct save_callbacks {
@@ -167,18 +167,22 @@ struct xc_hvm_firmware_module {
  * Sets *lockfd to -1.
  * Has deallocated everything even on error.
  */
-int xc_suspend_evtchn_release(xc_interface *xch, xenevtchn_handle *xce, int domid, int suspend_evtchn, int *lockfd);
+int xc_suspend_evtchn_release(xc_interface *xch,
+                              struct xenevtchn_handle *xce,
+                              int domid, int suspend_evtchn, int *lockfd);
 
 /**
  * This function eats the initial notification.
  * xce must not be used for anything else
  * See xc_suspend_evtchn_init_sane re lockfd.
  */
-int xc_suspend_evtchn_init_exclusive(xc_interface *xch, xenevtchn_handle *xce,
+int xc_suspend_evtchn_init_exclusive(xc_interface *xch,
+                                     struct xenevtchn_handle *xce,
                                      int domid, int port, int *lockfd);
 
 /* xce must not be used for anything else */
-int xc_await_suspend(xc_interface *xch, xenevtchn_handle *xce, int suspend_evtchn);
+int xc_await_suspend(xc_interface *xch, struct xenevtchn_handle *xce,
+                     int suspend_evtchn);
 
 /**
  * The port will be signaled immediately after this call
@@ -187,7 +191,8 @@ int xc_await_suspend(xc_interface *xch, xenevtchn_handle *xce, int suspend_evtch
  * and fed to xc_suspend_evtchn_release.  (On error *lockfd is
  * undefined and xc_suspend_evtchn_release is not allowed.)
  */
-int xc_suspend_evtchn_init_sane(xc_interface *xch, xenevtchn_handle *xce,
+int xc_suspend_evtchn_init_sane(xc_interface *xch,
+                                struct xenevtchn_handle *xce,
                                 int domid, int port, int *lockfd);
 
 int xc_mark_page_online(xc_interface *xch, unsigned long start,
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:56:00 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:56: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 1aP9Wq-0005kz-76; Fri, 29 Jan 2016 13:56: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 1aP9Wp-0005ko-6W
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:59 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	11/7A-31443-E6F6BA65; Fri, 29 Jan 2016 13:55:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1454075756!9437204!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62069 invoked from network); 29 Jan 2016 13:55:57 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:55:57 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Xk-0007tq-0B
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Wm-0002f8-Dj
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:55:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9Wm-0002f8-Dj@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:55:56 +0000
Subject: [Xen-changelog] [xen master] tools: avoid redefinining
	xenevtchn_handle typedef for xc_suspend_*
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3b971de7f1cc595ae7ef03fb6f500295a8b82630
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jan 25 17:10:49 2016 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jan 25 17:21:45 2016 +0000

    tools: avoid redefinining xenevtchn_handle typedef for xc_suspend_*
    
    Similar to the previous xentoollog case this is not allowed. Switch to
    a forward decl of the struct and use of it in the APIs.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/include/xenguest.h | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index 050a537..d48b3ff 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -38,7 +38,7 @@
  * User not using xc_suspend_* / xc_await_suspent may not want to
  * include the full libxenevtchn API here.
  */
-typedef struct xenevtchn_handle xenevtchn_handle;
+struct xenevtchn_handle;
 
 /* callbacks provided by xc_domain_save */
 struct save_callbacks {
@@ -167,18 +167,22 @@ struct xc_hvm_firmware_module {
  * Sets *lockfd to -1.
  * Has deallocated everything even on error.
  */
-int xc_suspend_evtchn_release(xc_interface *xch, xenevtchn_handle *xce, int domid, int suspend_evtchn, int *lockfd);
+int xc_suspend_evtchn_release(xc_interface *xch,
+                              struct xenevtchn_handle *xce,
+                              int domid, int suspend_evtchn, int *lockfd);
 
 /**
  * This function eats the initial notification.
  * xce must not be used for anything else
  * See xc_suspend_evtchn_init_sane re lockfd.
  */
-int xc_suspend_evtchn_init_exclusive(xc_interface *xch, xenevtchn_handle *xce,
+int xc_suspend_evtchn_init_exclusive(xc_interface *xch,
+                                     struct xenevtchn_handle *xce,
                                      int domid, int port, int *lockfd);
 
 /* xce must not be used for anything else */
-int xc_await_suspend(xc_interface *xch, xenevtchn_handle *xce, int suspend_evtchn);
+int xc_await_suspend(xc_interface *xch, struct xenevtchn_handle *xce,
+                     int suspend_evtchn);
 
 /**
  * The port will be signaled immediately after this call
@@ -187,7 +191,8 @@ int xc_await_suspend(xc_interface *xch, xenevtchn_handle *xce, int suspend_evtch
  * and fed to xc_suspend_evtchn_release.  (On error *lockfd is
  * undefined and xc_suspend_evtchn_release is not allowed.)
  */
-int xc_suspend_evtchn_init_sane(xc_interface *xch, xenevtchn_handle *xce,
+int xc_suspend_evtchn_init_sane(xc_interface *xch,
+                                struct xenevtchn_handle *xce,
                                 int domid, int port, int *lockfd);
 
 int xc_mark_page_online(xc_interface *xch, unsigned long start,
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:56:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:56: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 1aP9X0-0005mf-EK; Fri, 29 Jan 2016 13:56: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 1aP9Wz-0005mN-6v
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:09 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	CA/17-25438-87F6BA65; Fri, 29 Jan 2016 13:56:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1454075767!18101154!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2611 invoked from network); 29 Jan 2016 13:56:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:56:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Xu-0007uU-Bl
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Ww-0002fl-Pm
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9Ww-0002fl-Pm@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:56:06 +0000
Subject: [Xen-changelog] [xen master] public/io/netif.h: change semantics of
	"request-multicast-control" flag
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 38992e5df2a3978c6bab7e6e8cbd46c1ab2c5a5e
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Wed Jan 20 12:50:49 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:24:04 2016 +0000

    public/io/netif.h: change semantics of "request-multicast-control" flag
    
    My patch b2700877 "move and amend multicast control documentation"
    clarified use of the multicast control protocol between frontend and
    backend. However, it transpires that the restrictions that documentation
    placed on the "request-multicast-control" flag make it hard for a
    frontend to enable 'all multicast' promiscuous mode, in that to do so
    would require the frontend and backend to disconnect and re-connect.
    
    This patch adds a new "feature-dynamic-multicast-control" flag to allow
    a backend to advertise that it will watch "request-multicast-control" hence
    allowing it to be meaningfully modified by the frontend at any time rather
    than only when the frontend and backend are disconnected.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/include/public/io/netif.h | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index fe0a87f..8816e0f 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -136,18 +136,28 @@
  */
 
 /*
- * "feature-multicast-control" advertises the capability to filter ethernet
- * multicast packets in the backend. To enable use of this capability the
- * frontend must set "request-multicast-control" before moving into the
- * connected state.
- *
- * If "request-multicast-control" is set then the backend transmit side should
- * no longer flood multicast packets to the frontend, it should instead drop any
- * multicast packet that does not match in a filter list. The list is
- * amended by the frontend by sending dummy transmit requests containing
- * XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL} extra-info fragments as specified below.
- * Once enabled by the frontend, the feature cannot be disabled except by
- * closing and re-connecting to the backend.
+ * "feature-multicast-control" and "feature-dynamic-multicast-control"
+ * advertise the capability to filter ethernet multicast packets in the
+ * backend. If the frontend wishes to take advantage of this feature then
+ * it may set "request-multicast-control". If the backend only advertises
+ * "feature-multicast-control" then "request-multicast-control" must be set
+ * before the frontend moves into the connected state. The backend will
+ * sample the value on this state transition and any subsequent change in
+ * value will have no effect. However, if the backend also advertises
+ * "feature-dynamic-multicast-control" then "request-multicast-control"
+ * may be set by the frontend at any time. In this case, the backend will
+ * watch the value and re-sample on watch events.
+ *
+ * If the sampled value of "request-multicast-control" is set then the
+ * backend transmit side should no longer flood multicast packets to the
+ * frontend, it should instead drop any multicast packet that does not
+ * match in a filter list.
+ * The list is amended by the frontend by sending dummy transmit requests
+ * containing XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL} extra-info fragments as
+ * specified below.
+ * Note that the filter list may be amended even if the sampled value of
+ * "request-multicast-control" is not set, however the filter should only
+ * be applied if it is 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 Fri Jan 29 13:56:10 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:56: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 1aP9X0-0005mf-EK; Fri, 29 Jan 2016 13:56: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 1aP9Wz-0005mN-6v
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:09 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	CA/17-25438-87F6BA65; Fri, 29 Jan 2016 13:56:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1454075767!18101154!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: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2611 invoked from network); 29 Jan 2016 13:56:07 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:56:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Xu-0007uU-Bl
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Ww-0002fl-Pm
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9Ww-0002fl-Pm@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:56:06 +0000
Subject: [Xen-changelog] [xen master] public/io/netif.h: change semantics of
	"request-multicast-control" flag
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 38992e5df2a3978c6bab7e6e8cbd46c1ab2c5a5e
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Wed Jan 20 12:50:49 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:24:04 2016 +0000

    public/io/netif.h: change semantics of "request-multicast-control" flag
    
    My patch b2700877 "move and amend multicast control documentation"
    clarified use of the multicast control protocol between frontend and
    backend. However, it transpires that the restrictions that documentation
    placed on the "request-multicast-control" flag make it hard for a
    frontend to enable 'all multicast' promiscuous mode, in that to do so
    would require the frontend and backend to disconnect and re-connect.
    
    This patch adds a new "feature-dynamic-multicast-control" flag to allow
    a backend to advertise that it will watch "request-multicast-control" hence
    allowing it to be meaningfully modified by the frontend at any time rather
    than only when the frontend and backend are disconnected.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/include/public/io/netif.h | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index fe0a87f..8816e0f 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -136,18 +136,28 @@
  */
 
 /*
- * "feature-multicast-control" advertises the capability to filter ethernet
- * multicast packets in the backend. To enable use of this capability the
- * frontend must set "request-multicast-control" before moving into the
- * connected state.
- *
- * If "request-multicast-control" is set then the backend transmit side should
- * no longer flood multicast packets to the frontend, it should instead drop any
- * multicast packet that does not match in a filter list. The list is
- * amended by the frontend by sending dummy transmit requests containing
- * XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL} extra-info fragments as specified below.
- * Once enabled by the frontend, the feature cannot be disabled except by
- * closing and re-connecting to the backend.
+ * "feature-multicast-control" and "feature-dynamic-multicast-control"
+ * advertise the capability to filter ethernet multicast packets in the
+ * backend. If the frontend wishes to take advantage of this feature then
+ * it may set "request-multicast-control". If the backend only advertises
+ * "feature-multicast-control" then "request-multicast-control" must be set
+ * before the frontend moves into the connected state. The backend will
+ * sample the value on this state transition and any subsequent change in
+ * value will have no effect. However, if the backend also advertises
+ * "feature-dynamic-multicast-control" then "request-multicast-control"
+ * may be set by the frontend at any time. In this case, the backend will
+ * watch the value and re-sample on watch events.
+ *
+ * If the sampled value of "request-multicast-control" is set then the
+ * backend transmit side should no longer flood multicast packets to the
+ * frontend, it should instead drop any multicast packet that does not
+ * match in a filter list.
+ * The list is amended by the frontend by sending dummy transmit requests
+ * containing XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL} extra-info fragments as
+ * specified below.
+ * Note that the filter list may be amended even if the sampled value of
+ * "request-multicast-control" is not set, however the filter should only
+ * be applied if it is 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 Fri Jan 29 13:56:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:56: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 1aP9XA-0005oX-Iz; Fri, 29 Jan 2016 13:56: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 1aP9X9-0005oM-IC
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:19 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	B6/CF-31122-28F6BA65; Fri, 29 Jan 2016 13:56:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1454075777!12876385!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44372 invoked from network); 29 Jan 2016 13:56:18 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:56:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Y4-0007v8-Nx
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9X7-0002g9-4W
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9X7-0002g9-4W@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:56:17 +0000
Subject: [Xen-changelog] [xen master] xenalyze: fix misleading indentation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ebdba150bff1d914805d60efa576337bbef0c305
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 22 14:27:28 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:24:39 2016 +0000

    xenalyze: fix misleading indentation.
    
    gcc-6 adds -Wmisleading-indentation which found these issues.
    
    xenalyze.c: In function 'weighted_percentile':
    xenalyze.c:2136:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
                 L=I; L_weight = I_weight;
                      ^~~~~~~~
    
    xenalyze.c:2135:9: note: ...this 'if' clause, but it is not
             if(J_weight<K_weight)
             ^~
    
    xenalyze.c:2138:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
                 R=J; R_weight = J_weight;
                      ^~~~~~~~
    
    xenalyze.c:2137:9: note: ...this 'if' clause, but it is not
             if(K_weight<I_weight)
             ^~
    
    xenalyze.c: In function 'self_weighted_percentile':
    xenalyze.c:2215:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
                 L=I; L_weight = I_weight;
                      ^~~~~~~~
    
    xenalyze.c:2214:9: note: ...this 'if' clause, but it is not
             if(J_weight<K_weight)
             ^~
    
    xenalyze.c:2217:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
                 R=J; R_weight = J_weight;
                      ^~~~~~~~
    
    xenalyze.c:2216:9: note: ...this 'if' clause, but it is not
             if(K_weight<I_weight)
             ^~
    
    I've modified according to what I think the intention is, i.e. added braces
    rather than moving the line in question out a level.
    
    I have only build tested the result.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 tools/xentrace/xenalyze.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 5a2735c..4bcaf83 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -2132,10 +2132,14 @@ float weighted_percentile(float * A, /* values */
         } while (I <= J); /* Keep going until our pointers meet or pass */
 
         /* Re-adjust L and R, based on which element we're looking for */
-        if(J_weight<K_weight)
-            L=I; L_weight = I_weight;
-        if(K_weight<I_weight)
-            R=J; R_weight = J_weight;
+        if(J_weight<K_weight) {
+            L=I;
+            L_weight = I_weight;
+        }
+        if(K_weight<I_weight) {
+            R=J;
+            R_weight = J_weight;
+        }
     }
 
     return A[L];
@@ -2211,10 +2215,14 @@ long long self_weighted_percentile(long long * A,
         } while (I <= J); /* Keep going until our pointers meet or pass */
 
         /* Re-adjust L and R, based on which element we're looking for */
-        if(J_weight<K_weight)
-            L=I; L_weight = I_weight;
-        if(K_weight<I_weight)
-            R=J; R_weight = J_weight;
+        if(J_weight<K_weight) {
+            L=I;
+            L_weight = I_weight;
+        }
+        if(K_weight<I_weight) {
+            R=J;
+            R_weight = J_weight;
+        }
     }
 
     return A[L];
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:56:20 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:56: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 1aP9XA-0005oX-Iz; Fri, 29 Jan 2016 13:56: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 1aP9X9-0005oM-IC
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:19 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	B6/CF-31122-28F6BA65; Fri, 29 Jan 2016 13:56:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1454075777!12876385!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44372 invoked from network); 29 Jan 2016 13:56:18 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:56:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Y4-0007v8-Nx
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9X7-0002g9-4W
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9X7-0002g9-4W@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:56:17 +0000
Subject: [Xen-changelog] [xen master] xenalyze: fix misleading indentation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ebdba150bff1d914805d60efa576337bbef0c305
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 22 14:27:28 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:24:39 2016 +0000

    xenalyze: fix misleading indentation.
    
    gcc-6 adds -Wmisleading-indentation which found these issues.
    
    xenalyze.c: In function 'weighted_percentile':
    xenalyze.c:2136:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
                 L=I; L_weight = I_weight;
                      ^~~~~~~~
    
    xenalyze.c:2135:9: note: ...this 'if' clause, but it is not
             if(J_weight<K_weight)
             ^~
    
    xenalyze.c:2138:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
                 R=J; R_weight = J_weight;
                      ^~~~~~~~
    
    xenalyze.c:2137:9: note: ...this 'if' clause, but it is not
             if(K_weight<I_weight)
             ^~
    
    xenalyze.c: In function 'self_weighted_percentile':
    xenalyze.c:2215:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
                 L=I; L_weight = I_weight;
                      ^~~~~~~~
    
    xenalyze.c:2214:9: note: ...this 'if' clause, but it is not
             if(J_weight<K_weight)
             ^~
    
    xenalyze.c:2217:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
                 R=J; R_weight = J_weight;
                      ^~~~~~~~
    
    xenalyze.c:2216:9: note: ...this 'if' clause, but it is not
             if(K_weight<I_weight)
             ^~
    
    I've modified according to what I think the intention is, i.e. added braces
    rather than moving the line in question out a level.
    
    I have only build tested the result.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 tools/xentrace/xenalyze.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 5a2735c..4bcaf83 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -2132,10 +2132,14 @@ float weighted_percentile(float * A, /* values */
         } while (I <= J); /* Keep going until our pointers meet or pass */
 
         /* Re-adjust L and R, based on which element we're looking for */
-        if(J_weight<K_weight)
-            L=I; L_weight = I_weight;
-        if(K_weight<I_weight)
-            R=J; R_weight = J_weight;
+        if(J_weight<K_weight) {
+            L=I;
+            L_weight = I_weight;
+        }
+        if(K_weight<I_weight) {
+            R=J;
+            R_weight = J_weight;
+        }
     }
 
     return A[L];
@@ -2211,10 +2215,14 @@ long long self_weighted_percentile(long long * A,
         } while (I <= J); /* Keep going until our pointers meet or pass */
 
         /* Re-adjust L and R, based on which element we're looking for */
-        if(J_weight<K_weight)
-            L=I; L_weight = I_weight;
-        if(K_weight<I_weight)
-            R=J; R_weight = J_weight;
+        if(J_weight<K_weight) {
+            L=I;
+            L_weight = I_weight;
+        }
+        if(K_weight<I_weight) {
+            R=J;
+            R_weight = J_weight;
+        }
     }
 
     return A[L];
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:56:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:56: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 1aP9XL-0005qB-NA; Fri, 29 Jan 2016 13:56: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 1aP9XK-0005py-7K
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:30 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	84/DD-03066-D8F6BA65; Fri, 29 Jan 2016 13:56:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1454075787!19047028!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 43533 invoked from network); 29 Jan 2016 13:56:28 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:56:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9YF-0007vG-2G
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9XH-0002gX-G1
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9XH-0002gX-G1@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:56:27 +0000
Subject: [Xen-changelog] [xen master] xenalyze: remove cr3_compare_total
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 87761277d7f079ce278323b45da279f2bd25d31b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 22 14:27:29 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:24:44 2016 +0000

    xenalyze: remove cr3_compare_total
    
    gcc-6 complains:
    xenalyze.c:4132:9: error: 'cr3_compare_total' defined but not used [-Werror=unused-function]
         int cr3_compare_total(const void *_a, const void *_b) {
             ^~~~~~~~~~~~~~~~~
    
    I believe it is correct.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 tools/xentrace/xenalyze.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 4bcaf83..6520790 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -4129,23 +4129,6 @@ void cr3_dump_list(struct cr3_value_struct *head){
     struct cr3_value_struct **qsort_array;
     int i, N=0;
 
-    int cr3_compare_total(const void *_a, const void *_b) {
-        struct cr3_value_struct *a=*(typeof(&a))_a;
-        struct cr3_value_struct *b=*(typeof(&a))_b;
-
-        if(a->total_time.cycles < b->total_time.cycles)
-            return 1;
-        else if(b->total_time.cycles == a->total_time.cycles) {
-            if(a->total_time.count < b->total_time.count)
-                return 1;
-            else if(a->total_time.count == b->total_time.count)
-                return 0;
-            else
-                return -1;
-        } else
-            return -1;
-    }
-
     int cr3_compare_start(const void *_a, const void *_b) {
         struct cr3_value_struct *a=*(typeof(&a))_a;
         struct cr3_value_struct *b=*(typeof(&a))_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 Fri Jan 29 13:56:31 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:56: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 1aP9XL-0005qB-NA; Fri, 29 Jan 2016 13:56: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 1aP9XK-0005py-7K
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:30 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	84/DD-03066-D8F6BA65; Fri, 29 Jan 2016 13:56:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1454075787!19047028!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 43533 invoked from network); 29 Jan 2016 13:56:28 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:56:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9YF-0007vG-2G
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9XH-0002gX-G1
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9XH-0002gX-G1@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:56:27 +0000
Subject: [Xen-changelog] [xen master] xenalyze: remove cr3_compare_total
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 87761277d7f079ce278323b45da279f2bd25d31b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 22 14:27:29 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:24:44 2016 +0000

    xenalyze: remove cr3_compare_total
    
    gcc-6 complains:
    xenalyze.c:4132:9: error: 'cr3_compare_total' defined but not used [-Werror=unused-function]
         int cr3_compare_total(const void *_a, const void *_b) {
             ^~~~~~~~~~~~~~~~~
    
    I believe it is correct.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 tools/xentrace/xenalyze.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 4bcaf83..6520790 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -4129,23 +4129,6 @@ void cr3_dump_list(struct cr3_value_struct *head){
     struct cr3_value_struct **qsort_array;
     int i, N=0;
 
-    int cr3_compare_total(const void *_a, const void *_b) {
-        struct cr3_value_struct *a=*(typeof(&a))_a;
-        struct cr3_value_struct *b=*(typeof(&a))_b;
-
-        if(a->total_time.cycles < b->total_time.cycles)
-            return 1;
-        else if(b->total_time.cycles == a->total_time.cycles) {
-            if(a->total_time.count < b->total_time.count)
-                return 1;
-            else if(a->total_time.count == b->total_time.count)
-                return 0;
-            else
-                return -1;
-        } else
-            return -1;
-    }
-
     int cr3_compare_start(const void *_a, const void *_b) {
         struct cr3_value_struct *a=*(typeof(&a))_a;
         struct cr3_value_struct *b=*(typeof(&a))_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 Fri Jan 29 13:56:43 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:56:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aP9XX-0005rp-Sw; Fri, 29 Jan 2016 13:56:43 +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 1aP9XW-0005rd-AG
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:42 +0000
Content-Length: 1780
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	F9/03-06010-99F6BA65; Fri, 29 Jan 2016 13:56:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1454075798!19083545!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 36500 invoked from network); 29 Jan 2016 13:56:38 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:56:38 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9YP-0007vO-DJ
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9XR-0002hR-Rl
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9XR-0002hR-Rl@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:56:37 +0000
Subject: [Xen-changelog] [xen master] libxl: update comment to no longer
	mention Xen 4.3
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4146389909628653157=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4146389909628653157==
Content-Length: 1360
Content-Transfer-Encoding: quoted-printable

commit 489b62533a66c7ae2c69d0635ea426a09d791fcc
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jan 25 16:25:30 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:25:45 2016 +0000

    libxl: update comment to no longer mention Xen 4.3
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reported by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index b194e65..fc1b558 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2425,8 +2425,8 @@ struct libxl__multidev {
  * provided by qemu) are freed (eg, fds closed) before it shuts down,
  * and no confirmation from a terminating qemu back to the toolstack.
  *
- * This will need to be fixed in Xen 4.3.  In the meantime (Xen 4.2)
- * we implement a bodge.
+ * This will need to be fixed in future Xen versions. In the meantime
+ * (Xen 4.2) we implement a bodge.
  *
  *      WE WANT TO UNPLUG         WE WANT TO SHUT DOWN OR DESTROY
  *                    |                           |
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jan 29 13:56:43 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:56:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1aP9XX-0005rp-Sw; Fri, 29 Jan 2016 13:56:43 +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 1aP9XW-0005rd-AG
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:42 +0000
Content-Length: 1780
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	F9/03-06010-99F6BA65; Fri, 29 Jan 2016 13:56:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1454075798!19083545!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 36500 invoked from network); 29 Jan 2016 13:56:38 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:56:38 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9YP-0007vO-DJ
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9XR-0002hR-Rl
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9XR-0002hR-Rl@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:56:37 +0000
Subject: [Xen-changelog] [xen master] libxl: update comment to no longer
	mention Xen 4.3
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4146389909628653157=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4146389909628653157==
Content-Length: 1360
Content-Transfer-Encoding: quoted-printable

commit 489b62533a66c7ae2c69d0635ea426a09d791fcc
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jan 25 16:25:30 2016 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:25:45 2016 +0000

    libxl: update comment to no longer mention Xen 4.3
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reported by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index b194e65..fc1b558 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2425,8 +2425,8 @@ struct libxl__multidev {
  * provided by qemu) are freed (eg, fds closed) before it shuts down,
  * and no confirmation from a terminating qemu back to the toolstack.
  *
- * This will need to be fixed in Xen 4.3.  In the meantime (Xen 4.2)
- * we implement a bodge.
+ * This will need to be fixed in future Xen versions. In the meantime
+ * (Xen 4.2) we implement a bodge.
  *
  *      WE WANT TO UNPLUG         WE WANT TO SHUT DOWN OR DESTROY
  *                    |                           |
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Fri Jan 29 13:56:52 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:56: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 1aP9Xg-0005xe-1n; Fri, 29 Jan 2016 13:56: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 1aP9Xe-0005uq-A0
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:50 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	1F/60-31122-1AF6BA65; Fri, 29 Jan 2016 13:56:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1454075808!12872571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41195 invoked from network); 29 Jan 2016 13:56:49 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:56:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9YZ-0007vW-Mf
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Xc-0002hp-54
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9Xc-0002hp-54@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:56:48 +0000
Subject: [Xen-changelog] [xen master] libxl: tidy libxl_get_scheduler()
	according to CODING_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 337d298b0a071e55a0d934b9d8861828a35de4e8
Author:     Chester Lin <czylin@uwaterloo.ca>
AuthorDate: Sun Jan 24 19:45:34 2016 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:26:43 2016 +0000

    libxl: tidy libxl_get_scheduler() according to CODING_STYLE
    
    To more closely follow the guidelines in CODING_STYLE, store the result
    of xc_sched_id() in the local variable r, and the check the result of
    the call in a separate statement.  Change the type of the output
    parameter given to xc_sched_id() from libxl_scheduler to int to match
    the libxc interface.
    
    Additionally, change the error log statement to more accurately reflect
    the failure.  This is the only functional change introduced by this
    patch.
    
    Suggested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Chester Lin <czylin@uwaterloo.ca>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2bde0f5..52fefc0 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5580,10 +5580,12 @@ out:
 
 libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx)
 {
-    libxl_scheduler sched, ret;
+    int r, sched;
+
     GC_INIT(ctx);
-    if ((ret = xc_sched_id(ctx->xch, (int *)&sched)) != 0) {
-        LOGE(ERROR, "getting domain info list");
+    r = xc_sched_id(ctx->xch, &sched);
+    if (r != 0) {
+        LOGE(ERROR, "getting current scheduler id");
         return ERROR_FAIL;
         GC_FREE;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jan 29 13:56:52 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:56: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 1aP9Xg-0005xe-1n; Fri, 29 Jan 2016 13:56: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 1aP9Xe-0005uq-A0
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:50 +0000
Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id
	1F/60-31122-1AF6BA65; Fri, 29 Jan 2016 13:56:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1454075808!12872571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41195 invoked from network); 29 Jan 2016 13:56:49 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:56:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9YZ-0007vW-Mf
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Xc-0002hp-54
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9Xc-0002hp-54@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:56:48 +0000
Subject: [Xen-changelog] [xen master] libxl: tidy libxl_get_scheduler()
	according to CODING_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 337d298b0a071e55a0d934b9d8861828a35de4e8
Author:     Chester Lin <czylin@uwaterloo.ca>
AuthorDate: Sun Jan 24 19:45:34 2016 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:26:43 2016 +0000

    libxl: tidy libxl_get_scheduler() according to CODING_STYLE
    
    To more closely follow the guidelines in CODING_STYLE, store the result
    of xc_sched_id() in the local variable r, and the check the result of
    the call in a separate statement.  Change the type of the output
    parameter given to xc_sched_id() from libxl_scheduler to int to match
    the libxc interface.
    
    Additionally, change the error log statement to more accurately reflect
    the failure.  This is the only functional change introduced by this
    patch.
    
    Suggested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Chester Lin <czylin@uwaterloo.ca>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2bde0f5..52fefc0 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5580,10 +5580,12 @@ out:
 
 libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx)
 {
-    libxl_scheduler sched, ret;
+    int r, sched;
+
     GC_INIT(ctx);
-    if ((ret = xc_sched_id(ctx->xch, (int *)&sched)) != 0) {
-        LOGE(ERROR, "getting domain info list");
+    r = xc_sched_id(ctx->xch, &sched);
+    if (r != 0) {
+        LOGE(ERROR, "getting current scheduler id");
         return ERROR_FAIL;
         GC_FREE;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jan 29 13:57:03 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:57: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 1aP9Xr-00067L-5S; Fri, 29 Jan 2016 13:57:03 +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 1aP9Xp-000678-8K
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:01 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	56/3B-29293-CAF6BA65; Fri, 29 Jan 2016 13:57:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1454075818!19036931!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2428 invoked from network); 29 Jan 2016 13:56:59 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:56:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Yk-0007ve-1E
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Xm-0002iD-G3
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9Xm-0002iD-G3@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:56:58 +0000
Subject: [Xen-changelog] [xen master] libxl: make GC_FREE reachable in
	libxl_get_scheduler()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9937763265d9597e5f2439249b16d995842cdf0f
Author:     Chester Lin <czylin@uwaterloo.ca>
AuthorDate: Sun Jan 24 19:45:51 2016 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:27:01 2016 +0000

    libxl: make GC_FREE reachable in libxl_get_scheduler()
    
    Coverity CID 1343309
    
    Make GC_FREE reachable in all cases in libxl_get_scheduler() by
    eliminating the error-path return and instead storing the error code in
    the returned variable.
    
    To make this semantically consistent, change the return type of
    libxl_get_scheduler() from libxl_scheduler to int, and make a note of
    the interpretation of the return value in libxl.h.  N.B. This change
    does not change the API in a way that affects functionality.
    
    The libxl_scheduler enum is consistent with the sched_id return value
    of xc_sched_id and this must continue to be true.
    
    Suggested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Chester Lin <czylin@uwaterloo.ca>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c | 5 ++---
 tools/libxl/libxl.h | 5 ++++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 52fefc0..94b5656 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5578,7 +5578,7 @@ out:
     return rc;
 }
 
-libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx)
+int libxl_get_scheduler(libxl_ctx *ctx)
 {
     int r, sched;
 
@@ -5586,8 +5586,7 @@ libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx)
     r = xc_sched_id(ctx->xch, &sched);
     if (r != 0) {
         LOGE(ERROR, "getting current scheduler id");
-        return ERROR_FAIL;
-        GC_FREE;
+        sched = ERROR_FAIL;
     }
     GC_FREE;
     return sched;
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 156c0d5..fa87f53 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -1716,7 +1716,10 @@ int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
                                   libxl_bitmap *nodemap);
 int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap);
 
-libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx);
+/* A return value less than 0 should be interpreted as a libxl_error, while a
+ * return value greater than or equal to 0 should be interpreted as a
+ * libxl_scheduler. */
+int libxl_get_scheduler(libxl_ctx *ctx);
 
 /* Per-scheduler parameters */
 int libxl_sched_credit_params_get(libxl_ctx *ctx, uint32_t poolid,
--
generated by git-patchbot for /home/xen/git/xen.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 Jan 29 13:57:03 2016
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 Jan 2016 13:57: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 1aP9Xr-00067L-5S; Fri, 29 Jan 2016 13:57:03 +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 1aP9Xp-000678-8K
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:01 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	56/3B-29293-CAF6BA65; Fri, 29 Jan 2016 13:57:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1454075818!19036931!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.35.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2428 invoked from network); 29 Jan 2016 13:56:59 -0000
Received: from 50-57-168-107.static.cloud-ips.com (HELO mail.xen.org)
	(50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jan 2016 13:56:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Yk-0007ve-1E
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:57:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.84)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1aP9Xm-0002iD-G3
	for xen-changelog@lists.xensource.com; Fri, 29 Jan 2016 13:56:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Message-Id: <E1aP9Xm-0002iD-G3@xenbits.xen.org>
Date: Fri, 29 Jan 2016 13:56:58 +0000
Subject: [Xen-changelog] [xen master] libxl: make GC_FREE reachable in
	libxl_get_scheduler()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9937763265d9597e5f2439249b16d995842cdf0f
Author:     Chester Lin <czylin@uwaterloo.ca>
AuthorDate: Sun Jan 24 19:45:51 2016 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:27:01 2016 +0000

    libxl: make GC_FREE reachable in libxl_get_scheduler()
    
    Coverity CID 1343309
    
    Make GC_FREE reachable in all cases in libxl_get_scheduler() by
    eliminating the error-path return and instead storing the error code in
    the returned variable.
    
    To make this semantically consistent, change the return type of
    libxl_get_scheduler() from libxl_scheduler to int, and make a note of
    the interpretation of the return value in libxl.h.  N.B. This change
    does not change the API in a way that affects functionality.
    
    The libxl_scheduler enum is consistent with the sched_id return value
    of xc_sched_id and this must continue to be true.
    
    Suggested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Chester Lin <czylin@uwaterloo.ca>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c | 5 ++---
 tools/libxl/libxl.h | 5 ++++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 52fefc0..94b5656 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5578,7 +5578,7 @@ out:
     return rc;
 }
 
-libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx)
+int libxl_get_scheduler(libxl_ctx *ctx)
 {
     int r, sched;
 
@@ -5586,8 +5586,7 @@ libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx)
     r = xc_sched_id(ctx->xch, &sched);
     if (r != 0) {
         LOGE(ERROR, "getting current scheduler id");
-        return ERROR_FAIL;
-        GC_FREE;
+        sched = ERROR_FAIL;
     }
     GC_FREE;
     return sched;
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 156c0d5..fa87f53 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -1716,7 +1716,10 @@ int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
                                   libxl_bitmap *nodemap);
 int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap);
 
-libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx);
+/* A return value less than 0 should be interpreted as a libxl_error, while a
+ * return value greater than or equal to 0 should be interpreted as a
+ * libxl_scheduler. */
+int libxl_get_scheduler(libxl_ctx *ctx);
 
 /* Per-scheduler parameters */
 int libxl_sched_credit_params_get(libxl_ctx *ctx, uint32_t poolid,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

