From xen-changelog-bounces@lists.xen.org Tue Oct 01 01:55:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 01: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 1VQpB8-0006QD-At; Tue, 01 Oct 2013 01:55: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 1VQpB5-0006Q3-V1
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:08 +0000
Received: from [85.158.139.211:44055] by server-6.bemta-5.messagelabs.com id
	66/92-05559-A7B2A425; Tue, 01 Oct 2013 01:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1380592504!3678190!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10575 invoked from network); 1 Oct 2013 01:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 01:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpB1-0000Hl-Vg
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpB1-0007aR-MI
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:03 +0000
Date: Tue, 01 Oct 2013 01:55:03 +0000
Message-Id: <E1VQpB1-0007aR-MI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: properly handle
	hvm_copy_from_guest_{phys, virt}() errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 43aef4c11dcd40de6a91eb3483a0922d894e5eee
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 14:22:37 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:22:37 2013 +0200

    x86: properly handle hvm_copy_from_guest_{phys,virt}() errors
    
    Ignoring them generally implies using uninitialized data and, in all
    but two of the cases dealt with here, potentially leaking hypervisor
    stack contents to guests.
    
    This is CVE-2013-4355 / XSA-63.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6bb838e7375f5b031e9ac346b353775c90de45dc
    master date: 2013-09-30 14:17:46 +0200
---
 xen/arch/x86/hvm/hvm.c          |   18 ++++---------
 xen/arch/x86/hvm/intercept.c    |   49 +++++++++++++++++++++++++++++++-------
 xen/arch/x86/hvm/io.c           |   24 +++++++++++++-----
 xen/arch/x86/hvm/vmx/realmode.c |    6 ++--
 4 files changed, 66 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 20ff58c..4cf503b 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2316,11 +2316,7 @@ void hvm_task_switch(
 
     rc = hvm_copy_from_guest_virt(
         &tss, prev_tr.base, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    if ( rc == HVMCOPY_gfn_shared )
+    if ( rc != HVMCOPY_okay )
         goto out;
 
     eflags = regs->eflags;
@@ -2365,13 +2361,11 @@ void hvm_task_switch(
 
     rc = hvm_copy_from_guest_virt(
         &tss, tr.base, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    /* Note: this could be optimised, if the callee functions knew we want RO
-     * access */
-    if ( rc == HVMCOPY_gfn_shared )
+    /*
+     * Note: The HVMCOPY_gfn_shared case could be optimised, if the callee
+     * functions knew we want RO access.
+     */
+    if ( rc != HVMCOPY_okay )
         goto out;
 
 
diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c
index 85caa0c..5bb1c17 100644
--- a/xen/arch/x86/hvm/intercept.c
+++ b/xen/arch/x86/hvm/intercept.c
@@ -87,17 +87,28 @@ static int hvm_mmio_access(struct vcpu *v,
     {
         for ( i = 0; i < p->count; i++ )
         {
-            int ret;
-
-            ret = hvm_copy_from_guest_phys(&data,
-                                           p->data + (sign * i * p->size),
-                                           p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) || 
-                 (ret == HVMCOPY_gfn_shared) )
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
             {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 rc = X86EMUL_RETRY;
                 break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
             }
+            if ( rc != X86EMUL_OKAY )
+                break;
             rc = write_handler(v, p->addr + (sign * i * p->size), p->size,
                                data);
             if ( rc != X86EMUL_OKAY )
@@ -165,8 +176,28 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
         for ( i = 0; i < p->count; i++ )
         {
             data = 0;
-            (void)hvm_copy_from_guest_phys(&data, p->data + sign*i*p->size,
-                                           p->size);
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
+                rc = X86EMUL_RETRY;
+                break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
+            }
+            if ( rc != X86EMUL_OKAY )
+                break;
             rc = action(IOREQ_WRITE, p->addr, p->size, &data);
             if ( rc != X86EMUL_OKAY )
                 break;
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 4ae2c0c..5f5009a 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -340,14 +340,24 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
         data = p->data;
         if ( p->data_is_ptr )
         {
-            int ret;
-            
-            ret = hvm_copy_from_guest_phys(&data, 
-                                           p->data + (sign * i * p->size),
-                                           p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) &&
-                 (ret == HVMCOPY_gfn_shared) )
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 return X86EMUL_RETRY;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                return X86EMUL_UNHANDLEABLE;
+            }
         }
 
         switch ( p->size )
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c
index ce7a13b..a942b70 100644
--- a/xen/arch/x86/hvm/vmx/realmode.c
+++ b/xen/arch/x86/hvm/vmx/realmode.c
@@ -39,7 +39,9 @@ static void realmode_deliver_exception(
 
  again:
     last_byte = (vector * 4) + 3;
-    if ( idtr->limit < last_byte )
+    if ( idtr->limit < last_byte ||
+         hvm_copy_from_guest_phys(&cs_eip, idtr->base + vector * 4, 4) !=
+         HVMCOPY_okay )
     {
         /* Software interrupt? */
         if ( insn_len != 0 )
@@ -64,8 +66,6 @@ static void realmode_deliver_exception(
         }
     }
 
-    (void)hvm_copy_from_guest_phys(&cs_eip, idtr->base + vector * 4, 4);
-
     frame[0] = regs->eip + insn_len;
     frame[1] = csr->sel;
     frame[2] = regs->eflags & ~X86_EFLAGS_RF;
--
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 Tue Oct 01 01:55:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 01: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 1VQpB8-0006QD-At; Tue, 01 Oct 2013 01:55: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 1VQpB5-0006Q3-V1
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:08 +0000
Received: from [85.158.139.211:44055] by server-6.bemta-5.messagelabs.com id
	66/92-05559-A7B2A425; Tue, 01 Oct 2013 01:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1380592504!3678190!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10575 invoked from network); 1 Oct 2013 01:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 01:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpB1-0000Hl-Vg
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpB1-0007aR-MI
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:03 +0000
Date: Tue, 01 Oct 2013 01:55:03 +0000
Message-Id: <E1VQpB1-0007aR-MI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: properly handle
	hvm_copy_from_guest_{phys, virt}() errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 43aef4c11dcd40de6a91eb3483a0922d894e5eee
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 14:22:37 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:22:37 2013 +0200

    x86: properly handle hvm_copy_from_guest_{phys,virt}() errors
    
    Ignoring them generally implies using uninitialized data and, in all
    but two of the cases dealt with here, potentially leaking hypervisor
    stack contents to guests.
    
    This is CVE-2013-4355 / XSA-63.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6bb838e7375f5b031e9ac346b353775c90de45dc
    master date: 2013-09-30 14:17:46 +0200
---
 xen/arch/x86/hvm/hvm.c          |   18 ++++---------
 xen/arch/x86/hvm/intercept.c    |   49 +++++++++++++++++++++++++++++++-------
 xen/arch/x86/hvm/io.c           |   24 +++++++++++++-----
 xen/arch/x86/hvm/vmx/realmode.c |    6 ++--
 4 files changed, 66 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 20ff58c..4cf503b 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2316,11 +2316,7 @@ void hvm_task_switch(
 
     rc = hvm_copy_from_guest_virt(
         &tss, prev_tr.base, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    if ( rc == HVMCOPY_gfn_shared )
+    if ( rc != HVMCOPY_okay )
         goto out;
 
     eflags = regs->eflags;
@@ -2365,13 +2361,11 @@ void hvm_task_switch(
 
     rc = hvm_copy_from_guest_virt(
         &tss, tr.base, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    /* Note: this could be optimised, if the callee functions knew we want RO
-     * access */
-    if ( rc == HVMCOPY_gfn_shared )
+    /*
+     * Note: The HVMCOPY_gfn_shared case could be optimised, if the callee
+     * functions knew we want RO access.
+     */
+    if ( rc != HVMCOPY_okay )
         goto out;
 
 
diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c
index 85caa0c..5bb1c17 100644
--- a/xen/arch/x86/hvm/intercept.c
+++ b/xen/arch/x86/hvm/intercept.c
@@ -87,17 +87,28 @@ static int hvm_mmio_access(struct vcpu *v,
     {
         for ( i = 0; i < p->count; i++ )
         {
-            int ret;
-
-            ret = hvm_copy_from_guest_phys(&data,
-                                           p->data + (sign * i * p->size),
-                                           p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) || 
-                 (ret == HVMCOPY_gfn_shared) )
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
             {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 rc = X86EMUL_RETRY;
                 break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
             }
+            if ( rc != X86EMUL_OKAY )
+                break;
             rc = write_handler(v, p->addr + (sign * i * p->size), p->size,
                                data);
             if ( rc != X86EMUL_OKAY )
@@ -165,8 +176,28 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
         for ( i = 0; i < p->count; i++ )
         {
             data = 0;
-            (void)hvm_copy_from_guest_phys(&data, p->data + sign*i*p->size,
-                                           p->size);
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
+                rc = X86EMUL_RETRY;
+                break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
+            }
+            if ( rc != X86EMUL_OKAY )
+                break;
             rc = action(IOREQ_WRITE, p->addr, p->size, &data);
             if ( rc != X86EMUL_OKAY )
                 break;
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 4ae2c0c..5f5009a 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -340,14 +340,24 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
         data = p->data;
         if ( p->data_is_ptr )
         {
-            int ret;
-            
-            ret = hvm_copy_from_guest_phys(&data, 
-                                           p->data + (sign * i * p->size),
-                                           p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) &&
-                 (ret == HVMCOPY_gfn_shared) )
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 return X86EMUL_RETRY;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                return X86EMUL_UNHANDLEABLE;
+            }
         }
 
         switch ( p->size )
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c
index ce7a13b..a942b70 100644
--- a/xen/arch/x86/hvm/vmx/realmode.c
+++ b/xen/arch/x86/hvm/vmx/realmode.c
@@ -39,7 +39,9 @@ static void realmode_deliver_exception(
 
  again:
     last_byte = (vector * 4) + 3;
-    if ( idtr->limit < last_byte )
+    if ( idtr->limit < last_byte ||
+         hvm_copy_from_guest_phys(&cs_eip, idtr->base + vector * 4, 4) !=
+         HVMCOPY_okay )
     {
         /* Software interrupt? */
         if ( insn_len != 0 )
@@ -64,8 +66,6 @@ static void realmode_deliver_exception(
         }
     }
 
-    (void)hvm_copy_from_guest_phys(&cs_eip, idtr->base + vector * 4, 4);
-
     frame[0] = regs->eip + insn_len;
     frame[1] = csr->sel;
     frame[2] = regs->eflags & ~X86_EFLAGS_RF;
--
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 Tue Oct 01 01:55:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQpBG-0006Qb-E0; Tue, 01 Oct 2013 01: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 1VQpBF-0006QQ-7F
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:17 +0000
Received: from [193.109.254.147:42777] by server-13.bemta-14.messagelabs.com
	id E7/F1-01215-48B2A425; Tue, 01 Oct 2013 01:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1380592514!2162314!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11207 invoked from network); 1 Oct 2013 01:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 01:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpBC-0000Ho-8i
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpBC-0007ap-35
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:14 +0000
Date: Tue, 01 Oct 2013 01:55:14 +0000
Message-Id: <E1VQpBC-0007ap-35@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/mm/shadow: Fix initialization
	of PV shadow L4 tables.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0155524aa6bf4ea4947c865dee4b13dd3dec6427
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Mon Sep 30 14:23:33 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:23:33 2013 +0200

    x86/mm/shadow: Fix initialization of PV shadow L4 tables.
    
    Shadowed PV L4 tables must have the same Xen mappings as their
    unshadowed equivalent.  This is done by copying the Xen entries
    verbatim from the idle pagetable, and then using guest_l4_slot()
    in the SHADOW_FOREACH_L4E() iterator to avoid touching those entries.
    
    adc5afbf1c70ef55c260fb93e4b8ce5ccb918706 (x86: support up to 16Tb)
    changed the definition of ROOT_PAGETABLE_XEN_SLOTS to extend right to
    the top of the address space, which causes the shadow code to
    copy Xen mappings into guest-kernel-address slots too.
    
    In the common case, all those slots are zero in the idle pagetable,
    and no harm is done.  But if any slot above #271 is non-zero, Xen will
    crash when that slot is later cleared (it attempts to drop
    shadow-pagetable refcounts on its own L4 pagetables).
    
    Fix by using the new ROOT_PAGETABLE_PV_XEN_SLOTS when appropriate.
    Monitor pagetables need the full Xen mappings, so they keep using the
    old name (with its new semantics).
    
    This is CVE-2013-4356 / XSA-64.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: f46befdd825c8a459c5eb21adb7d5b0dc6e30ad5
    master date: 2013-09-30 14:18:25 +0200
---
 xen/arch/x86/mm/shadow/multi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 4c4c2ba..3fed0b6 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1433,15 +1433,19 @@ void sh_install_xen_entries_in_l4(struct vcpu *v, mfn_t gl4mfn, mfn_t sl4mfn)
 {
     struct domain *d = v->domain;
     shadow_l4e_t *sl4e;
+    unsigned int slots;
 
     sl4e = sh_map_domain_page(sl4mfn);
     ASSERT(sl4e != NULL);
     ASSERT(sizeof (l4_pgentry_t) == sizeof (shadow_l4e_t));
     
     /* Copy the common Xen mappings from the idle domain */
+    slots = (shadow_mode_external(d)
+             ? ROOT_PAGETABLE_XEN_SLOTS
+             : ROOT_PAGETABLE_PV_XEN_SLOTS);
     memcpy(&sl4e[ROOT_PAGETABLE_FIRST_XEN_SLOT],
            &idle_pg_table[ROOT_PAGETABLE_FIRST_XEN_SLOT],
-           ROOT_PAGETABLE_XEN_SLOTS * sizeof(l4_pgentry_t));
+           slots * sizeof(l4_pgentry_t));
 
     /* Install the per-domain mappings for this domain */
     sl4e[shadow_l4_table_offset(PERDOMAIN_VIRT_START)] =
--
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 Tue Oct 01 01:55:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQpBG-0006Qb-E0; Tue, 01 Oct 2013 01: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 1VQpBF-0006QQ-7F
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:17 +0000
Received: from [193.109.254.147:42777] by server-13.bemta-14.messagelabs.com
	id E7/F1-01215-48B2A425; Tue, 01 Oct 2013 01:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1380592514!2162314!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11207 invoked from network); 1 Oct 2013 01:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 01:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpBC-0000Ho-8i
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpBC-0007ap-35
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:14 +0000
Date: Tue, 01 Oct 2013 01:55:14 +0000
Message-Id: <E1VQpBC-0007ap-35@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/mm/shadow: Fix initialization
	of PV shadow L4 tables.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0155524aa6bf4ea4947c865dee4b13dd3dec6427
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Mon Sep 30 14:23:33 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:23:33 2013 +0200

    x86/mm/shadow: Fix initialization of PV shadow L4 tables.
    
    Shadowed PV L4 tables must have the same Xen mappings as their
    unshadowed equivalent.  This is done by copying the Xen entries
    verbatim from the idle pagetable, and then using guest_l4_slot()
    in the SHADOW_FOREACH_L4E() iterator to avoid touching those entries.
    
    adc5afbf1c70ef55c260fb93e4b8ce5ccb918706 (x86: support up to 16Tb)
    changed the definition of ROOT_PAGETABLE_XEN_SLOTS to extend right to
    the top of the address space, which causes the shadow code to
    copy Xen mappings into guest-kernel-address slots too.
    
    In the common case, all those slots are zero in the idle pagetable,
    and no harm is done.  But if any slot above #271 is non-zero, Xen will
    crash when that slot is later cleared (it attempts to drop
    shadow-pagetable refcounts on its own L4 pagetables).
    
    Fix by using the new ROOT_PAGETABLE_PV_XEN_SLOTS when appropriate.
    Monitor pagetables need the full Xen mappings, so they keep using the
    old name (with its new semantics).
    
    This is CVE-2013-4356 / XSA-64.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: f46befdd825c8a459c5eb21adb7d5b0dc6e30ad5
    master date: 2013-09-30 14:18:25 +0200
---
 xen/arch/x86/mm/shadow/multi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 4c4c2ba..3fed0b6 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1433,15 +1433,19 @@ void sh_install_xen_entries_in_l4(struct vcpu *v, mfn_t gl4mfn, mfn_t sl4mfn)
 {
     struct domain *d = v->domain;
     shadow_l4e_t *sl4e;
+    unsigned int slots;
 
     sl4e = sh_map_domain_page(sl4mfn);
     ASSERT(sl4e != NULL);
     ASSERT(sizeof (l4_pgentry_t) == sizeof (shadow_l4e_t));
     
     /* Copy the common Xen mappings from the idle domain */
+    slots = (shadow_mode_external(d)
+             ? ROOT_PAGETABLE_XEN_SLOTS
+             : ROOT_PAGETABLE_PV_XEN_SLOTS);
     memcpy(&sl4e[ROOT_PAGETABLE_FIRST_XEN_SLOT],
            &idle_pg_table[ROOT_PAGETABLE_FIRST_XEN_SLOT],
-           ROOT_PAGETABLE_XEN_SLOTS * sizeof(l4_pgentry_t));
+           slots * sizeof(l4_pgentry_t));
 
     /* Install the per-domain mappings for this domain */
     sl4e[shadow_l4_table_offset(PERDOMAIN_VIRT_START)] =
--
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 Tue Oct 01 01:55:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 01:55:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQpBQ-0006Rr-Gu; Tue, 01 Oct 2013 01:55:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpBP-0006Rd-Ca
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:27 +0000
Received: from [85.158.139.211:26721] by server-15.bemta-5.messagelabs.com id
	B3/5D-01145-E8B2A425; Tue, 01 Oct 2013 01:55:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1380592524!5585612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17924 invoked from network); 1 Oct 2013 01:55:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 01:55:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpBM-0000Hu-I2
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpBM-0007bB-Ct
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:24 +0000
Date: Tue, 01 Oct 2013 01:55:24 +0000
Message-Id: <E1VQpBM-0007bB-Ct@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: properly set up fbld
	emulation operand 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 ec8cda7355419ef4131bafb77212bd983322dacb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 14:24:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:24:25 2013 +0200

    x86: properly set up fbld emulation operand address
    
    This is CVE-2013-4361 / XSA-66.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    master commit: 28b706efb6abb637fabfd74cde70a50935a5640b
    master date: 2013-09-30 14:18:58 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 8794b82..e390c2a 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3156,11 +3156,11 @@ x86_emulate(
                 break;
             case 4: /* fbld m80dec */
                 ea.bytes = 10;
-                dst = ea;
+                src = ea;
                 if ( (rc = ops->read(src.mem.seg, src.mem.off,
                                      &src.val, src.bytes, ctxt)) != 0 )
                     goto done;
-                emulate_fpu_insn_memdst("fbld", src.val);
+                emulate_fpu_insn_memsrc("fbld", src.val);
                 break;
             case 5: /* fild m64i */
                 ea.bytes = 8;
--
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 Tue Oct 01 01:55:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 01:55:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQpBQ-0006Rr-Gu; Tue, 01 Oct 2013 01:55:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpBP-0006Rd-Ca
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:27 +0000
Received: from [85.158.139.211:26721] by server-15.bemta-5.messagelabs.com id
	B3/5D-01145-E8B2A425; Tue, 01 Oct 2013 01:55:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1380592524!5585612!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17924 invoked from network); 1 Oct 2013 01:55:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 01:55:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpBM-0000Hu-I2
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQpBM-0007bB-Ct
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 01:55:24 +0000
Date: Tue, 01 Oct 2013 01:55:24 +0000
Message-Id: <E1VQpBM-0007bB-Ct@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: properly set up fbld
	emulation operand 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 ec8cda7355419ef4131bafb77212bd983322dacb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 14:24:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:24:25 2013 +0200

    x86: properly set up fbld emulation operand address
    
    This is CVE-2013-4361 / XSA-66.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    master commit: 28b706efb6abb637fabfd74cde70a50935a5640b
    master date: 2013-09-30 14:18:58 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 8794b82..e390c2a 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3156,11 +3156,11 @@ x86_emulate(
                 break;
             case 4: /* fbld m80dec */
                 ea.bytes = 10;
-                dst = ea;
+                src = ea;
                 if ( (rc = ops->read(src.mem.seg, src.mem.off,
                                      &src.val, src.bytes, ctxt)) != 0 )
                     goto done;
-                emulate_fpu_insn_memdst("fbld", src.val);
+                emulate_fpu_insn_memsrc("fbld", src.val);
                 break;
             case 5: /* fild m64i */
                 ea.bytes = 8;
--
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 Tue Oct 01 06:55:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQtrQ-0002ar-K3; Tue, 01 Oct 2013 06:55: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 1VQtrP-0002aX-6t
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:07 +0000
Received: from [85.158.143.35:60672] by server-2.bemta-4.messagelabs.com id
	42/8C-31802-AC17A425; Tue, 01 Oct 2013 06:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1380610505!7754395!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21087 invoked from network); 1 Oct 2013 06:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrM-0005h6-EA
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrL-00078c-Mu
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:03 +0000
Date: Tue, 01 Oct 2013 06:55:03 +0000
Message-Id: <E1VQtrL-00078c-Mu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Nested VMX: Expose unrestricted guest
	feature to 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 eb68feea83c9d299c82ef673dd73aa04265292db
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Mon Sep 30 13:58:48 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 13:58:48 2013 +0200

    Nested VMX: Expose unrestricted guest feature to guest
    
    With virtual unrestricted guest feature, L2 guest is allowed to run
    with PG cleared. Also, allow PAE not set during virtual vmexit emulation.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Eddie.Dong@intel.com
---
 xen/arch/x86/hvm/hvm.c      |    3 ++-
 xen/arch/x86/hvm/vmx/vvmx.c |    3 +++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index e0e0f5d..150b0ec 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1732,7 +1732,8 @@ int hvm_set_cr0(unsigned long value)
     {
         if ( v->arch.hvm_vcpu.guest_efer & EFER_LME )
         {
-            if ( !(v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_PAE) )
+            if ( !(v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_PAE) &&
+                 !nestedhvm_vmswitch_in_progress(v) )
             {
                 HVM_DBG_LOG(DBG_LEVEL_1, "Enable paging before PAE enable");
                 goto gpf;
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index ba617fa..d476f03 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1342,6 +1342,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
 
     nestedhvm_vcpu_exit_guestmode(v);
     nvcpu->nv_vmexit_pending = 0;
+    nvcpu->nv_vmswitch_in_progress = 1;
 
     lm_l2 = !!hvm_long_mode_enabled(v);
     lm_l1 = !!(__get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS) &
@@ -1372,6 +1373,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
     if ( cpu_has_vmx_virtual_intr_delivery )
         nvmx_update_apicv(v);
 
+    nvcpu->nv_vmswitch_in_progress = 0;
     vmreturn(regs, VMSUCCEED);
 }
 
@@ -1877,6 +1879,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         data = SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING |
                SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
                SECONDARY_EXEC_ENABLE_VPID |
+               SECONDARY_EXEC_UNRESTRICTED_GUEST |
                SECONDARY_EXEC_ENABLE_EPT;
         data = gen_vmx_msr(data, 0, host_data);
         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 Oct 01 06:55:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQtrQ-0002ar-K3; Tue, 01 Oct 2013 06:55: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 1VQtrP-0002aX-6t
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:07 +0000
Received: from [85.158.143.35:60672] by server-2.bemta-4.messagelabs.com id
	42/8C-31802-AC17A425; Tue, 01 Oct 2013 06:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1380610505!7754395!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21087 invoked from network); 1 Oct 2013 06:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrM-0005h6-EA
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrL-00078c-Mu
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:03 +0000
Date: Tue, 01 Oct 2013 06:55:03 +0000
Message-Id: <E1VQtrL-00078c-Mu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Nested VMX: Expose unrestricted guest
	feature to 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 eb68feea83c9d299c82ef673dd73aa04265292db
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Mon Sep 30 13:58:48 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 13:58:48 2013 +0200

    Nested VMX: Expose unrestricted guest feature to guest
    
    With virtual unrestricted guest feature, L2 guest is allowed to run
    with PG cleared. Also, allow PAE not set during virtual vmexit emulation.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Eddie.Dong@intel.com
---
 xen/arch/x86/hvm/hvm.c      |    3 ++-
 xen/arch/x86/hvm/vmx/vvmx.c |    3 +++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index e0e0f5d..150b0ec 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1732,7 +1732,8 @@ int hvm_set_cr0(unsigned long value)
     {
         if ( v->arch.hvm_vcpu.guest_efer & EFER_LME )
         {
-            if ( !(v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_PAE) )
+            if ( !(v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_PAE) &&
+                 !nestedhvm_vmswitch_in_progress(v) )
             {
                 HVM_DBG_LOG(DBG_LEVEL_1, "Enable paging before PAE enable");
                 goto gpf;
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index ba617fa..d476f03 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1342,6 +1342,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
 
     nestedhvm_vcpu_exit_guestmode(v);
     nvcpu->nv_vmexit_pending = 0;
+    nvcpu->nv_vmswitch_in_progress = 1;
 
     lm_l2 = !!hvm_long_mode_enabled(v);
     lm_l1 = !!(__get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS) &
@@ -1372,6 +1373,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
     if ( cpu_has_vmx_virtual_intr_delivery )
         nvmx_update_apicv(v);
 
+    nvcpu->nv_vmswitch_in_progress = 0;
     vmreturn(regs, VMSUCCEED);
 }
 
@@ -1877,6 +1879,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         data = SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING |
                SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
                SECONDARY_EXEC_ENABLE_VPID |
+               SECONDARY_EXEC_UNRESTRICTED_GUEST |
                SECONDARY_EXEC_ENABLE_EPT;
         data = gen_vmx_msr(data, 0, host_data);
         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 Oct 01 06:55:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:55:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQtrb-0002c8-N8; Tue, 01 Oct 2013 06:55: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 1VQtra-0002bc-Gv
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:18 +0000
Received: from [85.158.143.35:63675] by server-2.bemta-4.messagelabs.com id
	31/CC-31802-5D17A425; Tue, 01 Oct 2013 06:55:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1380610515!1505897!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31205 invoked from network); 1 Oct 2013 06:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrW-0005h9-Uu
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrW-00079p-KB
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:14 +0000
Date: Tue, 01 Oct 2013 06:55:14 +0000
Message-Id: <E1VQtrW-00079p-KB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cpupools: update domU's node-affinity
	on the cpupool_unassign_cpu() path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 93be8285a79c6cbbf66c8681fec1d1bfb71d84cc
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Sep 30 13:59:47 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 13:59:47 2013 +0200

    cpupools: update domU's node-affinity on the cpupool_unassign_cpu() path
    
    that is, when a cpu is remove from a pool, as it is happening already
    on the cpupool_assign_cpu_*() path (i.e., when a cpu is added to a
    pool).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
---
 xen/common/cpupool.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 2164a9f..933de78 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -355,6 +355,12 @@ int cpupool_unassign_cpu(struct cpupool *c, unsigned int cpu)
     atomic_inc(&c->refcnt);
     cpupool_cpu_moving = c;
     cpumask_clear_cpu(cpu, c->cpu_valid);
+
+    rcu_read_lock(&domlist_read_lock);
+    for_each_domain_in_cpupool(d, c)
+        domain_update_node_affinity(d);
+    rcu_read_unlock(&domlist_read_lock);
+
     spin_unlock(&cpupool_lock);
 
     work_cpu = smp_processor_id();
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 06:55:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:55:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQtrb-0002c8-N8; Tue, 01 Oct 2013 06:55: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 1VQtra-0002bc-Gv
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:18 +0000
Received: from [85.158.143.35:63675] by server-2.bemta-4.messagelabs.com id
	31/CC-31802-5D17A425; Tue, 01 Oct 2013 06:55:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1380610515!1505897!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31205 invoked from network); 1 Oct 2013 06:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrW-0005h9-Uu
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrW-00079p-KB
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:14 +0000
Date: Tue, 01 Oct 2013 06:55:14 +0000
Message-Id: <E1VQtrW-00079p-KB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cpupools: update domU's node-affinity
	on the cpupool_unassign_cpu() path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 93be8285a79c6cbbf66c8681fec1d1bfb71d84cc
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Sep 30 13:59:47 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 13:59:47 2013 +0200

    cpupools: update domU's node-affinity on the cpupool_unassign_cpu() path
    
    that is, when a cpu is remove from a pool, as it is happening already
    on the cpupool_assign_cpu_*() path (i.e., when a cpu is added to a
    pool).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
---
 xen/common/cpupool.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 2164a9f..933de78 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -355,6 +355,12 @@ int cpupool_unassign_cpu(struct cpupool *c, unsigned int cpu)
     atomic_inc(&c->refcnt);
     cpupool_cpu_moving = c;
     cpumask_clear_cpu(cpu, c->cpu_valid);
+
+    rcu_read_lock(&domlist_read_lock);
+    for_each_domain_in_cpupool(d, c)
+        domain_update_node_affinity(d);
+    rcu_read_unlock(&domlist_read_lock);
+
     spin_unlock(&cpupool_lock);
 
     work_cpu = smp_processor_id();
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 06:55:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQtrl-0002di-Q3; Tue, 01 Oct 2013 06:55: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 1VQtrk-0002dB-2f
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:28 +0000
Received: from [85.158.139.211:27241] by server-2.bemta-5.messagelabs.com id
	02/68-26841-FD17A425; Tue, 01 Oct 2013 06:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1380610525!5612193!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9335 invoked from network); 1 Oct 2013 06:55:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:55:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrh-0005hF-3I
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrh-0007AB-1L
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:25 +0000
Date: Tue, 01 Oct 2013 06:55:25 +0000
Message-Id: <E1VQtrh-0007AB-1L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD-Vi: Fix IVRS HPET
	special->handle override
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a6b415d5212af68249ddf41a20dfc3998c8d670
Author:     Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
AuthorDate: Mon Sep 30 14:00:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:00:44 2013 +0200

    x86/AMD-Vi: Fix IVRS HPET special->handle override
    
    The current logic does not handle the case when HPET special->handle
    is invalid in IVRS. On such system, the following message is shown:
    
    (XEN) AMD-Vi: Failed to setup HPET MSI remapping: Wrong HPET
    
    This patch will allow the ivrs_hpet[<handle>]=<sbdf> to override the
    IVRS.  Also, it removes struct hpet_sbdf.iommu since it is not
    used anywhere in the code.
    
    Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 xen/drivers/passthrough/amd/iommu_acpi.c      |   28 ++++++++++++++++---------
 xen/drivers/passthrough/amd/iommu_intr.c      |   12 ++++++++--
 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h |    7 ++++-
 3 files changed, 32 insertions(+), 15 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthrough/amd/iommu_acpi.c
index c3b9631..fca2037 100644
--- a/xen/drivers/passthrough/amd/iommu_acpi.c
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c
@@ -674,7 +674,7 @@ static void __init parse_ivrs_hpet(char *str)
     hpet_sbdf.id = id;
     hpet_sbdf.bdf = PCI_BDF(bus, dev, func);
     hpet_sbdf.seg = seg;
-    hpet_sbdf.cmdline = 1;
+    hpet_sbdf.init = HPET_CMDL;
 }
 custom_param("ivrs_hpet[", parse_ivrs_hpet);
 
@@ -789,20 +789,28 @@ static u16 __init parse_ivhd_device_special(
         }
         break;
     case ACPI_IVHD_HPET:
-        /* set device id of hpet */
-        if ( hpet_sbdf.iommu ||
-             (hpet_sbdf.cmdline && hpet_sbdf.id != special->handle) )
+        switch (hpet_sbdf.init)
         {
-            printk(XENLOG_WARNING "Only one IVHD HPET entry is supported\n");
+        case HPET_IVHD:
+            printk(XENLOG_WARNING "Only one IVHD HPET entry is supported.\n");
             break;
-        }
-        hpet_sbdf.id = special->handle;
-        if ( !hpet_sbdf.cmdline )
-        {
+        case HPET_CMDL:
+            AMD_IOMMU_DEBUG("IVHD: Command line override present for HPET %#x "
+                            "(IVRS: %#x devID %04x:%02x:%02x.%u)\n",
+                            hpet_sbdf.id, special->handle, seg, PCI_BUS(bdf),
+                            PCI_SLOT(bdf), PCI_FUNC(bdf));
+            break;
+        case HPET_NONE:
+            /* set device id of hpet */
+            hpet_sbdf.id = special->handle;
             hpet_sbdf.bdf = bdf;
             hpet_sbdf.seg = seg;
+            hpet_sbdf.init = HPET_IVHD;
+            break;
+        default:
+            ASSERT(0);
+            break;
         }
-        hpet_sbdf.iommu = iommu;
         break;
     default:
         printk(XENLOG_ERR "Unrecognized IVHD special variety %#x\n",
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 213f4d7..c1b76fb 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -598,10 +598,16 @@ int __init amd_setup_hpet_msi(struct msi_desc *msi_desc)
     unsigned long flags;
     int rc = 0;
 
-    if ( msi_desc->hpet_id != hpet_sbdf.id || !hpet_sbdf.iommu )
+    if ( hpet_sbdf.init == HPET_NONE )
     {
-        AMD_IOMMU_DEBUG("Failed to setup HPET MSI remapping: %s\n",
-                        hpet_sbdf.iommu ? "Wrong HPET" : "No IOMMU");
+        AMD_IOMMU_DEBUG("Failed to setup HPET MSI remapping."
+                        " Missing IVRS HPET info.\n");
+        return -ENODEV;
+    }
+    if ( msi_desc->hpet_id != hpet_sbdf.id )
+    {
+        AMD_IOMMU_DEBUG("Failed to setup HPET MSI remapping."
+                        " Wrong HPET.\n");
         return -ENODEV;
     }
 
diff --git a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
index 3e6961d..b5abc8f 100644
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
@@ -108,8 +108,11 @@ extern struct ioapic_sbdf {
 
 extern struct hpet_sbdf {
     u16 bdf, seg, id;
-    bool_t cmdline;
-    struct amd_iommu *iommu;
+    enum {
+        HPET_NONE,
+        HPET_CMDL,
+        HPET_IVHD,
+    } init;
 } hpet_sbdf;
 
 extern void *shared_intremap_table;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 06:55:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQtrl-0002di-Q3; Tue, 01 Oct 2013 06:55: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 1VQtrk-0002dB-2f
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:28 +0000
Received: from [85.158.139.211:27241] by server-2.bemta-5.messagelabs.com id
	02/68-26841-FD17A425; Tue, 01 Oct 2013 06:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1380610525!5612193!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9335 invoked from network); 1 Oct 2013 06:55:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:55:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrh-0005hF-3I
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrh-0007AB-1L
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:25 +0000
Date: Tue, 01 Oct 2013 06:55:25 +0000
Message-Id: <E1VQtrh-0007AB-1L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD-Vi: Fix IVRS HPET
	special->handle override
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a6b415d5212af68249ddf41a20dfc3998c8d670
Author:     Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
AuthorDate: Mon Sep 30 14:00:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:00:44 2013 +0200

    x86/AMD-Vi: Fix IVRS HPET special->handle override
    
    The current logic does not handle the case when HPET special->handle
    is invalid in IVRS. On such system, the following message is shown:
    
    (XEN) AMD-Vi: Failed to setup HPET MSI remapping: Wrong HPET
    
    This patch will allow the ivrs_hpet[<handle>]=<sbdf> to override the
    IVRS.  Also, it removes struct hpet_sbdf.iommu since it is not
    used anywhere in the code.
    
    Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 xen/drivers/passthrough/amd/iommu_acpi.c      |   28 ++++++++++++++++---------
 xen/drivers/passthrough/amd/iommu_intr.c      |   12 ++++++++--
 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h |    7 ++++-
 3 files changed, 32 insertions(+), 15 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthrough/amd/iommu_acpi.c
index c3b9631..fca2037 100644
--- a/xen/drivers/passthrough/amd/iommu_acpi.c
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c
@@ -674,7 +674,7 @@ static void __init parse_ivrs_hpet(char *str)
     hpet_sbdf.id = id;
     hpet_sbdf.bdf = PCI_BDF(bus, dev, func);
     hpet_sbdf.seg = seg;
-    hpet_sbdf.cmdline = 1;
+    hpet_sbdf.init = HPET_CMDL;
 }
 custom_param("ivrs_hpet[", parse_ivrs_hpet);
 
@@ -789,20 +789,28 @@ static u16 __init parse_ivhd_device_special(
         }
         break;
     case ACPI_IVHD_HPET:
-        /* set device id of hpet */
-        if ( hpet_sbdf.iommu ||
-             (hpet_sbdf.cmdline && hpet_sbdf.id != special->handle) )
+        switch (hpet_sbdf.init)
         {
-            printk(XENLOG_WARNING "Only one IVHD HPET entry is supported\n");
+        case HPET_IVHD:
+            printk(XENLOG_WARNING "Only one IVHD HPET entry is supported.\n");
             break;
-        }
-        hpet_sbdf.id = special->handle;
-        if ( !hpet_sbdf.cmdline )
-        {
+        case HPET_CMDL:
+            AMD_IOMMU_DEBUG("IVHD: Command line override present for HPET %#x "
+                            "(IVRS: %#x devID %04x:%02x:%02x.%u)\n",
+                            hpet_sbdf.id, special->handle, seg, PCI_BUS(bdf),
+                            PCI_SLOT(bdf), PCI_FUNC(bdf));
+            break;
+        case HPET_NONE:
+            /* set device id of hpet */
+            hpet_sbdf.id = special->handle;
             hpet_sbdf.bdf = bdf;
             hpet_sbdf.seg = seg;
+            hpet_sbdf.init = HPET_IVHD;
+            break;
+        default:
+            ASSERT(0);
+            break;
         }
-        hpet_sbdf.iommu = iommu;
         break;
     default:
         printk(XENLOG_ERR "Unrecognized IVHD special variety %#x\n",
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 213f4d7..c1b76fb 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -598,10 +598,16 @@ int __init amd_setup_hpet_msi(struct msi_desc *msi_desc)
     unsigned long flags;
     int rc = 0;
 
-    if ( msi_desc->hpet_id != hpet_sbdf.id || !hpet_sbdf.iommu )
+    if ( hpet_sbdf.init == HPET_NONE )
     {
-        AMD_IOMMU_DEBUG("Failed to setup HPET MSI remapping: %s\n",
-                        hpet_sbdf.iommu ? "Wrong HPET" : "No IOMMU");
+        AMD_IOMMU_DEBUG("Failed to setup HPET MSI remapping."
+                        " Missing IVRS HPET info.\n");
+        return -ENODEV;
+    }
+    if ( msi_desc->hpet_id != hpet_sbdf.id )
+    {
+        AMD_IOMMU_DEBUG("Failed to setup HPET MSI remapping."
+                        " Wrong HPET.\n");
         return -ENODEV;
     }
 
diff --git a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
index 3e6961d..b5abc8f 100644
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
@@ -108,8 +108,11 @@ extern struct ioapic_sbdf {
 
 extern struct hpet_sbdf {
     u16 bdf, seg, id;
-    bool_t cmdline;
-    struct amd_iommu *iommu;
+    enum {
+        HPET_NONE,
+        HPET_CMDL,
+        HPET_IVHD,
+    } init;
 } hpet_sbdf;
 
 extern void *shared_intremap_table;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 06:55:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQtrv-0002fS-TX; Tue, 01 Oct 2013 06:55: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 1VQtru-0002f7-AG
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:38 +0000
Received: from [85.158.139.211:14016] by server-13.bemta-5.messagelabs.com id
	3A/30-23010-9E17A425; Tue, 01 Oct 2013 06:55:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1380610535!5618948!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16251 invoked from network); 1 Oct 2013 06:55:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:55:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrr-0005hN-9Q
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrr-0007Ac-6N
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:35 +0000
Date: Tue, 01 Oct 2013 06:55:35 +0000
Message-Id: <E1VQtrr-0007Ac-6N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: properly handle
	hvm_copy_from_guest_{phys, virt}() errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6bb838e7375f5b031e9ac346b353775c90de45dc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 14:17:46 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:17:46 2013 +0200

    x86: properly handle hvm_copy_from_guest_{phys,virt}() errors
    
    Ignoring them generally implies using uninitialized data and, in all
    but two of the cases dealt with here, potentially leaking hypervisor
    stack contents to guests.
    
    This is CVE-2013-4355 / XSA-63.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c          |   18 ++++---------
 xen/arch/x86/hvm/intercept.c    |   49 +++++++++++++++++++++++++++++++-------
 xen/arch/x86/hvm/io.c           |   24 +++++++++++++-----
 xen/arch/x86/hvm/vmx/realmode.c |    6 ++--
 4 files changed, 66 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 150b0ec..bf807bf 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2310,11 +2310,7 @@ void hvm_task_switch(
 
     rc = hvm_copy_from_guest_virt(
         &tss, prev_tr.base, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    if ( rc == HVMCOPY_gfn_shared )
+    if ( rc != HVMCOPY_okay )
         goto out;
 
     eflags = regs->eflags;
@@ -2359,13 +2355,11 @@ void hvm_task_switch(
 
     rc = hvm_copy_from_guest_virt(
         &tss, tr.base, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    /* Note: this could be optimised, if the callee functions knew we want RO
-     * access */
-    if ( rc == HVMCOPY_gfn_shared )
+    /*
+     * Note: The HVMCOPY_gfn_shared case could be optimised, if the callee
+     * functions knew we want RO access.
+     */
+    if ( rc != HVMCOPY_okay )
         goto out;
 
 
diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c
index 85caa0c..5bb1c17 100644
--- a/xen/arch/x86/hvm/intercept.c
+++ b/xen/arch/x86/hvm/intercept.c
@@ -87,17 +87,28 @@ static int hvm_mmio_access(struct vcpu *v,
     {
         for ( i = 0; i < p->count; i++ )
         {
-            int ret;
-
-            ret = hvm_copy_from_guest_phys(&data,
-                                           p->data + (sign * i * p->size),
-                                           p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) || 
-                 (ret == HVMCOPY_gfn_shared) )
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
             {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 rc = X86EMUL_RETRY;
                 break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
             }
+            if ( rc != X86EMUL_OKAY )
+                break;
             rc = write_handler(v, p->addr + (sign * i * p->size), p->size,
                                data);
             if ( rc != X86EMUL_OKAY )
@@ -165,8 +176,28 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
         for ( i = 0; i < p->count; i++ )
         {
             data = 0;
-            (void)hvm_copy_from_guest_phys(&data, p->data + sign*i*p->size,
-                                           p->size);
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
+                rc = X86EMUL_RETRY;
+                break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
+            }
+            if ( rc != X86EMUL_OKAY )
+                break;
             rc = action(IOREQ_WRITE, p->addr, p->size, &data);
             if ( rc != X86EMUL_OKAY )
                 break;
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 4ae2c0c..5f5009a 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -340,14 +340,24 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
         data = p->data;
         if ( p->data_is_ptr )
         {
-            int ret;
-            
-            ret = hvm_copy_from_guest_phys(&data, 
-                                           p->data + (sign * i * p->size),
-                                           p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) &&
-                 (ret == HVMCOPY_gfn_shared) )
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 return X86EMUL_RETRY;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                return X86EMUL_UNHANDLEABLE;
+            }
         }
 
         switch ( p->size )
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c
index 2e12e24..45066b2 100644
--- a/xen/arch/x86/hvm/vmx/realmode.c
+++ b/xen/arch/x86/hvm/vmx/realmode.c
@@ -39,7 +39,9 @@ static void realmode_deliver_exception(
 
  again:
     last_byte = (vector * 4) + 3;
-    if ( idtr->limit < last_byte )
+    if ( idtr->limit < last_byte ||
+         hvm_copy_from_guest_phys(&cs_eip, idtr->base + vector * 4, 4) !=
+         HVMCOPY_okay )
     {
         /* Software interrupt? */
         if ( insn_len != 0 )
@@ -64,8 +66,6 @@ static void realmode_deliver_exception(
         }
     }
 
-    (void)hvm_copy_from_guest_phys(&cs_eip, idtr->base + vector * 4, 4);
-
     frame[0] = regs->eip + insn_len;
     frame[1] = csr->sel;
     frame[2] = regs->eflags & ~X86_EFLAGS_RF;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 06:55:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQtrv-0002fS-TX; Tue, 01 Oct 2013 06:55: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 1VQtru-0002f7-AG
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:38 +0000
Received: from [85.158.139.211:14016] by server-13.bemta-5.messagelabs.com id
	3A/30-23010-9E17A425; Tue, 01 Oct 2013 06:55:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1380610535!5618948!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16251 invoked from network); 1 Oct 2013 06:55:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:55:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrr-0005hN-9Q
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtrr-0007Ac-6N
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:35 +0000
Date: Tue, 01 Oct 2013 06:55:35 +0000
Message-Id: <E1VQtrr-0007Ac-6N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: properly handle
	hvm_copy_from_guest_{phys, virt}() errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6bb838e7375f5b031e9ac346b353775c90de45dc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 14:17:46 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:17:46 2013 +0200

    x86: properly handle hvm_copy_from_guest_{phys,virt}() errors
    
    Ignoring them generally implies using uninitialized data and, in all
    but two of the cases dealt with here, potentially leaking hypervisor
    stack contents to guests.
    
    This is CVE-2013-4355 / XSA-63.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c          |   18 ++++---------
 xen/arch/x86/hvm/intercept.c    |   49 +++++++++++++++++++++++++++++++-------
 xen/arch/x86/hvm/io.c           |   24 +++++++++++++-----
 xen/arch/x86/hvm/vmx/realmode.c |    6 ++--
 4 files changed, 66 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 150b0ec..bf807bf 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2310,11 +2310,7 @@ void hvm_task_switch(
 
     rc = hvm_copy_from_guest_virt(
         &tss, prev_tr.base, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    if ( rc == HVMCOPY_gfn_shared )
+    if ( rc != HVMCOPY_okay )
         goto out;
 
     eflags = regs->eflags;
@@ -2359,13 +2355,11 @@ void hvm_task_switch(
 
     rc = hvm_copy_from_guest_virt(
         &tss, tr.base, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    /* Note: this could be optimised, if the callee functions knew we want RO
-     * access */
-    if ( rc == HVMCOPY_gfn_shared )
+    /*
+     * Note: The HVMCOPY_gfn_shared case could be optimised, if the callee
+     * functions knew we want RO access.
+     */
+    if ( rc != HVMCOPY_okay )
         goto out;
 
 
diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c
index 85caa0c..5bb1c17 100644
--- a/xen/arch/x86/hvm/intercept.c
+++ b/xen/arch/x86/hvm/intercept.c
@@ -87,17 +87,28 @@ static int hvm_mmio_access(struct vcpu *v,
     {
         for ( i = 0; i < p->count; i++ )
         {
-            int ret;
-
-            ret = hvm_copy_from_guest_phys(&data,
-                                           p->data + (sign * i * p->size),
-                                           p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) || 
-                 (ret == HVMCOPY_gfn_shared) )
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
             {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 rc = X86EMUL_RETRY;
                 break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
             }
+            if ( rc != X86EMUL_OKAY )
+                break;
             rc = write_handler(v, p->addr + (sign * i * p->size), p->size,
                                data);
             if ( rc != X86EMUL_OKAY )
@@ -165,8 +176,28 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
         for ( i = 0; i < p->count; i++ )
         {
             data = 0;
-            (void)hvm_copy_from_guest_phys(&data, p->data + sign*i*p->size,
-                                           p->size);
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
+                rc = X86EMUL_RETRY;
+                break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
+            }
+            if ( rc != X86EMUL_OKAY )
+                break;
             rc = action(IOREQ_WRITE, p->addr, p->size, &data);
             if ( rc != X86EMUL_OKAY )
                 break;
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 4ae2c0c..5f5009a 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -340,14 +340,24 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
         data = p->data;
         if ( p->data_is_ptr )
         {
-            int ret;
-            
-            ret = hvm_copy_from_guest_phys(&data, 
-                                           p->data + (sign * i * p->size),
-                                           p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) &&
-                 (ret == HVMCOPY_gfn_shared) )
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 return X86EMUL_RETRY;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                return X86EMUL_UNHANDLEABLE;
+            }
         }
 
         switch ( p->size )
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c
index 2e12e24..45066b2 100644
--- a/xen/arch/x86/hvm/vmx/realmode.c
+++ b/xen/arch/x86/hvm/vmx/realmode.c
@@ -39,7 +39,9 @@ static void realmode_deliver_exception(
 
  again:
     last_byte = (vector * 4) + 3;
-    if ( idtr->limit < last_byte )
+    if ( idtr->limit < last_byte ||
+         hvm_copy_from_guest_phys(&cs_eip, idtr->base + vector * 4, 4) !=
+         HVMCOPY_okay )
     {
         /* Software interrupt? */
         if ( insn_len != 0 )
@@ -64,8 +66,6 @@ static void realmode_deliver_exception(
         }
     }
 
-    (void)hvm_copy_from_guest_phys(&cs_eip, idtr->base + vector * 4, 4);
-
     frame[0] = regs->eip + insn_len;
     frame[1] = csr->sel;
     frame[2] = regs->eflags & ~X86_EFLAGS_RF;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 01 06:55:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQts6-0002hL-0q; Tue, 01 Oct 2013 06:55: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 1VQts4-0002gv-8N
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:48 +0000
Received: from [85.158.137.68:37580] by server-2.bemta-3.messagelabs.com id
	40/11-14467-3F17A425; Tue, 01 Oct 2013 06:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1380610545!5817364!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14931 invoked from network); 1 Oct 2013 06:55:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:55:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQts1-0005hT-E3
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQts1-0007Ay-CM
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:45 +0000
Date: Tue, 01 Oct 2013 06:55:45 +0000
Message-Id: <E1VQts1-0007Ay-CM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm/shadow: Fix initialization of
	PV shadow L4 tables.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f46befdd825c8a459c5eb21adb7d5b0dc6e30ad5
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Mon Sep 30 14:18:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:18:25 2013 +0200

    x86/mm/shadow: Fix initialization of PV shadow L4 tables.
    
    Shadowed PV L4 tables must have the same Xen mappings as their
    unshadowed equivalent.  This is done by copying the Xen entries
    verbatim from the idle pagetable, and then using guest_l4_slot()
    in the SHADOW_FOREACH_L4E() iterator to avoid touching those entries.
    
    adc5afbf1c70ef55c260fb93e4b8ce5ccb918706 (x86: support up to 16Tb)
    changed the definition of ROOT_PAGETABLE_XEN_SLOTS to extend right to
    the top of the address space, which causes the shadow code to
    copy Xen mappings into guest-kernel-address slots too.
    
    In the common case, all those slots are zero in the idle pagetable,
    and no harm is done.  But if any slot above #271 is non-zero, Xen will
    crash when that slot is later cleared (it attempts to drop
    shadow-pagetable refcounts on its own L4 pagetables).
    
    Fix by using the new ROOT_PAGETABLE_PV_XEN_SLOTS when appropriate.
    Monitor pagetables need the full Xen mappings, so they keep using the
    old name (with its new semantics).
    
    This is CVE-2013-4356 / XSA-64.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm/shadow/multi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 4c4c2ba..3fed0b6 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1433,15 +1433,19 @@ void sh_install_xen_entries_in_l4(struct vcpu *v, mfn_t gl4mfn, mfn_t sl4mfn)
 {
     struct domain *d = v->domain;
     shadow_l4e_t *sl4e;
+    unsigned int slots;
 
     sl4e = sh_map_domain_page(sl4mfn);
     ASSERT(sl4e != NULL);
     ASSERT(sizeof (l4_pgentry_t) == sizeof (shadow_l4e_t));
     
     /* Copy the common Xen mappings from the idle domain */
+    slots = (shadow_mode_external(d)
+             ? ROOT_PAGETABLE_XEN_SLOTS
+             : ROOT_PAGETABLE_PV_XEN_SLOTS);
     memcpy(&sl4e[ROOT_PAGETABLE_FIRST_XEN_SLOT],
            &idle_pg_table[ROOT_PAGETABLE_FIRST_XEN_SLOT],
-           ROOT_PAGETABLE_XEN_SLOTS * sizeof(l4_pgentry_t));
+           slots * sizeof(l4_pgentry_t));
 
     /* Install the per-domain mappings for this domain */
     sl4e[shadow_l4_table_offset(PERDOMAIN_VIRT_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 Tue Oct 01 06:55:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQts6-0002hL-0q; Tue, 01 Oct 2013 06:55: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 1VQts4-0002gv-8N
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:48 +0000
Received: from [85.158.137.68:37580] by server-2.bemta-3.messagelabs.com id
	40/11-14467-3F17A425; Tue, 01 Oct 2013 06:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1380610545!5817364!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14931 invoked from network); 1 Oct 2013 06:55:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:55:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQts1-0005hT-E3
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQts1-0007Ay-CM
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:45 +0000
Date: Tue, 01 Oct 2013 06:55:45 +0000
Message-Id: <E1VQts1-0007Ay-CM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm/shadow: Fix initialization of
	PV shadow L4 tables.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f46befdd825c8a459c5eb21adb7d5b0dc6e30ad5
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Mon Sep 30 14:18:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:18:25 2013 +0200

    x86/mm/shadow: Fix initialization of PV shadow L4 tables.
    
    Shadowed PV L4 tables must have the same Xen mappings as their
    unshadowed equivalent.  This is done by copying the Xen entries
    verbatim from the idle pagetable, and then using guest_l4_slot()
    in the SHADOW_FOREACH_L4E() iterator to avoid touching those entries.
    
    adc5afbf1c70ef55c260fb93e4b8ce5ccb918706 (x86: support up to 16Tb)
    changed the definition of ROOT_PAGETABLE_XEN_SLOTS to extend right to
    the top of the address space, which causes the shadow code to
    copy Xen mappings into guest-kernel-address slots too.
    
    In the common case, all those slots are zero in the idle pagetable,
    and no harm is done.  But if any slot above #271 is non-zero, Xen will
    crash when that slot is later cleared (it attempts to drop
    shadow-pagetable refcounts on its own L4 pagetables).
    
    Fix by using the new ROOT_PAGETABLE_PV_XEN_SLOTS when appropriate.
    Monitor pagetables need the full Xen mappings, so they keep using the
    old name (with its new semantics).
    
    This is CVE-2013-4356 / XSA-64.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm/shadow/multi.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 4c4c2ba..3fed0b6 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1433,15 +1433,19 @@ void sh_install_xen_entries_in_l4(struct vcpu *v, mfn_t gl4mfn, mfn_t sl4mfn)
 {
     struct domain *d = v->domain;
     shadow_l4e_t *sl4e;
+    unsigned int slots;
 
     sl4e = sh_map_domain_page(sl4mfn);
     ASSERT(sl4e != NULL);
     ASSERT(sizeof (l4_pgentry_t) == sizeof (shadow_l4e_t));
     
     /* Copy the common Xen mappings from the idle domain */
+    slots = (shadow_mode_external(d)
+             ? ROOT_PAGETABLE_XEN_SLOTS
+             : ROOT_PAGETABLE_PV_XEN_SLOTS);
     memcpy(&sl4e[ROOT_PAGETABLE_FIRST_XEN_SLOT],
            &idle_pg_table[ROOT_PAGETABLE_FIRST_XEN_SLOT],
-           ROOT_PAGETABLE_XEN_SLOTS * sizeof(l4_pgentry_t));
+           slots * sizeof(l4_pgentry_t));
 
     /* Install the per-domain mappings for this domain */
     sl4e[shadow_l4_table_offset(PERDOMAIN_VIRT_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 Tue Oct 01 06:56:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:56: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 1VQtsG-0002ja-3j; Tue, 01 Oct 2013 06: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 1VQtsE-0002j5-9l
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:58 +0000
Received: from [85.158.137.68:10345] by server-5.bemta-3.messagelabs.com id
	78/12-23058-DF17A425; Tue, 01 Oct 2013 06:55:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1380610555!5803853!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29537 invoked from network); 1 Oct 2013 06:55:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:55:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtsB-0005hc-It
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtsB-0007BK-H1
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:55 +0000
Date: Tue, 01 Oct 2013 06:55:55 +0000
Message-Id: <E1VQtsB-0007BK-H1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: properly set up fbld emulation
	operand 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 28b706efb6abb637fabfd74cde70a50935a5640b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 14:18:58 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:18:58 2013 +0200

    x86: properly set up fbld emulation operand address
    
    This is CVE-2013-4361 / XSA-66.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index bb40b83..e89035b 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3177,11 +3177,11 @@ x86_emulate(
                 break;
             case 4: /* fbld m80dec */
                 ea.bytes = 10;
-                dst = ea;
+                src = ea;
                 if ( (rc = ops->read(src.mem.seg, src.mem.off,
                                      &src.val, src.bytes, ctxt)) != 0 )
                     goto done;
-                emulate_fpu_insn_memdst("fbld", src.val);
+                emulate_fpu_insn_memsrc("fbld", src.val);
                 break;
             case 5: /* fild m64i */
                 ea.bytes = 8;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 06:56:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:56: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 1VQtsG-0002ja-3j; Tue, 01 Oct 2013 06: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 1VQtsE-0002j5-9l
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:58 +0000
Received: from [85.158.137.68:10345] by server-5.bemta-3.messagelabs.com id
	78/12-23058-DF17A425; Tue, 01 Oct 2013 06:55:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1380610555!5803853!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29537 invoked from network); 1 Oct 2013 06:55:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:55:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtsB-0005hc-It
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtsB-0007BK-H1
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:55:55 +0000
Date: Tue, 01 Oct 2013 06:55:55 +0000
Message-Id: <E1VQtsB-0007BK-H1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: properly set up fbld emulation
	operand 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 28b706efb6abb637fabfd74cde70a50935a5640b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 14:18:58 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:18:58 2013 +0200

    x86: properly set up fbld emulation operand address
    
    This is CVE-2013-4361 / XSA-66.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index bb40b83..e89035b 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3177,11 +3177,11 @@ x86_emulate(
                 break;
             case 4: /* fbld m80dec */
                 ea.bytes = 10;
-                dst = ea;
+                src = ea;
                 if ( (rc = ops->read(src.mem.seg, src.mem.off,
                                      &src.val, src.bytes, ctxt)) != 0 )
                     goto done;
-                emulate_fpu_insn_memdst("fbld", src.val);
+                emulate_fpu_insn_memsrc("fbld", src.val);
                 break;
             case 5: /* fild m64i */
                 ea.bytes = 8;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 06:56:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:56: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 1VQtsQ-0002lf-8e; Tue, 01 Oct 2013 06: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 1VQtsO-0002lG-8W
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:56:08 +0000
Received: from [85.158.143.35:11805] by server-3.bemta-4.messagelabs.com id
	AD/C5-24907-7027A425; Tue, 01 Oct 2013 06:56:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1380610565!2773259!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27647 invoked from network); 1 Oct 2013 06:56:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:56:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtsL-0005iB-O8
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:56:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtsL-0007Bq-MZ
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:56:05 +0000
Date: Tue, 01 Oct 2013 06:56:05 +0000
Message-Id: <E1VQtsL-0007Bq-MZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: don't blindly create L3 tables
	for the direct 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 ca145fe70bad3a25ad54c6ded1ef237e45a2311e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 15:28:12 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 15:28:12 2013 +0200

    x86: don't blindly create L3 tables for the direct map
    
    Now that the direct map area can extend all the way up to almost the
    end of address space, this is wasteful.
    
    Also fold two almost redundant messages in SRAT parsing into one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/mm.c        |    2 +-
 xen/arch/x86/srat.c      |   15 ++++++---------
 xen/arch/x86/x86_64/mm.c |   29 ++++++++++++-----------------
 xen/include/asm-x86/mm.h |    2 +-
 4 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e7f0e13..7d4215d 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -137,7 +137,7 @@ l1_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
 #define PTE_UPDATE_WITH_CMPXCHG
 #endif
 
-bool_t __read_mostly mem_hotplug = 0;
+paddr_t __read_mostly mem_hotplug;
 
 /* Private domain structs for DOMID_XEN and DOMID_IO. */
 struct domain *dom_xen, *dom_io, *dom_cow;
diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index ff73881..2b05272 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -113,6 +113,7 @@ static __init void bad_srat(void)
 		apicid_to_node[i] = NUMA_NO_NODE;
 	for (i = 0; i < ARRAY_SIZE(pxm2node); i++)
 		pxm2node[i] = NUMA_NO_NODE;
+	mem_hotplug = 0;
 }
 
 /*
@@ -257,13 +258,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 		return;
 	}
 	/* It is fine to add this area to the nodes data it will be used later*/
-	if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)
-	{
-		printk(KERN_INFO "SRAT: hot plug zone found %"PRIx64" - %"PRIx64" \n",
-				start, end);
-		mem_hotplug = 1;
-	}
-
 	i = conflicting_memblks(start, end);
 	if (i == node) {
 		printk(KERN_WARNING
@@ -287,8 +281,11 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 		if (nd->end < end)
 			nd->end = end;
 	}
-	printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIx64"-%"PRIx64"\n", node, pxm,
-	       start, end);
+	if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && end > mem_hotplug)
+		mem_hotplug = end;
+	printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIx64"-%"PRIx64"%s\n",
+	       node, pxm, start, end,
+	       ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE ? " (hotplug)" : "");
 
 	node_memblk_range[num_node_memblks].start = start;
 	node_memblk_range[num_node_memblks].end = end;
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 26cb998..84a2434 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -559,25 +559,20 @@ void __init paging_init(void)
      * We setup the L3s for 1:1 mapping if host support memory hotplug
      * to avoid sync the 1:1 mapping on page fault handler
      */
-    if ( mem_hotplug )
+    for ( va = DIRECTMAP_VIRT_START;
+          va < DIRECTMAP_VIRT_END && (void *)va < __va(mem_hotplug);
+          va += (1UL << L4_PAGETABLE_SHIFT) )
     {
-        unsigned long va;
-
-        for ( va = DIRECTMAP_VIRT_START;
-              va < DIRECTMAP_VIRT_END;
-              va += (1UL << L4_PAGETABLE_SHIFT) )
+        if ( !(l4e_get_flags(idle_pg_table[l4_table_offset(va)]) &
+              _PAGE_PRESENT) )
         {
-            if ( !(l4e_get_flags(idle_pg_table[l4_table_offset(va)]) &
-                  _PAGE_PRESENT) )
-            {
-                l3_pg = alloc_domheap_page(NULL, 0);
-                if ( !l3_pg )
-                    goto nomem;
-                l3_ro_mpt = page_to_virt(l3_pg);
-                clear_page(l3_ro_mpt);
-                l4e_write(&idle_pg_table[l4_table_offset(va)],
-                  l4e_from_page(l3_pg, __PAGE_HYPERVISOR));
-            }
+            l3_pg = alloc_domheap_page(NULL, 0);
+            if ( !l3_pg )
+                goto nomem;
+            l3_ro_mpt = page_to_virt(l3_pg);
+            clear_page(l3_ro_mpt);
+            l4e_write(&idle_pg_table[l4_table_offset(va)],
+                      l4e_from_page(l3_pg, __PAGE_HYPERVISOR));
         }
     }
 
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 213fc9c..5f03875 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -399,7 +399,7 @@ static inline int get_page_and_type(struct page_info *page,
 int check_descriptor(const struct domain *, struct desc_struct *d);
 
 extern bool_t opt_allow_superpage;
-extern bool_t mem_hotplug;
+extern paddr_t mem_hotplug;
 
 /******************************************************************************
  * With shadow pagetables, the different kinds of address 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 Tue Oct 01 06:56:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 06:56: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 1VQtsQ-0002lf-8e; Tue, 01 Oct 2013 06: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 1VQtsO-0002lG-8W
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:56:08 +0000
Received: from [85.158.143.35:11805] by server-3.bemta-4.messagelabs.com id
	AD/C5-24907-7027A425; Tue, 01 Oct 2013 06:56:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1380610565!2773259!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27647 invoked from network); 1 Oct 2013 06:56:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 06:56:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtsL-0005iB-O8
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:56:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQtsL-0007Bq-MZ
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 06:56:05 +0000
Date: Tue, 01 Oct 2013 06:56:05 +0000
Message-Id: <E1VQtsL-0007Bq-MZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: don't blindly create L3 tables
	for the direct 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 ca145fe70bad3a25ad54c6ded1ef237e45a2311e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 15:28:12 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 15:28:12 2013 +0200

    x86: don't blindly create L3 tables for the direct map
    
    Now that the direct map area can extend all the way up to almost the
    end of address space, this is wasteful.
    
    Also fold two almost redundant messages in SRAT parsing into one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/mm.c        |    2 +-
 xen/arch/x86/srat.c      |   15 ++++++---------
 xen/arch/x86/x86_64/mm.c |   29 ++++++++++++-----------------
 xen/include/asm-x86/mm.h |    2 +-
 4 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e7f0e13..7d4215d 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -137,7 +137,7 @@ l1_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
 #define PTE_UPDATE_WITH_CMPXCHG
 #endif
 
-bool_t __read_mostly mem_hotplug = 0;
+paddr_t __read_mostly mem_hotplug;
 
 /* Private domain structs for DOMID_XEN and DOMID_IO. */
 struct domain *dom_xen, *dom_io, *dom_cow;
diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index ff73881..2b05272 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -113,6 +113,7 @@ static __init void bad_srat(void)
 		apicid_to_node[i] = NUMA_NO_NODE;
 	for (i = 0; i < ARRAY_SIZE(pxm2node); i++)
 		pxm2node[i] = NUMA_NO_NODE;
+	mem_hotplug = 0;
 }
 
 /*
@@ -257,13 +258,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 		return;
 	}
 	/* It is fine to add this area to the nodes data it will be used later*/
-	if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)
-	{
-		printk(KERN_INFO "SRAT: hot plug zone found %"PRIx64" - %"PRIx64" \n",
-				start, end);
-		mem_hotplug = 1;
-	}
-
 	i = conflicting_memblks(start, end);
 	if (i == node) {
 		printk(KERN_WARNING
@@ -287,8 +281,11 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 		if (nd->end < end)
 			nd->end = end;
 	}
-	printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIx64"-%"PRIx64"\n", node, pxm,
-	       start, end);
+	if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && end > mem_hotplug)
+		mem_hotplug = end;
+	printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIx64"-%"PRIx64"%s\n",
+	       node, pxm, start, end,
+	       ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE ? " (hotplug)" : "");
 
 	node_memblk_range[num_node_memblks].start = start;
 	node_memblk_range[num_node_memblks].end = end;
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 26cb998..84a2434 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -559,25 +559,20 @@ void __init paging_init(void)
      * We setup the L3s for 1:1 mapping if host support memory hotplug
      * to avoid sync the 1:1 mapping on page fault handler
      */
-    if ( mem_hotplug )
+    for ( va = DIRECTMAP_VIRT_START;
+          va < DIRECTMAP_VIRT_END && (void *)va < __va(mem_hotplug);
+          va += (1UL << L4_PAGETABLE_SHIFT) )
     {
-        unsigned long va;
-
-        for ( va = DIRECTMAP_VIRT_START;
-              va < DIRECTMAP_VIRT_END;
-              va += (1UL << L4_PAGETABLE_SHIFT) )
+        if ( !(l4e_get_flags(idle_pg_table[l4_table_offset(va)]) &
+              _PAGE_PRESENT) )
         {
-            if ( !(l4e_get_flags(idle_pg_table[l4_table_offset(va)]) &
-                  _PAGE_PRESENT) )
-            {
-                l3_pg = alloc_domheap_page(NULL, 0);
-                if ( !l3_pg )
-                    goto nomem;
-                l3_ro_mpt = page_to_virt(l3_pg);
-                clear_page(l3_ro_mpt);
-                l4e_write(&idle_pg_table[l4_table_offset(va)],
-                  l4e_from_page(l3_pg, __PAGE_HYPERVISOR));
-            }
+            l3_pg = alloc_domheap_page(NULL, 0);
+            if ( !l3_pg )
+                goto nomem;
+            l3_ro_mpt = page_to_virt(l3_pg);
+            clear_page(l3_ro_mpt);
+            l4e_write(&idle_pg_table[l4_table_offset(va)],
+                      l4e_from_page(l3_pg, __PAGE_HYPERVISOR));
         }
     }
 
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 213fc9c..5f03875 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -399,7 +399,7 @@ static inline int get_page_and_type(struct page_info *page,
 int check_descriptor(const struct domain *, struct desc_struct *d);
 
 extern bool_t opt_allow_superpage;
-extern bool_t mem_hotplug;
+extern paddr_t mem_hotplug;
 
 /******************************************************************************
  * With shadow pagetables, the different kinds of address 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 Tue Oct 01 08:11:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 08:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQv2z-0004q0-4L; Tue, 01 Oct 2013 08:11: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 1VQv2x-0004ps-BF
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 08:11:07 +0000
Received: from [85.158.137.68:26281] by server-3.bemta-3.messagelabs.com id
	A4/2D-11625-A938A425; Tue, 01 Oct 2013 08:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1380615064!5828821!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6718 invoked from network); 1 Oct 2013 08:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 08:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQv2u-0006tU-02
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 08:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQv2t-00010S-Or
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 08:11:03 +0000
Date: Tue, 01 Oct 2013 08:11:03 +0000
Message-Id: <E1VQv2t-00010S-Or@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: properly handle
	hvm_copy_from_guest_{phys, virt}() errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 592e139cabb514d22d97b4738dad6bf6eaf0ca89
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 14:31:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:31:44 2013 +0200

    x86: properly handle hvm_copy_from_guest_{phys,virt}() errors
    
    Ignoring them generally implies using uninitialized data and, in all
    but two of the cases dealt with here, potentially leaking hypervisor
    stack contents to guests.
    
    This is CVE-2013-4355 / XSA-63.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6bb838e7375f5b031e9ac346b353775c90de45dc
    master date: 2013-09-30 14:17:46 +0200
---
 xen/arch/x86/hvm/hvm.c          |   18 ++++---------
 xen/arch/x86/hvm/intercept.c    |   49 +++++++++++++++++++++++++++++++-------
 xen/arch/x86/hvm/io.c           |   24 +++++++++++++-----
 xen/arch/x86/hvm/vmx/realmode.c |    6 ++--
 4 files changed, 66 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 42ee784..dc24810 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1961,11 +1961,7 @@ void hvm_task_switch(
 
     rc = hvm_copy_from_guest_virt(
         &tss, prev_tr.base, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    if ( rc == HVMCOPY_gfn_shared )
+    if ( rc != HVMCOPY_okay )
         goto out;
 
     eflags = regs->eflags;
@@ -2010,13 +2006,11 @@ void hvm_task_switch(
 
     rc = hvm_copy_from_guest_virt(
         &tss, tr.base, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    /* Note: this could be optimised, if the callee functions knew we want RO
-     * access */
-    if ( rc == HVMCOPY_gfn_shared )
+    /*
+     * Note: The HVMCOPY_gfn_shared case could be optimised, if the callee
+     * functions knew we want RO access.
+     */
+    if ( rc != HVMCOPY_okay )
         goto out;
 
 
diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c
index 54f0f8c..7a0e964 100644
--- a/xen/arch/x86/hvm/intercept.c
+++ b/xen/arch/x86/hvm/intercept.c
@@ -93,17 +93,28 @@ static int hvm_mmio_access(struct vcpu *v,
     {
         for ( i = 0; i < p->count; i++ )
         {
-            int ret;
-
-            ret = hvm_copy_from_guest_phys(&data,
-                                           p->data + (sign * i * p->size),
-                                           p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) || 
-                 (ret == HVMCOPY_gfn_shared) )
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
             {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 rc = X86EMUL_RETRY;
                 break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
             }
+            if ( rc != X86EMUL_OKAY )
+                break;
             rc = write_handler(v, p->addr + (sign * i * p->size), p->size,
                                data);
             if ( rc != X86EMUL_OKAY )
@@ -171,8 +182,28 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
         for ( i = 0; i < p->count; i++ )
         {
             data = 0;
-            (void)hvm_copy_from_guest_phys(&data, p->data + sign*i*p->size,
-                                           p->size);
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
+                rc = X86EMUL_RETRY;
+                break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
+            }
+            if ( rc != X86EMUL_OKAY )
+                break;
             rc = action(IOREQ_WRITE, p->addr, p->size, &data);
             if ( rc != X86EMUL_OKAY )
                 break;
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 06a3fea..46e4ae7 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -333,14 +333,24 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
         data = p->data;
         if ( p->data_is_ptr )
         {
-            int ret;
-            
-            ret = hvm_copy_from_guest_phys(&data, 
-                                           p->data + (sign * i * p->size),
-                                           p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) &&
-                 (ret == HVMCOPY_gfn_shared) )
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 return X86EMUL_RETRY;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                return X86EMUL_UNHANDLEABLE;
+            }
         }
 
         switch ( p->size )
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c
index 1fd81dd..2220fe1 100644
--- a/xen/arch/x86/hvm/vmx/realmode.c
+++ b/xen/arch/x86/hvm/vmx/realmode.c
@@ -38,7 +38,9 @@ static void realmode_deliver_exception(
 
  again:
     last_byte = (vector * 4) + 3;
-    if ( idtr->limit < last_byte )
+    if ( idtr->limit < last_byte ||
+         hvm_copy_from_guest_phys(&cs_eip, idtr->base + vector * 4, 4) !=
+         HVMCOPY_okay )
     {
         /* Software interrupt? */
         if ( insn_len != 0 )
@@ -63,8 +65,6 @@ static void realmode_deliver_exception(
         }
     }
 
-    (void)hvm_copy_from_guest_phys(&cs_eip, idtr->base + vector * 4, 4);
-
     frame[0] = regs->eip + insn_len;
     frame[1] = csr->sel;
     frame[2] = regs->eflags & ~X86_EFLAGS_RF;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 08:11:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 08:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VQv2z-0004q0-4L; Tue, 01 Oct 2013 08:11: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 1VQv2x-0004ps-BF
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 08:11:07 +0000
Received: from [85.158.137.68:26281] by server-3.bemta-3.messagelabs.com id
	A4/2D-11625-A938A425; Tue, 01 Oct 2013 08:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1380615064!5828821!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6718 invoked from network); 1 Oct 2013 08:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 08:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQv2u-0006tU-02
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 08:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQv2t-00010S-Or
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 08:11:03 +0000
Date: Tue, 01 Oct 2013 08:11:03 +0000
Message-Id: <E1VQv2t-00010S-Or@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: properly handle
	hvm_copy_from_guest_{phys, virt}() errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 592e139cabb514d22d97b4738dad6bf6eaf0ca89
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 14:31:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:31:44 2013 +0200

    x86: properly handle hvm_copy_from_guest_{phys,virt}() errors
    
    Ignoring them generally implies using uninitialized data and, in all
    but two of the cases dealt with here, potentially leaking hypervisor
    stack contents to guests.
    
    This is CVE-2013-4355 / XSA-63.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6bb838e7375f5b031e9ac346b353775c90de45dc
    master date: 2013-09-30 14:17:46 +0200
---
 xen/arch/x86/hvm/hvm.c          |   18 ++++---------
 xen/arch/x86/hvm/intercept.c    |   49 +++++++++++++++++++++++++++++++-------
 xen/arch/x86/hvm/io.c           |   24 +++++++++++++-----
 xen/arch/x86/hvm/vmx/realmode.c |    6 ++--
 4 files changed, 66 insertions(+), 31 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 42ee784..dc24810 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1961,11 +1961,7 @@ void hvm_task_switch(
 
     rc = hvm_copy_from_guest_virt(
         &tss, prev_tr.base, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    if ( rc == HVMCOPY_gfn_shared )
+    if ( rc != HVMCOPY_okay )
         goto out;
 
     eflags = regs->eflags;
@@ -2010,13 +2006,11 @@ void hvm_task_switch(
 
     rc = hvm_copy_from_guest_virt(
         &tss, tr.base, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    /* Note: this could be optimised, if the callee functions knew we want RO
-     * access */
-    if ( rc == HVMCOPY_gfn_shared )
+    /*
+     * Note: The HVMCOPY_gfn_shared case could be optimised, if the callee
+     * functions knew we want RO access.
+     */
+    if ( rc != HVMCOPY_okay )
         goto out;
 
 
diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c
index 54f0f8c..7a0e964 100644
--- a/xen/arch/x86/hvm/intercept.c
+++ b/xen/arch/x86/hvm/intercept.c
@@ -93,17 +93,28 @@ static int hvm_mmio_access(struct vcpu *v,
     {
         for ( i = 0; i < p->count; i++ )
         {
-            int ret;
-
-            ret = hvm_copy_from_guest_phys(&data,
-                                           p->data + (sign * i * p->size),
-                                           p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) || 
-                 (ret == HVMCOPY_gfn_shared) )
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
             {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 rc = X86EMUL_RETRY;
                 break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
             }
+            if ( rc != X86EMUL_OKAY )
+                break;
             rc = write_handler(v, p->addr + (sign * i * p->size), p->size,
                                data);
             if ( rc != X86EMUL_OKAY )
@@ -171,8 +182,28 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
         for ( i = 0; i < p->count; i++ )
         {
             data = 0;
-            (void)hvm_copy_from_guest_phys(&data, p->data + sign*i*p->size,
-                                           p->size);
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
+                rc = X86EMUL_RETRY;
+                break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
+            }
+            if ( rc != X86EMUL_OKAY )
+                break;
             rc = action(IOREQ_WRITE, p->addr, p->size, &data);
             if ( rc != X86EMUL_OKAY )
                 break;
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 06a3fea..46e4ae7 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -333,14 +333,24 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
         data = p->data;
         if ( p->data_is_ptr )
         {
-            int ret;
-            
-            ret = hvm_copy_from_guest_phys(&data, 
-                                           p->data + (sign * i * p->size),
-                                           p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) &&
-                 (ret == HVMCOPY_gfn_shared) )
+            switch ( hvm_copy_from_guest_phys(&data,
+                                              p->data + sign * i * p->size,
+                                              p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 return X86EMUL_RETRY;
+            case HVMCOPY_bad_gfn_to_mfn:
+                data = ~0;
+                break;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                return X86EMUL_UNHANDLEABLE;
+            }
         }
 
         switch ( p->size )
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c
index 1fd81dd..2220fe1 100644
--- a/xen/arch/x86/hvm/vmx/realmode.c
+++ b/xen/arch/x86/hvm/vmx/realmode.c
@@ -38,7 +38,9 @@ static void realmode_deliver_exception(
 
  again:
     last_byte = (vector * 4) + 3;
-    if ( idtr->limit < last_byte )
+    if ( idtr->limit < last_byte ||
+         hvm_copy_from_guest_phys(&cs_eip, idtr->base + vector * 4, 4) !=
+         HVMCOPY_okay )
     {
         /* Software interrupt? */
         if ( insn_len != 0 )
@@ -63,8 +65,6 @@ static void realmode_deliver_exception(
         }
     }
 
-    (void)hvm_copy_from_guest_phys(&cs_eip, idtr->base + vector * 4, 4);
-
     frame[0] = regs->eip + insn_len;
     frame[1] = csr->sel;
     frame[2] = regs->eflags & ~X86_EFLAGS_RF;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 08:11:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 08: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 1VQv38-0004qj-7E; Tue, 01 Oct 2013 08:11: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 1VQv37-0004qW-1P
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 08:11:17 +0000
Received: from [85.158.137.68:27393] by server-1.bemta-3.messagelabs.com id
	17/1D-04901-4A38A425; Tue, 01 Oct 2013 08:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1380615074!5811741!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16686 invoked from network); 1 Oct 2013 08:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 08:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQv34-0006tX-6w
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 08:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQv34-00010r-3h
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 08:11:14 +0000
Date: Tue, 01 Oct 2013 08:11:14 +0000
Message-Id: <E1VQv34-00010r-3h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: properly set up fbld
	emulation operand 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 ca0fe6dc4ff9fd12bca751d73b20b309f0444ae2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 14:32:39 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:32:39 2013 +0200

    x86: properly set up fbld emulation operand address
    
    This is CVE-2013-4361 / XSA-66.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    master commit: 28b706efb6abb637fabfd74cde70a50935a5640b
    master date: 2013-09-30 14:18:58 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index f4686c4..d1c2c23 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2975,11 +2975,11 @@ x86_emulate(
                 break;
             case 4: /* fbld m80dec */
                 ea.bytes = 10;
-                dst = ea;
+                src = ea;
                 if ( (rc = ops->read(src.mem.seg, src.mem.off,
                                      &src.val, src.bytes, ctxt)) != 0 )
                     goto done;
-                emulate_fpu_insn_memdst("fbld", src.val);
+                emulate_fpu_insn_memsrc("fbld", src.val);
                 break;
             case 5: /* fild m64i */
                 ea.bytes = 8;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 08:11:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 08: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 1VQv38-0004qj-7E; Tue, 01 Oct 2013 08:11: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 1VQv37-0004qW-1P
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 08:11:17 +0000
Received: from [85.158.137.68:27393] by server-1.bemta-3.messagelabs.com id
	17/1D-04901-4A38A425; Tue, 01 Oct 2013 08:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1380615074!5811741!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16686 invoked from network); 1 Oct 2013 08:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 08:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQv34-0006tX-6w
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 08:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VQv34-00010r-3h
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 08:11:14 +0000
Date: Tue, 01 Oct 2013 08:11:14 +0000
Message-Id: <E1VQv34-00010r-3h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: properly set up fbld
	emulation operand 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 ca0fe6dc4ff9fd12bca751d73b20b309f0444ae2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 30 14:32:39 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 30 14:32:39 2013 +0200

    x86: properly set up fbld emulation operand address
    
    This is CVE-2013-4361 / XSA-66.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    master commit: 28b706efb6abb637fabfd74cde70a50935a5640b
    master date: 2013-09-30 14:18:58 +0200
---
 xen/arch/x86/x86_emulate/x86_emulate.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index f4686c4..d1c2c23 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2975,11 +2975,11 @@ x86_emulate(
                 break;
             case 4: /* fbld m80dec */
                 ea.bytes = 10;
-                dst = ea;
+                src = ea;
                 if ( (rc = ops->read(src.mem.seg, src.mem.off,
                                      &src.val, src.bytes, ctxt)) != 0 )
                     goto done;
-                emulate_fpu_insn_memdst("fbld", src.val);
+                emulate_fpu_insn_memsrc("fbld", src.val);
                 break;
             case 5: /* fild m64i */
                 ea.bytes = 8;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 14:55:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 14:55: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 1VR1Lw-0007t6-Hl; Tue, 01 Oct 2013 14:55: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 1VR1Lu-0007sy-BH
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 14:55:06 +0000
Received: from [85.158.143.35:54158] by server-2.bemta-4.messagelabs.com id
	A2/5F-31802-942EA425; Tue, 01 Oct 2013 14:55:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1380639303!2942485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9852 invoked from network); 1 Oct 2013 14:55:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 14:55:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR1Lr-0002jy-CW
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 14:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR1Lr-0003cG-0B
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 14:55:03 +0000
Date: Tue, 01 Oct 2013 14:55:03 +0000
Message-Id: <E1VR1Lr-0003cG-0B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Add -f FMT / --format FMT
	arg to qemu-nbd
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6dc71da698bfdc5297f8719e78eba26b1f15ff2c
Author:     Daniel P. Berrange <berrange@redhat.com>
AuthorDate: Tue Oct 1 14:50:32 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Oct 1 14:53:36 2013 +0000

    Add -f FMT / --format FMT arg to qemu-nbd
    
    Currently the qemu-nbd program will auto-detect the format of
    any disk it is given. This behaviour is known to be insecure.
    For example, if qemu-nbd initially exposes a 'raw' file to an
    unprivileged app, and that app runs
    
       'qemu-img create -f qcow2 -o backing_file=/etc/shadow /dev/nbd0'
    
    then the next time the app is started, the qemu-nbd will now
    detect it as a 'qcow2' file and expose /etc/shadow to the
    unprivileged app.
    
    The only way to avoid this is to explicitly tell qemu-nbd what
    disk format to use on the command line, completely disabling
    auto-detection. This patch adds a '-f' / '--format' arg for
    this purpose, mirroring what is already available via qemu-img
    and qemu commands.
    
      qemu-nbd --format raw -p 9000 evil.img
    
    will now always use raw, regardless of what format 'evil.img'
    looks like it contains
    
    upstream-commit-id: e6b636779b51c97e67694be740ee972c52460c59
    
    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
    [Use errx, not err. - Paolo]
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 qemu-nbd.c    |   20 ++++++++++++++++++--
 qemu-nbd.texi |    2 ++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/qemu-nbd.c b/qemu-nbd.c
index 80f08d8..73d8833 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -305,6 +305,7 @@ static void nbd_accept(void *opaque)
 int main(int argc, char **argv)
 {
     BlockDriverState *bs;
+    BlockDriver *drv;
     off_t dev_offset = 0;
     uint32_t nbdflags = 0;
     bool disconnect = false;
@@ -312,7 +313,7 @@ int main(int argc, char **argv)
     char *device = NULL;
     int port = NBD_DEFAULT_PORT;
     off_t fd_size;
-    const char *sopt = "hVb:o:p:rsnP:c:dvk:e:t";
+    const char *sopt = "hVb:o:p:rsnP:c:dvk:e:f:t";
     struct option lopt[] = {
         { "help", 0, NULL, 'h' },
         { "version", 0, NULL, 'V' },
@@ -331,6 +332,7 @@ int main(int argc, char **argv)
         { "aio", 1, NULL, QEMU_NBD_OPT_AIO },
 #endif
         { "shared", 1, NULL, 'e' },
+        { "format", 1, NULL, 'f' },
         { "persistent", 0, NULL, 't' },
         { "verbose", 0, NULL, 'v' },
         { NULL, 0, NULL, 0 }
@@ -348,6 +350,7 @@ int main(int argc, char **argv)
     bool seen_aio = false;
 #endif
     pthread_t client_thread;
+    const char *fmt = NULL;
 
     /* The client thread uses SIGTERM to interrupt the server.  A signal
      * handler ensures that "qemu-nbd -v -c" exits with a nice status code.
@@ -442,6 +445,9 @@ int main(int argc, char **argv)
                 errx(EXIT_FAILURE, "Shared device number must be greater than 0\n");
             }
             break;
+        case 'f':
+            fmt = optarg;
+            break;
 	case 't':
 	    persistent = 1;
 	    break;
@@ -543,9 +549,19 @@ int main(int argc, char **argv)
     bdrv_init();
     atexit(bdrv_close_all);
 
+    if (fmt) {
+        drv = bdrv_find_format(fmt);
+        if (!drv) {
+            errx(EXIT_FAILURE, "Unknown file format '%s'", fmt);
+        }
+    } else {
+        drv = NULL;
+    }
+
     bs = bdrv_new("hda");
     srcpath = argv[optind];
-    if ((ret = bdrv_open(bs, srcpath, flags, NULL)) < 0) {
+    ret = bdrv_open(bs, srcpath, flags, drv);
+    if (ret < 0) {
         errno = -ret;
         err(EXIT_FAILURE, "Failed to bdrv_open '%s'", argv[optind]);
     }
diff --git a/qemu-nbd.texi b/qemu-nbd.texi
index 6955d90..70abfeb 100644
--- a/qemu-nbd.texi
+++ b/qemu-nbd.texi
@@ -36,6 +36,8 @@ Export QEMU disk image using NBD protocol.
   disconnect the specified device
 @item -e, --shared=@var{num}
   device can be shared by @var{num} clients (default @samp{1})
+@item -f, --format=@var{fmt}
+  force block driver for format @var{fmt} instead of auto-detecting
 @item -t, --persistent
   don't exit on the last connection
 @item -v, --verbose
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 14:55:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 14:55: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 1VR1Lw-0007t6-Hl; Tue, 01 Oct 2013 14:55: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 1VR1Lu-0007sy-BH
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 14:55:06 +0000
Received: from [85.158.143.35:54158] by server-2.bemta-4.messagelabs.com id
	A2/5F-31802-942EA425; Tue, 01 Oct 2013 14:55:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1380639303!2942485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9852 invoked from network); 1 Oct 2013 14:55:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 14:55:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR1Lr-0002jy-CW
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 14:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR1Lr-0003cG-0B
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 14:55:03 +0000
Date: Tue, 01 Oct 2013 14:55:03 +0000
Message-Id: <E1VR1Lr-0003cG-0B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Add -f FMT / --format FMT
	arg to qemu-nbd
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6dc71da698bfdc5297f8719e78eba26b1f15ff2c
Author:     Daniel P. Berrange <berrange@redhat.com>
AuthorDate: Tue Oct 1 14:50:32 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Oct 1 14:53:36 2013 +0000

    Add -f FMT / --format FMT arg to qemu-nbd
    
    Currently the qemu-nbd program will auto-detect the format of
    any disk it is given. This behaviour is known to be insecure.
    For example, if qemu-nbd initially exposes a 'raw' file to an
    unprivileged app, and that app runs
    
       'qemu-img create -f qcow2 -o backing_file=/etc/shadow /dev/nbd0'
    
    then the next time the app is started, the qemu-nbd will now
    detect it as a 'qcow2' file and expose /etc/shadow to the
    unprivileged app.
    
    The only way to avoid this is to explicitly tell qemu-nbd what
    disk format to use on the command line, completely disabling
    auto-detection. This patch adds a '-f' / '--format' arg for
    this purpose, mirroring what is already available via qemu-img
    and qemu commands.
    
      qemu-nbd --format raw -p 9000 evil.img
    
    will now always use raw, regardless of what format 'evil.img'
    looks like it contains
    
    upstream-commit-id: e6b636779b51c97e67694be740ee972c52460c59
    
    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
    [Use errx, not err. - Paolo]
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 qemu-nbd.c    |   20 ++++++++++++++++++--
 qemu-nbd.texi |    2 ++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/qemu-nbd.c b/qemu-nbd.c
index 80f08d8..73d8833 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -305,6 +305,7 @@ static void nbd_accept(void *opaque)
 int main(int argc, char **argv)
 {
     BlockDriverState *bs;
+    BlockDriver *drv;
     off_t dev_offset = 0;
     uint32_t nbdflags = 0;
     bool disconnect = false;
@@ -312,7 +313,7 @@ int main(int argc, char **argv)
     char *device = NULL;
     int port = NBD_DEFAULT_PORT;
     off_t fd_size;
-    const char *sopt = "hVb:o:p:rsnP:c:dvk:e:t";
+    const char *sopt = "hVb:o:p:rsnP:c:dvk:e:f:t";
     struct option lopt[] = {
         { "help", 0, NULL, 'h' },
         { "version", 0, NULL, 'V' },
@@ -331,6 +332,7 @@ int main(int argc, char **argv)
         { "aio", 1, NULL, QEMU_NBD_OPT_AIO },
 #endif
         { "shared", 1, NULL, 'e' },
+        { "format", 1, NULL, 'f' },
         { "persistent", 0, NULL, 't' },
         { "verbose", 0, NULL, 'v' },
         { NULL, 0, NULL, 0 }
@@ -348,6 +350,7 @@ int main(int argc, char **argv)
     bool seen_aio = false;
 #endif
     pthread_t client_thread;
+    const char *fmt = NULL;
 
     /* The client thread uses SIGTERM to interrupt the server.  A signal
      * handler ensures that "qemu-nbd -v -c" exits with a nice status code.
@@ -442,6 +445,9 @@ int main(int argc, char **argv)
                 errx(EXIT_FAILURE, "Shared device number must be greater than 0\n");
             }
             break;
+        case 'f':
+            fmt = optarg;
+            break;
 	case 't':
 	    persistent = 1;
 	    break;
@@ -543,9 +549,19 @@ int main(int argc, char **argv)
     bdrv_init();
     atexit(bdrv_close_all);
 
+    if (fmt) {
+        drv = bdrv_find_format(fmt);
+        if (!drv) {
+            errx(EXIT_FAILURE, "Unknown file format '%s'", fmt);
+        }
+    } else {
+        drv = NULL;
+    }
+
     bs = bdrv_new("hda");
     srcpath = argv[optind];
-    if ((ret = bdrv_open(bs, srcpath, flags, NULL)) < 0) {
+    ret = bdrv_open(bs, srcpath, flags, drv);
+    if (ret < 0) {
         errno = -ret;
         err(EXIT_FAILURE, "Failed to bdrv_open '%s'", argv[optind]);
     }
diff --git a/qemu-nbd.texi b/qemu-nbd.texi
index 6955d90..70abfeb 100644
--- a/qemu-nbd.texi
+++ b/qemu-nbd.texi
@@ -36,6 +36,8 @@ Export QEMU disk image using NBD protocol.
   disconnect the specified device
 @item -e, --shared=@var{num}
   device can be shared by @var{num} clients (default @samp{1})
+@item -f, --format=@var{fmt}
+  force block driver for format @var{fmt} instead of auto-detecting
 @item -t, --persistent
   don't exit on the last connection
 @item -v, --verbose
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 17:22:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 17:22: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 1VR3eC-0002LJ-8C; Tue, 01 Oct 2013 17: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 1VR3eA-0002LA-RG
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 17:22:06 +0000
Received: from [193.109.254.147:16650] by server-4.bemta-14.messagelabs.com id
	46/70-05823-DB40B425; Tue, 01 Oct 2013 17:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1380648124!5499873!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11265 invoked from network); 1 Oct 2013 17:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 17:22:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR3e8-0004fH-13
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 17:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR3e7-0007yS-Cq
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 17:22:03 +0000
Date: Tue, 01 Oct 2013 17:22:03 +0000
Message-Id: <E1VR3e7-0007yS-Cq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] update Xen version to 4.3.1-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7a650cb1591b7a64a29da944c1b3c0069dc59fdb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 1 12:21:04 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 1 12:21:04 2013 +0200

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

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

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 17:22:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 17:22: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 1VR3eC-0002LJ-8C; Tue, 01 Oct 2013 17: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 1VR3eA-0002LA-RG
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 17:22:06 +0000
Received: from [193.109.254.147:16650] by server-4.bemta-14.messagelabs.com id
	46/70-05823-DB40B425; Tue, 01 Oct 2013 17:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1380648124!5499873!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11265 invoked from network); 1 Oct 2013 17:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 17:22:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR3e8-0004fH-13
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 17:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR3e7-0007yS-Cq
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 17:22:03 +0000
Date: Tue, 01 Oct 2013 17:22:03 +0000
Message-Id: <E1VR3e7-0007yS-Cq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] update Xen version to 4.3.1-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7a650cb1591b7a64a29da944c1b3c0069dc59fdb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 1 12:21:04 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 1 12:21:04 2013 +0200

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

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

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 19:33:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 19:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VR5gw-00050P-95; Tue, 01 Oct 2013 19:33:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR5gv-00050I-1B
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 19:33:05 +0000
Received: from [85.158.143.35:38553] by server-3.bemta-4.messagelabs.com id
	D8/BC-24907-0732B425; Tue, 01 Oct 2013 19:33:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1380655982!2876875!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_32,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10910 invoked from network); 1 Oct 2013 19:33:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 19:33:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR5gs-00064L-8Z
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 19:33:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR5gs-0003DZ-2L
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 19:33:02 +0000
Date: Tue, 01 Oct 2013 19:33:02 +0000
Message-Id: <E1VR5gs-0003DZ-2L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qga: set umask 0077 when
	daemonizing (CVE-2013-2007)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a4bd762aa01b21c43aa24c5b743f4bd7c9db3e3
Author:     Laszlo Ersek <lersek@redhat.com>
AuthorDate: Tue Oct 1 15:13:33 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Oct 1 15:13:33 2013 +0000

    qga: set umask 0077 when daemonizing (CVE-2013-2007)
    
    The qemu guest agent creates a bunch of files with insecure permissions
    when started in daemon mode. For example:
    
      -rw-rw-rw- 1 root root /var/log/qemu-ga.log
      -rw-rw-rw- 1 root root /var/run/qga.state
      -rw-rw-rw- 1 root root /var/log/qga-fsfreeze-hook.log
    
    In addition, at least all files created with the "guest-file-open" QMP
    command, and all files created with shell output redirection (or
    otherwise) by utilities invoked by the fsfreeze hook script are affected.
    
    For now mask all file mode bits for "group" and "others" in
    become_daemon().
    
    Temporarily, for compatibility reasons, stick with the 0666 file-mode in
    case of files newly created by the "guest-file-open" QMP call. Do so
    without changing the umask temporarily.
    
    upstream-commit-id: c689b4f1bac352dcfd6ecb9a1d45337de0f1de67
    
    Signed-off-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 qemu-ga.c            |    2 +-
 qga/commands-posix.c |  119 ++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 117 insertions(+), 4 deletions(-)

diff --git a/qemu-ga.c b/qemu-ga.c
index 9b59a52..8764cf9 100644
--- a/qemu-ga.c
+++ b/qemu-ga.c
@@ -421,7 +421,7 @@ static void become_daemon(const char *pidfile)
         }
     }
 
-    umask(0);
+    umask(S_IRWXG | S_IRWXO);
     sid = setsid();
     if (sid < 0) {
         goto fail;
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 726930a..fbb5234 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -125,9 +125,122 @@ static GuestFileHandle *guest_file_handle_find(int64_t id)
     return NULL;
 }
 
+typedef const char * const ccpc;
+
+/* http://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html */
+static const struct {
+    ccpc *forms;
+    int oflag_base;
+} guest_file_open_modes[] = {
+    { (ccpc[]){ "r",  "rb",         NULL }, O_RDONLY                      },
+    { (ccpc[]){ "w",  "wb",         NULL }, O_WRONLY | O_CREAT | O_TRUNC  },
+    { (ccpc[]){ "a",  "ab",         NULL }, O_WRONLY | O_CREAT | O_APPEND },
+    { (ccpc[]){ "r+", "rb+", "r+b", NULL }, O_RDWR                        },
+    { (ccpc[]){ "w+", "wb+", "w+b", NULL }, O_RDWR   | O_CREAT | O_TRUNC  },
+    { (ccpc[]){ "a+", "ab+", "a+b", NULL }, O_RDWR   | O_CREAT | O_APPEND }
+};
+
+static int
+find_open_flag(const char *mode_str, Error **err)
+{
+    unsigned mode;
+
+    for (mode = 0; mode < ARRAY_SIZE(guest_file_open_modes); ++mode) {
+        ccpc *form;
+
+        form = guest_file_open_modes[mode].forms;
+        while (*form != NULL && strcmp(*form, mode_str) != 0) {
+            ++form;
+        }
+        if (*form != NULL) {
+            break;
+        }
+    }
+
+    if (mode == ARRAY_SIZE(guest_file_open_modes)) {
+        error_setg(err, "invalid file open mode '%s'", mode_str);
+        return -1;
+    }
+    return guest_file_open_modes[mode].oflag_base | O_NOCTTY | O_NONBLOCK;
+}
+
+#define DEFAULT_NEW_FILE_MODE (S_IRUSR | S_IWUSR | \
+                               S_IRGRP | S_IWGRP | \
+                               S_IROTH | S_IWOTH)
+
+static FILE *
+safe_open_or_create(const char *path, const char *mode, Error **err)
+{
+    Error *local_err = NULL;
+    int oflag;
+
+    oflag = find_open_flag(mode, &local_err);
+    if (local_err == NULL) {
+        int fd;
+
+        /* If the caller wants / allows creation of a new file, we implement it
+         * with a two step process: open() + (open() / fchmod()).
+         *
+         * First we insist on creating the file exclusively as a new file. If
+         * that succeeds, we're free to set any file-mode bits on it. (The
+         * motivation is that we want to set those file-mode bits independently
+         * of the current umask.)
+         *
+         * If the exclusive creation fails because the file already exists
+         * (EEXIST is not possible for any other reason), we just attempt to
+         * open the file, but in this case we won't be allowed to change the
+         * file-mode bits on the preexistent file.
+         *
+         * The pathname should never disappear between the two open()s in
+         * practice. If it happens, then someone very likely tried to race us.
+         * In this case just go ahead and report the ENOENT from the second
+         * open() to the caller.
+         *
+         * If the caller wants to open a preexistent file, then the first
+         * open() is decisive and its third argument is ignored, and the second
+         * open() and the fchmod() are never called.
+         */
+        fd = open(path, oflag | ((oflag & O_CREAT) ? O_EXCL : 0), 0);
+        if (fd == -1 && errno == EEXIST) {
+            oflag &= ~(unsigned)O_CREAT;
+            fd = open(path, oflag);
+        }
+
+        if (fd == -1) {
+            error_setg_errno(&local_err, errno, "failed to open file '%s' "
+                             "(mode: '%s')", path, mode);
+        } else {
+            qemu_set_cloexec(fd);
+
+            if ((oflag & O_CREAT) && fchmod(fd, DEFAULT_NEW_FILE_MODE) == -1) {
+                error_setg_errno(&local_err, errno, "failed to set permission "
+                                 "0%03o on new file '%s' (mode: '%s')",
+                                 (unsigned)DEFAULT_NEW_FILE_MODE, path, mode);
+            } else {
+                FILE *f;
+
+                f = fdopen(fd, mode);
+                if (f == NULL) {
+                    error_setg_errno(&local_err, errno, "failed to associate "
+                                     "stdio stream with file descriptor %d, "
+                                     "file '%s' (mode: '%s')", fd, path, mode);
+                } else {
+                    return f;
+                }
+            }
+
+            close(fd);
+        }
+    }
+
+    error_propagate(err, local_err);
+    return NULL;
+}
+
 int64_t qmp_guest_file_open(const char *path, bool has_mode, const char *mode, Error **err)
 {
     FILE *fh;
+    Error *local_err = NULL;
     int fd;
     int64_t ret = -1;
 
@@ -135,9 +248,9 @@ int64_t qmp_guest_file_open(const char *path, bool has_mode, const char *mode, E
         mode = "r";
     }
     slog("guest-file-open called, filepath: %s, mode: %s", path, mode);
-    fh = fopen(path, mode);
-    if (!fh) {
-        error_set(err, QERR_OPEN_FILE_FAILED, path);
+    fh = safe_open_or_create(path, mode, &local_err);
+    if (local_err != NULL) {
+        error_propagate(err, local_err);
         return -1;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Tue Oct 01 19:33:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 01 Oct 2013 19:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VR5gw-00050P-95; Tue, 01 Oct 2013 19:33:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR5gv-00050I-1B
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 19:33:05 +0000
Received: from [85.158.143.35:38553] by server-3.bemta-4.messagelabs.com id
	D8/BC-24907-0732B425; Tue, 01 Oct 2013 19:33:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1380655982!2876875!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_32,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10910 invoked from network); 1 Oct 2013 19:33:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Oct 2013 19:33:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR5gs-00064L-8Z
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 19:33:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VR5gs-0003DZ-2L
	for xen-changelog@lists.xensource.com; Tue, 01 Oct 2013 19:33:02 +0000
Date: Tue, 01 Oct 2013 19:33:02 +0000
Message-Id: <E1VR5gs-0003DZ-2L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qga: set umask 0077 when
	daemonizing (CVE-2013-2007)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a4bd762aa01b21c43aa24c5b743f4bd7c9db3e3
Author:     Laszlo Ersek <lersek@redhat.com>
AuthorDate: Tue Oct 1 15:13:33 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Oct 1 15:13:33 2013 +0000

    qga: set umask 0077 when daemonizing (CVE-2013-2007)
    
    The qemu guest agent creates a bunch of files with insecure permissions
    when started in daemon mode. For example:
    
      -rw-rw-rw- 1 root root /var/log/qemu-ga.log
      -rw-rw-rw- 1 root root /var/run/qga.state
      -rw-rw-rw- 1 root root /var/log/qga-fsfreeze-hook.log
    
    In addition, at least all files created with the "guest-file-open" QMP
    command, and all files created with shell output redirection (or
    otherwise) by utilities invoked by the fsfreeze hook script are affected.
    
    For now mask all file mode bits for "group" and "others" in
    become_daemon().
    
    Temporarily, for compatibility reasons, stick with the 0666 file-mode in
    case of files newly created by the "guest-file-open" QMP call. Do so
    without changing the umask temporarily.
    
    upstream-commit-id: c689b4f1bac352dcfd6ecb9a1d45337de0f1de67
    
    Signed-off-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 qemu-ga.c            |    2 +-
 qga/commands-posix.c |  119 ++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 117 insertions(+), 4 deletions(-)

diff --git a/qemu-ga.c b/qemu-ga.c
index 9b59a52..8764cf9 100644
--- a/qemu-ga.c
+++ b/qemu-ga.c
@@ -421,7 +421,7 @@ static void become_daemon(const char *pidfile)
         }
     }
 
-    umask(0);
+    umask(S_IRWXG | S_IRWXO);
     sid = setsid();
     if (sid < 0) {
         goto fail;
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 726930a..fbb5234 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -125,9 +125,122 @@ static GuestFileHandle *guest_file_handle_find(int64_t id)
     return NULL;
 }
 
+typedef const char * const ccpc;
+
+/* http://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html */
+static const struct {
+    ccpc *forms;
+    int oflag_base;
+} guest_file_open_modes[] = {
+    { (ccpc[]){ "r",  "rb",         NULL }, O_RDONLY                      },
+    { (ccpc[]){ "w",  "wb",         NULL }, O_WRONLY | O_CREAT | O_TRUNC  },
+    { (ccpc[]){ "a",  "ab",         NULL }, O_WRONLY | O_CREAT | O_APPEND },
+    { (ccpc[]){ "r+", "rb+", "r+b", NULL }, O_RDWR                        },
+    { (ccpc[]){ "w+", "wb+", "w+b", NULL }, O_RDWR   | O_CREAT | O_TRUNC  },
+    { (ccpc[]){ "a+", "ab+", "a+b", NULL }, O_RDWR   | O_CREAT | O_APPEND }
+};
+
+static int
+find_open_flag(const char *mode_str, Error **err)
+{
+    unsigned mode;
+
+    for (mode = 0; mode < ARRAY_SIZE(guest_file_open_modes); ++mode) {
+        ccpc *form;
+
+        form = guest_file_open_modes[mode].forms;
+        while (*form != NULL && strcmp(*form, mode_str) != 0) {
+            ++form;
+        }
+        if (*form != NULL) {
+            break;
+        }
+    }
+
+    if (mode == ARRAY_SIZE(guest_file_open_modes)) {
+        error_setg(err, "invalid file open mode '%s'", mode_str);
+        return -1;
+    }
+    return guest_file_open_modes[mode].oflag_base | O_NOCTTY | O_NONBLOCK;
+}
+
+#define DEFAULT_NEW_FILE_MODE (S_IRUSR | S_IWUSR | \
+                               S_IRGRP | S_IWGRP | \
+                               S_IROTH | S_IWOTH)
+
+static FILE *
+safe_open_or_create(const char *path, const char *mode, Error **err)
+{
+    Error *local_err = NULL;
+    int oflag;
+
+    oflag = find_open_flag(mode, &local_err);
+    if (local_err == NULL) {
+        int fd;
+
+        /* If the caller wants / allows creation of a new file, we implement it
+         * with a two step process: open() + (open() / fchmod()).
+         *
+         * First we insist on creating the file exclusively as a new file. If
+         * that succeeds, we're free to set any file-mode bits on it. (The
+         * motivation is that we want to set those file-mode bits independently
+         * of the current umask.)
+         *
+         * If the exclusive creation fails because the file already exists
+         * (EEXIST is not possible for any other reason), we just attempt to
+         * open the file, but in this case we won't be allowed to change the
+         * file-mode bits on the preexistent file.
+         *
+         * The pathname should never disappear between the two open()s in
+         * practice. If it happens, then someone very likely tried to race us.
+         * In this case just go ahead and report the ENOENT from the second
+         * open() to the caller.
+         *
+         * If the caller wants to open a preexistent file, then the first
+         * open() is decisive and its third argument is ignored, and the second
+         * open() and the fchmod() are never called.
+         */
+        fd = open(path, oflag | ((oflag & O_CREAT) ? O_EXCL : 0), 0);
+        if (fd == -1 && errno == EEXIST) {
+            oflag &= ~(unsigned)O_CREAT;
+            fd = open(path, oflag);
+        }
+
+        if (fd == -1) {
+            error_setg_errno(&local_err, errno, "failed to open file '%s' "
+                             "(mode: '%s')", path, mode);
+        } else {
+            qemu_set_cloexec(fd);
+
+            if ((oflag & O_CREAT) && fchmod(fd, DEFAULT_NEW_FILE_MODE) == -1) {
+                error_setg_errno(&local_err, errno, "failed to set permission "
+                                 "0%03o on new file '%s' (mode: '%s')",
+                                 (unsigned)DEFAULT_NEW_FILE_MODE, path, mode);
+            } else {
+                FILE *f;
+
+                f = fdopen(fd, mode);
+                if (f == NULL) {
+                    error_setg_errno(&local_err, errno, "failed to associate "
+                                     "stdio stream with file descriptor %d, "
+                                     "file '%s' (mode: '%s')", fd, path, mode);
+                } else {
+                    return f;
+                }
+            }
+
+            close(fd);
+        }
+    }
+
+    error_propagate(err, local_err);
+    return NULL;
+}
+
 int64_t qmp_guest_file_open(const char *path, bool has_mode, const char *mode, Error **err)
 {
     FILE *fh;
+    Error *local_err = NULL;
     int fd;
     int64_t ret = -1;
 
@@ -135,9 +248,9 @@ int64_t qmp_guest_file_open(const char *path, bool has_mode, const char *mode, E
         mode = "r";
     }
     slog("guest-file-open called, filepath: %s, mode: %s", path, mode);
-    fh = fopen(path, mode);
-    if (!fh) {
-        error_set(err, QERR_OPEN_FILE_FAILED, path);
+    fh = safe_open_or_create(path, mode, &local_err);
+    if (local_err != NULL) {
+        error_propagate(err, local_err);
         return -1;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Fri Oct 04 11:55:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VS3yP-0003tX-VS; Fri, 04 Oct 2013 11:55: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 1VS3yO-0003tQ-H8
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:08 +0000
Received: from [85.158.143.35:49639] by server-2.bemta-4.messagelabs.com id
	35/CD-31802-B9CAE425; Fri, 04 Oct 2013 11:55:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1380887706!2469079!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23156 invoked from network); 4 Oct 2013 11:55:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:55:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yL-0006CW-G4
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yK-0003LO-PR
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:04 +0000
Date: Fri, 04 Oct 2013 11:55:04 +0000
Message-Id: <E1VS3yK-0003LO-PR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: handle null lists in
	libxl_string_list_length
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a7fa7a4fd6b94c2ace19774ba4ba9f0185c2f2c1
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Fri Sep 27 23:29:10 2013 +1200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 13:37:17 2013 +0100

    libxl: handle null lists in libxl_string_list_length
    
    After commit b0be2b12 ("libxl: fix libxl_string_list_length and its only
    caller") libxl_string_list_length no longer handles null (empty) lists. Fix
    so they are handled, returning length 0.
    
    While at it, remove the unneccessary undereferenced null pointer check
    and tidy the layout of the function.
    
    Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index ca24ca3..b6dacea 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -200,9 +200,12 @@ void libxl_string_list_dispose(libxl_string_list *psl)
 
 int libxl_string_list_length(const libxl_string_list *psl)
 {
-    if (!psl) return 0;
     int i = 0;
-    while ((*psl)[i]) i++;
+
+    if (*psl)
+        while ((*psl)[i])
+            i++;
+
     return i;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 04 11:55:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VS3yP-0003tX-VS; Fri, 04 Oct 2013 11:55: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 1VS3yO-0003tQ-H8
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:08 +0000
Received: from [85.158.143.35:49639] by server-2.bemta-4.messagelabs.com id
	35/CD-31802-B9CAE425; Fri, 04 Oct 2013 11:55:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1380887706!2469079!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23156 invoked from network); 4 Oct 2013 11:55:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:55:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yL-0006CW-G4
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yK-0003LO-PR
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:04 +0000
Date: Fri, 04 Oct 2013 11:55:04 +0000
Message-Id: <E1VS3yK-0003LO-PR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: handle null lists in
	libxl_string_list_length
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a7fa7a4fd6b94c2ace19774ba4ba9f0185c2f2c1
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Fri Sep 27 23:29:10 2013 +1200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 13:37:17 2013 +0100

    libxl: handle null lists in libxl_string_list_length
    
    After commit b0be2b12 ("libxl: fix libxl_string_list_length and its only
    caller") libxl_string_list_length no longer handles null (empty) lists. Fix
    so they are handled, returning length 0.
    
    While at it, remove the unneccessary undereferenced null pointer check
    and tidy the layout of the function.
    
    Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index ca24ca3..b6dacea 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -200,9 +200,12 @@ void libxl_string_list_dispose(libxl_string_list *psl)
 
 int libxl_string_list_length(const libxl_string_list *psl)
 {
-    if (!psl) return 0;
     int i = 0;
-    while ((*psl)[i]) i++;
+
+    if (*psl)
+        while ((*psl)[i])
+            i++;
+
     return i;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 04 11:55:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VS3yZ-0003uC-1y; Fri, 04 Oct 2013 11:55:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yY-0003u0-CJ
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:18 +0000
Received: from [85.158.137.68:16002] by server-16.bemta-3.messagelabs.com id
	31/48-06346-5ACAE425; Fri, 04 Oct 2013 11:55:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1380887715!6640737!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31191 invoked from network); 4 Oct 2013 11:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yV-0006CZ-Ls
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yV-0003MV-Il
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:15 +0000
Date: Fri, 04 Oct 2013 11:55:15 +0000
Message-Id: <E1VS3yV-0003MV-Il@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: fork before execing vncviewer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6ea993cbb173bbc4bb5f8095724735aa6439d164
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Sep 27 11:16:22 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 13:39:53 2013 +0100

    xl: fork before execing vncviewer
    
    Otherwise we don't daemonize to monitor the domain.
    
    Heavily cargo-culted from autoconnect-console and only compile tested.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Tested-by: Olaf Hering <olaf@aepfle.de>
---
 tools/libxl/xl.h         |    2 +-
 tools/libxl/xl_cmdimpl.c |   33 ++++++++++++++++++++++++++++++++-
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index e72a7d2..e005c39 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -128,7 +128,7 @@ typedef struct {
 } xlchild;
 
 typedef enum {
-    child_console, child_waitdaemon, child_migration,
+    child_console, child_waitdaemon, child_migration, child_vncviewer,
     child_max
 } xlchildnum;
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 642b130..a91b427 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -194,6 +194,37 @@ static int vncviewer(uint32_t domid, int autopass)
     return 1;
 }
 
+static void vncviewer_child_report(void)
+{
+    if (xl_child_pid(child_vncviewer)) {
+        int status;
+        pid_t got = xl_waitpid(child_vncviewer, &status, 0);
+        if (got < 0)
+            perror("xl: warning, failed to waitpid for vncviewer child");
+        else if (status)
+            libxl_report_child_exitstatus(ctx, XTL_ERROR, "vncviewer child",
+                                          xl_child_pid(child_vncviewer), status);
+    }
+}
+
+static void autoconnect_vncviewer(uint32_t domid, int autopass)
+{
+    vncviewer_child_report();
+
+    pid_t pid = xl_fork(child_vncviewer);
+    if (pid < 0) {
+        perror("unable to fork vncviewer");
+        return;
+    } else if (pid > 0)
+        return;
+
+    postfork();
+
+    sleep(1);
+    vncviewer(domid, autopass);
+    _exit(1);
+}
+
 static int acquire_lock(void)
 {
     int rc;
@@ -2093,7 +2124,7 @@ start:
         goto out;
 
     if (dom_info->vnc)
-        vncviewer(domid, vncautopass);
+        autoconnect_vncviewer(domid, vncautopass);
 
     if (need_daemon) {
         char *fullname, *name;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 04 11:55:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VS3yZ-0003uC-1y; Fri, 04 Oct 2013 11:55:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yY-0003u0-CJ
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:18 +0000
Received: from [85.158.137.68:16002] by server-16.bemta-3.messagelabs.com id
	31/48-06346-5ACAE425; Fri, 04 Oct 2013 11:55:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1380887715!6640737!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31191 invoked from network); 4 Oct 2013 11:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yV-0006CZ-Ls
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yV-0003MV-Il
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:15 +0000
Date: Fri, 04 Oct 2013 11:55:15 +0000
Message-Id: <E1VS3yV-0003MV-Il@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: fork before execing vncviewer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6ea993cbb173bbc4bb5f8095724735aa6439d164
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Sep 27 11:16:22 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 13:39:53 2013 +0100

    xl: fork before execing vncviewer
    
    Otherwise we don't daemonize to monitor the domain.
    
    Heavily cargo-culted from autoconnect-console and only compile tested.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Tested-by: Olaf Hering <olaf@aepfle.de>
---
 tools/libxl/xl.h         |    2 +-
 tools/libxl/xl_cmdimpl.c |   33 ++++++++++++++++++++++++++++++++-
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index e72a7d2..e005c39 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -128,7 +128,7 @@ typedef struct {
 } xlchild;
 
 typedef enum {
-    child_console, child_waitdaemon, child_migration,
+    child_console, child_waitdaemon, child_migration, child_vncviewer,
     child_max
 } xlchildnum;
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 642b130..a91b427 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -194,6 +194,37 @@ static int vncviewer(uint32_t domid, int autopass)
     return 1;
 }
 
+static void vncviewer_child_report(void)
+{
+    if (xl_child_pid(child_vncviewer)) {
+        int status;
+        pid_t got = xl_waitpid(child_vncviewer, &status, 0);
+        if (got < 0)
+            perror("xl: warning, failed to waitpid for vncviewer child");
+        else if (status)
+            libxl_report_child_exitstatus(ctx, XTL_ERROR, "vncviewer child",
+                                          xl_child_pid(child_vncviewer), status);
+    }
+}
+
+static void autoconnect_vncviewer(uint32_t domid, int autopass)
+{
+    vncviewer_child_report();
+
+    pid_t pid = xl_fork(child_vncviewer);
+    if (pid < 0) {
+        perror("unable to fork vncviewer");
+        return;
+    } else if (pid > 0)
+        return;
+
+    postfork();
+
+    sleep(1);
+    vncviewer(domid, autopass);
+    _exit(1);
+}
+
 static int acquire_lock(void)
 {
     int rc;
@@ -2093,7 +2124,7 @@ start:
         goto out;
 
     if (dom_info->vnc)
-        vncviewer(domid, vncautopass);
+        autoconnect_vncviewer(domid, vncautopass);
 
     if (need_daemon) {
         char *fullname, *name;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 04 11:55:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VS3yj-0003vH-54; Fri, 04 Oct 2013 11:55: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 1VS3yi-0003v6-FP
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:28 +0000
Received: from [85.158.139.211:24062] by server-12.bemta-5.messagelabs.com id
	2C/64-18373-FACAE425; Fri, 04 Oct 2013 11:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1380887726!6397038!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7964 invoked from network); 4 Oct 2013 11:55:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:55:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yf-0006Cf-SN
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yf-0003Ms-Oq
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:25 +0000
Date: Fri, 04 Oct 2013 11:55:25 +0000
Message-Id: <E1VS3yf-0003Ms-Oq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm32: don't export v7_init
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b685c64be7a8d870313c9a652a15eadf9f25f195
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Sep 27 17:49:52 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 13:40:56 2013 +0100

    xen/arm32: don't export v7_init
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/proc-v7.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm32/proc-v7.S b/xen/arch/arm/arm32/proc-v7.S
index e38d5a4..6577a89 100644
--- a/xen/arch/arm/arm32/proc-v7.S
+++ b/xen/arch/arm/arm32/proc-v7.S
@@ -20,7 +20,7 @@
 #include <asm/asm_defns.h>
 #include <asm/arm32/processor.h>
 
-GLOBAL(v7_init)
+v7_init:
         /* Set up the SMP bit in ACTLR */
         mrc   CP32(r0, ACTLR)
         orr   r0, r0, #(ACTLR_V7_SMP) /* enable SMP bit */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 04 11:55:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VS3yj-0003vH-54; Fri, 04 Oct 2013 11:55: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 1VS3yi-0003v6-FP
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:28 +0000
Received: from [85.158.139.211:24062] by server-12.bemta-5.messagelabs.com id
	2C/64-18373-FACAE425; Fri, 04 Oct 2013 11:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1380887726!6397038!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7964 invoked from network); 4 Oct 2013 11:55:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:55:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yf-0006Cf-SN
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yf-0003Ms-Oq
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:25 +0000
Date: Fri, 04 Oct 2013 11:55:25 +0000
Message-Id: <E1VS3yf-0003Ms-Oq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm32: don't export v7_init
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b685c64be7a8d870313c9a652a15eadf9f25f195
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Sep 27 17:49:52 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 13:40:56 2013 +0100

    xen/arm32: don't export v7_init
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/proc-v7.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm32/proc-v7.S b/xen/arch/arm/arm32/proc-v7.S
index e38d5a4..6577a89 100644
--- a/xen/arch/arm/arm32/proc-v7.S
+++ b/xen/arch/arm/arm32/proc-v7.S
@@ -20,7 +20,7 @@
 #include <asm/asm_defns.h>
 #include <asm/arm32/processor.h>
 
-GLOBAL(v7_init)
+v7_init:
         /* Set up the SMP bit in ACTLR */
         mrc   CP32(r0, ACTLR)
         orr   r0, r0, #(ACTLR_V7_SMP) /* enable SMP bit */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 04 11:55:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:55:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VS3yt-0003wk-8J; Fri, 04 Oct 2013 11:55: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 1VS3ys-0003wL-9a
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:38 +0000
Received: from [85.158.143.35:41395] by server-2.bemta-4.messagelabs.com id
	1B/7E-31802-9BCAE425; Fri, 04 Oct 2013 11:55:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1380887736!3904095!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13210 invoked from network); 4 Oct 2013 11:55:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:55:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yq-0006Ck-2F
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yp-0003NI-Vy
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:36 +0000
Date: Fri, 04 Oct 2013 11:55:35 +0000
Message-Id: <E1VS3yp-0003NI-Vy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xm-test: fix the ip allocation 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 c8f5eb4b8093ac6acc947a4df5779e69005d16c4
Author:     Zhu Yanhai <zhu.yanhai@gmail.com>
AuthorDate: Mon Sep 30 16:12:10 2013 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 13:43:23 2013 +0100

    xm-test: fix the ip allocation function
    
    __findFirstOctetIP() is expecting min and max available octets according to
    its code, however the caller getFreeIP() gives it the min octet and (max -
    min + 1), which is the length instead.
    
    Signed-off-by: Zhu Yanhai <gaoyang.zyh@taobao.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xm-test/lib/XmTestLib/NetConfig.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/xm-test/lib/XmTestLib/NetConfig.py b/tools/xm-test/lib/XmTestLib/NetConfig.py
index 1f834cc..5013bef 100644
--- a/tools/xm-test/lib/XmTestLib/NetConfig.py
+++ b/tools/xm-test/lib/XmTestLib/NetConfig.py
@@ -159,7 +159,8 @@ class NetConfig:
     def setUsedIP(self, domname, interface, ip):
         self.used_ips['%s:%s' % (domname, interface)] = ip
 
-    def __findFirstOctetIP(self, prefix, min, max):
+    def __findFirstOctetIP(self, prefix, min, len):
+        max = min + len
         for i in range(min, max):
             ip = '%s%s' % (prefix, str(i))
             found = False
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 04 11:55:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:55:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VS3yt-0003wk-8J; Fri, 04 Oct 2013 11:55: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 1VS3ys-0003wL-9a
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:38 +0000
Received: from [85.158.143.35:41395] by server-2.bemta-4.messagelabs.com id
	1B/7E-31802-9BCAE425; Fri, 04 Oct 2013 11:55:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1380887736!3904095!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13210 invoked from network); 4 Oct 2013 11:55:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:55:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yq-0006Ck-2F
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3yp-0003NI-Vy
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:36 +0000
Date: Fri, 04 Oct 2013 11:55:35 +0000
Message-Id: <E1VS3yp-0003NI-Vy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xm-test: fix the ip allocation 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 c8f5eb4b8093ac6acc947a4df5779e69005d16c4
Author:     Zhu Yanhai <zhu.yanhai@gmail.com>
AuthorDate: Mon Sep 30 16:12:10 2013 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 13:43:23 2013 +0100

    xm-test: fix the ip allocation function
    
    __findFirstOctetIP() is expecting min and max available octets according to
    its code, however the caller getFreeIP() gives it the min octet and (max -
    min + 1), which is the length instead.
    
    Signed-off-by: Zhu Yanhai <gaoyang.zyh@taobao.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xm-test/lib/XmTestLib/NetConfig.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/xm-test/lib/XmTestLib/NetConfig.py b/tools/xm-test/lib/XmTestLib/NetConfig.py
index 1f834cc..5013bef 100644
--- a/tools/xm-test/lib/XmTestLib/NetConfig.py
+++ b/tools/xm-test/lib/XmTestLib/NetConfig.py
@@ -159,7 +159,8 @@ class NetConfig:
     def setUsedIP(self, domname, interface, ip):
         self.used_ips['%s:%s' % (domname, interface)] = ip
 
-    def __findFirstOctetIP(self, prefix, min, max):
+    def __findFirstOctetIP(self, prefix, min, len):
+        max = min + len
         for i in range(min, max):
             ip = '%s%s' % (prefix, str(i))
             found = False
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Oct 04 11:55:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:55: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 1VS3z3-0003y9-BW; Fri, 04 Oct 2013 11: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 1VS3z2-0003xs-HO
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:48 +0000
Received: from [85.158.143.35:57046] by server-1.bemta-4.messagelabs.com id
	C5/2B-11076-3CCAE425; Fri, 04 Oct 2013 11:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1380887746!8724183!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5488 invoked from network); 4 Oct 2013 11:55:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:55:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3z0-0006Cq-7F
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3z0-0003Ne-4s
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:46 +0000
Date: Fri, 04 Oct 2013 11:55:46 +0000
Message-Id: <E1VS3z0-0003Ne-4s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: only munmap when something has
	actually been mapped in change_pte
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c827d7f39f7a184ed73e435237bbba54d4272bc1
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Sun Sep 29 14:35:02 2013 +1300
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 14:06:43 2013 +0100

    libxc: only munmap when something has actually been mapped in change_pte
    
    Coverity-ID: 1055269
    signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_offline_page.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xc_offline_page.c
index fbb53f5..8195efb 100644
--- a/tools/libxc/xc_offline_page.c
+++ b/tools/libxc/xc_offline_page.c
@@ -317,10 +317,10 @@ static int change_pte(xc_interface *xch, int domid,
                     goto failed;
                 }
             }
-        }
 
-        munmap(content, PAGE_SIZE);
-        content = NULL;
+            munmap(content, PAGE_SIZE);
+            content = NULL;
+        }
     }
 
     if ( xc_flush_mmu_updates(xch, mmu) )
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 04 11:55:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:55: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 1VS3z3-0003y9-BW; Fri, 04 Oct 2013 11: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 1VS3z2-0003xs-HO
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:48 +0000
Received: from [85.158.143.35:57046] by server-1.bemta-4.messagelabs.com id
	C5/2B-11076-3CCAE425; Fri, 04 Oct 2013 11:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1380887746!8724183!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5488 invoked from network); 4 Oct 2013 11:55:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:55:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3z0-0006Cq-7F
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3z0-0003Ne-4s
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:46 +0000
Date: Fri, 04 Oct 2013 11:55:46 +0000
Message-Id: <E1VS3z0-0003Ne-4s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: only munmap when something has
	actually been mapped in change_pte
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c827d7f39f7a184ed73e435237bbba54d4272bc1
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Sun Sep 29 14:35:02 2013 +1300
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 14:06:43 2013 +0100

    libxc: only munmap when something has actually been mapped in change_pte
    
    Coverity-ID: 1055269
    signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_offline_page.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xc_offline_page.c
index fbb53f5..8195efb 100644
--- a/tools/libxc/xc_offline_page.c
+++ b/tools/libxc/xc_offline_page.c
@@ -317,10 +317,10 @@ static int change_pte(xc_interface *xch, int domid,
                     goto failed;
                 }
             }
-        }
 
-        munmap(content, PAGE_SIZE);
-        content = NULL;
+            munmap(content, PAGE_SIZE);
+            content = NULL;
+        }
     }
 
     if ( xc_flush_mmu_updates(xch, mmu) )
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 04 11:56:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:56: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 1VS3zE-00040J-Ec; Fri, 04 Oct 2013 11:56:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zD-000401-2S
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:59 +0000
Received: from [85.158.139.211:4196] by server-12.bemta-5.messagelabs.com id
	CE/65-18373-ECCAE425; Fri, 04 Oct 2013 11:55:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1380887756!6419242!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17819 invoked from network); 4 Oct 2013 11:55:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:55:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zA-0006D2-EK
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zA-0003O1-A8
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:56 +0000
Date: Fri, 04 Oct 2013 11:55:56 +0000
Message-Id: <E1VS3zA-0003O1-A8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: only put poller if already
	gotten in libxl_event_wait
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c1f3f1748daec78533911035d0aaa07666bf8ea8
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Sun Sep 29 18:24:36 2013 +1300
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 14:07:30 2013 +0100

    libxl: only put poller if already gotten in libxl_event_wait
    
    Coverity-ID: 1055292
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_event.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index e42b371..6f033dd 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1476,7 +1476,8 @@ int libxl_event_wait(libxl_ctx *ctx, libxl_event **event_r,
     }
 
  out:
-    libxl__poller_put(ctx, poller);
+    if (poller)
+        libxl__poller_put(ctx, poller);
 
     CTX_UNLOCK;
     EGC_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 Oct 04 11:56:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:56: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 1VS3zE-00040J-Ec; Fri, 04 Oct 2013 11:56:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zD-000401-2S
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:59 +0000
Received: from [85.158.139.211:4196] by server-12.bemta-5.messagelabs.com id
	CE/65-18373-ECCAE425; Fri, 04 Oct 2013 11:55:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1380887756!6419242!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17819 invoked from network); 4 Oct 2013 11:55:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:55:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zA-0006D2-EK
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zA-0003O1-A8
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:55:56 +0000
Date: Fri, 04 Oct 2013 11:55:56 +0000
Message-Id: <E1VS3zA-0003O1-A8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: only put poller if already
	gotten in libxl_event_wait
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c1f3f1748daec78533911035d0aaa07666bf8ea8
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Sun Sep 29 18:24:36 2013 +1300
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 14:07:30 2013 +0100

    libxl: only put poller if already gotten in libxl_event_wait
    
    Coverity-ID: 1055292
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_event.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index e42b371..6f033dd 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1476,7 +1476,8 @@ int libxl_event_wait(libxl_ctx *ctx, libxl_event **event_r,
     }
 
  out:
-    libxl__poller_put(ctx, poller);
+    if (poller)
+        libxl__poller_put(ctx, poller);
 
     CTX_UNLOCK;
     EGC_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 Oct 04 11:56:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:56: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 1VS3zP-00042F-Hf; Fri, 04 Oct 2013 11:56: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 1VS3zN-00041o-QA
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:56:10 +0000
Received: from [85.158.139.211:4991] by server-7.bemta-5.messagelabs.com id
	BD/DD-24315-8DCAE425; Fri, 04 Oct 2013 11:56:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1380887767!6414666!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27612 invoked from network); 4 Oct 2013 11:56:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:56:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zK-0006Db-Rc
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:56:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zK-0003OX-Gm
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:56:06 +0000
Date: Fri, 04 Oct 2013 11:56:06 +0000
Message-Id: <E1VS3zK-0003OX-Gm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: map_domain_page: reuse slots
	with avail == 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 14cd36c23d7165156e1ec4ecb082363dfffe7537
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Sep 30 13:06:12 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 14:12:04 2013 +0100

    xen/arm: map_domain_page: reuse slots with avail == 0
    
    If a slot has avail == 0 but still points to the right mfn, reuse it.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 068d7a0..474dfef 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -259,7 +259,15 @@ void *map_domain_page(unsigned long mfn)
           i < DOMHEAP_ENTRIES;
           slot = (slot + 1) % DOMHEAP_ENTRIES, i++ )
     {
-        if ( map[slot].pt.avail == 0 )
+        if ( map[slot].pt.avail < 0xf &&
+             map[slot].pt.base == slot_mfn &&
+             map[slot].pt.valid )
+        {
+            /* This slot already points to the right place; reuse it */
+            map[slot].pt.avail++;
+            break;
+        }
+        else if ( map[slot].pt.avail == 0 )
         {
             /* Commandeer this 2MB slot */
             pte = mfn_to_xen_entry(slot_mfn);
@@ -267,12 +275,7 @@ void *map_domain_page(unsigned long mfn)
             write_pte(map + slot, pte);
             break;
         }
-        else if ( map[slot].pt.avail < 0xf && map[slot].pt.base == slot_mfn )
-        {
-            /* This slot already points to the right place; reuse it */
-            map[slot].pt.avail++;
-            break;
-        }
+
     }
     /* If the map fills up, the callers have misbehaved. */
     BUG_ON(i == DOMHEAP_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 Fri Oct 04 11:56:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:56: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 1VS3zP-00042F-Hf; Fri, 04 Oct 2013 11:56: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 1VS3zN-00041o-QA
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:56:10 +0000
Received: from [85.158.139.211:4991] by server-7.bemta-5.messagelabs.com id
	BD/DD-24315-8DCAE425; Fri, 04 Oct 2013 11:56:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1380887767!6414666!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27612 invoked from network); 4 Oct 2013 11:56:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:56:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zK-0006Db-Rc
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:56:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zK-0003OX-Gm
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:56:06 +0000
Date: Fri, 04 Oct 2013 11:56:06 +0000
Message-Id: <E1VS3zK-0003OX-Gm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: map_domain_page: reuse slots
	with avail == 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 14cd36c23d7165156e1ec4ecb082363dfffe7537
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Sep 30 13:06:12 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 14:12:04 2013 +0100

    xen/arm: map_domain_page: reuse slots with avail == 0
    
    If a slot has avail == 0 but still points to the right mfn, reuse it.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 068d7a0..474dfef 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -259,7 +259,15 @@ void *map_domain_page(unsigned long mfn)
           i < DOMHEAP_ENTRIES;
           slot = (slot + 1) % DOMHEAP_ENTRIES, i++ )
     {
-        if ( map[slot].pt.avail == 0 )
+        if ( map[slot].pt.avail < 0xf &&
+             map[slot].pt.base == slot_mfn &&
+             map[slot].pt.valid )
+        {
+            /* This slot already points to the right place; reuse it */
+            map[slot].pt.avail++;
+            break;
+        }
+        else if ( map[slot].pt.avail == 0 )
         {
             /* Commandeer this 2MB slot */
             pte = mfn_to_xen_entry(slot_mfn);
@@ -267,12 +275,7 @@ void *map_domain_page(unsigned long mfn)
             write_pte(map + slot, pte);
             break;
         }
-        else if ( map[slot].pt.avail < 0xf && map[slot].pt.base == slot_mfn )
-        {
-            /* This slot already points to the right place; reuse it */
-            map[slot].pt.avail++;
-            break;
-        }
+
     }
     /* If the map fills up, the callers have misbehaved. */
     BUG_ON(i == DOMHEAP_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 Fri Oct 04 11:56:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:56: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 1VS3zZ-00044R-39; Fri, 04 Oct 2013 11:56:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zX-00043v-9K
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:56:19 +0000
Received: from [85.158.143.35:2239] by server-2.bemta-4.messagelabs.com id
	BC/8F-31802-2ECAE425; Fri, 04 Oct 2013 11:56:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1380887777!3737771!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21437 invoked from network); 4 Oct 2013 11:56:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:56:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zV-0006Dh-08
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:56:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zU-0003PT-Ue
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:56:16 +0000
Date: Fri, 04 Oct 2013 11:56:16 +0000
Message-Id: <E1VS3zU-0003PT-Ue@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: correctly handle
	libxl_get_cpu_topology failure in libxl_{cpu,
	node}map_to_{node, cpu}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 1e143e2ae8be3ba86c2e931a1ee8d91efca08f89
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Sun Sep 29 18:47:37 2013 +1300
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 14:45:54 2013 +0100

    libxl: correctly handle libxl_get_cpu_topology failure in libxl_{cpu, node}map_to_{node, cpu}map
    
    Initialize nr_cpus to 0 so that if it is unchanged by a failing
    libxl_get_cpu_topology, libxl_cputopology_list_free still works OK
    afterward.
    
    Coverity-ID: 1055294
    Coverity-ID: 1055295
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 tools/libxl/libxl_utils.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 4309e5e..244725b 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -650,7 +650,7 @@ int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
                             libxl_bitmap *cpumap)
 {
     libxl_cputopology *tinfo = NULL;
-    int nr_cpus, i, rc = 0;
+    int nr_cpus = 0, i, rc = 0;
 
     tinfo = libxl_get_cpu_topology(ctx, &nr_cpus);
     if (tinfo == NULL) {
@@ -673,7 +673,7 @@ int libxl_cpumap_to_nodemap(libxl_ctx *ctx,
                             libxl_bitmap *nodemap)
 {
     libxl_cputopology *tinfo = NULL;
-    int nr_cpus, i, rc = 0;
+    int nr_cpus = 0, i, rc = 0;
 
     tinfo = libxl_get_cpu_topology(ctx, &nr_cpus);
     if (tinfo == 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 Fri Oct 04 11:56:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Oct 2013 11:56: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 1VS3zZ-00044R-39; Fri, 04 Oct 2013 11:56:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zX-00043v-9K
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:56:19 +0000
Received: from [85.158.143.35:2239] by server-2.bemta-4.messagelabs.com id
	BC/8F-31802-2ECAE425; Fri, 04 Oct 2013 11:56:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1380887777!3737771!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21437 invoked from network); 4 Oct 2013 11:56:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Oct 2013 11:56:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zV-0006Dh-08
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:56:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VS3zU-0003PT-Ue
	for xen-changelog@lists.xensource.com; Fri, 04 Oct 2013 11:56:16 +0000
Date: Fri, 04 Oct 2013 11:56:16 +0000
Message-Id: <E1VS3zU-0003PT-Ue@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: correctly handle
	libxl_get_cpu_topology failure in libxl_{cpu,
	node}map_to_{node, cpu}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 1e143e2ae8be3ba86c2e931a1ee8d91efca08f89
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Sun Sep 29 18:47:37 2013 +1300
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 3 14:45:54 2013 +0100

    libxl: correctly handle libxl_get_cpu_topology failure in libxl_{cpu, node}map_to_{node, cpu}map
    
    Initialize nr_cpus to 0 so that if it is unchanged by a failing
    libxl_get_cpu_topology, libxl_cputopology_list_free still works OK
    afterward.
    
    Coverity-ID: 1055294
    Coverity-ID: 1055295
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 tools/libxl/libxl_utils.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 4309e5e..244725b 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -650,7 +650,7 @@ int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
                             libxl_bitmap *cpumap)
 {
     libxl_cputopology *tinfo = NULL;
-    int nr_cpus, i, rc = 0;
+    int nr_cpus = 0, i, rc = 0;
 
     tinfo = libxl_get_cpu_topology(ctx, &nr_cpus);
     if (tinfo == NULL) {
@@ -673,7 +673,7 @@ int libxl_cpumap_to_nodemap(libxl_ctx *ctx,
                             libxl_bitmap *nodemap)
 {
     libxl_cputopology *tinfo = NULL;
-    int nr_cpus, i, rc = 0;
+    int nr_cpus = 0, i, rc = 0;
 
     tinfo = libxl_get_cpu_topology(ctx, &nr_cpus);
     if (tinfo == 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 Sat Oct 05 01:33:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGk0-0002id-CC; Sat, 05 Oct 2013 01:33: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 1VSGjz-0002iT-3s
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:07 +0000
Received: from [85.158.139.211:18185] by server-14.bemta-5.messagelabs.com id
	24/CB-12040-15C6F425; Sat, 05 Oct 2013 01:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1380936783!6509244!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19381 invoked from network); 5 Oct 2013 01:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGjv-0005SN-FT
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGjv-0002EK-8t
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:03 +0000
Date: Sat, 05 Oct 2013 01:33:03 +0000
Message-Id: <E1VSGjv-0002EK-8t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/idle: Fix get_cpu_idle_time()'s
	interaction with offline pcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0aa27ce3351f7eb09d13e863a1d5f303086aa32a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 4 12:23:23 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:23:23 2013 +0200

    x86/idle: Fix get_cpu_idle_time()'s interaction with offline pcpus
    
    Checking for "idle_vcpu[cpu] != NULL" is insufficient protection against
    offline pcpus.  From a hypercall, vcpu_runstate_get() will determine "v !=
    current", and try to take the vcpu_schedule_lock().  This will try to look up
    per_cpu(schedule_data, v->processor) and promptly suffer a NULL structure
    deference as v->processors' __per_cpu_offset is INVALID_PERCPU_AREA.
    
    One example might look like this:
    
    ...
    Xen call trace:
       [<ffff82c4c0126ddb>] vcpu_runstate_get+0x50/0x113
       [<ffff82c4c0126ec6>] get_cpu_idle_time+0x28/0x2e
       [<ffff82c4c012b5cb>] do_sysctl+0x3db/0xeb8
       [<ffff82c4c023280d>] compat_hypercall+0xbd/0x116
    
    Pagetable walk from 0000000000000040:
     L4[0x000] = 0000000186df8027 0000000000028207
     L3[0x000] = 0000000188e36027 00000000000261c9
     L2[0x000] = 0000000000000000 ffffffffffffffff
    
    ****************************************
    Panic on CPU 11:
    ...
    
    get_cpu_idle_time() has been updated to correctly deal with offline pcpus
    itself by returning 0, in the same way as it would if it was missing the
    idle_vcpu[] pointer.
    
    In doing so, XENPF_getidletime needed updating to correctly retain its
    described behaviour of clearing bits in the cpumap for offline pcpus.
    
    As this crash can only be triggered with toolstack hypercalls, it is not a
    security issue and just a simple bug.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/platform_hypercall.c |    8 ++++++--
 xen/common/schedule.c             |    9 ++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 7175a82..2162811 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -355,10 +355,14 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
         for_each_cpu ( cpu, cpumap )
         {
-            if ( idle_vcpu[cpu] == NULL )
-                cpumask_clear_cpu(cpu, cpumap);
             idletime = get_cpu_idle_time(cpu);
 
+            if ( !idletime )
+            {
+                cpumask_clear_cpu(cpu, cpumap);
+                continue;
+            }
+
             if ( copy_to_guest_offset(idletimes, cpu, &idletime, 1) )
             {
                 ret = -EFAULT;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index a8398bd..1ddfb22 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -176,13 +176,12 @@ void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate)
 
 uint64_t get_cpu_idle_time(unsigned int cpu)
 {
-    struct vcpu_runstate_info state;
-    struct vcpu *v;
+    struct vcpu_runstate_info state = { 0 };
+    struct vcpu *v = idle_vcpu[cpu];
 
-    if ( (v = idle_vcpu[cpu]) == NULL )
-        return 0;
+    if ( cpu_online(cpu) && v )
+        vcpu_runstate_get(v, &state);
 
-    vcpu_runstate_get(v, &state);
     return state.time[RUNSTATE_running];
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:33:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGk0-0002id-CC; Sat, 05 Oct 2013 01:33: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 1VSGjz-0002iT-3s
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:07 +0000
Received: from [85.158.139.211:18185] by server-14.bemta-5.messagelabs.com id
	24/CB-12040-15C6F425; Sat, 05 Oct 2013 01:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1380936783!6509244!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19381 invoked from network); 5 Oct 2013 01:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGjv-0005SN-FT
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGjv-0002EK-8t
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:03 +0000
Date: Sat, 05 Oct 2013 01:33:03 +0000
Message-Id: <E1VSGjv-0002EK-8t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/idle: Fix get_cpu_idle_time()'s
	interaction with offline pcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0aa27ce3351f7eb09d13e863a1d5f303086aa32a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 4 12:23:23 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:23:23 2013 +0200

    x86/idle: Fix get_cpu_idle_time()'s interaction with offline pcpus
    
    Checking for "idle_vcpu[cpu] != NULL" is insufficient protection against
    offline pcpus.  From a hypercall, vcpu_runstate_get() will determine "v !=
    current", and try to take the vcpu_schedule_lock().  This will try to look up
    per_cpu(schedule_data, v->processor) and promptly suffer a NULL structure
    deference as v->processors' __per_cpu_offset is INVALID_PERCPU_AREA.
    
    One example might look like this:
    
    ...
    Xen call trace:
       [<ffff82c4c0126ddb>] vcpu_runstate_get+0x50/0x113
       [<ffff82c4c0126ec6>] get_cpu_idle_time+0x28/0x2e
       [<ffff82c4c012b5cb>] do_sysctl+0x3db/0xeb8
       [<ffff82c4c023280d>] compat_hypercall+0xbd/0x116
    
    Pagetable walk from 0000000000000040:
     L4[0x000] = 0000000186df8027 0000000000028207
     L3[0x000] = 0000000188e36027 00000000000261c9
     L2[0x000] = 0000000000000000 ffffffffffffffff
    
    ****************************************
    Panic on CPU 11:
    ...
    
    get_cpu_idle_time() has been updated to correctly deal with offline pcpus
    itself by returning 0, in the same way as it would if it was missing the
    idle_vcpu[] pointer.
    
    In doing so, XENPF_getidletime needed updating to correctly retain its
    described behaviour of clearing bits in the cpumap for offline pcpus.
    
    As this crash can only be triggered with toolstack hypercalls, it is not a
    security issue and just a simple bug.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/platform_hypercall.c |    8 ++++++--
 xen/common/schedule.c             |    9 ++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 7175a82..2162811 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -355,10 +355,14 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
         for_each_cpu ( cpu, cpumap )
         {
-            if ( idle_vcpu[cpu] == NULL )
-                cpumask_clear_cpu(cpu, cpumap);
             idletime = get_cpu_idle_time(cpu);
 
+            if ( !idletime )
+            {
+                cpumask_clear_cpu(cpu, cpumap);
+                continue;
+            }
+
             if ( copy_to_guest_offset(idletimes, cpu, &idletime, 1) )
             {
                 ret = -EFAULT;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index a8398bd..1ddfb22 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -176,13 +176,12 @@ void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate)
 
 uint64_t get_cpu_idle_time(unsigned int cpu)
 {
-    struct vcpu_runstate_info state;
-    struct vcpu *v;
+    struct vcpu_runstate_info state = { 0 };
+    struct vcpu *v = idle_vcpu[cpu];
 
-    if ( (v = idle_vcpu[cpu]) == NULL )
-        return 0;
+    if ( cpu_online(cpu) && v )
+        vcpu_runstate_get(v, &state);
 
-    vcpu_runstate_get(v, &state);
     return state.time[RUNSTATE_running];
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:33:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGkA-0002jH-FM; Sat, 05 Oct 2013 01: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 1VSGk9-0002j4-2M
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:17 +0000
Received: from [85.158.137.68:2417] by server-7.bemta-3.messagelabs.com id
	23/33-24536-C5C6F425; Sat, 05 Oct 2013 01:33:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1380936794!6745422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6608 invoked from network); 5 Oct 2013 01:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGk5-0005SR-T6
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGk5-0002Ek-KA
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:13 +0000
Date: Sat, 05 Oct 2013 01:33:13 +0000
Message-Id: <E1VSGk5-0002Ek-KA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/percpu: Force INVALID_PERCPU_AREA
	into the non-canonical address region
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7cfb0053629c4dd1a6f01dc43cca7c0c25b8b7bf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 4 12:24:34 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:24:34 2013 +0200

    x86/percpu: Force INVALID_PERCPU_AREA into the non-canonical address region
    
    This causes accidental uses of per_cpu() on a pcpu with an INVALID_PERCPU_AREA
    to result in a #GF for attempting to access the middle of the non-canonical
    virtual address region.
    
    This is preferable to the current behaviour, where incorrect use of per_cpu()
    will result in an effective NULL structure dereference which has security
    implication in the context of PV guests.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/percpu.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index e545024..1c1dad9 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -6,7 +6,14 @@
 #include <xen/rcupdate.h>
 
 unsigned long __per_cpu_offset[NR_CPUS];
-#define INVALID_PERCPU_AREA (-(long)__per_cpu_start)
+
+/*
+ * Force uses of per_cpu() with an invalid area to attempt to access the
+ * middle of the non-canonical address space resulting in a #GP, rather than a
+ * possible #PF at (NULL + a little) which has security implications in the
+ * context of PV guests.
+ */
+#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
 #define PERCPU_ORDER (get_order_from_bytes(__per_cpu_data_end-__per_cpu_start))
 
 void __init percpu_init_areas(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:33:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGkA-0002jH-FM; Sat, 05 Oct 2013 01: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 1VSGk9-0002j4-2M
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:17 +0000
Received: from [85.158.137.68:2417] by server-7.bemta-3.messagelabs.com id
	23/33-24536-C5C6F425; Sat, 05 Oct 2013 01:33:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1380936794!6745422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6608 invoked from network); 5 Oct 2013 01:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGk5-0005SR-T6
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGk5-0002Ek-KA
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:13 +0000
Date: Sat, 05 Oct 2013 01:33:13 +0000
Message-Id: <E1VSGk5-0002Ek-KA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/percpu: Force INVALID_PERCPU_AREA
	into the non-canonical address region
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7cfb0053629c4dd1a6f01dc43cca7c0c25b8b7bf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 4 12:24:34 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:24:34 2013 +0200

    x86/percpu: Force INVALID_PERCPU_AREA into the non-canonical address region
    
    This causes accidental uses of per_cpu() on a pcpu with an INVALID_PERCPU_AREA
    to result in a #GF for attempting to access the middle of the non-canonical
    virtual address region.
    
    This is preferable to the current behaviour, where incorrect use of per_cpu()
    will result in an effective NULL structure dereference which has security
    implication in the context of PV guests.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/percpu.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index e545024..1c1dad9 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -6,7 +6,14 @@
 #include <xen/rcupdate.h>
 
 unsigned long __per_cpu_offset[NR_CPUS];
-#define INVALID_PERCPU_AREA (-(long)__per_cpu_start)
+
+/*
+ * Force uses of per_cpu() with an invalid area to attempt to access the
+ * middle of the non-canonical address space resulting in a #GP, rather than a
+ * possible #PF at (NULL + a little) which has security implications in the
+ * context of PV guests.
+ */
+#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
 #define PERCPU_ORDER (get_order_from_bytes(__per_cpu_data_end-__per_cpu_start))
 
 void __init percpu_init_areas(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:33:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGkK-0002kn-5y; Sat, 05 Oct 2013 01: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 1VSGkJ-0002kZ-0N
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:27 +0000
Received: from [193.109.254.147:27033] by server-7.bemta-14.messagelabs.com id
	41/2E-04456-66C6F425; Sat, 05 Oct 2013 01:33:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1380936804!203008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15699 invoked from network); 5 Oct 2013 01:33:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:33:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkG-0005SZ-6m
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkG-0002Fs-0h
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:24 +0000
Date: Sat, 05 Oct 2013 01:33:24 +0000
Message-Id: <E1VSGkG-0002Fs-0h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Nested VMX: check VMX capability
	before read VMX related 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 190b667ac20e8175758f4a3a0f13c4d990e6af7e
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Fri Oct 4 12:28:14 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:28:14 2013 +0200

    Nested VMX: check VMX capability before read VMX related MSRs
    
    VMX MSRs only available when the CPU support the VMX feature. In addition,
    VMX_TRUE* MSRs only available when bit 55 of VMX_BASIC MSR is set.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    
    Cleanup.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |    3 +++
 xen/arch/x86/hvm/vmx/vvmx.c        |   21 +++++++++++++++++++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 89a22a4..b64ec6f 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -78,6 +78,7 @@ static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
 static DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
+u64 __read_mostly vmx_basic_msr;
 
 static void __init vmx_display_features(void)
 {
@@ -301,6 +302,8 @@ static int vmx_init_vmcs_config(void)
         vmx_vmexit_control         = _vmx_vmexit_control;
         vmx_vmentry_control        = _vmx_vmentry_control;
         cpu_has_vmx_ins_outs_instr_info = !!(vmx_basic_msr_high & (1U<<22));
+        vmx_basic_msr              = ((u64)vmx_basic_msr_high << 32) |
+                                     vmx_basic_msr_low;
         vmx_display_features();
     }
     else
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index d476f03..b911eb1 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1815,12 +1815,33 @@ int nvmx_handle_invvpid(struct cpu_user_regs *regs)
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
     struct vcpu *v = current;
+    unsigned int ecx, dummy;
     u64 data = 0, host_data = 0;
     int r = 1;
 
     if ( !nestedhvm_enabled(v->domain) )
         return 0;
 
+    /* VMX capablity MSRs are available only when guest supports VMX. */
+    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &dummy);
+    if ( !(ecx & cpufeat_mask(X86_FEATURE_VMXE)) )
+        return 0;
+
+    /*
+     * Those MSRs are available only when bit 55 of
+     * MSR_IA32_VMX_BASIC is set.
+     */
+    switch ( msr )
+    {
+    case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
+    case MSR_IA32_VMX_TRUE_PROCBASED_CTLS:
+    case MSR_IA32_VMX_TRUE_EXIT_CTLS:
+    case MSR_IA32_VMX_TRUE_ENTRY_CTLS:
+        if ( !(vmx_basic_msr & VMX_BASIC_DEFAULT1_ZERO) )
+            return 0;
+        break;
+    }
+
     rdmsrl(msr, host_data);
 
     /*
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 38c2494..8c123c7 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -284,6 +284,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr_info;
  */
 #define VMX_BASIC_DEFAULT1_ZERO		(1ULL << 55)
 
+extern u64 vmx_basic_msr;
+
 /* Guest interrupt status */
 #define VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK  0x0FF
 #define VMX_GUEST_INTR_STATUS_SVI_OFFSET        8
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:33:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGkK-0002kn-5y; Sat, 05 Oct 2013 01: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 1VSGkJ-0002kZ-0N
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:27 +0000
Received: from [193.109.254.147:27033] by server-7.bemta-14.messagelabs.com id
	41/2E-04456-66C6F425; Sat, 05 Oct 2013 01:33:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1380936804!203008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15699 invoked from network); 5 Oct 2013 01:33:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:33:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkG-0005SZ-6m
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkG-0002Fs-0h
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:24 +0000
Date: Sat, 05 Oct 2013 01:33:24 +0000
Message-Id: <E1VSGkG-0002Fs-0h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Nested VMX: check VMX capability
	before read VMX related 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 190b667ac20e8175758f4a3a0f13c4d990e6af7e
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Fri Oct 4 12:28:14 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:28:14 2013 +0200

    Nested VMX: check VMX capability before read VMX related MSRs
    
    VMX MSRs only available when the CPU support the VMX feature. In addition,
    VMX_TRUE* MSRs only available when bit 55 of VMX_BASIC MSR is set.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    
    Cleanup.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |    3 +++
 xen/arch/x86/hvm/vmx/vvmx.c        |   21 +++++++++++++++++++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 89a22a4..b64ec6f 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -78,6 +78,7 @@ static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
 static DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
+u64 __read_mostly vmx_basic_msr;
 
 static void __init vmx_display_features(void)
 {
@@ -301,6 +302,8 @@ static int vmx_init_vmcs_config(void)
         vmx_vmexit_control         = _vmx_vmexit_control;
         vmx_vmentry_control        = _vmx_vmentry_control;
         cpu_has_vmx_ins_outs_instr_info = !!(vmx_basic_msr_high & (1U<<22));
+        vmx_basic_msr              = ((u64)vmx_basic_msr_high << 32) |
+                                     vmx_basic_msr_low;
         vmx_display_features();
     }
     else
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index d476f03..b911eb1 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1815,12 +1815,33 @@ int nvmx_handle_invvpid(struct cpu_user_regs *regs)
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
     struct vcpu *v = current;
+    unsigned int ecx, dummy;
     u64 data = 0, host_data = 0;
     int r = 1;
 
     if ( !nestedhvm_enabled(v->domain) )
         return 0;
 
+    /* VMX capablity MSRs are available only when guest supports VMX. */
+    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &dummy);
+    if ( !(ecx & cpufeat_mask(X86_FEATURE_VMXE)) )
+        return 0;
+
+    /*
+     * Those MSRs are available only when bit 55 of
+     * MSR_IA32_VMX_BASIC is set.
+     */
+    switch ( msr )
+    {
+    case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
+    case MSR_IA32_VMX_TRUE_PROCBASED_CTLS:
+    case MSR_IA32_VMX_TRUE_EXIT_CTLS:
+    case MSR_IA32_VMX_TRUE_ENTRY_CTLS:
+        if ( !(vmx_basic_msr & VMX_BASIC_DEFAULT1_ZERO) )
+            return 0;
+        break;
+    }
+
     rdmsrl(msr, host_data);
 
     /*
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 38c2494..8c123c7 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -284,6 +284,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr_info;
  */
 #define VMX_BASIC_DEFAULT1_ZERO		(1ULL << 55)
 
+extern u64 vmx_basic_msr;
+
 /* Guest interrupt status */
 #define VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK  0x0FF
 #define VMX_GUEST_INTR_STATUS_SVI_OFFSET        8
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:33:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGkU-0002mI-8a; Sat, 05 Oct 2013 01:33: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 1VSGkT-0002m5-8N
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:37 +0000
Received: from [85.158.139.211:12699] by server-16.bemta-5.messagelabs.com id
	6C/84-03533-07C6F425; Sat, 05 Oct 2013 01:33:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1380936814!6532170!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11165 invoked from network); 5 Oct 2013 01:33:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:33:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkQ-0005Sl-Gm
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkQ-0002Gl-9y
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:34 +0000
Date: Sat, 05 Oct 2013 01:33:34 +0000
Message-Id: <E1VSGkQ-0002Gl-9y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: clean up capability 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 1332d0e907fd5b6075241d36257f8faef5ec97a7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 4 12:29:08 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:29:08 2013 +0200

    VMX: clean up capability checks
    
    VMCS size validation on APs should check against BP's size.
    
    No need for a separate cpu_has_vmx_ins_outs_instr_info variable
    anymore.
    
    Use proper symbolics.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   44 ++++++++++++++++++++++--------------
 xen/include/asm-x86/hvm/vmx/vmcs.h |   10 ++++++-
 2 files changed, 35 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index b64ec6f..6526504 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -70,7 +70,6 @@ u32 vmx_secondary_exec_control __read_mostly;
 u32 vmx_vmexit_control __read_mostly;
 u32 vmx_vmentry_control __read_mostly;
 u64 vmx_ept_vpid_cap __read_mostly;
-bool_t cpu_has_vmx_ins_outs_instr_info __read_mostly;
 
 static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, vmxon_region);
 static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
@@ -294,24 +293,33 @@ static int vmx_init_vmcs_config(void)
     if ( !vmx_pin_based_exec_control )
     {
         /* First time through. */
-        vmcs_revision_id = vmx_basic_msr_low;
+        vmcs_revision_id           = vmx_basic_msr_low & VMX_BASIC_REVISION_MASK;
         vmx_pin_based_exec_control = _vmx_pin_based_exec_control;
         vmx_cpu_based_exec_control = _vmx_cpu_based_exec_control;
         vmx_secondary_exec_control = _vmx_secondary_exec_control;
         vmx_ept_vpid_cap           = _vmx_ept_vpid_cap;
         vmx_vmexit_control         = _vmx_vmexit_control;
         vmx_vmentry_control        = _vmx_vmentry_control;
-        cpu_has_vmx_ins_outs_instr_info = !!(vmx_basic_msr_high & (1U<<22));
         vmx_basic_msr              = ((u64)vmx_basic_msr_high << 32) |
                                      vmx_basic_msr_low;
         vmx_display_features();
+
+        /* IA-32 SDM Vol 3B: VMCS size is never greater than 4kB. */
+        if ( (vmx_basic_msr_high & (VMX_BASIC_VMCS_SIZE_MASK >> 32)) >
+             PAGE_SIZE )
+        {
+            printk("VMX: CPU%d VMCS size is too big (%Lu bytes)\n",
+                   smp_processor_id(),
+                   vmx_basic_msr_high & (VMX_BASIC_VMCS_SIZE_MASK >> 32));
+            return -EINVAL;
+        }
     }
     else
     {
         /* Globals are already initialised: re-check them. */
         mismatch |= cap_check(
             "VMCS revision ID",
-            vmcs_revision_id, vmx_basic_msr_low);
+            vmcs_revision_id, vmx_basic_msr_low & VMX_BASIC_REVISION_MASK);
         mismatch |= cap_check(
             "Pin-Based Exec Control",
             vmx_pin_based_exec_control, _vmx_pin_based_exec_control);
@@ -331,13 +339,21 @@ static int vmx_init_vmcs_config(void)
             "EPT and VPID Capability",
             vmx_ept_vpid_cap, _vmx_ept_vpid_cap);
         if ( cpu_has_vmx_ins_outs_instr_info !=
-             !!(vmx_basic_msr_high & (1U<<22)) )
+             !!(vmx_basic_msr_high & (VMX_BASIC_INS_OUT_INFO >> 32)) )
         {
             printk("VMX INS/OUTS Instruction Info: saw %d expected %d\n",
-                   !!(vmx_basic_msr_high & (1U<<22)),
+                   !!(vmx_basic_msr_high & (VMX_BASIC_INS_OUT_INFO >> 32)),
                    cpu_has_vmx_ins_outs_instr_info);
             mismatch = 1;
         }
+        if ( (vmx_basic_msr_high & (VMX_BASIC_VMCS_SIZE_MASK >> 32)) !=
+             ((vmx_basic_msr & VMX_BASIC_VMCS_SIZE_MASK) >> 32) )
+        {
+            printk("VMX: CPU%d unexpected VMCS size %Lu\n",
+                   smp_processor_id(),
+                   vmx_basic_msr_high & (VMX_BASIC_VMCS_SIZE_MASK >> 32));
+            mismatch = 1;
+        }
         if ( mismatch )
         {
             printk("VMX: Capabilities fatally differ between CPU%d and CPU0\n",
@@ -346,16 +362,8 @@ static int vmx_init_vmcs_config(void)
         }
     }
 
-    /* IA-32 SDM Vol 3B: VMCS size is never greater than 4kB. */
-    if ( (vmx_basic_msr_high & 0x1fff) > PAGE_SIZE )
-    {
-        printk("VMX: CPU%d VMCS size is too big (%u bytes)\n",
-               smp_processor_id(), vmx_basic_msr_high & 0x1fff);
-        return -EINVAL;
-    }
-
     /* IA-32 SDM Vol 3B: 64-bit CPUs always have VMX_BASIC_MSR[48]==0. */
-    if ( vmx_basic_msr_high & (1u<<16) )
+    if ( vmx_basic_msr_high & (VMX_BASIC_32BIT_ADDRESSES >> 32) )
     {
         printk("VMX: CPU%d limits VMX structure pointers to 32 bits\n",
                smp_processor_id());
@@ -363,10 +371,12 @@ static int vmx_init_vmcs_config(void)
     }
 
     /* Require Write-Back (WB) memory type for VMCS accesses. */
-    if ( ((vmx_basic_msr_high >> 18) & 15) != 6 )
+    opt = (vmx_basic_msr_high & (VMX_BASIC_MEMORY_TYPE_MASK >> 32)) /
+          ((VMX_BASIC_MEMORY_TYPE_MASK & -VMX_BASIC_MEMORY_TYPE_MASK) >> 32);
+    if ( opt != MTRR_TYPE_WRBACK )
     {
         printk("VMX: CPU%d has unexpected VMCS access type %u\n",
-               smp_processor_id(), (vmx_basic_msr_high >> 18) & 15);
+               smp_processor_id(), opt);
         return -EINVAL;
     }
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 8c123c7..b50352f 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -210,8 +210,6 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000
 extern u32 vmx_secondary_exec_control;
 
-extern bool_t cpu_has_vmx_ins_outs_instr_info;
-
 #define VMX_EPT_EXEC_ONLY_SUPPORTED             0x00000001
 #define VMX_EPT_WALK_LENGTH_4_SUPPORTED         0x00000040
 #define VMX_EPT_MEMORY_TYPE_UC                  0x00000100
@@ -278,6 +276,12 @@ extern bool_t cpu_has_vmx_ins_outs_instr_info;
 #define VMX_INTR_SHADOW_SMI             0x00000004
 #define VMX_INTR_SHADOW_NMI             0x00000008
 
+#define VMX_BASIC_REVISION_MASK         0x7fffffff
+#define VMX_BASIC_VMCS_SIZE_MASK        (0x1fffULL << 32)
+#define VMX_BASIC_32BIT_ADDRESSES       (1ULL << 48)
+#define VMX_BASIC_DUAL_MONITOR          (1ULL << 49)
+#define VMX_BASIC_MEMORY_TYPE_MASK      (0xfULL << 50)
+#define VMX_BASIC_INS_OUT_INFO          (1ULL << 54)
 /* 
  * bit 55 of IA32_VMX_BASIC MSR, indicating whether any VMX controls that
  * default to 1 may be cleared to 0.
@@ -285,6 +289,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr_info;
 #define VMX_BASIC_DEFAULT1_ZERO		(1ULL << 55)
 
 extern u64 vmx_basic_msr;
+#define cpu_has_vmx_ins_outs_instr_info \
+    (!!(vmx_basic_msr & VMX_BASIC_INS_OUT_INFO))
 
 /* Guest interrupt status */
 #define VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK  0x0FF
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:33:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGkU-0002mI-8a; Sat, 05 Oct 2013 01:33: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 1VSGkT-0002m5-8N
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:37 +0000
Received: from [85.158.139.211:12699] by server-16.bemta-5.messagelabs.com id
	6C/84-03533-07C6F425; Sat, 05 Oct 2013 01:33:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1380936814!6532170!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11165 invoked from network); 5 Oct 2013 01:33:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:33:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkQ-0005Sl-Gm
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkQ-0002Gl-9y
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:34 +0000
Date: Sat, 05 Oct 2013 01:33:34 +0000
Message-Id: <E1VSGkQ-0002Gl-9y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: clean up capability 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 1332d0e907fd5b6075241d36257f8faef5ec97a7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 4 12:29:08 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:29:08 2013 +0200

    VMX: clean up capability checks
    
    VMCS size validation on APs should check against BP's size.
    
    No need for a separate cpu_has_vmx_ins_outs_instr_info variable
    anymore.
    
    Use proper symbolics.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   44 ++++++++++++++++++++++--------------
 xen/include/asm-x86/hvm/vmx/vmcs.h |   10 ++++++-
 2 files changed, 35 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index b64ec6f..6526504 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -70,7 +70,6 @@ u32 vmx_secondary_exec_control __read_mostly;
 u32 vmx_vmexit_control __read_mostly;
 u32 vmx_vmentry_control __read_mostly;
 u64 vmx_ept_vpid_cap __read_mostly;
-bool_t cpu_has_vmx_ins_outs_instr_info __read_mostly;
 
 static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, vmxon_region);
 static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
@@ -294,24 +293,33 @@ static int vmx_init_vmcs_config(void)
     if ( !vmx_pin_based_exec_control )
     {
         /* First time through. */
-        vmcs_revision_id = vmx_basic_msr_low;
+        vmcs_revision_id           = vmx_basic_msr_low & VMX_BASIC_REVISION_MASK;
         vmx_pin_based_exec_control = _vmx_pin_based_exec_control;
         vmx_cpu_based_exec_control = _vmx_cpu_based_exec_control;
         vmx_secondary_exec_control = _vmx_secondary_exec_control;
         vmx_ept_vpid_cap           = _vmx_ept_vpid_cap;
         vmx_vmexit_control         = _vmx_vmexit_control;
         vmx_vmentry_control        = _vmx_vmentry_control;
-        cpu_has_vmx_ins_outs_instr_info = !!(vmx_basic_msr_high & (1U<<22));
         vmx_basic_msr              = ((u64)vmx_basic_msr_high << 32) |
                                      vmx_basic_msr_low;
         vmx_display_features();
+
+        /* IA-32 SDM Vol 3B: VMCS size is never greater than 4kB. */
+        if ( (vmx_basic_msr_high & (VMX_BASIC_VMCS_SIZE_MASK >> 32)) >
+             PAGE_SIZE )
+        {
+            printk("VMX: CPU%d VMCS size is too big (%Lu bytes)\n",
+                   smp_processor_id(),
+                   vmx_basic_msr_high & (VMX_BASIC_VMCS_SIZE_MASK >> 32));
+            return -EINVAL;
+        }
     }
     else
     {
         /* Globals are already initialised: re-check them. */
         mismatch |= cap_check(
             "VMCS revision ID",
-            vmcs_revision_id, vmx_basic_msr_low);
+            vmcs_revision_id, vmx_basic_msr_low & VMX_BASIC_REVISION_MASK);
         mismatch |= cap_check(
             "Pin-Based Exec Control",
             vmx_pin_based_exec_control, _vmx_pin_based_exec_control);
@@ -331,13 +339,21 @@ static int vmx_init_vmcs_config(void)
             "EPT and VPID Capability",
             vmx_ept_vpid_cap, _vmx_ept_vpid_cap);
         if ( cpu_has_vmx_ins_outs_instr_info !=
-             !!(vmx_basic_msr_high & (1U<<22)) )
+             !!(vmx_basic_msr_high & (VMX_BASIC_INS_OUT_INFO >> 32)) )
         {
             printk("VMX INS/OUTS Instruction Info: saw %d expected %d\n",
-                   !!(vmx_basic_msr_high & (1U<<22)),
+                   !!(vmx_basic_msr_high & (VMX_BASIC_INS_OUT_INFO >> 32)),
                    cpu_has_vmx_ins_outs_instr_info);
             mismatch = 1;
         }
+        if ( (vmx_basic_msr_high & (VMX_BASIC_VMCS_SIZE_MASK >> 32)) !=
+             ((vmx_basic_msr & VMX_BASIC_VMCS_SIZE_MASK) >> 32) )
+        {
+            printk("VMX: CPU%d unexpected VMCS size %Lu\n",
+                   smp_processor_id(),
+                   vmx_basic_msr_high & (VMX_BASIC_VMCS_SIZE_MASK >> 32));
+            mismatch = 1;
+        }
         if ( mismatch )
         {
             printk("VMX: Capabilities fatally differ between CPU%d and CPU0\n",
@@ -346,16 +362,8 @@ static int vmx_init_vmcs_config(void)
         }
     }
 
-    /* IA-32 SDM Vol 3B: VMCS size is never greater than 4kB. */
-    if ( (vmx_basic_msr_high & 0x1fff) > PAGE_SIZE )
-    {
-        printk("VMX: CPU%d VMCS size is too big (%u bytes)\n",
-               smp_processor_id(), vmx_basic_msr_high & 0x1fff);
-        return -EINVAL;
-    }
-
     /* IA-32 SDM Vol 3B: 64-bit CPUs always have VMX_BASIC_MSR[48]==0. */
-    if ( vmx_basic_msr_high & (1u<<16) )
+    if ( vmx_basic_msr_high & (VMX_BASIC_32BIT_ADDRESSES >> 32) )
     {
         printk("VMX: CPU%d limits VMX structure pointers to 32 bits\n",
                smp_processor_id());
@@ -363,10 +371,12 @@ static int vmx_init_vmcs_config(void)
     }
 
     /* Require Write-Back (WB) memory type for VMCS accesses. */
-    if ( ((vmx_basic_msr_high >> 18) & 15) != 6 )
+    opt = (vmx_basic_msr_high & (VMX_BASIC_MEMORY_TYPE_MASK >> 32)) /
+          ((VMX_BASIC_MEMORY_TYPE_MASK & -VMX_BASIC_MEMORY_TYPE_MASK) >> 32);
+    if ( opt != MTRR_TYPE_WRBACK )
     {
         printk("VMX: CPU%d has unexpected VMCS access type %u\n",
-               smp_processor_id(), (vmx_basic_msr_high >> 18) & 15);
+               smp_processor_id(), opt);
         return -EINVAL;
     }
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 8c123c7..b50352f 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -210,8 +210,6 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000
 extern u32 vmx_secondary_exec_control;
 
-extern bool_t cpu_has_vmx_ins_outs_instr_info;
-
 #define VMX_EPT_EXEC_ONLY_SUPPORTED             0x00000001
 #define VMX_EPT_WALK_LENGTH_4_SUPPORTED         0x00000040
 #define VMX_EPT_MEMORY_TYPE_UC                  0x00000100
@@ -278,6 +276,12 @@ extern bool_t cpu_has_vmx_ins_outs_instr_info;
 #define VMX_INTR_SHADOW_SMI             0x00000004
 #define VMX_INTR_SHADOW_NMI             0x00000008
 
+#define VMX_BASIC_REVISION_MASK         0x7fffffff
+#define VMX_BASIC_VMCS_SIZE_MASK        (0x1fffULL << 32)
+#define VMX_BASIC_32BIT_ADDRESSES       (1ULL << 48)
+#define VMX_BASIC_DUAL_MONITOR          (1ULL << 49)
+#define VMX_BASIC_MEMORY_TYPE_MASK      (0xfULL << 50)
+#define VMX_BASIC_INS_OUT_INFO          (1ULL << 54)
 /* 
  * bit 55 of IA32_VMX_BASIC MSR, indicating whether any VMX controls that
  * default to 1 may be cleared to 0.
@@ -285,6 +289,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr_info;
 #define VMX_BASIC_DEFAULT1_ZERO		(1ULL << 55)
 
 extern u64 vmx_basic_msr;
+#define cpu_has_vmx_ins_outs_instr_info \
+    (!!(vmx_basic_msr & VMX_BASIC_INS_OUT_INFO))
 
 /* Guest interrupt status */
 #define VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK  0x0FF
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:33:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:33:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGke-0002oZ-Bq; Sat, 05 Oct 2013 01:33: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 1VSGkd-0002o6-Dj
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:47 +0000
Received: from [193.109.254.147:12379] by server-13.bemta-14.messagelabs.com
	id 72/18-01215-A7C6F425; Sat, 05 Oct 2013 01:33:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1380936824!200181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14126 invoked from network); 5 Oct 2013 01:33:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:33:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGka-0005Sw-M4
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGka-0002HY-KA
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:44 +0000
Date: Sat, 05 Oct 2013 01:33:44 +0000
Message-Id: <E1VSGka-0002HY-KA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Nested VMX: fix IA32_VMX_CR4_FIXED1
	msr emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6f92aed0e209df823d2cb5780dbb1ea12fc6d4a
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Fri Oct 4 12:30:09 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:30:09 2013 +0200

    Nested VMX: fix IA32_VMX_CR4_FIXED1 msr emulation
    
    Currently, it use hardcode value for IA32_VMX_CR4_FIXED1. This is wrong.
    We should check guest's cpuid to know which bits are writeable in CR4 by guest
    and allow the guest to set the corresponding bit only when guest has the feature.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    
    Cleanup.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c      |   55 +++++++++++++++++++++++++++++++++++---
 xen/include/asm-x86/cpufeature.h |    1 +
 xen/include/asm-x86/processor.h  |    1 +
 3 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index b911eb1..eb0218e 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1815,7 +1815,7 @@ int nvmx_handle_invvpid(struct cpu_user_regs *regs)
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
     struct vcpu *v = current;
-    unsigned int ecx, dummy;
+    unsigned int eax, ebx, ecx, edx, dummy;
     u64 data = 0, host_data = 0;
     int r = 1;
 
@@ -1823,7 +1823,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         return 0;
 
     /* VMX capablity MSRs are available only when guest supports VMX. */
-    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &dummy);
+    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &edx);
     if ( !(ecx & cpufeat_mask(X86_FEATURE_VMXE)) )
         return 0;
 
@@ -1948,8 +1948,55 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         data = X86_CR4_VMXE;
         break;
     case MSR_IA32_VMX_CR4_FIXED1:
-        /* allow 0-settings except SMXE */
-        data = 0x267ff & ~X86_CR4_SMXE;
+        if ( edx & cpufeat_mask(X86_FEATURE_VME) )
+            data |= X86_CR4_VME | X86_CR4_PVI;
+        if ( edx & cpufeat_mask(X86_FEATURE_TSC) )
+            data |= X86_CR4_TSD;
+        if ( edx & cpufeat_mask(X86_FEATURE_DE) )
+            data |= X86_CR4_DE;
+        if ( edx & cpufeat_mask(X86_FEATURE_PSE) )
+            data |= X86_CR4_PSE;
+        if ( edx & cpufeat_mask(X86_FEATURE_PAE) )
+            data |= X86_CR4_PAE;
+        if ( edx & cpufeat_mask(X86_FEATURE_MCE) )
+            data |= X86_CR4_MCE;
+        if ( edx & cpufeat_mask(X86_FEATURE_PGE) )
+            data |= X86_CR4_PGE;
+        if ( edx & cpufeat_mask(X86_FEATURE_FXSR) )
+            data |= X86_CR4_OSFXSR;
+        if ( edx & cpufeat_mask(X86_FEATURE_XMM) )
+            data |= X86_CR4_OSXMMEXCPT;
+        if ( ecx & cpufeat_mask(X86_FEATURE_VMXE) )
+            data |= X86_CR4_VMXE;
+        if ( ecx & cpufeat_mask(X86_FEATURE_SMXE) )
+            data |= X86_CR4_SMXE;
+        if ( ecx & cpufeat_mask(X86_FEATURE_PCID) )
+            data |= X86_CR4_PCIDE;
+        if ( ecx & cpufeat_mask(X86_FEATURE_XSAVE) )
+            data |= X86_CR4_OSXSAVE;
+
+        hvm_cpuid(0x0, &eax, &dummy, &dummy, &dummy);
+        switch ( eax )
+        {
+        default:
+            hvm_cpuid(0xa, &eax, &dummy, &dummy, &dummy);
+            /* Check whether guest has the perf monitor feature. */
+            if ( (eax & 0xff) && (eax & 0xff00) )
+                data |= X86_CR4_PCE;
+            /* fall through */
+        case 0x7 ... 0x9:
+            ecx = 0;
+            hvm_cpuid(0x7, &dummy, &ebx, &ecx, &dummy);
+            if ( ebx & cpufeat_mask(X86_FEATURE_FSGSBASE) )
+                data |= X86_CR4_FSGSBASE;
+            if ( ebx & cpufeat_mask(X86_FEATURE_SMEP) )
+                data |= X86_CR4_SMEP;
+            if ( ebx & cpufeat_mask(X86_FEATURE_SMAP) )
+                data |= X86_CR4_SMAP;
+            /* fall through */
+        case 0x0 ... 0x6:
+            break;
+        }
         break;
     case MSR_IA32_VMX_MISC:
         /* Do not support CR3-target feature now */
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 065c265..1cfaf94 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -148,6 +148,7 @@
 #define X86_FEATURE_INVPCID	(7*32+10) /* Invalidate Process Context ID */
 #define X86_FEATURE_RTM 	(7*32+11) /* Restricted Transactional Memory */
 #define X86_FEATURE_NO_FPU_SEL 	(7*32+13) /* FPU CS/DS stored as zero */
+#define X86_FEATURE_SMAP	(7*32+20) /* Supervisor Mode Access Prevention */
 
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)	test_bit(bit, boot_cpu_data.x86_capability)
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 5cdacc7..893afa3 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -87,6 +87,7 @@
 #define X86_CR4_PCIDE		0x20000 /* enable PCID */
 #define X86_CR4_OSXSAVE	0x40000 /* enable XSAVE/XRSTOR */
 #define X86_CR4_SMEP		0x100000/* enable SMEP */
+#define X86_CR4_SMAP		0x200000/* enable SMAP */
 
 /*
  * Trap/fault mnemonics.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:33:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:33:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGke-0002oZ-Bq; Sat, 05 Oct 2013 01:33: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 1VSGkd-0002o6-Dj
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:47 +0000
Received: from [193.109.254.147:12379] by server-13.bemta-14.messagelabs.com
	id 72/18-01215-A7C6F425; Sat, 05 Oct 2013 01:33:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1380936824!200181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14126 invoked from network); 5 Oct 2013 01:33:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:33:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGka-0005Sw-M4
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGka-0002HY-KA
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:44 +0000
Date: Sat, 05 Oct 2013 01:33:44 +0000
Message-Id: <E1VSGka-0002HY-KA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Nested VMX: fix IA32_VMX_CR4_FIXED1
	msr emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6f92aed0e209df823d2cb5780dbb1ea12fc6d4a
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Fri Oct 4 12:30:09 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:30:09 2013 +0200

    Nested VMX: fix IA32_VMX_CR4_FIXED1 msr emulation
    
    Currently, it use hardcode value for IA32_VMX_CR4_FIXED1. This is wrong.
    We should check guest's cpuid to know which bits are writeable in CR4 by guest
    and allow the guest to set the corresponding bit only when guest has the feature.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    
    Cleanup.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c      |   55 +++++++++++++++++++++++++++++++++++---
 xen/include/asm-x86/cpufeature.h |    1 +
 xen/include/asm-x86/processor.h  |    1 +
 3 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index b911eb1..eb0218e 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1815,7 +1815,7 @@ int nvmx_handle_invvpid(struct cpu_user_regs *regs)
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
     struct vcpu *v = current;
-    unsigned int ecx, dummy;
+    unsigned int eax, ebx, ecx, edx, dummy;
     u64 data = 0, host_data = 0;
     int r = 1;
 
@@ -1823,7 +1823,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         return 0;
 
     /* VMX capablity MSRs are available only when guest supports VMX. */
-    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &dummy);
+    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &edx);
     if ( !(ecx & cpufeat_mask(X86_FEATURE_VMXE)) )
         return 0;
 
@@ -1948,8 +1948,55 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         data = X86_CR4_VMXE;
         break;
     case MSR_IA32_VMX_CR4_FIXED1:
-        /* allow 0-settings except SMXE */
-        data = 0x267ff & ~X86_CR4_SMXE;
+        if ( edx & cpufeat_mask(X86_FEATURE_VME) )
+            data |= X86_CR4_VME | X86_CR4_PVI;
+        if ( edx & cpufeat_mask(X86_FEATURE_TSC) )
+            data |= X86_CR4_TSD;
+        if ( edx & cpufeat_mask(X86_FEATURE_DE) )
+            data |= X86_CR4_DE;
+        if ( edx & cpufeat_mask(X86_FEATURE_PSE) )
+            data |= X86_CR4_PSE;
+        if ( edx & cpufeat_mask(X86_FEATURE_PAE) )
+            data |= X86_CR4_PAE;
+        if ( edx & cpufeat_mask(X86_FEATURE_MCE) )
+            data |= X86_CR4_MCE;
+        if ( edx & cpufeat_mask(X86_FEATURE_PGE) )
+            data |= X86_CR4_PGE;
+        if ( edx & cpufeat_mask(X86_FEATURE_FXSR) )
+            data |= X86_CR4_OSFXSR;
+        if ( edx & cpufeat_mask(X86_FEATURE_XMM) )
+            data |= X86_CR4_OSXMMEXCPT;
+        if ( ecx & cpufeat_mask(X86_FEATURE_VMXE) )
+            data |= X86_CR4_VMXE;
+        if ( ecx & cpufeat_mask(X86_FEATURE_SMXE) )
+            data |= X86_CR4_SMXE;
+        if ( ecx & cpufeat_mask(X86_FEATURE_PCID) )
+            data |= X86_CR4_PCIDE;
+        if ( ecx & cpufeat_mask(X86_FEATURE_XSAVE) )
+            data |= X86_CR4_OSXSAVE;
+
+        hvm_cpuid(0x0, &eax, &dummy, &dummy, &dummy);
+        switch ( eax )
+        {
+        default:
+            hvm_cpuid(0xa, &eax, &dummy, &dummy, &dummy);
+            /* Check whether guest has the perf monitor feature. */
+            if ( (eax & 0xff) && (eax & 0xff00) )
+                data |= X86_CR4_PCE;
+            /* fall through */
+        case 0x7 ... 0x9:
+            ecx = 0;
+            hvm_cpuid(0x7, &dummy, &ebx, &ecx, &dummy);
+            if ( ebx & cpufeat_mask(X86_FEATURE_FSGSBASE) )
+                data |= X86_CR4_FSGSBASE;
+            if ( ebx & cpufeat_mask(X86_FEATURE_SMEP) )
+                data |= X86_CR4_SMEP;
+            if ( ebx & cpufeat_mask(X86_FEATURE_SMAP) )
+                data |= X86_CR4_SMAP;
+            /* fall through */
+        case 0x0 ... 0x6:
+            break;
+        }
         break;
     case MSR_IA32_VMX_MISC:
         /* Do not support CR3-target feature now */
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 065c265..1cfaf94 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -148,6 +148,7 @@
 #define X86_FEATURE_INVPCID	(7*32+10) /* Invalidate Process Context ID */
 #define X86_FEATURE_RTM 	(7*32+11) /* Restricted Transactional Memory */
 #define X86_FEATURE_NO_FPU_SEL 	(7*32+13) /* FPU CS/DS stored as zero */
+#define X86_FEATURE_SMAP	(7*32+20) /* Supervisor Mode Access Prevention */
 
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)	test_bit(bit, boot_cpu_data.x86_capability)
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 5cdacc7..893afa3 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -87,6 +87,7 @@
 #define X86_CR4_PCIDE		0x20000 /* enable PCID */
 #define X86_CR4_OSXSAVE	0x40000 /* enable XSAVE/XRSTOR */
 #define X86_CR4_SMEP		0x100000/* enable SMEP */
+#define X86_CR4_SMAP		0x200000/* enable SMAP */
 
 /*
  * Trap/fault mnemonics.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:34:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:34:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGkp-0002sK-Hd; Sat, 05 Oct 2013 01:33:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkn-0002rb-Sp
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:58 +0000
Received: from [85.158.137.68:24922] by server-10.bemta-3.messagelabs.com id
	EF/53-30473-58C6F425; Sat, 05 Oct 2013 01:33:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1380936835!6741350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12725 invoked from network); 5 Oct 2013 01:33:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:33:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkk-0005T5-Rg
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkk-0002Hw-Pd
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:54 +0000
Date: Sat, 05 Oct 2013 01:33:54 +0000
Message-Id: <E1VSGkk-0002Hw-Pd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make hvm_cpuid() tolerate NULL
	pointers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 11b85dbd0ab068bad3beadda3aee2298205a3c01
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 4 12:32:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:32:25 2013 +0200

    x86: make hvm_cpuid() tolerate NULL pointers
    
    Now that other HVM code started making more extensive use of
    hvm_cpuid(), let's not force every caller to declare dummy variables
    for output not cared about.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/hvm.c      |   30 ++++++++++++++++++++----------
 xen/arch/x86/hvm/svm/svm.c  |    8 ++++----
 xen/arch/x86/hvm/vmx/vvmx.c |   10 +++++-----
 3 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index bf807bf..a1a7780 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2764,7 +2764,17 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
 {
     struct vcpu *v = current;
     struct domain *d = v->domain;
-    unsigned int count = *ecx;
+    unsigned int count, dummy = 0;
+
+    if ( !eax )
+        eax = &dummy;
+    if ( !ebx )
+        ebx = &dummy;
+    if ( !ecx )
+        ecx = &dummy;
+    count = *ecx;
+    if ( !edx )
+        edx = &dummy;
 
     if ( cpuid_viridian_leaves(input, eax, ebx, ecx, edx) )
         return;
@@ -2772,7 +2782,7 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
     if ( cpuid_hypervisor_leaves(input, count, eax, ebx, ecx, edx) )
         return;
 
-    domain_cpuid(d, input, *ecx, eax, ebx, ecx, edx);
+    domain_cpuid(d, input, count, eax, ebx, ecx, edx);
 
     switch ( input )
     {
@@ -2860,15 +2870,15 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 {
     struct vcpu *v = current;
     uint64_t *var_range_base, *fixed_range_base;
-    int index, mtrr;
-    uint32_t cpuid[4];
+    bool_t mtrr;
+    unsigned int edx, index;
     int ret = X86EMUL_OKAY;
 
     var_range_base = (uint64_t *)v->arch.hvm_vcpu.mtrr.var_ranges;
     fixed_range_base = (uint64_t *)v->arch.hvm_vcpu.mtrr.fixed_ranges;
 
-    hvm_cpuid(1, &cpuid[0], &cpuid[1], &cpuid[2], &cpuid[3]);
-    mtrr = !!(cpuid[3] & cpufeat_mask(X86_FEATURE_MTRR));
+    hvm_cpuid(1, NULL, NULL, NULL, &edx);
+    mtrr = !!(edx & cpufeat_mask(X86_FEATURE_MTRR));
 
     switch ( msr )
     {
@@ -2976,15 +2986,15 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
 {
     struct vcpu *v = current;
-    int index, mtrr;
-    uint32_t cpuid[4];
+    bool_t mtrr;
+    unsigned int edx, index;
     int ret = X86EMUL_OKAY;
 
     HVMTRACE_3D(MSR_WRITE, msr,
                (uint32_t)msr_content, (uint32_t)(msr_content >> 32));
 
-    hvm_cpuid(1, &cpuid[0], &cpuid[1], &cpuid[2], &cpuid[3]);
-    mtrr = !!(cpuid[3] & cpufeat_mask(X86_FEATURE_MTRR));
+    hvm_cpuid(1, NULL, NULL, NULL, &edx);
+    mtrr = !!(edx & cpufeat_mask(X86_FEATURE_MTRR));
 
     hvm_memory_event_msr(msr, msr_content);
 
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 695b53a..22a63a7 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -806,13 +806,13 @@ static inline void svm_lwp_load(struct vcpu *v)
 /* Update LWP_CFG MSR (0xc0000105). Return -1 if error; otherwise returns 0. */
 static int svm_update_lwp_cfg(struct vcpu *v, uint64_t msr_content)
 {
-    unsigned int eax, ebx, ecx, edx;
+    unsigned int edx;
     uint32_t msr_low;
     static uint8_t lwp_intr_vector;
 
     if ( xsave_enabled(v) && cpu_has_lwp )
     {
-        hvm_cpuid(0x8000001c, &eax, &ebx, &ecx, &edx);
+        hvm_cpuid(0x8000001c, NULL, NULL, NULL, &edx);
         msr_low = (uint32_t)msr_content;
         
         /* generate #GP if guest tries to turn on unsupported features. */
@@ -1163,10 +1163,10 @@ static void svm_init_erratum_383(struct cpuinfo_x86 *c)
 
 static int svm_handle_osvw(struct vcpu *v, uint32_t msr, uint64_t *val, bool_t read)
 {
-    uint eax, ebx, ecx, edx;
+    unsigned int ecx;
 
     /* Guest OSVW support */
-    hvm_cpuid(0x80000001, &eax, &ebx, &ecx, &edx);
+    hvm_cpuid(0x80000001, NULL, NULL, &ecx, NULL);
     if ( !test_bit((X86_FEATURE_OSVW & 31), &ecx) )
         return -1;
 
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index eb0218e..2b2de77 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1815,7 +1815,7 @@ int nvmx_handle_invvpid(struct cpu_user_regs *regs)
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
     struct vcpu *v = current;
-    unsigned int eax, ebx, ecx, edx, dummy;
+    unsigned int eax, ebx, ecx, edx;
     u64 data = 0, host_data = 0;
     int r = 1;
 
@@ -1823,7 +1823,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         return 0;
 
     /* VMX capablity MSRs are available only when guest supports VMX. */
-    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &edx);
+    hvm_cpuid(0x1, NULL, NULL, &ecx, &edx);
     if ( !(ecx & cpufeat_mask(X86_FEATURE_VMXE)) )
         return 0;
 
@@ -1975,18 +1975,18 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         if ( ecx & cpufeat_mask(X86_FEATURE_XSAVE) )
             data |= X86_CR4_OSXSAVE;
 
-        hvm_cpuid(0x0, &eax, &dummy, &dummy, &dummy);
+        hvm_cpuid(0x0, &eax, NULL, NULL, NULL);
         switch ( eax )
         {
         default:
-            hvm_cpuid(0xa, &eax, &dummy, &dummy, &dummy);
+            hvm_cpuid(0xa, &eax, NULL, NULL, NULL);
             /* Check whether guest has the perf monitor feature. */
             if ( (eax & 0xff) && (eax & 0xff00) )
                 data |= X86_CR4_PCE;
             /* fall through */
         case 0x7 ... 0x9:
             ecx = 0;
-            hvm_cpuid(0x7, &dummy, &ebx, &ecx, &dummy);
+            hvm_cpuid(0x7, NULL, &ebx, &ecx, NULL);
             if ( ebx & cpufeat_mask(X86_FEATURE_FSGSBASE) )
                 data |= X86_CR4_FSGSBASE;
             if ( ebx & cpufeat_mask(X86_FEATURE_SMEP) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:34:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:34:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGkp-0002sK-Hd; Sat, 05 Oct 2013 01:33:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkn-0002rb-Sp
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:58 +0000
Received: from [85.158.137.68:24922] by server-10.bemta-3.messagelabs.com id
	EF/53-30473-58C6F425; Sat, 05 Oct 2013 01:33:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1380936835!6741350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12725 invoked from network); 5 Oct 2013 01:33:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:33:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkk-0005T5-Rg
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkk-0002Hw-Pd
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:33:54 +0000
Date: Sat, 05 Oct 2013 01:33:54 +0000
Message-Id: <E1VSGkk-0002Hw-Pd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make hvm_cpuid() tolerate NULL
	pointers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 11b85dbd0ab068bad3beadda3aee2298205a3c01
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 4 12:32:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:32:25 2013 +0200

    x86: make hvm_cpuid() tolerate NULL pointers
    
    Now that other HVM code started making more extensive use of
    hvm_cpuid(), let's not force every caller to declare dummy variables
    for output not cared about.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/hvm.c      |   30 ++++++++++++++++++++----------
 xen/arch/x86/hvm/svm/svm.c  |    8 ++++----
 xen/arch/x86/hvm/vmx/vvmx.c |   10 +++++-----
 3 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index bf807bf..a1a7780 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2764,7 +2764,17 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
 {
     struct vcpu *v = current;
     struct domain *d = v->domain;
-    unsigned int count = *ecx;
+    unsigned int count, dummy = 0;
+
+    if ( !eax )
+        eax = &dummy;
+    if ( !ebx )
+        ebx = &dummy;
+    if ( !ecx )
+        ecx = &dummy;
+    count = *ecx;
+    if ( !edx )
+        edx = &dummy;
 
     if ( cpuid_viridian_leaves(input, eax, ebx, ecx, edx) )
         return;
@@ -2772,7 +2782,7 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
     if ( cpuid_hypervisor_leaves(input, count, eax, ebx, ecx, edx) )
         return;
 
-    domain_cpuid(d, input, *ecx, eax, ebx, ecx, edx);
+    domain_cpuid(d, input, count, eax, ebx, ecx, edx);
 
     switch ( input )
     {
@@ -2860,15 +2870,15 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 {
     struct vcpu *v = current;
     uint64_t *var_range_base, *fixed_range_base;
-    int index, mtrr;
-    uint32_t cpuid[4];
+    bool_t mtrr;
+    unsigned int edx, index;
     int ret = X86EMUL_OKAY;
 
     var_range_base = (uint64_t *)v->arch.hvm_vcpu.mtrr.var_ranges;
     fixed_range_base = (uint64_t *)v->arch.hvm_vcpu.mtrr.fixed_ranges;
 
-    hvm_cpuid(1, &cpuid[0], &cpuid[1], &cpuid[2], &cpuid[3]);
-    mtrr = !!(cpuid[3] & cpufeat_mask(X86_FEATURE_MTRR));
+    hvm_cpuid(1, NULL, NULL, NULL, &edx);
+    mtrr = !!(edx & cpufeat_mask(X86_FEATURE_MTRR));
 
     switch ( msr )
     {
@@ -2976,15 +2986,15 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
 int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
 {
     struct vcpu *v = current;
-    int index, mtrr;
-    uint32_t cpuid[4];
+    bool_t mtrr;
+    unsigned int edx, index;
     int ret = X86EMUL_OKAY;
 
     HVMTRACE_3D(MSR_WRITE, msr,
                (uint32_t)msr_content, (uint32_t)(msr_content >> 32));
 
-    hvm_cpuid(1, &cpuid[0], &cpuid[1], &cpuid[2], &cpuid[3]);
-    mtrr = !!(cpuid[3] & cpufeat_mask(X86_FEATURE_MTRR));
+    hvm_cpuid(1, NULL, NULL, NULL, &edx);
+    mtrr = !!(edx & cpufeat_mask(X86_FEATURE_MTRR));
 
     hvm_memory_event_msr(msr, msr_content);
 
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 695b53a..22a63a7 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -806,13 +806,13 @@ static inline void svm_lwp_load(struct vcpu *v)
 /* Update LWP_CFG MSR (0xc0000105). Return -1 if error; otherwise returns 0. */
 static int svm_update_lwp_cfg(struct vcpu *v, uint64_t msr_content)
 {
-    unsigned int eax, ebx, ecx, edx;
+    unsigned int edx;
     uint32_t msr_low;
     static uint8_t lwp_intr_vector;
 
     if ( xsave_enabled(v) && cpu_has_lwp )
     {
-        hvm_cpuid(0x8000001c, &eax, &ebx, &ecx, &edx);
+        hvm_cpuid(0x8000001c, NULL, NULL, NULL, &edx);
         msr_low = (uint32_t)msr_content;
         
         /* generate #GP if guest tries to turn on unsupported features. */
@@ -1163,10 +1163,10 @@ static void svm_init_erratum_383(struct cpuinfo_x86 *c)
 
 static int svm_handle_osvw(struct vcpu *v, uint32_t msr, uint64_t *val, bool_t read)
 {
-    uint eax, ebx, ecx, edx;
+    unsigned int ecx;
 
     /* Guest OSVW support */
-    hvm_cpuid(0x80000001, &eax, &ebx, &ecx, &edx);
+    hvm_cpuid(0x80000001, NULL, NULL, &ecx, NULL);
     if ( !test_bit((X86_FEATURE_OSVW & 31), &ecx) )
         return -1;
 
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index eb0218e..2b2de77 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1815,7 +1815,7 @@ int nvmx_handle_invvpid(struct cpu_user_regs *regs)
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
     struct vcpu *v = current;
-    unsigned int eax, ebx, ecx, edx, dummy;
+    unsigned int eax, ebx, ecx, edx;
     u64 data = 0, host_data = 0;
     int r = 1;
 
@@ -1823,7 +1823,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         return 0;
 
     /* VMX capablity MSRs are available only when guest supports VMX. */
-    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &edx);
+    hvm_cpuid(0x1, NULL, NULL, &ecx, &edx);
     if ( !(ecx & cpufeat_mask(X86_FEATURE_VMXE)) )
         return 0;
 
@@ -1975,18 +1975,18 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         if ( ecx & cpufeat_mask(X86_FEATURE_XSAVE) )
             data |= X86_CR4_OSXSAVE;
 
-        hvm_cpuid(0x0, &eax, &dummy, &dummy, &dummy);
+        hvm_cpuid(0x0, &eax, NULL, NULL, NULL);
         switch ( eax )
         {
         default:
-            hvm_cpuid(0xa, &eax, &dummy, &dummy, &dummy);
+            hvm_cpuid(0xa, &eax, NULL, NULL, NULL);
             /* Check whether guest has the perf monitor feature. */
             if ( (eax & 0xff) && (eax & 0xff00) )
                 data |= X86_CR4_PCE;
             /* fall through */
         case 0x7 ... 0x9:
             ecx = 0;
-            hvm_cpuid(0x7, &dummy, &ebx, &ecx, &dummy);
+            hvm_cpuid(0x7, NULL, &ebx, &ecx, NULL);
             if ( ebx & cpufeat_mask(X86_FEATURE_FSGSBASE) )
                 data |= X86_CR4_FSGSBASE;
             if ( ebx & cpufeat_mask(X86_FEATURE_SMEP) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:34:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:34:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGky-0002uT-Kp; Sat, 05 Oct 2013 01:34:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkx-0002u4-Nv
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:07 +0000
Received: from [85.158.143.35:46341] by server-2.bemta-4.messagelabs.com id
	91/43-31802-F8C6F425; Sat, 05 Oct 2013 01:34:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1380936845!3867649!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11107 invoked from network); 5 Oct 2013 01:34:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:34:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkv-0005Td-1N
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGku-0002IU-VZ
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:05 +0000
Date: Sat, 05 Oct 2013 01:34:04 +0000
Message-Id: <E1VSGku-0002IU-VZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xsm: forbid PV guest console reads
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 65ba631bcb62c79eb33ebfde8a0471fd012c37a8
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Fri Oct 4 12:51:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:51:44 2013 +0200

    xsm: forbid PV guest console reads
    
    The CONSOLEIO_read operation was incorrectly allowed to PV guests if the
    hypervisor was compiled in debug mode (with VERBOSE defined).
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/include/xsm/dummy.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 052f3e0..52c651c 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -222,10 +222,10 @@ static XSM_INLINE int xsm_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
 #ifdef VERBOSE
-    return xsm_default_action(XSM_HOOK, current->domain, NULL);
-#else
-    return xsm_default_action(XSM_PRIV, current->domain, NULL);
+    if ( cmd == CONSOLEIO_write )
+        return xsm_default_action(XSM_HOOK, d, NULL);
 #endif
+    return xsm_default_action(XSM_PRIV, d, NULL);
 }
 
 static XSM_INLINE int xsm_profile(XSM_DEFAULT_ARG struct domain *d, int op)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:34:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:34:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGky-0002uT-Kp; Sat, 05 Oct 2013 01:34:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkx-0002u4-Nv
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:07 +0000
Received: from [85.158.143.35:46341] by server-2.bemta-4.messagelabs.com id
	91/43-31802-F8C6F425; Sat, 05 Oct 2013 01:34:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1380936845!3867649!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11107 invoked from network); 5 Oct 2013 01:34:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:34:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGkv-0005Td-1N
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGku-0002IU-VZ
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:05 +0000
Date: Sat, 05 Oct 2013 01:34:04 +0000
Message-Id: <E1VSGku-0002IU-VZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xsm: forbid PV guest console reads
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 65ba631bcb62c79eb33ebfde8a0471fd012c37a8
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Fri Oct 4 12:51:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:51:44 2013 +0200

    xsm: forbid PV guest console reads
    
    The CONSOLEIO_read operation was incorrectly allowed to PV guests if the
    hypervisor was compiled in debug mode (with VERBOSE defined).
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/include/xsm/dummy.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 052f3e0..52c651c 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -222,10 +222,10 @@ static XSM_INLINE int xsm_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
 #ifdef VERBOSE
-    return xsm_default_action(XSM_HOOK, current->domain, NULL);
-#else
-    return xsm_default_action(XSM_PRIV, current->domain, NULL);
+    if ( cmd == CONSOLEIO_write )
+        return xsm_default_action(XSM_HOOK, d, NULL);
 #endif
+    return xsm_default_action(XSM_PRIV, d, NULL);
 }
 
 static XSM_INLINE int xsm_profile(XSM_DEFAULT_ARG struct domain *d, int op)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:34:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:34: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 1VSGl9-0002ww-O3; Sat, 05 Oct 2013 01:34:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGl8-0002wT-0a
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:18 +0000
Received: from [85.158.137.68:3609] by server-4.bemta-3.messagelabs.com id
	57/90-13758-99C6F425; Sat, 05 Oct 2013 01:34:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1380936855!6753060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27126 invoked from network); 5 Oct 2013 01:34:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:34:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGl5-0005Tm-7W
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGl5-0002Iv-5C
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:15 +0000
Date: Sat, 05 Oct 2013 01:34:15 +0000
Message-Id: <E1VSGl5-0002Iv-5C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xsm: clean up unneeded current
	references
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d4fede3b1248c034901c0e3e901d7400d8dbbed1
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Fri Oct 4 12:52:56 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:52:56 2013 +0200

    xsm: clean up unneeded current references
    
    Some XSM hooks in dummy.h used current->domain when this was also passed
    as a parameter; use the parameter in these cases. There are two hooks
    where this does not apply and which are not immediately obvious:
    xsm_set_target's parameters are the device model and HVM domains, and
    xsm_mem_sharing_op's first parameter is the source of the shared page,
    not the domain making the hypercall.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/include/xsm/dummy.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 52c651c..eb9e1a1 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -231,7 +231,7 @@ static XSM_INLINE int xsm_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd)
 static XSM_INLINE int xsm_profile(XSM_DEFAULT_ARG struct domain *d, int op)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
-    return xsm_default_action(action, current->domain, NULL);
+    return xsm_default_action(action, d, NULL);
 }
 
 static XSM_INLINE int xsm_kexec(XSM_DEFAULT_VOID)
@@ -281,7 +281,7 @@ static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
 static XSM_INLINE int xsm_evtchn_send(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
-    return xsm_default_action(action, current->domain, NULL);
+    return xsm_default_action(action, d, NULL);
 }
 
 static XSM_INLINE int xsm_evtchn_status(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:34:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:34: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 1VSGl9-0002ww-O3; Sat, 05 Oct 2013 01:34:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGl8-0002wT-0a
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:18 +0000
Received: from [85.158.137.68:3609] by server-4.bemta-3.messagelabs.com id
	57/90-13758-99C6F425; Sat, 05 Oct 2013 01:34:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1380936855!6753060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27126 invoked from network); 5 Oct 2013 01:34:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:34:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGl5-0005Tm-7W
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGl5-0002Iv-5C
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:15 +0000
Date: Sat, 05 Oct 2013 01:34:15 +0000
Message-Id: <E1VSGl5-0002Iv-5C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xsm: clean up unneeded current
	references
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d4fede3b1248c034901c0e3e901d7400d8dbbed1
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Fri Oct 4 12:52:56 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:52:56 2013 +0200

    xsm: clean up unneeded current references
    
    Some XSM hooks in dummy.h used current->domain when this was also passed
    as a parameter; use the parameter in these cases. There are two hooks
    where this does not apply and which are not immediately obvious:
    xsm_set_target's parameters are the device model and HVM domains, and
    xsm_mem_sharing_op's first parameter is the source of the shared page,
    not the domain making the hypercall.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/include/xsm/dummy.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 52c651c..eb9e1a1 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -231,7 +231,7 @@ static XSM_INLINE int xsm_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd)
 static XSM_INLINE int xsm_profile(XSM_DEFAULT_ARG struct domain *d, int op)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
-    return xsm_default_action(action, current->domain, NULL);
+    return xsm_default_action(action, d, NULL);
 }
 
 static XSM_INLINE int xsm_kexec(XSM_DEFAULT_VOID)
@@ -281,7 +281,7 @@ static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
 static XSM_INLINE int xsm_evtchn_send(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
-    return xsm_default_action(action, current->domain, NULL);
+    return xsm_default_action(action, d, NULL);
 }
 
 static XSM_INLINE int xsm_evtchn_status(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:34:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGlJ-0002zd-Qn; Sat, 05 Oct 2013 01:34:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlI-0002z1-7v
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:28 +0000
Received: from [85.158.137.68:25611] by server-1.bemta-3.messagelabs.com id
	9C/EC-04901-3AC6F425; Sat, 05 Oct 2013 01:34:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1380936865!6739356!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14962 invoked from network); 5 Oct 2013 01:34:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:34:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlF-0005Ts-Ej
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlF-0002K2-BL
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:25 +0000
Date: Sat, 05 Oct 2013 01:34:25 +0000
Message-Id: <E1VSGlF-0002K2-BL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow HVM guests to make
	console_io hypercall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef912fbf2eadfa34e61210430117b6c2a4f7c567
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Fri Oct 4 12:54:38 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:54:38 2013 +0200

    x86: allow HVM guests to make console_io hypercall
    
    The console_io hypercall is provided for PV guests and for HVM
    guests it is done via the 0xe9 port. However the PV hypercall
    is more efficient as it takes a string rather than one character
    per write.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/hvm/hvm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a1a7780..de81e45 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3304,6 +3304,7 @@ static hvm_hypercall_t *const hvm_hypercall64_table[NR_hypercalls] = {
     [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op,
     [ __HYPERVISOR_physdev_op ] = (hvm_hypercall_t *)hvm_physdev_op,
     HYPERCALL(xen_version),
+    HYPERCALL(console_io),
     HYPERCALL(event_channel_op),
     HYPERCALL(sched_op),
     HYPERCALL(set_timer_op),
@@ -3323,6 +3324,7 @@ static hvm_hypercall_t *const hvm_hypercall32_table[NR_hypercalls] = {
     [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op_compat32,
     [ __HYPERVISOR_physdev_op ] = (hvm_hypercall_t *)hvm_physdev_op_compat32,
     COMPAT_CALL(xen_version),
+    HYPERCALL(console_io),
     HYPERCALL(event_channel_op),
     COMPAT_CALL(sched_op),
     COMPAT_CALL(set_timer_op),
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:34:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGlJ-0002zd-Qn; Sat, 05 Oct 2013 01:34:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlI-0002z1-7v
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:28 +0000
Received: from [85.158.137.68:25611] by server-1.bemta-3.messagelabs.com id
	9C/EC-04901-3AC6F425; Sat, 05 Oct 2013 01:34:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1380936865!6739356!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14962 invoked from network); 5 Oct 2013 01:34:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:34:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlF-0005Ts-Ej
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlF-0002K2-BL
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:25 +0000
Date: Sat, 05 Oct 2013 01:34:25 +0000
Message-Id: <E1VSGlF-0002K2-BL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow HVM guests to make
	console_io hypercall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef912fbf2eadfa34e61210430117b6c2a4f7c567
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Fri Oct 4 12:54:38 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:54:38 2013 +0200

    x86: allow HVM guests to make console_io hypercall
    
    The console_io hypercall is provided for PV guests and for HVM
    guests it is done via the 0xe9 port. However the PV hypercall
    is more efficient as it takes a string rather than one character
    per write.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/hvm/hvm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a1a7780..de81e45 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3304,6 +3304,7 @@ static hvm_hypercall_t *const hvm_hypercall64_table[NR_hypercalls] = {
     [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op,
     [ __HYPERVISOR_physdev_op ] = (hvm_hypercall_t *)hvm_physdev_op,
     HYPERCALL(xen_version),
+    HYPERCALL(console_io),
     HYPERCALL(event_channel_op),
     HYPERCALL(sched_op),
     HYPERCALL(set_timer_op),
@@ -3323,6 +3324,7 @@ static hvm_hypercall_t *const hvm_hypercall32_table[NR_hypercalls] = {
     [ __HYPERVISOR_vcpu_op ] = (hvm_hypercall_t *)hvm_vcpu_op_compat32,
     [ __HYPERVISOR_physdev_op ] = (hvm_hypercall_t *)hvm_physdev_op_compat32,
     COMPAT_CALL(xen_version),
+    HYPERCALL(console_io),
     HYPERCALL(event_channel_op),
     COMPAT_CALL(sched_op),
     COMPAT_CALL(set_timer_op),
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:34:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:34: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 1VSGlT-00031i-TX; Sat, 05 Oct 2013 01:34: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 1VSGlS-00031Q-El
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:38 +0000
Received: from [85.158.137.68:44604] by server-6.bemta-3.messagelabs.com id
	37/93-04812-DAC6F425; Sat, 05 Oct 2013 01:34:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1380936875!6768070!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32719 invoked from network); 5 Oct 2013 01:34:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:34:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlP-0005Tx-Ky
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlP-0002KV-Iz
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:35 +0000
Date: Sat, 05 Oct 2013 01:34:35 +0000
Message-Id: <E1VSGlP-0002KV-Iz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: Record last extable
	faulting 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 fe06795e82922f8d8c8910da545ef1215cbb1b8c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 4 12:57:43 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:57:43 2013 +0200

    x86/traps: Record last extable faulting address
    
    ... so the following patch can identify the location of faults leading to a
    decision to crash a domain.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/traps.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 72e8566..771e59a 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -89,6 +89,7 @@ static char __read_mostly opt_nmi[10] = "fatal";
 string_param("nmi", opt_nmi);
 
 DEFINE_PER_CPU(u64, efer);
+static DEFINE_PER_CPU(unsigned long, last_extable_addr);
 
 DEFINE_PER_CPU_READ_MOSTLY(u32, ler_msr);
 
@@ -550,6 +551,7 @@ static inline void do_trap(
     {
         dprintk(XENLOG_ERR, "Trap %d: %p -> %p\n",
                 trapnr, _p(regs->eip), _p(fixup));
+        this_cpu(last_extable_addr) = regs->eip;
         regs->eip = fixup;
         return;
     }
@@ -1038,6 +1040,7 @@ void do_invalid_op(struct cpu_user_regs *regs)
  die:
     if ( (fixup = search_exception_table(regs->eip)) != 0 )
     {
+        this_cpu(last_extable_addr) = regs->eip;
         regs->eip = fixup;
         return;
     }
@@ -1370,6 +1373,7 @@ void do_page_fault(struct cpu_user_regs *regs)
             perfc_incr(copy_user_faults);
             if ( unlikely(regs->error_code & PFEC_reserved_bit) )
                 reserved_bit_page_fault(addr, regs);
+            this_cpu(last_extable_addr) = regs->eip;
             regs->eip = fixup;
             return;
         }
@@ -3062,6 +3066,7 @@ void do_general_protection(struct cpu_user_regs *regs)
     {
         dprintk(XENLOG_INFO, "GPF (%04x): %p -> %p\n",
                 regs->error_code, _p(regs->eip), _p(fixup));
+        this_cpu(last_extable_addr) = regs->eip;
         regs->eip = fixup;
         return;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:34:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:34: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 1VSGlT-00031i-TX; Sat, 05 Oct 2013 01:34: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 1VSGlS-00031Q-El
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:38 +0000
Received: from [85.158.137.68:44604] by server-6.bemta-3.messagelabs.com id
	37/93-04812-DAC6F425; Sat, 05 Oct 2013 01:34:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1380936875!6768070!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32719 invoked from network); 5 Oct 2013 01:34:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:34:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlP-0005Tx-Ky
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlP-0002KV-Iz
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:35 +0000
Date: Sat, 05 Oct 2013 01:34:35 +0000
Message-Id: <E1VSGlP-0002KV-Iz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: Record last extable
	faulting 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 fe06795e82922f8d8c8910da545ef1215cbb1b8c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 4 12:57:43 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:57:43 2013 +0200

    x86/traps: Record last extable faulting address
    
    ... so the following patch can identify the location of faults leading to a
    decision to crash a domain.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/traps.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 72e8566..771e59a 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -89,6 +89,7 @@ static char __read_mostly opt_nmi[10] = "fatal";
 string_param("nmi", opt_nmi);
 
 DEFINE_PER_CPU(u64, efer);
+static DEFINE_PER_CPU(unsigned long, last_extable_addr);
 
 DEFINE_PER_CPU_READ_MOSTLY(u32, ler_msr);
 
@@ -550,6 +551,7 @@ static inline void do_trap(
     {
         dprintk(XENLOG_ERR, "Trap %d: %p -> %p\n",
                 trapnr, _p(regs->eip), _p(fixup));
+        this_cpu(last_extable_addr) = regs->eip;
         regs->eip = fixup;
         return;
     }
@@ -1038,6 +1040,7 @@ void do_invalid_op(struct cpu_user_regs *regs)
  die:
     if ( (fixup = search_exception_table(regs->eip)) != 0 )
     {
+        this_cpu(last_extable_addr) = regs->eip;
         regs->eip = fixup;
         return;
     }
@@ -1370,6 +1373,7 @@ void do_page_fault(struct cpu_user_regs *regs)
             perfc_incr(copy_user_faults);
             if ( unlikely(regs->error_code & PFEC_reserved_bit) )
                 reserved_bit_page_fault(addr, regs);
+            this_cpu(last_extable_addr) = regs->eip;
             regs->eip = fixup;
             return;
         }
@@ -3062,6 +3066,7 @@ void do_general_protection(struct cpu_user_regs *regs)
     {
         dprintk(XENLOG_INFO, "GPF (%04x): %p -> %p\n",
                 regs->error_code, _p(regs->eip), _p(fixup));
+        this_cpu(last_extable_addr) = regs->eip;
         regs->eip = fixup;
         return;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:34:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:34:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGlf-00033x-0q; Sat, 05 Oct 2013 01:34:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGld-00033d-81
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:49 +0000
Received: from [85.158.139.211:38426] by server-17.bemta-5.messagelabs.com id
	2E/13-19396-8BC6F425; Sat, 05 Oct 2013 01:34:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1380936886!6531634!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1271 invoked from network); 5 Oct 2013 01:34:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:34:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlZ-0005U6-R4
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlZ-0002Kt-P9
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:45 +0000
Date: Sat, 05 Oct 2013 01:34:45 +0000
Message-Id: <E1VSGlZ-0002Kt-P9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: Improve information from
	domain_crash_synchronous
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e0da8c07f4f80e14314977a11f738bd74a5b62b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 4 12:58:20 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:58:20 2013 +0200

    x86: Improve information from domain_crash_synchronous
    
    As it currently stands, the string "domain_crash_sync called from entry.S" is
    not helpful at identifying why the domain was crashed, and a debug build of
    Xen doesn't help the matter
    
    This patch improves the information printed, by pointing to where the crash
    decision was made.
    
    Specific improvements include:
     * Moving the ascii string "domain_crash_sync called from entry.S\n" away from
       some semi-hot code cache lines.
     * Moving the printk into C code (especially as this_cpu() is miserable to use
       in assembly code)
     * Undo the previous confusing situation of having the
       domain_crash_synchronous() as a macro in C code, yet a global symbol in
       assembly code.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/traps.c               |   11 ++++++++
 xen/arch/x86/x86_64/compat/entry.S |   11 +++++---
 xen/arch/x86/x86_64/entry.S        |   46 ++++++++++++++++++------------------
 xen/include/asm-x86/asm_defns.h    |    4 +++
 xen/include/xen/sched.h            |    7 +++++
 5 files changed, 52 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 771e59a..6c7bd99 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3748,6 +3748,17 @@ unsigned long do_get_debugreg(int reg)
     return -EINVAL;
 }
 
+void asm_domain_crash_synchronous(unsigned long addr)
+{
+    if ( addr == 0 )
+        addr = this_cpu(last_extable_addr);
+
+    printk("domain_crash_sync called from entry.S: fault at %p ", _p(addr));
+    print_symbol("%s\n", addr);
+
+    __domain_crash_synchronous();
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index c0afe2c..594b0b9 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -329,7 +329,10 @@ UNLIKELY_END(compat_bounce_failsafe)
         movzwl TRAPBOUNCE_cs(%rdx),%eax
         /* Null selectors (0-3) are not allowed. */
         testl $~3,%eax
-        jz    domain_crash_synchronous
+UNLIKELY_START(z, compat_bounce_null_selector)
+        lea   UNLIKELY_DISPATCH_LABEL(compat_bounce_null_selector)(%rip), %rdi
+        jmp   asm_domain_crash_synchronous  /* Does not return */
+__UNLIKELY_END(compat_bounce_null_selector)
         movl  %eax,UREGS_cs+8(%rsp)
         movl  TRAPBOUNCE_eip(%rdx),%eax
         movl  %eax,UREGS_rip+8(%rsp)
@@ -339,10 +342,10 @@ UNLIKELY_END(compat_bounce_failsafe)
         xorl  %edi,%edi
         jmp   .Lft13
 .previous
-        _ASM_EXTABLE(.Lft1,  domain_crash_synchronous)
+        _ASM_EXTABLE(.Lft1,  dom_crash_sync_extable)
         _ASM_EXTABLE(.Lft2,  compat_crash_page_fault)
         _ASM_EXTABLE(.Lft3,  compat_crash_page_fault_4)
-        _ASM_EXTABLE(.Lft4,  domain_crash_synchronous)
+        _ASM_EXTABLE(.Lft4,  dom_crash_sync_extable)
         _ASM_EXTABLE(.Lft5,  compat_crash_page_fault_4)
         _ASM_EXTABLE(.Lft6,  compat_crash_page_fault_8)
         _ASM_EXTABLE(.Lft7,  compat_crash_page_fault)
@@ -363,7 +366,7 @@ compat_crash_page_fault:
 .Lft14: mov   %edi,%fs
         movl  %esi,%edi
         call  show_page_walk
-        jmp   domain_crash_synchronous
+        jmp   dom_crash_sync_extable
 .section .fixup,"ax"
 .Lfx14:
         xorl  %edi,%edi
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index f64e871..3ea4683 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -370,7 +370,10 @@ create_bounce_frame:
         sbb   %ecx,%ecx                 # In +ve address space? Then okay.
         cmpq  %rax,%rsi
         adc   %ecx,%ecx                 # Above Xen private area? Then okay.
-        jg    domain_crash_synchronous
+UNLIKELY_START(g, create_bounce_frame_bad_sp)
+        lea   UNLIKELY_DISPATCH_LABEL(create_bounce_frame_bad_sp)(%rip), %rdi
+        jmp   asm_domain_crash_synchronous  /* Does not return */
+__UNLIKELY_END(create_bounce_frame_bad_sp)
         movb  TRAPBOUNCE_flags(%rdx),%cl
         subq  $40,%rsi
         movq  UREGS_ss+8(%rsp),%rax
@@ -429,26 +432,26 @@ UNLIKELY_END(bounce_failsafe)
         movq  $FLAT_KERNEL_CS,UREGS_cs+8(%rsp)
         movq  TRAPBOUNCE_eip(%rdx),%rax
         testq %rax,%rax
-        jz    domain_crash_synchronous
+UNLIKELY_START(z, create_bounce_frame_bad_bounce_ip)
+        lea   UNLIKELY_DISPATCH_LABEL(create_bounce_frame_bad_bounce_ip)(%rip), %rdi
+        jmp   asm_domain_crash_synchronous  /* Does not return */
+__UNLIKELY_END(create_bounce_frame_bad_bounce_ip)
         movq  %rax,UREGS_rip+8(%rsp)
         ret
-        _ASM_EXTABLE(.Lft2,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft3,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft4,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft5,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft6,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft7,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft8,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft9,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft10, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft11, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft12, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft13, domain_crash_synchronous)
-
-domain_crash_synchronous_string:
-        .asciz "domain_crash_sync called from entry.S\n"
-
-ENTRY(domain_crash_synchronous)
+        _ASM_EXTABLE(.Lft2,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft3,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft4,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft5,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft6,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft7,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft8,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft9,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft10, dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft11, dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft12, dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft13, dom_crash_sync_extable)
+
+ENTRY(dom_crash_sync_extable)
         # Get out of the guest-save area of the stack.
         GET_STACK_BASE(%rax)
         leaq  STACK_CPUINFO_FIELD(guest_cpu_user_regs)(%rax),%rsp
@@ -459,11 +462,8 @@ ENTRY(domain_crash_synchronous)
         setz  %al
         leal  (%rax,%rax,2),%eax
         orb   %al,UREGS_cs(%rsp)
-        # printk(domain_crash_synchronous_string)
-        leaq  domain_crash_synchronous_string(%rip),%rdi
-        xorl  %eax,%eax
-        call  printk
-        jmp  __domain_crash_synchronous
+        xorl  %edi,%edi
+        jmp   asm_domain_crash_synchronous /* Does not return */
 
 /* No special register assumptions. */
 ENTRY(ret_from_intr)
diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h
index 25032d5..a4601ba 100644
--- a/xen/include/asm-x86/asm_defns.h
+++ b/xen/include/asm-x86/asm_defns.h
@@ -35,10 +35,14 @@ void ret_from_intr(void);
 #ifdef __ASSEMBLY__
 
 #define UNLIKELY_START(cond, tag) \
+        .Ldispatch.tag:           \
         j##cond .Lunlikely.tag;   \
         .subsection 1;            \
         .Lunlikely.tag:
 
+#define UNLIKELY_DISPATCH_LABEL(tag) \
+        .Ldispatch.tag
+
 #define UNLIKELY_DONE(cond, tag)  \
         j##cond .Llikely.tag
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 0013a8d..1765e18 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -547,6 +547,13 @@ void __domain_crash_synchronous(void) __attribute__((noreturn));
     __domain_crash_synchronous();                                         \
 } while (0)
 
+/*
+ * Called from assembly code, with an optional address to help indicate why
+ * the crash occured.  If addr is 0, look up address from last extable
+ * redirection.
+ */
+void asm_domain_crash_synchronous(unsigned long addr) __attribute__((noreturn));
+
 #define set_current_state(_s) do { current->state = (_s); } while (0)
 void scheduler_init(void);
 int  sched_init_vcpu(struct vcpu *v, unsigned int processor);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 05 01:34:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 05 Oct 2013 01:34:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VSGlf-00033x-0q; Sat, 05 Oct 2013 01:34:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGld-00033d-81
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:49 +0000
Received: from [85.158.139.211:38426] by server-17.bemta-5.messagelabs.com id
	2E/13-19396-8BC6F425; Sat, 05 Oct 2013 01:34:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1380936886!6531634!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1271 invoked from network); 5 Oct 2013 01:34:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Oct 2013 01:34:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlZ-0005U6-R4
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VSGlZ-0002Kt-P9
	for xen-changelog@lists.xensource.com; Sat, 05 Oct 2013 01:34:45 +0000
Date: Sat, 05 Oct 2013 01:34:45 +0000
Message-Id: <E1VSGlZ-0002Kt-P9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: Improve information from
	domain_crash_synchronous
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e0da8c07f4f80e14314977a11f738bd74a5b62b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 4 12:58:20 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 4 12:58:20 2013 +0200

    x86: Improve information from domain_crash_synchronous
    
    As it currently stands, the string "domain_crash_sync called from entry.S" is
    not helpful at identifying why the domain was crashed, and a debug build of
    Xen doesn't help the matter
    
    This patch improves the information printed, by pointing to where the crash
    decision was made.
    
    Specific improvements include:
     * Moving the ascii string "domain_crash_sync called from entry.S\n" away from
       some semi-hot code cache lines.
     * Moving the printk into C code (especially as this_cpu() is miserable to use
       in assembly code)
     * Undo the previous confusing situation of having the
       domain_crash_synchronous() as a macro in C code, yet a global symbol in
       assembly code.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/traps.c               |   11 ++++++++
 xen/arch/x86/x86_64/compat/entry.S |   11 +++++---
 xen/arch/x86/x86_64/entry.S        |   46 ++++++++++++++++++------------------
 xen/include/asm-x86/asm_defns.h    |    4 +++
 xen/include/xen/sched.h            |    7 +++++
 5 files changed, 52 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 771e59a..6c7bd99 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3748,6 +3748,17 @@ unsigned long do_get_debugreg(int reg)
     return -EINVAL;
 }
 
+void asm_domain_crash_synchronous(unsigned long addr)
+{
+    if ( addr == 0 )
+        addr = this_cpu(last_extable_addr);
+
+    printk("domain_crash_sync called from entry.S: fault at %p ", _p(addr));
+    print_symbol("%s\n", addr);
+
+    __domain_crash_synchronous();
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index c0afe2c..594b0b9 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -329,7 +329,10 @@ UNLIKELY_END(compat_bounce_failsafe)
         movzwl TRAPBOUNCE_cs(%rdx),%eax
         /* Null selectors (0-3) are not allowed. */
         testl $~3,%eax
-        jz    domain_crash_synchronous
+UNLIKELY_START(z, compat_bounce_null_selector)
+        lea   UNLIKELY_DISPATCH_LABEL(compat_bounce_null_selector)(%rip), %rdi
+        jmp   asm_domain_crash_synchronous  /* Does not return */
+__UNLIKELY_END(compat_bounce_null_selector)
         movl  %eax,UREGS_cs+8(%rsp)
         movl  TRAPBOUNCE_eip(%rdx),%eax
         movl  %eax,UREGS_rip+8(%rsp)
@@ -339,10 +342,10 @@ UNLIKELY_END(compat_bounce_failsafe)
         xorl  %edi,%edi
         jmp   .Lft13
 .previous
-        _ASM_EXTABLE(.Lft1,  domain_crash_synchronous)
+        _ASM_EXTABLE(.Lft1,  dom_crash_sync_extable)
         _ASM_EXTABLE(.Lft2,  compat_crash_page_fault)
         _ASM_EXTABLE(.Lft3,  compat_crash_page_fault_4)
-        _ASM_EXTABLE(.Lft4,  domain_crash_synchronous)
+        _ASM_EXTABLE(.Lft4,  dom_crash_sync_extable)
         _ASM_EXTABLE(.Lft5,  compat_crash_page_fault_4)
         _ASM_EXTABLE(.Lft6,  compat_crash_page_fault_8)
         _ASM_EXTABLE(.Lft7,  compat_crash_page_fault)
@@ -363,7 +366,7 @@ compat_crash_page_fault:
 .Lft14: mov   %edi,%fs
         movl  %esi,%edi
         call  show_page_walk
-        jmp   domain_crash_synchronous
+        jmp   dom_crash_sync_extable
 .section .fixup,"ax"
 .Lfx14:
         xorl  %edi,%edi
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index f64e871..3ea4683 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -370,7 +370,10 @@ create_bounce_frame:
         sbb   %ecx,%ecx                 # In +ve address space? Then okay.
         cmpq  %rax,%rsi
         adc   %ecx,%ecx                 # Above Xen private area? Then okay.
-        jg    domain_crash_synchronous
+UNLIKELY_START(g, create_bounce_frame_bad_sp)
+        lea   UNLIKELY_DISPATCH_LABEL(create_bounce_frame_bad_sp)(%rip), %rdi
+        jmp   asm_domain_crash_synchronous  /* Does not return */
+__UNLIKELY_END(create_bounce_frame_bad_sp)
         movb  TRAPBOUNCE_flags(%rdx),%cl
         subq  $40,%rsi
         movq  UREGS_ss+8(%rsp),%rax
@@ -429,26 +432,26 @@ UNLIKELY_END(bounce_failsafe)
         movq  $FLAT_KERNEL_CS,UREGS_cs+8(%rsp)
         movq  TRAPBOUNCE_eip(%rdx),%rax
         testq %rax,%rax
-        jz    domain_crash_synchronous
+UNLIKELY_START(z, create_bounce_frame_bad_bounce_ip)
+        lea   UNLIKELY_DISPATCH_LABEL(create_bounce_frame_bad_bounce_ip)(%rip), %rdi
+        jmp   asm_domain_crash_synchronous  /* Does not return */
+__UNLIKELY_END(create_bounce_frame_bad_bounce_ip)
         movq  %rax,UREGS_rip+8(%rsp)
         ret
-        _ASM_EXTABLE(.Lft2,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft3,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft4,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft5,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft6,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft7,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft8,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft9,  domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft10, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft11, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft12, domain_crash_synchronous)
-        _ASM_EXTABLE(.Lft13, domain_crash_synchronous)
-
-domain_crash_synchronous_string:
-        .asciz "domain_crash_sync called from entry.S\n"
-
-ENTRY(domain_crash_synchronous)
+        _ASM_EXTABLE(.Lft2,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft3,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft4,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft5,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft6,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft7,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft8,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft9,  dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft10, dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft11, dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft12, dom_crash_sync_extable)
+        _ASM_EXTABLE(.Lft13, dom_crash_sync_extable)
+
+ENTRY(dom_crash_sync_extable)
         # Get out of the guest-save area of the stack.
         GET_STACK_BASE(%rax)
         leaq  STACK_CPUINFO_FIELD(guest_cpu_user_regs)(%rax),%rsp
@@ -459,11 +462,8 @@ ENTRY(domain_crash_synchronous)
         setz  %al
         leal  (%rax,%rax,2),%eax
         orb   %al,UREGS_cs(%rsp)
-        # printk(domain_crash_synchronous_string)
-        leaq  domain_crash_synchronous_string(%rip),%rdi
-        xorl  %eax,%eax
-        call  printk
-        jmp  __domain_crash_synchronous
+        xorl  %edi,%edi
+        jmp   asm_domain_crash_synchronous /* Does not return */
 
 /* No special register assumptions. */
 ENTRY(ret_from_intr)
diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h
index 25032d5..a4601ba 100644
--- a/xen/include/asm-x86/asm_defns.h
+++ b/xen/include/asm-x86/asm_defns.h
@@ -35,10 +35,14 @@ void ret_from_intr(void);
 #ifdef __ASSEMBLY__
 
 #define UNLIKELY_START(cond, tag) \
+        .Ldispatch.tag:           \
         j##cond .Lunlikely.tag;   \
         .subsection 1;            \
         .Lunlikely.tag:
 
+#define UNLIKELY_DISPATCH_LABEL(tag) \
+        .Ldispatch.tag
+
 #define UNLIKELY_DONE(cond, tag)  \
         j##cond .Llikely.tag
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 0013a8d..1765e18 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -547,6 +547,13 @@ void __domain_crash_synchronous(void) __attribute__((noreturn));
     __domain_crash_synchronous();                                         \
 } while (0)
 
+/*
+ * Called from assembly code, with an optional address to help indicate why
+ * the crash occured.  If addr is 0, look up address from last extable
+ * redirection.
+ */
+void asm_domain_crash_synchronous(unsigned long addr) __attribute__((noreturn));
+
 #define set_current_state(_s) do { current->state = (_s); } while (0)
 void scheduler_init(void);
 int  sched_init_vcpu(struct vcpu *v, unsigned int processor);
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 08 00:55:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Oct 2013 00:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VTLa2-0007vn-IP; Tue, 08 Oct 2013 00: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 1VTLa1-0007vi-AM
	for xen-changelog@lists.xensource.com; Tue, 08 Oct 2013 00:55:17 +0000
Received: from [85.158.143.35:18698] by server-2.bemta-4.messagelabs.com id
	4B/16-31802-4F753525; Tue, 08 Oct 2013 00:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1381193714!255484!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17387 invoked from network); 8 Oct 2013 00:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2013 00:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VTLZy-0001kp-KP
	for xen-changelog@lists.xensource.com; Tue, 08 Oct 2013 00:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VTLZy-0006nf-7L
	for xen-changelog@lists.xensource.com; Tue, 08 Oct 2013 00:55:14 +0000
Date: Tue, 08 Oct 2013 00:55:14 +0000
Message-Id: <E1VTLZy-0006nf-7L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: add LZ4 decompression support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84f04d8f0dbfc24a48ee888011ca7410b7bbafc5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 7 09:42:51 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 7 09:42:51 2013 +0200

    libxc: add LZ4 decompression support
    
    Since there's no shared or static library to link against, this simply
    re-uses the hypervisor side code. However, I only audited the code
    added here for possible security issues, not the referenced code in
    the hypervisor tree.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/Makefile                |    1 +
 tools/libxc/xc_dom_bzimageloader.c  |   13 +++-
 tools/libxc/xc_dom_decompress.h     |    8 ++
 tools/libxc/xc_dom_decompress_lz4.c |  136 +++++++++++++++++++++++++++++++++++
 4 files changed, 157 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 512a994..4c64c15 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -63,6 +63,7 @@ $(patsubst %.c,%.opic,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
 GUEST_SRCS-y                 += xc_dom_core.c xc_dom_boot.c
 GUEST_SRCS-y                 += xc_dom_elfloader.c
 GUEST_SRCS-$(CONFIG_X86)     += xc_dom_bzimageloader.c
+GUEST_SRCS-$(CONFIG_X86)     += xc_dom_decompress_lz4.c
 GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_armzimageloader.c
 GUEST_SRCS-y                 += xc_dom_binloader.c
 GUEST_SRCS-y                 += xc_dom_compat_linux.c
diff --git a/tools/libxc/xc_dom_bzimageloader.c b/tools/libxc/xc_dom_bzimageloader.c
index 3870c6d..2225699 100644
--- a/tools/libxc/xc_dom_bzimageloader.c
+++ b/tools/libxc/xc_dom_bzimageloader.c
@@ -33,7 +33,7 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xc_dom.h"
+#include "xc_dom_decompress.h"
 
 #ifndef __MINIOS__
 
@@ -733,6 +733,17 @@ static int xc_dom_probe_bzimage_kernel(struct xc_dom_image *dom)
             return -EINVAL;
         }
     }
+    else if ( check_magic(dom, "\x02\x21", 2) )
+    {
+        ret = xc_try_lz4_decode(dom, &dom->kernel_blob, &dom->kernel_size);
+        if ( ret < 0 )
+        {
+            xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                         "%s unable to LZ4 decompress kernel\n",
+                         __FUNCTION__);
+            return -EINVAL;
+        }
+    }
     else
     {
         xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
diff --git a/tools/libxc/xc_dom_decompress.h b/tools/libxc/xc_dom_decompress.h
new file mode 100644
index 0000000..42cefa3
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress.h
@@ -0,0 +1,8 @@
+#ifndef __MINIOS__
+# include "xc_dom.h"
+#else
+# include "xc_dom_decompress_unsafe.h"
+#endif
+
+int xc_try_lz4_decode(struct xc_dom_image *dom, void **blob, size_t *size);
+
diff --git a/tools/libxc/xc_dom_decompress_lz4.c b/tools/libxc/xc_dom_decompress_lz4.c
new file mode 100644
index 0000000..4787535
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_lz4.c
@@ -0,0 +1,136 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <endian.h>
+#include <stdint.h>
+
+#include "xg_private.h"
+#include "xc_dom_decompress.h"
+
+#define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+
+#define likely(a) a
+#define unlikely(a) a
+
+static inline uint_fast16_t le16_to_cpup(const unsigned char *buf)
+{
+    return buf[0] | (buf[1] << 8);
+}
+
+static inline uint_fast32_t le32_to_cpup(const unsigned char *buf)
+{
+    return le16_to_cpup(buf) | ((uint32_t)le16_to_cpup(buf + 2) << 16);
+}
+
+#include "../../xen/include/xen/lz4.h"
+#include "../../xen/common/decompress.h"
+
+#ifndef __MINIOS__
+
+#include "../../xen/common/lz4/decompress.c"
+
+#define ARCHIVE_MAGICNUMBER 0x184C2102
+
+int xc_try_lz4_decode(
+	struct xc_dom_image *dom, void **blob, size_t *psize)
+{
+	int ret = -1;
+	unsigned char *inp = *blob, *output, *outp;
+	ssize_t size = *psize - 4;
+	size_t out_len, dest_len, chunksize;
+	const char *msg;
+
+	if (size < 4) {
+		msg = "input too small";
+		goto exit_0;
+	}
+
+	out_len = get_unaligned_le32(inp + size);
+	if (xc_dom_kernel_check_size(dom, out_len)) {
+		msg = "Decompressed image too large";
+		goto exit_0;
+	}
+
+	output = malloc(out_len);
+	if (!output) {
+		msg = "Could not allocate output buffer";
+		goto exit_0;
+	}
+	outp = output;
+
+	chunksize = get_unaligned_le32(inp);
+	if (chunksize == ARCHIVE_MAGICNUMBER) {
+		inp += 4;
+		size -= 4;
+	} else {
+		msg = "invalid header";
+		goto exit_2;
+	}
+
+	for (;;) {
+		if (size < 4) {
+			msg = "missing data";
+			goto exit_2;
+		}
+		chunksize = get_unaligned_le32(inp);
+		if (chunksize == ARCHIVE_MAGICNUMBER) {
+			inp += 4;
+			size -= 4;
+			continue;
+		}
+		inp += 4;
+		size -= 4;
+		if (chunksize > size) {
+			msg = "insufficient input data";
+			goto exit_2;
+		}
+
+		dest_len = out_len - (outp - output);
+		ret = lz4_decompress_unknownoutputsize(inp, chunksize, outp,
+				&dest_len);
+		if (ret < 0) {
+			msg = "decoding failed";
+			goto exit_2;
+		}
+
+		outp += dest_len;
+		size -= chunksize;
+
+		if (size == 0)
+		{
+			*blob = output;
+			*psize = out_len;
+			return 0;
+		}
+
+		if (size < 0) {
+			msg = "data corrupted";
+			goto exit_2;
+		}
+
+		inp += chunksize;
+	}
+
+exit_2:
+	free(output);
+exit_0:
+	DOMPRINTF("LZ4 decompression error: %s\n", msg);
+	return ret;
+}
+
+#else /* __MINIOS__ */
+
+#include "../../xen/common/unlz4.c"
+
+int xc_try_lz4_decode(
+    struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    return xc_dom_decompress_unsafe(unlz4, dom, blob, size);
+}
+
+#endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Oct 08 00:55:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Oct 2013 00:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VTLa2-0007vn-IP; Tue, 08 Oct 2013 00: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 1VTLa1-0007vi-AM
	for xen-changelog@lists.xensource.com; Tue, 08 Oct 2013 00:55:17 +0000
Received: from [85.158.143.35:18698] by server-2.bemta-4.messagelabs.com id
	4B/16-31802-4F753525; Tue, 08 Oct 2013 00:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1381193714!255484!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17387 invoked from network); 8 Oct 2013 00:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2013 00:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VTLZy-0001kp-KP
	for xen-changelog@lists.xensource.com; Tue, 08 Oct 2013 00:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VTLZy-0006nf-7L
	for xen-changelog@lists.xensource.com; Tue, 08 Oct 2013 00:55:14 +0000
Date: Tue, 08 Oct 2013 00:55:14 +0000
Message-Id: <E1VTLZy-0006nf-7L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: add LZ4 decompression support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84f04d8f0dbfc24a48ee888011ca7410b7bbafc5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 7 09:42:51 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 7 09:42:51 2013 +0200

    libxc: add LZ4 decompression support
    
    Since there's no shared or static library to link against, this simply
    re-uses the hypervisor side code. However, I only audited the code
    added here for possible security issues, not the referenced code in
    the hypervisor tree.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/Makefile                |    1 +
 tools/libxc/xc_dom_bzimageloader.c  |   13 +++-
 tools/libxc/xc_dom_decompress.h     |    8 ++
 tools/libxc/xc_dom_decompress_lz4.c |  136 +++++++++++++++++++++++++++++++++++
 4 files changed, 157 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 512a994..4c64c15 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -63,6 +63,7 @@ $(patsubst %.c,%.opic,$(ELF_SRCS-y)): CFLAGS += -Wno-pointer-sign
 GUEST_SRCS-y                 += xc_dom_core.c xc_dom_boot.c
 GUEST_SRCS-y                 += xc_dom_elfloader.c
 GUEST_SRCS-$(CONFIG_X86)     += xc_dom_bzimageloader.c
+GUEST_SRCS-$(CONFIG_X86)     += xc_dom_decompress_lz4.c
 GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_armzimageloader.c
 GUEST_SRCS-y                 += xc_dom_binloader.c
 GUEST_SRCS-y                 += xc_dom_compat_linux.c
diff --git a/tools/libxc/xc_dom_bzimageloader.c b/tools/libxc/xc_dom_bzimageloader.c
index 3870c6d..2225699 100644
--- a/tools/libxc/xc_dom_bzimageloader.c
+++ b/tools/libxc/xc_dom_bzimageloader.c
@@ -33,7 +33,7 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xc_dom.h"
+#include "xc_dom_decompress.h"
 
 #ifndef __MINIOS__
 
@@ -733,6 +733,17 @@ static int xc_dom_probe_bzimage_kernel(struct xc_dom_image *dom)
             return -EINVAL;
         }
     }
+    else if ( check_magic(dom, "\x02\x21", 2) )
+    {
+        ret = xc_try_lz4_decode(dom, &dom->kernel_blob, &dom->kernel_size);
+        if ( ret < 0 )
+        {
+            xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                         "%s unable to LZ4 decompress kernel\n",
+                         __FUNCTION__);
+            return -EINVAL;
+        }
+    }
     else
     {
         xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
diff --git a/tools/libxc/xc_dom_decompress.h b/tools/libxc/xc_dom_decompress.h
new file mode 100644
index 0000000..42cefa3
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress.h
@@ -0,0 +1,8 @@
+#ifndef __MINIOS__
+# include "xc_dom.h"
+#else
+# include "xc_dom_decompress_unsafe.h"
+#endif
+
+int xc_try_lz4_decode(struct xc_dom_image *dom, void **blob, size_t *size);
+
diff --git a/tools/libxc/xc_dom_decompress_lz4.c b/tools/libxc/xc_dom_decompress_lz4.c
new file mode 100644
index 0000000..4787535
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_lz4.c
@@ -0,0 +1,136 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <endian.h>
+#include <stdint.h>
+
+#include "xg_private.h"
+#include "xc_dom_decompress.h"
+
+#define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+
+#define likely(a) a
+#define unlikely(a) a
+
+static inline uint_fast16_t le16_to_cpup(const unsigned char *buf)
+{
+    return buf[0] | (buf[1] << 8);
+}
+
+static inline uint_fast32_t le32_to_cpup(const unsigned char *buf)
+{
+    return le16_to_cpup(buf) | ((uint32_t)le16_to_cpup(buf + 2) << 16);
+}
+
+#include "../../xen/include/xen/lz4.h"
+#include "../../xen/common/decompress.h"
+
+#ifndef __MINIOS__
+
+#include "../../xen/common/lz4/decompress.c"
+
+#define ARCHIVE_MAGICNUMBER 0x184C2102
+
+int xc_try_lz4_decode(
+	struct xc_dom_image *dom, void **blob, size_t *psize)
+{
+	int ret = -1;
+	unsigned char *inp = *blob, *output, *outp;
+	ssize_t size = *psize - 4;
+	size_t out_len, dest_len, chunksize;
+	const char *msg;
+
+	if (size < 4) {
+		msg = "input too small";
+		goto exit_0;
+	}
+
+	out_len = get_unaligned_le32(inp + size);
+	if (xc_dom_kernel_check_size(dom, out_len)) {
+		msg = "Decompressed image too large";
+		goto exit_0;
+	}
+
+	output = malloc(out_len);
+	if (!output) {
+		msg = "Could not allocate output buffer";
+		goto exit_0;
+	}
+	outp = output;
+
+	chunksize = get_unaligned_le32(inp);
+	if (chunksize == ARCHIVE_MAGICNUMBER) {
+		inp += 4;
+		size -= 4;
+	} else {
+		msg = "invalid header";
+		goto exit_2;
+	}
+
+	for (;;) {
+		if (size < 4) {
+			msg = "missing data";
+			goto exit_2;
+		}
+		chunksize = get_unaligned_le32(inp);
+		if (chunksize == ARCHIVE_MAGICNUMBER) {
+			inp += 4;
+			size -= 4;
+			continue;
+		}
+		inp += 4;
+		size -= 4;
+		if (chunksize > size) {
+			msg = "insufficient input data";
+			goto exit_2;
+		}
+
+		dest_len = out_len - (outp - output);
+		ret = lz4_decompress_unknownoutputsize(inp, chunksize, outp,
+				&dest_len);
+		if (ret < 0) {
+			msg = "decoding failed";
+			goto exit_2;
+		}
+
+		outp += dest_len;
+		size -= chunksize;
+
+		if (size == 0)
+		{
+			*blob = output;
+			*psize = out_len;
+			return 0;
+		}
+
+		if (size < 0) {
+			msg = "data corrupted";
+			goto exit_2;
+		}
+
+		inp += chunksize;
+	}
+
+exit_2:
+	free(output);
+exit_0:
+	DOMPRINTF("LZ4 decompression error: %s\n", msg);
+	return ret;
+}
+
+#else /* __MINIOS__ */
+
+#include "../../xen/common/unlz4.c"
+
+int xc_try_lz4_decode(
+    struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    return xc_dom_decompress_unsafe(unlz4, dom, blob, size);
+}
+
+#endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Oct 08 00:55:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Oct 2013 00:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VTLa4-0007w2-L1; Tue, 08 Oct 2013 00:55: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 1VTLa3-0007vs-JN
	for xen-changelog@lists.xensource.com; Tue, 08 Oct 2013 00:55:20 +0000
Received: from [85.158.139.211:40346] by server-2.bemta-5.messagelabs.com id
	59/A9-26841-6F753525; Tue, 08 Oct 2013 00:55:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1381193704!5024923!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_18,ML_RADAR_SPEW_LINKS_8,spamassassin: ,
	async_handler: YXN5bmNfZGVsYXk6IDcwNTkwODYgKHRpbWVvdXQp\n
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28308 invoked from network); 8 Oct 2013 00:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2013 00:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VTLZo-0001km-3i
	for xen-changelog@lists.xensource.com; Tue, 08 Oct 2013 00:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VTLZn-0006nH-Fk
	for xen-changelog@lists.xensource.com; Tue, 08 Oct 2013 00:55:03 +0000
Date: Tue, 08 Oct 2013 00:55:03 +0000
Message-Id: <E1VTLZn-0006nH-Fk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: add LZ4 decompression support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e850049bbc831bfe40b87eaea673675d8a829e74
Author:     Kyungsik Lee <kyungsik.lee@lge.com>
AuthorDate: Mon Oct 7 09:40:35 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 7 09:40:35 2013 +0200

    xen: add LZ4 decompression support
    
    Add support for LZ4 decompression in Xen. LZ4 Decompression APIs for
    Xen are based on LZ4 implementation by Yann Collet.
    
    Benchmark Results(PATCH v3)
    Compiler: Linaro ARM gcc 4.6.2
    
    1. ARMv7, 1.5GHz based board
       Kernel: linux 3.4
       Uncompressed Kernel Size: 14MB
            Compressed Size  Decompression Speed
       LZO  6.7MB            20.1MB/s, 25.2MB/s(UA)
       LZ4  7.3MB            29.1MB/s, 45.6MB/s(UA)
    
    2. ARMv7, 1.7GHz based board
       Kernel: linux 3.7
       Uncompressed Kernel Size: 14MB
            Compressed Size  Decompression Speed
       LZO  6.0MB            34.1MB/s, 52.2MB/s(UA)
       LZ4  6.5MB            86.7MB/s
    - UA: Unaligned memory Access support
    - Latest patch set for LZO applied
    
    This patch set is for adding support for LZ4-compressed Kernel.  LZ4 is a
    very fast lossless compression algorithm and it also features an extremely
    fast decoder [1].
    
    But we have five of decompressors already and one question which does
    arise, however, is that of where do we stop adding new ones?  This issue
    had been discussed and came to the conclusion [2].
    
    Russell King said that we should have:
    
     - one decompressor which is the fastest
     - one decompressor for the highest compression ratio
     - one popular decompressor (eg conventional gzip)
    
    If we have a replacement one for one of these, then it should do exactly
    that: replace it.
    
    The benchmark shows that an 8% increase in image size vs a 66% increase
    in decompression speed compared to LZO(which has been known as the
    fastest decompressor in the Kernel).  Therefore the "fast but may not be
    small" compression title has clearly been taken by LZ4 [3].
    
    [1] http://code.google.com/p/lz4/
    [2] http://thread.gmane.org/gmane.linux.kbuild.devel/9157
    [3] http://thread.gmane.org/gmane.linux.kbuild.devel/9347
    
    LZ4 homepage: http://fastcompression.blogspot.com/p/lz4.html
    LZ4 source repository: http://code.google.com/p/lz4/
    
    Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>
    Signed-off-by: Yann Collet <yann.collet.73@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/Makefile          |    2 +-
 xen/common/decompress.c      |    3 +
 xen/common/lz4/decompress.c  |  323 ++++++++++++++++++++++++++++++++++++++++++
 xen/common/lz4/defs.h        |  184 ++++++++++++++++++++++++
 xen/common/unlz4.c           |  166 ++++++++++++++++++++++
 xen/include/asm-x86/config.h |    1 +
 xen/include/xen/decompress.h |    2 +-
 xen/include/xen/lz4.h        |   88 ++++++++++++
 8 files changed, 767 insertions(+), 2 deletions(-)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index 6da4651..fcb4a84 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -49,7 +49,7 @@ obj-y += radix-tree.o
 obj-y += rbtree.o
 obj-y += lzo.o
 
-obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo earlycpio,$(n).init.o)
+obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o)
 
 obj-$(perfc)       += perfc.o
 obj-$(crash_debug) += gdbstub.o
diff --git a/xen/common/decompress.c b/xen/common/decompress.c
index 1098481..5f86af9 100644
--- a/xen/common/decompress.c
+++ b/xen/common/decompress.c
@@ -29,5 +29,8 @@ int __init decompress(void *inbuf, unsigned int len, void *outbuf)
     if ( len >= 5 && !memcmp(inbuf, "\x89LZO", 5) )
         return unlzo(inbuf, len, NULL, NULL, outbuf, NULL, error);
 
+    if ( len >= 2 && !memcmp(inbuf, "\x02\x21", 2) )
+	return unlz4(inbuf, len, NULL, NULL, outbuf, NULL, error);
+
     return 1;
 }
diff --git a/xen/common/lz4/decompress.c b/xen/common/lz4/decompress.c
new file mode 100644
index 0000000..40b3381
--- /dev/null
+++ b/xen/common/lz4/decompress.c
@@ -0,0 +1,323 @@
+/*
+ * LZ4 Decompressor for Linux kernel
+ *
+ * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.com>
+ *
+ * Based on LZ4 implementation by Yann Collet.
+ *
+ * LZ4 - Fast LZ compression algorithm
+ * Copyright (C) 2011-2012, Yann Collet.
+ * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  You can contact the author at :
+ *  - LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html
+ *  - LZ4 source repository : http://code.google.com/p/lz4/
+ */
+
+#include "defs.h"
+
+#if defined(__XEN__) || defined(__MINIOS__)
+
+static int INIT lz4_uncompress(const unsigned char *source, unsigned char *dest,
+			       int osize)
+{
+	const BYTE *ip = (const BYTE *) source;
+	const BYTE *ref;
+	BYTE *op = (BYTE *) dest;
+	BYTE * const oend = op + osize;
+	BYTE *cpy;
+	unsigned token;
+	size_t length;
+	size_t dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0};
+#if LZ4_ARCH64
+	size_t dec64table[] = {0, 0, 0, -1, 0, 1, 2, 3};
+#endif
+
+	while (1) {
+
+		/* get runlength */
+		token = *ip++;
+		length = (token >> ML_BITS);
+		if (length == RUN_MASK) {
+			size_t len;
+
+			len = *ip++;
+			for (; len == 255; length += 255)
+				len = *ip++;
+			length += len;
+		}
+
+		/* copy literals */
+		cpy = op + length;
+		if (unlikely(cpy > oend - COPYLENGTH)) {
+			/*
+			 * Error: not enough place for another match
+			 * (min 4) + 5 literals
+			 */
+			if (cpy != oend)
+				goto _output_error;
+
+			memcpy(op, ip, length);
+			ip += length;
+			break; /* EOF */
+		}
+		LZ4_WILDCOPY(ip, op, cpy);
+		ip -= (op - cpy);
+		op = cpy;
+
+		/* get offset */
+		LZ4_READ_LITTLEENDIAN_16(ref, cpy, ip);
+		ip += 2;
+
+		/* Error: offset create reference outside destination buffer */
+		if (unlikely(ref < (BYTE *const) dest))
+			goto _output_error;
+
+		/* get matchlength */
+		length = token & ML_MASK;
+		if (length == ML_MASK) {
+			for (; *ip == 255; length += 255)
+				ip++;
+			length += *ip++;
+		}
+
+		/* copy repeated sequence */
+		if (unlikely((op - ref) < STEPSIZE)) {
+#if LZ4_ARCH64
+			size_t dec64 = dec64table[op - ref];
+#else
+			const int dec64 = 0;
+#endif
+			op[0] = ref[0];
+			op[1] = ref[1];
+			op[2] = ref[2];
+			op[3] = ref[3];
+			op += 4;
+			ref += 4;
+			ref -= dec32table[op-ref];
+			PUT4(ref, op);
+			op += STEPSIZE - 4;
+			ref -= dec64;
+		} else {
+			LZ4_COPYSTEP(ref, op);
+		}
+		cpy = op + length - (STEPSIZE - 4);
+		if (cpy > (oend - COPYLENGTH)) {
+
+			/* Error: request to write beyond destination buffer */
+			if (cpy > oend)
+				goto _output_error;
+			LZ4_SECURECOPY(ref, op, (oend - COPYLENGTH));
+			while (op < cpy)
+				*op++ = *ref++;
+			op = cpy;
+			/*
+			 * Check EOF (should never happen, since last 5 bytes
+			 * are supposed to be literals)
+			 */
+			if (op == oend)
+				goto _output_error;
+			continue;
+		}
+		LZ4_SECURECOPY(ref, op, cpy);
+		op = cpy; /* correction */
+	}
+	/* end of decoding */
+	return (int) (ip - source);
+
+	/* write overflow error detected */
+_output_error:
+	return (int) (-(ip - source));
+}
+
+#else /* defined(__XEN__) || defined(__MINIOS__) */
+
+static int lz4_uncompress_unknownoutputsize(const unsigned char *source,
+				unsigned char *dest, int isize,
+				size_t maxoutputsize)
+{
+	const BYTE *ip = (const BYTE *) source;
+	const BYTE *const iend = ip + isize;
+	const BYTE *ref;
+
+
+	BYTE *op = (BYTE *) dest;
+	BYTE * const oend = op + maxoutputsize;
+	BYTE *cpy;
+
+	size_t dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0};
+#if LZ4_ARCH64
+	size_t dec64table[] = {0, 0, 0, -1, 0, 1, 2, 3};
+#endif
+
+	/* Main Loop */
+	while (ip < iend) {
+
+		unsigned token;
+		size_t length;
+
+		/* get runlength */
+		token = *ip++;
+		length = (token >> ML_BITS);
+		if (length == RUN_MASK) {
+			int s = 255;
+			while ((ip < iend) && (s == 255)) {
+				s = *ip++;
+				length += s;
+			}
+		}
+		/* copy literals */
+		cpy = op + length;
+		if ((cpy > oend - COPYLENGTH) ||
+			(ip + length > iend - COPYLENGTH)) {
+
+			if (cpy > oend)
+				goto _output_error;/* writes beyond buffer */
+
+			if (ip + length != iend)
+				goto _output_error;/*
+						    * Error: LZ4 format requires
+						    * to consume all input
+						    * at this stage
+						    */
+			memcpy(op, ip, length);
+			op += length;
+			break;/* Necessarily EOF, due to parsing restrictions */
+		}
+		LZ4_WILDCOPY(ip, op, cpy);
+		ip -= (op - cpy);
+		op = cpy;
+
+		/* get offset */
+		LZ4_READ_LITTLEENDIAN_16(ref, cpy, ip);
+		ip += 2;
+		if (ref < (BYTE * const) dest)
+			goto _output_error;
+			/*
+			 * Error : offset creates reference
+			 * outside of destination buffer
+			 */
+
+		/* get matchlength */
+		length = (token & ML_MASK);
+		if (length == ML_MASK) {
+			while (ip < iend) {
+				int s = *ip++;
+				length += s;
+				if (s == 255)
+					continue;
+				break;
+			}
+		}
+
+		/* copy repeated sequence */
+		if (unlikely((op - ref) < STEPSIZE)) {
+#if LZ4_ARCH64
+			size_t dec64 = dec64table[op - ref];
+#else
+			const int dec64 = 0;
+#endif
+				op[0] = ref[0];
+				op[1] = ref[1];
+				op[2] = ref[2];
+				op[3] = ref[3];
+				op += 4;
+				ref += 4;
+				ref -= dec32table[op - ref];
+				PUT4(ref, op);
+				op += STEPSIZE - 4;
+				ref -= dec64;
+		} else {
+			LZ4_COPYSTEP(ref, op);
+		}
+		cpy = op + length - (STEPSIZE-4);
+		if (cpy > oend - COPYLENGTH) {
+			if (cpy > oend)
+				goto _output_error; /* write outside of buf */
+
+			LZ4_SECURECOPY(ref, op, (oend - COPYLENGTH));
+			while (op < cpy)
+				*op++ = *ref++;
+			op = cpy;
+			/*
+			 * Check EOF (should never happen, since last 5 bytes
+			 * are supposed to be literals)
+			 */
+			if (op == oend)
+				goto _output_error;
+			continue;
+		}
+		LZ4_SECURECOPY(ref, op, cpy);
+		op = cpy; /* correction */
+	}
+	/* end of decoding */
+	return (int) (op - dest);
+
+	/* write overflow error detected */
+_output_error:
+	return (int) (-(ip - source));
+}
+
+#endif
+
+#if defined(__XEN__) || defined(__MINIOS__)
+
+int INIT lz4_decompress(const unsigned char *src, size_t *src_len,
+		unsigned char *dest, size_t actual_dest_len)
+{
+	int ret = -1;
+	int input_len = 0;
+
+	input_len = lz4_uncompress(src, dest, actual_dest_len);
+	if (input_len < 0)
+		goto exit_0;
+	*src_len = input_len;
+
+	return 0;
+exit_0:
+	return ret;
+}
+
+#else /* defined(__XEN__) || defined(__MINIOS__) */
+
+int lz4_decompress_unknownoutputsize(const unsigned char *src, size_t src_len,
+		 unsigned char *dest, size_t *dest_len)
+{
+	int ret = -1;
+	int out_len = 0;
+
+	out_len = lz4_uncompress_unknownoutputsize(src, dest, src_len,
+					*dest_len);
+	if (out_len < 0)
+		goto exit_0;
+	*dest_len = out_len;
+
+	return 0;
+exit_0:
+	return ret;
+}
+
+#endif
diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h
new file mode 100644
index 0000000..f46df08
--- /dev/null
+++ b/xen/common/lz4/defs.h
@@ -0,0 +1,184 @@
+/*
+ * lz4defs.h -- architecture specific defines
+ *
+ * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifdef __XEN__
+#include <asm/byteorder.h>
+#endif
+
+#ifdef __LITTLE_ENDIAN
+static inline u16 INIT get_unaligned_le16(const void *p)
+{
+	return le16_to_cpup(p);
+}
+
+static inline u32 INIT get_unaligned_le32(const void *p)
+{
+	return le32_to_cpup(p);
+}
+#else
+#include <asm/unaligned.h>
+
+static inline u16 INIT get_unaligned_le16(const void *p)
+{
+	return le16_to_cpu(__get_unaligned(p, 2));
+}
+
+static inline u32 INIT get_unaligned_le32(void *p)
+{
+	return le32_to_cpu(__get_unaligned(p, 4));
+}
+#endif
+
+/*
+ * Detects 64 bits mode
+ */
+#if (defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) \
+	|| defined(__ppc64__) || defined(__LP64__))
+#define LZ4_ARCH64 1
+#else
+#define LZ4_ARCH64 0
+#endif
+
+/*
+ * Architecture-specific macros
+ */
+#define BYTE	u8
+typedef struct _U16_S { u16 v; } U16_S;
+typedef struct _U32_S { u32 v; } U32_S;
+typedef struct _U64_S { u64 v; } U64_S;
+#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)		\
+	|| defined(CONFIG_ARM) && __LINUX_ARM_ARCH__ >= 6	\
+	&& defined(ARM_EFFICIENT_UNALIGNED_ACCESS)
+
+#define A16(x) (((U16_S *)(x))->v)
+#define A32(x) (((U32_S *)(x))->v)
+#define A64(x) (((U64_S *)(x))->v)
+
+#define PUT4(s, d) (A32(d) = A32(s))
+#define PUT8(s, d) (A64(d) = A64(s))
+#define LZ4_WRITE_LITTLEENDIAN_16(p, v)	\
+	do {	\
+		A16(p) = v; \
+		p += 2; \
+	} while (0)
+#else /* CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */
+
+#define A64(x) get_unaligned((u64 *)&(((U16_S *)(x))->v))
+#define A32(x) get_unaligned((u32 *)&(((U16_S *)(x))->v))
+#define A16(x) get_unaligned((u16 *)&(((U16_S *)(x))->v))
+
+#define PUT4(s, d) \
+	put_unaligned(get_unaligned((const u32 *) s), (u32 *) d)
+#define PUT8(s, d) \
+	put_unaligned(get_unaligned((const u64 *) s), (u64 *) d)
+
+#define LZ4_WRITE_LITTLEENDIAN_16(p, v)	\
+	do {	\
+		put_unaligned(v, (u16 *)(p)); \
+		p += 2; \
+	} while (0)
+#endif
+
+#define COPYLENGTH 8
+#define ML_BITS  4
+#define ML_MASK  ((1U << ML_BITS) - 1)
+#define RUN_BITS (8 - ML_BITS)
+#define RUN_MASK ((1U << RUN_BITS) - 1)
+#define MEMORY_USAGE	14
+#define MINMATCH	4
+#define SKIPSTRENGTH	6
+#define LASTLITERALS	5
+#define MFLIMIT		(COPYLENGTH + MINMATCH)
+#define MINLENGTH	(MFLIMIT + 1)
+#define MAXD_LOG	16
+#define MAXD		(1 << MAXD_LOG)
+#define MAXD_MASK	(u32)(MAXD - 1)
+#define MAX_DISTANCE	(MAXD - 1)
+#define HASH_LOG	(MAXD_LOG - 1)
+#define HASHTABLESIZE	(1 << HASH_LOG)
+#define MAX_NB_ATTEMPTS	256
+#define OPTIMAL_ML	(int)((ML_MASK-1)+MINMATCH)
+#define LZ4_64KLIMIT	((1<<16) + (MFLIMIT - 1))
+#define HASHLOG64K	((MEMORY_USAGE - 2) + 1)
+#define HASH64KTABLESIZE	(1U << HASHLOG64K)
+#define LZ4_HASH_VALUE(p)	(((A32(p)) * 2654435761U) >> \
+				((MINMATCH * 8) - (MEMORY_USAGE-2)))
+#define LZ4_HASH64K_VALUE(p)	(((A32(p)) * 2654435761U) >> \
+				((MINMATCH * 8) - HASHLOG64K))
+#define HASH_VALUE(p)		(((A32(p)) * 2654435761U) >> \
+				((MINMATCH * 8) - HASH_LOG))
+
+#if LZ4_ARCH64/* 64-bit */
+#define STEPSIZE 8
+
+#define LZ4_COPYSTEP(s, d)	\
+	do {			\
+		PUT8(s, d);	\
+		d += 8;		\
+		s += 8;		\
+	} while (0)
+
+#define LZ4_COPYPACKET(s, d)	LZ4_COPYSTEP(s, d)
+
+#define LZ4_SECURECOPY(s, d, e)			\
+	do {					\
+		if (d < e) {			\
+			LZ4_WILDCOPY(s, d, e);	\
+		}				\
+	} while (0)
+#define HTYPE u32
+
+#ifdef __BIG_ENDIAN
+#define LZ4_NBCOMMONBYTES(val) (__builtin_clzll(val) >> 3)
+#else
+#define LZ4_NBCOMMONBYTES(val) (__builtin_ctzll(val) >> 3)
+#endif
+
+#else	/* 32-bit */
+#define STEPSIZE 4
+
+#define LZ4_COPYSTEP(s, d)	\
+	do {			\
+		PUT4(s, d);	\
+		d += 4;		\
+		s += 4;		\
+	} while (0)
+
+#define LZ4_COPYPACKET(s, d)		\
+	do {				\
+		LZ4_COPYSTEP(s, d);	\
+		LZ4_COPYSTEP(s, d);	\
+	} while (0)
+
+#define LZ4_SECURECOPY	LZ4_WILDCOPY
+#define HTYPE const u8*
+
+#ifdef __BIG_ENDIAN
+#define LZ4_NBCOMMONBYTES(val) (__builtin_clz(val) >> 3)
+#else
+#define LZ4_NBCOMMONBYTES(val) (__builtin_ctz(val) >> 3)
+#endif
+
+#endif
+
+#define LZ4_READ_LITTLEENDIAN_16(d, s, p) \
+	(d = s - get_unaligned_le16(p))
+
+#define LZ4_WILDCOPY(s, d, e)		\
+	do {				\
+		LZ4_COPYPACKET(s, d);	\
+	} while (d < e)
+
+#define LZ4_BLINDCOPY(s, d, l)	\
+	do {	\
+		u8 *e = (d) + l;	\
+		LZ4_WILDCOPY(s, d, e);	\
+		d = e;	\
+	} while (0)
diff --git a/xen/common/unlz4.c b/xen/common/unlz4.c
new file mode 100644
index 0000000..195d829
--- /dev/null
+++ b/xen/common/unlz4.c
@@ -0,0 +1,166 @@
+/*
+ * Wrapper for decompressing LZ4-compressed kernel, initramfs, and initrd
+ *
+ * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "decompress.h"
+#include <xen/lz4.h>
+#include "lz4/decompress.c"
+
+/*
+ * Note: Uncompressed chunk size is used in the compressor side
+ * (userspace side for compression).
+ * It is hardcoded because there is not proper way to extract it
+ * from the binary stream which is generated by the preliminary
+ * version of LZ4 tool so far.
+ */
+#define LZ4_DEFAULT_UNCOMPRESSED_CHUNK_SIZE (8 << 20)
+#define ARCHIVE_MAGICNUMBER 0x184C2102
+
+STATIC int INIT unlz4(unsigned char *input, unsigned int in_len,
+		      int (*fill)(void *, unsigned int),
+		      int (*flush)(void *, unsigned int),
+		      unsigned char *output,
+		      unsigned int *posp,
+		      void (*error)(const char *x))
+{
+	int ret = -1;
+	size_t chunksize = 0;
+	size_t uncomp_chunksize = LZ4_DEFAULT_UNCOMPRESSED_CHUNK_SIZE;
+	u8 *inp;
+	u8 *inp_start;
+	u8 *outp;
+	int size = in_len -= 4;
+#if defined(__XEN__) || defined(__MINIOS__)
+	size_t out_len = get_unaligned_le32(input + in_len);
+#endif
+	size_t dest_len;
+
+
+	if (output) {
+		outp = output;
+	} else if (!flush) {
+		error("NULL output pointer and no flush function provided");
+		goto exit_0;
+	} else {
+		outp = large_malloc(uncomp_chunksize);
+		if (!outp) {
+			error("Could not allocate output buffer");
+			goto exit_0;
+		}
+	}
+
+	if (input && fill) {
+		error("Both input pointer and fill function provided,");
+		goto exit_1;
+	} else if (input) {
+		inp = input;
+	} else if (!fill) {
+		error("NULL input pointer and missing fill function");
+		goto exit_1;
+	} else {
+		inp = large_malloc(lz4_compressbound(uncomp_chunksize));
+		if (!inp) {
+			error("Could not allocate input buffer");
+			goto exit_1;
+		}
+	}
+	inp_start = inp;
+
+	if (posp)
+		*posp = 0;
+
+	if (fill)
+		fill(inp, 4);
+
+	chunksize = get_unaligned_le32(inp);
+	if (chunksize == ARCHIVE_MAGICNUMBER) {
+		inp += 4;
+		size -= 4;
+	} else {
+		error("invalid header");
+		goto exit_2;
+	}
+
+	if (posp)
+		*posp += 4;
+
+	for (;;) {
+
+		if (fill)
+			fill(inp, 4);
+
+		chunksize = get_unaligned_le32(inp);
+		if (chunksize == ARCHIVE_MAGICNUMBER) {
+			inp += 4;
+			size -= 4;
+			if (posp)
+				*posp += 4;
+			continue;
+		}
+		inp += 4;
+		size -= 4;
+
+		if (posp)
+			*posp += 4;
+
+		if (fill) {
+			if (chunksize > lz4_compressbound(uncomp_chunksize)) {
+				error("chunk length is longer than allocated");
+				goto exit_2;
+			}
+			fill(inp, chunksize);
+		}
+#if defined(__XEN__) || defined(__MINIOS__)
+		if (out_len >= uncomp_chunksize) {
+			dest_len = uncomp_chunksize;
+			out_len -= dest_len;
+		} else
+			dest_len = out_len;
+		ret = lz4_decompress(inp, &chunksize, outp, dest_len);
+#else
+		dest_len = uncomp_chunksize;
+		ret = lz4_decompress_unknownoutputsize(inp, chunksize, outp,
+				&dest_len);
+#endif
+		if (ret < 0) {
+			error("Decoding failed");
+			goto exit_2;
+		}
+
+		if (flush && flush(outp, dest_len) != dest_len)
+			goto exit_2;
+		if (output)
+			outp += dest_len;
+		if (posp)
+			*posp += chunksize;
+
+		size -= chunksize;
+
+		if (size == 0)
+			break;
+		else if (size < 0) {
+			error("data corrupted");
+			goto exit_2;
+		}
+
+		inp += chunksize;
+		if (fill)
+			inp = inp_start;
+	}
+
+	ret = 0;
+exit_2:
+	if (!input)
+		large_free(inp_start);
+exit_1:
+	if (!output)
+		large_free(outp);
+exit_0:
+	return ret;
+}
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index cc42a88..3980e06 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -25,6 +25,7 @@
 #define CONFIG_X86_PM_TIMER 1
 #define CONFIG_HPET_TIMER 1
 #define CONFIG_X86_MCE_THERMAL 1
+#define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS 1
 #define CONFIG_NUMA 1
 #define CONFIG_DISCONTIGMEM 1
 #define CONFIG_NUMA_EMU 1
diff --git a/xen/include/xen/decompress.h b/xen/include/xen/decompress.h
index 681439f..b2955fa 100644
--- a/xen/include/xen/decompress.h
+++ b/xen/include/xen/decompress.h
@@ -31,7 +31,7 @@ typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
  * dependent).
  */
 
-decompress_fn bunzip2, unxz, unlzma, unlzo;
+decompress_fn bunzip2, unxz, unlzma, unlzo, unlz4;
 
 int decompress(void *inbuf, unsigned int len, void *outbuf);
 
diff --git a/xen/include/xen/lz4.h b/xen/include/xen/lz4.h
new file mode 100644
index 0000000..fa20520
--- /dev/null
+++ b/xen/include/xen/lz4.h
@@ -0,0 +1,88 @@
+#ifndef __LZ4_H__
+#define __LZ4_H__
+
+/*
+ * LZ4 Kernel Interface
+ *
+ * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#define LZ4_MEM_COMPRESS	(4096 * sizeof(unsigned char *))
+#define LZ4HC_MEM_COMPRESS	(65538 * sizeof(unsigned char *))
+
+/*
+ * lz4_compressbound()
+ * Provides the maximum size that LZ4 may output in a "worst case" scenario
+ * (input data not compressible)
+ */
+static inline size_t lz4_compressbound(size_t isize)
+{
+	return isize + (isize / 255) + 16;
+}
+
+/*
+ * lz4_compress()
+ *	src     : source address of the original data
+ *	src_len : size of the original data
+ *	dst	: output buffer address of the compressed data
+ *		This requires 'dst' of size LZ4_COMPRESSBOUND.
+ *	dst_len : is the output size, which is returned after compress done
+ *	workmem : address of the working memory.
+ *		This requires 'workmem' of size LZ4_MEM_COMPRESS.
+ *	return  : Success if return 0
+ *		  Error if return (< 0)
+ *	note :  Destination buffer and workmem must be already allocated with
+ *		the defined size.
+ */
+int lz4_compress(const unsigned char *src, size_t src_len,
+		unsigned char *dst, size_t *dst_len, void *wrkmem);
+
+ /*
+  * lz4hc_compress()
+  *	 src	 : source address of the original data
+  *	 src_len : size of the original data
+  *	 dst	 : output buffer address of the compressed data
+  *		This requires 'dst' of size LZ4_COMPRESSBOUND.
+  *	 dst_len : is the output size, which is returned after compress done
+  *	 workmem : address of the working memory.
+  *		This requires 'workmem' of size LZ4HC_MEM_COMPRESS.
+  *	 return  : Success if return 0
+  *		   Error if return (< 0)
+  *	 note :  Destination buffer and workmem must be already allocated with
+  *		 the defined size.
+  */
+int lz4hc_compress(const unsigned char *src, size_t src_len,
+		unsigned char *dst, size_t *dst_len, void *wrkmem);
+
+/*
+ * lz4_decompress()
+ *	src     : source address of the compressed data
+ *	src_len : is the input size, whcih is returned after decompress done
+ *	dest	: output buffer address of the decompressed data
+ *	actual_dest_len: is the size of uncompressed data, supposing it's known
+ *	return  : Success if return 0
+ *		  Error if return (< 0)
+ *	note :  Destination buffer must be already allocated.
+ *		slightly faster than lz4_decompress_unknownoutputsize()
+ */
+int lz4_decompress(const unsigned char *src, size_t *src_len,
+		unsigned char *dest, size_t actual_dest_len);
+
+/*
+ * lz4_decompress_unknownoutputsize()
+ *	src     : source address of the compressed data
+ *	src_len : is the input size, therefore the compressed size
+ *	dest	: output buffer address of the decompressed data
+ *	dest_len: is the max size of the destination buffer, which is
+ *			returned with actual size of decompressed data after
+ *			decompress done
+ *	return  : Success if return 0
+ *		  Error if return (< 0)
+ *	note :  Destination buffer must be already allocated.
+ */
+int lz4_decompress_unknownoutputsize(const unsigned char *src, size_t src_len,
+		unsigned char *dest, size_t *dest_len);
+#endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Tue Oct 08 00:55:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 08 Oct 2013 00:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VTLa4-0007w2-L1; Tue, 08 Oct 2013 00:55: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 1VTLa3-0007vs-JN
	for xen-changelog@lists.xensource.com; Tue, 08 Oct 2013 00:55:20 +0000
Received: from [85.158.139.211:40346] by server-2.bemta-5.messagelabs.com id
	59/A9-26841-6F753525; Tue, 08 Oct 2013 00:55:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1381193704!5024923!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_18,ML_RADAR_SPEW_LINKS_8,spamassassin: ,
	async_handler: YXN5bmNfZGVsYXk6IDcwNTkwODYgKHRpbWVvdXQp\n
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28308 invoked from network); 8 Oct 2013 00:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Oct 2013 00:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VTLZo-0001km-3i
	for xen-changelog@lists.xensource.com; Tue, 08 Oct 2013 00:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VTLZn-0006nH-Fk
	for xen-changelog@lists.xensource.com; Tue, 08 Oct 2013 00:55:03 +0000
Date: Tue, 08 Oct 2013 00:55:03 +0000
Message-Id: <E1VTLZn-0006nH-Fk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: add LZ4 decompression support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e850049bbc831bfe40b87eaea673675d8a829e74
Author:     Kyungsik Lee <kyungsik.lee@lge.com>
AuthorDate: Mon Oct 7 09:40:35 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 7 09:40:35 2013 +0200

    xen: add LZ4 decompression support
    
    Add support for LZ4 decompression in Xen. LZ4 Decompression APIs for
    Xen are based on LZ4 implementation by Yann Collet.
    
    Benchmark Results(PATCH v3)
    Compiler: Linaro ARM gcc 4.6.2
    
    1. ARMv7, 1.5GHz based board
       Kernel: linux 3.4
       Uncompressed Kernel Size: 14MB
            Compressed Size  Decompression Speed
       LZO  6.7MB            20.1MB/s, 25.2MB/s(UA)
       LZ4  7.3MB            29.1MB/s, 45.6MB/s(UA)
    
    2. ARMv7, 1.7GHz based board
       Kernel: linux 3.7
       Uncompressed Kernel Size: 14MB
            Compressed Size  Decompression Speed
       LZO  6.0MB            34.1MB/s, 52.2MB/s(UA)
       LZ4  6.5MB            86.7MB/s
    - UA: Unaligned memory Access support
    - Latest patch set for LZO applied
    
    This patch set is for adding support for LZ4-compressed Kernel.  LZ4 is a
    very fast lossless compression algorithm and it also features an extremely
    fast decoder [1].
    
    But we have five of decompressors already and one question which does
    arise, however, is that of where do we stop adding new ones?  This issue
    had been discussed and came to the conclusion [2].
    
    Russell King said that we should have:
    
     - one decompressor which is the fastest
     - one decompressor for the highest compression ratio
     - one popular decompressor (eg conventional gzip)
    
    If we have a replacement one for one of these, then it should do exactly
    that: replace it.
    
    The benchmark shows that an 8% increase in image size vs a 66% increase
    in decompression speed compared to LZO(which has been known as the
    fastest decompressor in the Kernel).  Therefore the "fast but may not be
    small" compression title has clearly been taken by LZ4 [3].
    
    [1] http://code.google.com/p/lz4/
    [2] http://thread.gmane.org/gmane.linux.kbuild.devel/9157
    [3] http://thread.gmane.org/gmane.linux.kbuild.devel/9347
    
    LZ4 homepage: http://fastcompression.blogspot.com/p/lz4.html
    LZ4 source repository: http://code.google.com/p/lz4/
    
    Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>
    Signed-off-by: Yann Collet <yann.collet.73@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/Makefile          |    2 +-
 xen/common/decompress.c      |    3 +
 xen/common/lz4/decompress.c  |  323 ++++++++++++++++++++++++++++++++++++++++++
 xen/common/lz4/defs.h        |  184 ++++++++++++++++++++++++
 xen/common/unlz4.c           |  166 ++++++++++++++++++++++
 xen/include/asm-x86/config.h |    1 +
 xen/include/xen/decompress.h |    2 +-
 xen/include/xen/lz4.h        |   88 ++++++++++++
 8 files changed, 767 insertions(+), 2 deletions(-)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index 6da4651..fcb4a84 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -49,7 +49,7 @@ obj-y += radix-tree.o
 obj-y += rbtree.o
 obj-y += lzo.o
 
-obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo earlycpio,$(n).init.o)
+obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o)
 
 obj-$(perfc)       += perfc.o
 obj-$(crash_debug) += gdbstub.o
diff --git a/xen/common/decompress.c b/xen/common/decompress.c
index 1098481..5f86af9 100644
--- a/xen/common/decompress.c
+++ b/xen/common/decompress.c
@@ -29,5 +29,8 @@ int __init decompress(void *inbuf, unsigned int len, void *outbuf)
     if ( len >= 5 && !memcmp(inbuf, "\x89LZO", 5) )
         return unlzo(inbuf, len, NULL, NULL, outbuf, NULL, error);
 
+    if ( len >= 2 && !memcmp(inbuf, "\x02\x21", 2) )
+	return unlz4(inbuf, len, NULL, NULL, outbuf, NULL, error);
+
     return 1;
 }
diff --git a/xen/common/lz4/decompress.c b/xen/common/lz4/decompress.c
new file mode 100644
index 0000000..40b3381
--- /dev/null
+++ b/xen/common/lz4/decompress.c
@@ -0,0 +1,323 @@
+/*
+ * LZ4 Decompressor for Linux kernel
+ *
+ * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.com>
+ *
+ * Based on LZ4 implementation by Yann Collet.
+ *
+ * LZ4 - Fast LZ compression algorithm
+ * Copyright (C) 2011-2012, Yann Collet.
+ * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  You can contact the author at :
+ *  - LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html
+ *  - LZ4 source repository : http://code.google.com/p/lz4/
+ */
+
+#include "defs.h"
+
+#if defined(__XEN__) || defined(__MINIOS__)
+
+static int INIT lz4_uncompress(const unsigned char *source, unsigned char *dest,
+			       int osize)
+{
+	const BYTE *ip = (const BYTE *) source;
+	const BYTE *ref;
+	BYTE *op = (BYTE *) dest;
+	BYTE * const oend = op + osize;
+	BYTE *cpy;
+	unsigned token;
+	size_t length;
+	size_t dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0};
+#if LZ4_ARCH64
+	size_t dec64table[] = {0, 0, 0, -1, 0, 1, 2, 3};
+#endif
+
+	while (1) {
+
+		/* get runlength */
+		token = *ip++;
+		length = (token >> ML_BITS);
+		if (length == RUN_MASK) {
+			size_t len;
+
+			len = *ip++;
+			for (; len == 255; length += 255)
+				len = *ip++;
+			length += len;
+		}
+
+		/* copy literals */
+		cpy = op + length;
+		if (unlikely(cpy > oend - COPYLENGTH)) {
+			/*
+			 * Error: not enough place for another match
+			 * (min 4) + 5 literals
+			 */
+			if (cpy != oend)
+				goto _output_error;
+
+			memcpy(op, ip, length);
+			ip += length;
+			break; /* EOF */
+		}
+		LZ4_WILDCOPY(ip, op, cpy);
+		ip -= (op - cpy);
+		op = cpy;
+
+		/* get offset */
+		LZ4_READ_LITTLEENDIAN_16(ref, cpy, ip);
+		ip += 2;
+
+		/* Error: offset create reference outside destination buffer */
+		if (unlikely(ref < (BYTE *const) dest))
+			goto _output_error;
+
+		/* get matchlength */
+		length = token & ML_MASK;
+		if (length == ML_MASK) {
+			for (; *ip == 255; length += 255)
+				ip++;
+			length += *ip++;
+		}
+
+		/* copy repeated sequence */
+		if (unlikely((op - ref) < STEPSIZE)) {
+#if LZ4_ARCH64
+			size_t dec64 = dec64table[op - ref];
+#else
+			const int dec64 = 0;
+#endif
+			op[0] = ref[0];
+			op[1] = ref[1];
+			op[2] = ref[2];
+			op[3] = ref[3];
+			op += 4;
+			ref += 4;
+			ref -= dec32table[op-ref];
+			PUT4(ref, op);
+			op += STEPSIZE - 4;
+			ref -= dec64;
+		} else {
+			LZ4_COPYSTEP(ref, op);
+		}
+		cpy = op + length - (STEPSIZE - 4);
+		if (cpy > (oend - COPYLENGTH)) {
+
+			/* Error: request to write beyond destination buffer */
+			if (cpy > oend)
+				goto _output_error;
+			LZ4_SECURECOPY(ref, op, (oend - COPYLENGTH));
+			while (op < cpy)
+				*op++ = *ref++;
+			op = cpy;
+			/*
+			 * Check EOF (should never happen, since last 5 bytes
+			 * are supposed to be literals)
+			 */
+			if (op == oend)
+				goto _output_error;
+			continue;
+		}
+		LZ4_SECURECOPY(ref, op, cpy);
+		op = cpy; /* correction */
+	}
+	/* end of decoding */
+	return (int) (ip - source);
+
+	/* write overflow error detected */
+_output_error:
+	return (int) (-(ip - source));
+}
+
+#else /* defined(__XEN__) || defined(__MINIOS__) */
+
+static int lz4_uncompress_unknownoutputsize(const unsigned char *source,
+				unsigned char *dest, int isize,
+				size_t maxoutputsize)
+{
+	const BYTE *ip = (const BYTE *) source;
+	const BYTE *const iend = ip + isize;
+	const BYTE *ref;
+
+
+	BYTE *op = (BYTE *) dest;
+	BYTE * const oend = op + maxoutputsize;
+	BYTE *cpy;
+
+	size_t dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0};
+#if LZ4_ARCH64
+	size_t dec64table[] = {0, 0, 0, -1, 0, 1, 2, 3};
+#endif
+
+	/* Main Loop */
+	while (ip < iend) {
+
+		unsigned token;
+		size_t length;
+
+		/* get runlength */
+		token = *ip++;
+		length = (token >> ML_BITS);
+		if (length == RUN_MASK) {
+			int s = 255;
+			while ((ip < iend) && (s == 255)) {
+				s = *ip++;
+				length += s;
+			}
+		}
+		/* copy literals */
+		cpy = op + length;
+		if ((cpy > oend - COPYLENGTH) ||
+			(ip + length > iend - COPYLENGTH)) {
+
+			if (cpy > oend)
+				goto _output_error;/* writes beyond buffer */
+
+			if (ip + length != iend)
+				goto _output_error;/*
+						    * Error: LZ4 format requires
+						    * to consume all input
+						    * at this stage
+						    */
+			memcpy(op, ip, length);
+			op += length;
+			break;/* Necessarily EOF, due to parsing restrictions */
+		}
+		LZ4_WILDCOPY(ip, op, cpy);
+		ip -= (op - cpy);
+		op = cpy;
+
+		/* get offset */
+		LZ4_READ_LITTLEENDIAN_16(ref, cpy, ip);
+		ip += 2;
+		if (ref < (BYTE * const) dest)
+			goto _output_error;
+			/*
+			 * Error : offset creates reference
+			 * outside of destination buffer
+			 */
+
+		/* get matchlength */
+		length = (token & ML_MASK);
+		if (length == ML_MASK) {
+			while (ip < iend) {
+				int s = *ip++;
+				length += s;
+				if (s == 255)
+					continue;
+				break;
+			}
+		}
+
+		/* copy repeated sequence */
+		if (unlikely((op - ref) < STEPSIZE)) {
+#if LZ4_ARCH64
+			size_t dec64 = dec64table[op - ref];
+#else
+			const int dec64 = 0;
+#endif
+				op[0] = ref[0];
+				op[1] = ref[1];
+				op[2] = ref[2];
+				op[3] = ref[3];
+				op += 4;
+				ref += 4;
+				ref -= dec32table[op - ref];
+				PUT4(ref, op);
+				op += STEPSIZE - 4;
+				ref -= dec64;
+		} else {
+			LZ4_COPYSTEP(ref, op);
+		}
+		cpy = op + length - (STEPSIZE-4);
+		if (cpy > oend - COPYLENGTH) {
+			if (cpy > oend)
+				goto _output_error; /* write outside of buf */
+
+			LZ4_SECURECOPY(ref, op, (oend - COPYLENGTH));
+			while (op < cpy)
+				*op++ = *ref++;
+			op = cpy;
+			/*
+			 * Check EOF (should never happen, since last 5 bytes
+			 * are supposed to be literals)
+			 */
+			if (op == oend)
+				goto _output_error;
+			continue;
+		}
+		LZ4_SECURECOPY(ref, op, cpy);
+		op = cpy; /* correction */
+	}
+	/* end of decoding */
+	return (int) (op - dest);
+
+	/* write overflow error detected */
+_output_error:
+	return (int) (-(ip - source));
+}
+
+#endif
+
+#if defined(__XEN__) || defined(__MINIOS__)
+
+int INIT lz4_decompress(const unsigned char *src, size_t *src_len,
+		unsigned char *dest, size_t actual_dest_len)
+{
+	int ret = -1;
+	int input_len = 0;
+
+	input_len = lz4_uncompress(src, dest, actual_dest_len);
+	if (input_len < 0)
+		goto exit_0;
+	*src_len = input_len;
+
+	return 0;
+exit_0:
+	return ret;
+}
+
+#else /* defined(__XEN__) || defined(__MINIOS__) */
+
+int lz4_decompress_unknownoutputsize(const unsigned char *src, size_t src_len,
+		 unsigned char *dest, size_t *dest_len)
+{
+	int ret = -1;
+	int out_len = 0;
+
+	out_len = lz4_uncompress_unknownoutputsize(src, dest, src_len,
+					*dest_len);
+	if (out_len < 0)
+		goto exit_0;
+	*dest_len = out_len;
+
+	return 0;
+exit_0:
+	return ret;
+}
+
+#endif
diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h
new file mode 100644
index 0000000..f46df08
--- /dev/null
+++ b/xen/common/lz4/defs.h
@@ -0,0 +1,184 @@
+/*
+ * lz4defs.h -- architecture specific defines
+ *
+ * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifdef __XEN__
+#include <asm/byteorder.h>
+#endif
+
+#ifdef __LITTLE_ENDIAN
+static inline u16 INIT get_unaligned_le16(const void *p)
+{
+	return le16_to_cpup(p);
+}
+
+static inline u32 INIT get_unaligned_le32(const void *p)
+{
+	return le32_to_cpup(p);
+}
+#else
+#include <asm/unaligned.h>
+
+static inline u16 INIT get_unaligned_le16(const void *p)
+{
+	return le16_to_cpu(__get_unaligned(p, 2));
+}
+
+static inline u32 INIT get_unaligned_le32(void *p)
+{
+	return le32_to_cpu(__get_unaligned(p, 4));
+}
+#endif
+
+/*
+ * Detects 64 bits mode
+ */
+#if (defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) \
+	|| defined(__ppc64__) || defined(__LP64__))
+#define LZ4_ARCH64 1
+#else
+#define LZ4_ARCH64 0
+#endif
+
+/*
+ * Architecture-specific macros
+ */
+#define BYTE	u8
+typedef struct _U16_S { u16 v; } U16_S;
+typedef struct _U32_S { u32 v; } U32_S;
+typedef struct _U64_S { u64 v; } U64_S;
+#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)		\
+	|| defined(CONFIG_ARM) && __LINUX_ARM_ARCH__ >= 6	\
+	&& defined(ARM_EFFICIENT_UNALIGNED_ACCESS)
+
+#define A16(x) (((U16_S *)(x))->v)
+#define A32(x) (((U32_S *)(x))->v)
+#define A64(x) (((U64_S *)(x))->v)
+
+#define PUT4(s, d) (A32(d) = A32(s))
+#define PUT8(s, d) (A64(d) = A64(s))
+#define LZ4_WRITE_LITTLEENDIAN_16(p, v)	\
+	do {	\
+		A16(p) = v; \
+		p += 2; \
+	} while (0)
+#else /* CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */
+
+#define A64(x) get_unaligned((u64 *)&(((U16_S *)(x))->v))
+#define A32(x) get_unaligned((u32 *)&(((U16_S *)(x))->v))
+#define A16(x) get_unaligned((u16 *)&(((U16_S *)(x))->v))
+
+#define PUT4(s, d) \
+	put_unaligned(get_unaligned((const u32 *) s), (u32 *) d)
+#define PUT8(s, d) \
+	put_unaligned(get_unaligned((const u64 *) s), (u64 *) d)
+
+#define LZ4_WRITE_LITTLEENDIAN_16(p, v)	\
+	do {	\
+		put_unaligned(v, (u16 *)(p)); \
+		p += 2; \
+	} while (0)
+#endif
+
+#define COPYLENGTH 8
+#define ML_BITS  4
+#define ML_MASK  ((1U << ML_BITS) - 1)
+#define RUN_BITS (8 - ML_BITS)
+#define RUN_MASK ((1U << RUN_BITS) - 1)
+#define MEMORY_USAGE	14
+#define MINMATCH	4
+#define SKIPSTRENGTH	6
+#define LASTLITERALS	5
+#define MFLIMIT		(COPYLENGTH + MINMATCH)
+#define MINLENGTH	(MFLIMIT + 1)
+#define MAXD_LOG	16
+#define MAXD		(1 << MAXD_LOG)
+#define MAXD_MASK	(u32)(MAXD - 1)
+#define MAX_DISTANCE	(MAXD - 1)
+#define HASH_LOG	(MAXD_LOG - 1)
+#define HASHTABLESIZE	(1 << HASH_LOG)
+#define MAX_NB_ATTEMPTS	256
+#define OPTIMAL_ML	(int)((ML_MASK-1)+MINMATCH)
+#define LZ4_64KLIMIT	((1<<16) + (MFLIMIT - 1))
+#define HASHLOG64K	((MEMORY_USAGE - 2) + 1)
+#define HASH64KTABLESIZE	(1U << HASHLOG64K)
+#define LZ4_HASH_VALUE(p)	(((A32(p)) * 2654435761U) >> \
+				((MINMATCH * 8) - (MEMORY_USAGE-2)))
+#define LZ4_HASH64K_VALUE(p)	(((A32(p)) * 2654435761U) >> \
+				((MINMATCH * 8) - HASHLOG64K))
+#define HASH_VALUE(p)		(((A32(p)) * 2654435761U) >> \
+				((MINMATCH * 8) - HASH_LOG))
+
+#if LZ4_ARCH64/* 64-bit */
+#define STEPSIZE 8
+
+#define LZ4_COPYSTEP(s, d)	\
+	do {			\
+		PUT8(s, d);	\
+		d += 8;		\
+		s += 8;		\
+	} while (0)
+
+#define LZ4_COPYPACKET(s, d)	LZ4_COPYSTEP(s, d)
+
+#define LZ4_SECURECOPY(s, d, e)			\
+	do {					\
+		if (d < e) {			\
+			LZ4_WILDCOPY(s, d, e);	\
+		}				\
+	} while (0)
+#define HTYPE u32
+
+#ifdef __BIG_ENDIAN
+#define LZ4_NBCOMMONBYTES(val) (__builtin_clzll(val) >> 3)
+#else
+#define LZ4_NBCOMMONBYTES(val) (__builtin_ctzll(val) >> 3)
+#endif
+
+#else	/* 32-bit */
+#define STEPSIZE 4
+
+#define LZ4_COPYSTEP(s, d)	\
+	do {			\
+		PUT4(s, d);	\
+		d += 4;		\
+		s += 4;		\
+	} while (0)
+
+#define LZ4_COPYPACKET(s, d)		\
+	do {				\
+		LZ4_COPYSTEP(s, d);	\
+		LZ4_COPYSTEP(s, d);	\
+	} while (0)
+
+#define LZ4_SECURECOPY	LZ4_WILDCOPY
+#define HTYPE const u8*
+
+#ifdef __BIG_ENDIAN
+#define LZ4_NBCOMMONBYTES(val) (__builtin_clz(val) >> 3)
+#else
+#define LZ4_NBCOMMONBYTES(val) (__builtin_ctz(val) >> 3)
+#endif
+
+#endif
+
+#define LZ4_READ_LITTLEENDIAN_16(d, s, p) \
+	(d = s - get_unaligned_le16(p))
+
+#define LZ4_WILDCOPY(s, d, e)		\
+	do {				\
+		LZ4_COPYPACKET(s, d);	\
+	} while (d < e)
+
+#define LZ4_BLINDCOPY(s, d, l)	\
+	do {	\
+		u8 *e = (d) + l;	\
+		LZ4_WILDCOPY(s, d, e);	\
+		d = e;	\
+	} while (0)
diff --git a/xen/common/unlz4.c b/xen/common/unlz4.c
new file mode 100644
index 0000000..195d829
--- /dev/null
+++ b/xen/common/unlz4.c
@@ -0,0 +1,166 @@
+/*
+ * Wrapper for decompressing LZ4-compressed kernel, initramfs, and initrd
+ *
+ * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "decompress.h"
+#include <xen/lz4.h>
+#include "lz4/decompress.c"
+
+/*
+ * Note: Uncompressed chunk size is used in the compressor side
+ * (userspace side for compression).
+ * It is hardcoded because there is not proper way to extract it
+ * from the binary stream which is generated by the preliminary
+ * version of LZ4 tool so far.
+ */
+#define LZ4_DEFAULT_UNCOMPRESSED_CHUNK_SIZE (8 << 20)
+#define ARCHIVE_MAGICNUMBER 0x184C2102
+
+STATIC int INIT unlz4(unsigned char *input, unsigned int in_len,
+		      int (*fill)(void *, unsigned int),
+		      int (*flush)(void *, unsigned int),
+		      unsigned char *output,
+		      unsigned int *posp,
+		      void (*error)(const char *x))
+{
+	int ret = -1;
+	size_t chunksize = 0;
+	size_t uncomp_chunksize = LZ4_DEFAULT_UNCOMPRESSED_CHUNK_SIZE;
+	u8 *inp;
+	u8 *inp_start;
+	u8 *outp;
+	int size = in_len -= 4;
+#if defined(__XEN__) || defined(__MINIOS__)
+	size_t out_len = get_unaligned_le32(input + in_len);
+#endif
+	size_t dest_len;
+
+
+	if (output) {
+		outp = output;
+	} else if (!flush) {
+		error("NULL output pointer and no flush function provided");
+		goto exit_0;
+	} else {
+		outp = large_malloc(uncomp_chunksize);
+		if (!outp) {
+			error("Could not allocate output buffer");
+			goto exit_0;
+		}
+	}
+
+	if (input && fill) {
+		error("Both input pointer and fill function provided,");
+		goto exit_1;
+	} else if (input) {
+		inp = input;
+	} else if (!fill) {
+		error("NULL input pointer and missing fill function");
+		goto exit_1;
+	} else {
+		inp = large_malloc(lz4_compressbound(uncomp_chunksize));
+		if (!inp) {
+			error("Could not allocate input buffer");
+			goto exit_1;
+		}
+	}
+	inp_start = inp;
+
+	if (posp)
+		*posp = 0;
+
+	if (fill)
+		fill(inp, 4);
+
+	chunksize = get_unaligned_le32(inp);
+	if (chunksize == ARCHIVE_MAGICNUMBER) {
+		inp += 4;
+		size -= 4;
+	} else {
+		error("invalid header");
+		goto exit_2;
+	}
+
+	if (posp)
+		*posp += 4;
+
+	for (;;) {
+
+		if (fill)
+			fill(inp, 4);
+
+		chunksize = get_unaligned_le32(inp);
+		if (chunksize == ARCHIVE_MAGICNUMBER) {
+			inp += 4;
+			size -= 4;
+			if (posp)
+				*posp += 4;
+			continue;
+		}
+		inp += 4;
+		size -= 4;
+
+		if (posp)
+			*posp += 4;
+
+		if (fill) {
+			if (chunksize > lz4_compressbound(uncomp_chunksize)) {
+				error("chunk length is longer than allocated");
+				goto exit_2;
+			}
+			fill(inp, chunksize);
+		}
+#if defined(__XEN__) || defined(__MINIOS__)
+		if (out_len >= uncomp_chunksize) {
+			dest_len = uncomp_chunksize;
+			out_len -= dest_len;
+		} else
+			dest_len = out_len;
+		ret = lz4_decompress(inp, &chunksize, outp, dest_len);
+#else
+		dest_len = uncomp_chunksize;
+		ret = lz4_decompress_unknownoutputsize(inp, chunksize, outp,
+				&dest_len);
+#endif
+		if (ret < 0) {
+			error("Decoding failed");
+			goto exit_2;
+		}
+
+		if (flush && flush(outp, dest_len) != dest_len)
+			goto exit_2;
+		if (output)
+			outp += dest_len;
+		if (posp)
+			*posp += chunksize;
+
+		size -= chunksize;
+
+		if (size == 0)
+			break;
+		else if (size < 0) {
+			error("data corrupted");
+			goto exit_2;
+		}
+
+		inp += chunksize;
+		if (fill)
+			inp = inp_start;
+	}
+
+	ret = 0;
+exit_2:
+	if (!input)
+		large_free(inp_start);
+exit_1:
+	if (!output)
+		large_free(outp);
+exit_0:
+	return ret;
+}
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index cc42a88..3980e06 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -25,6 +25,7 @@
 #define CONFIG_X86_PM_TIMER 1
 #define CONFIG_HPET_TIMER 1
 #define CONFIG_X86_MCE_THERMAL 1
+#define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS 1
 #define CONFIG_NUMA 1
 #define CONFIG_DISCONTIGMEM 1
 #define CONFIG_NUMA_EMU 1
diff --git a/xen/include/xen/decompress.h b/xen/include/xen/decompress.h
index 681439f..b2955fa 100644
--- a/xen/include/xen/decompress.h
+++ b/xen/include/xen/decompress.h
@@ -31,7 +31,7 @@ typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
  * dependent).
  */
 
-decompress_fn bunzip2, unxz, unlzma, unlzo;
+decompress_fn bunzip2, unxz, unlzma, unlzo, unlz4;
 
 int decompress(void *inbuf, unsigned int len, void *outbuf);
 
diff --git a/xen/include/xen/lz4.h b/xen/include/xen/lz4.h
new file mode 100644
index 0000000..fa20520
--- /dev/null
+++ b/xen/include/xen/lz4.h
@@ -0,0 +1,88 @@
+#ifndef __LZ4_H__
+#define __LZ4_H__
+
+/*
+ * LZ4 Kernel Interface
+ *
+ * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#define LZ4_MEM_COMPRESS	(4096 * sizeof(unsigned char *))
+#define LZ4HC_MEM_COMPRESS	(65538 * sizeof(unsigned char *))
+
+/*
+ * lz4_compressbound()
+ * Provides the maximum size that LZ4 may output in a "worst case" scenario
+ * (input data not compressible)
+ */
+static inline size_t lz4_compressbound(size_t isize)
+{
+	return isize + (isize / 255) + 16;
+}
+
+/*
+ * lz4_compress()
+ *	src     : source address of the original data
+ *	src_len : size of the original data
+ *	dst	: output buffer address of the compressed data
+ *		This requires 'dst' of size LZ4_COMPRESSBOUND.
+ *	dst_len : is the output size, which is returned after compress done
+ *	workmem : address of the working memory.
+ *		This requires 'workmem' of size LZ4_MEM_COMPRESS.
+ *	return  : Success if return 0
+ *		  Error if return (< 0)
+ *	note :  Destination buffer and workmem must be already allocated with
+ *		the defined size.
+ */
+int lz4_compress(const unsigned char *src, size_t src_len,
+		unsigned char *dst, size_t *dst_len, void *wrkmem);
+
+ /*
+  * lz4hc_compress()
+  *	 src	 : source address of the original data
+  *	 src_len : size of the original data
+  *	 dst	 : output buffer address of the compressed data
+  *		This requires 'dst' of size LZ4_COMPRESSBOUND.
+  *	 dst_len : is the output size, which is returned after compress done
+  *	 workmem : address of the working memory.
+  *		This requires 'workmem' of size LZ4HC_MEM_COMPRESS.
+  *	 return  : Success if return 0
+  *		   Error if return (< 0)
+  *	 note :  Destination buffer and workmem must be already allocated with
+  *		 the defined size.
+  */
+int lz4hc_compress(const unsigned char *src, size_t src_len,
+		unsigned char *dst, size_t *dst_len, void *wrkmem);
+
+/*
+ * lz4_decompress()
+ *	src     : source address of the compressed data
+ *	src_len : is the input size, whcih is returned after decompress done
+ *	dest	: output buffer address of the decompressed data
+ *	actual_dest_len: is the size of uncompressed data, supposing it's known
+ *	return  : Success if return 0
+ *		  Error if return (< 0)
+ *	note :  Destination buffer must be already allocated.
+ *		slightly faster than lz4_decompress_unknownoutputsize()
+ */
+int lz4_decompress(const unsigned char *src, size_t *src_len,
+		unsigned char *dest, size_t actual_dest_len);
+
+/*
+ * lz4_decompress_unknownoutputsize()
+ *	src     : source address of the compressed data
+ *	src_len : is the input size, therefore the compressed size
+ *	dest	: output buffer address of the decompressed data
+ *	dest_len: is the max size of the destination buffer, which is
+ *			returned with actual size of decompressed data after
+ *			decompress done
+ *	return  : Success if return 0
+ *		  Error if return (< 0)
+ *	note :  Destination buffer must be already allocated.
+ */
+int lz4_decompress_unknownoutputsize(const unsigned char *src, size_t src_len,
+		unsigned char *dest, size_t *dest_len);
+#endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:11:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUPNs-0008MW-GN; Thu, 10 Oct 2013 23:11: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 1VUPNr-0008ML-Bu
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:07 +0000
Received: from [85.158.139.211:11797] by server-7.bemta-5.messagelabs.com id
	80/71-24315-A0437525; Thu, 10 Oct 2013 23:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1381446664!705566!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14521 invoked from network); 10 Oct 2013 23:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPNo-00041R-Cu
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPNo-0005fG-5b
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:04 +0000
Date: Thu, 10 Oct 2013 23:11:04 +0000
Message-Id: <E1VUPNo-0005fG-5b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: fix suspected data race
	condition in iommu_set_root_entry()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1c240f1bfed56a459a9cde5100b12bfca4275f26
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 8 11:06:48 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 8 11:06:48 2013 +0200

    VT-d: fix suspected data race condition in iommu_set_root_entry()
    
    Coverity ID: 1054967
    
    Coverity spotted that iommu->root_maddr was optionally allocated within the
    protection of the iommu->lock, but was referenced with the protection of the
    iommu->register_lock, and freed without any lock.
    
    Luckily, the code as-is is not vulnerable to the potential risks identified.
    
    However, the alloc_pgtable_maddr() is far more appropriately done in
    iommu_alloc(), removing a set of spinlock calls, and a possibility for the
    iommu setup to fail later than iommu_alloc() with an -ENOMEM.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |   19 +++----------------
 1 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 12e0165..2dbe97a 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -696,25 +696,9 @@ static void iommu_free_pagetable(u64 pt_maddr, int level)
 
 static int iommu_set_root_entry(struct iommu *iommu)
 {
-    struct acpi_drhd_unit *drhd;
     u32 sts;
     unsigned long flags;
 
-    spin_lock(&iommu->lock);
-
-    if ( iommu->root_maddr == 0 )
-    {
-        drhd = iommu_to_drhd(iommu);
-        iommu->root_maddr = alloc_pgtable_maddr(drhd, 1);
-    }
-
-    if ( iommu->root_maddr == 0 )
-    {
-        spin_unlock(&iommu->lock);
-        return -ENOMEM;
-    }
-
-    spin_unlock(&iommu->lock);
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writeq(iommu->reg, DMAR_RTADDR_REG, iommu->root_maddr);
 
@@ -1144,6 +1128,9 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
     iommu->intel->drhd = drhd;
     drhd->iommu = iommu;
 
+    if ( !(iommu->root_maddr = alloc_pgtable_maddr(drhd, 1)) )
+        return -ENOMEM;
+
     iommu->reg = ioremap(drhd->address, PAGE_SIZE);
     if ( !iommu->reg )
         return -ENOMEM;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:11:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUPNs-0008MW-GN; Thu, 10 Oct 2013 23:11: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 1VUPNr-0008ML-Bu
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:07 +0000
Received: from [85.158.139.211:11797] by server-7.bemta-5.messagelabs.com id
	80/71-24315-A0437525; Thu, 10 Oct 2013 23:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1381446664!705566!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14521 invoked from network); 10 Oct 2013 23:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPNo-00041R-Cu
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPNo-0005fG-5b
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:04 +0000
Date: Thu, 10 Oct 2013 23:11:04 +0000
Message-Id: <E1VUPNo-0005fG-5b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: fix suspected data race
	condition in iommu_set_root_entry()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1c240f1bfed56a459a9cde5100b12bfca4275f26
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 8 11:06:48 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 8 11:06:48 2013 +0200

    VT-d: fix suspected data race condition in iommu_set_root_entry()
    
    Coverity ID: 1054967
    
    Coverity spotted that iommu->root_maddr was optionally allocated within the
    protection of the iommu->lock, but was referenced with the protection of the
    iommu->register_lock, and freed without any lock.
    
    Luckily, the code as-is is not vulnerable to the potential risks identified.
    
    However, the alloc_pgtable_maddr() is far more appropriately done in
    iommu_alloc(), removing a set of spinlock calls, and a possibility for the
    iommu setup to fail later than iommu_alloc() with an -ENOMEM.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |   19 +++----------------
 1 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 12e0165..2dbe97a 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -696,25 +696,9 @@ static void iommu_free_pagetable(u64 pt_maddr, int level)
 
 static int iommu_set_root_entry(struct iommu *iommu)
 {
-    struct acpi_drhd_unit *drhd;
     u32 sts;
     unsigned long flags;
 
-    spin_lock(&iommu->lock);
-
-    if ( iommu->root_maddr == 0 )
-    {
-        drhd = iommu_to_drhd(iommu);
-        iommu->root_maddr = alloc_pgtable_maddr(drhd, 1);
-    }
-
-    if ( iommu->root_maddr == 0 )
-    {
-        spin_unlock(&iommu->lock);
-        return -ENOMEM;
-    }
-
-    spin_unlock(&iommu->lock);
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writeq(iommu->reg, DMAR_RTADDR_REG, iommu->root_maddr);
 
@@ -1144,6 +1128,9 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
     iommu->intel->drhd = drhd;
     drhd->iommu = iommu;
 
+    if ( !(iommu->root_maddr = alloc_pgtable_maddr(drhd, 1)) )
+        return -ENOMEM;
+
     iommu->reg = ioremap(drhd->address, PAGE_SIZE);
     if ( !iommu->reg )
         return -ENOMEM;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:11:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUPO3-0008OF-KR; Thu, 10 Oct 2013 23:11: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 1VUPO2-0008Nu-1v
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:18 +0000
Received: from [85.158.139.211:18041] by server-15.bemta-5.messagelabs.com id
	2B/1F-01145-51437525; Thu, 10 Oct 2013 23:11:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1381446675!705805!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32597 invoked from network); 10 Oct 2013 23:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPNy-00041U-QG
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPNy-0005fi-HX
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:14 +0000
Date: Thu, 10 Oct 2013 23:11:14 +0000
Message-Id: <E1VUPNy-0005fi-HX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HPET: basic cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 081c4d400db24790b43ce344e6b5449b0800c253
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 8 11:09:22 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 8 11:09:22 2013 +0200

    x86/HPET: basic cleanup
    
    * Strip trailing whitespace
    * Remove redundant definitions
    * Update stale documentation links
    * Move hpet_address into __initdata
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hpet.c        |    6 +++---
 xen/arch/x86/hvm/hpet.c    |   18 +++++++++---------
 xen/include/asm-x86/hpet.h |    6 ++----
 3 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 7e0d332..99882b1 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -1,6 +1,6 @@
 /******************************************************************************
  * arch/x86/hpet.c
- * 
+ *
  * HPET management.
  */
 
@@ -50,7 +50,7 @@ static unsigned int __read_mostly num_hpets_used;
 
 DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
 
-unsigned long __read_mostly hpet_address;
+unsigned long __initdata hpet_address;
 u8 __initdata hpet_blockid;
 
 /*
@@ -540,7 +540,7 @@ static void handle_rtc_once(uint8_t index, uint8_t value)
 {
     if ( index != RTC_REG_B )
         return;
-    
+
     /* RTC Reg B, contain PIE/AIE/UIE */
     if ( value & (RTC_PIE | RTC_AIE | RTC_UIE ) )
     {
diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index 4b4b905..4324b52 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -47,7 +47,7 @@
 
 /* can be routed to IOAPIC.redirect_table[23..20] */
 #define HPET_TN_INT_ROUTE_CAP      (0x00f00000ULL \
-                    << HPET_TN_INT_ROUTE_CAP_SHIFT) 
+                    << HPET_TN_INT_ROUTE_CAP_SHIFT)
 
 #define HPET_TN_INT_ROUTE_CAP_MASK (0xffffffffULL \
                     << HPET_TN_INT_ROUTE_CAP_SHIFT)
@@ -79,7 +79,7 @@ static inline uint64_t hpet_read_maincounter(HPETState *h)
 
     if ( hpet_enabled(h) )
         return guest_time_hpet(h) + h->mc_offset;
-    else 
+    else
         return h->hpet.mc64;
 }
 
@@ -100,7 +100,7 @@ static uint64_t hpet_get_comparator(HPETState *h, unsigned int tn)
             h->hpet.comparator64[tn] = comparator;
         }
     }
-    
+
     /* truncate if timer is in 32 bit mode */
     if ( timer_is_32bit(h, tn) )
         comparator = (uint32_t)comparator;
@@ -249,7 +249,7 @@ static void hpet_set_timer(HPETState *h, unsigned int tn)
         irq = timer_int_route(h, tn);
 
     /*
-     * diff is the time from now when the timer should fire, for a periodic 
+     * diff is the time from now when the timer should fire, for a periodic
      * timer we also need the period which may be different because time may
      * have elapsed between the time the comparator was written and the timer
      * being enabled (now).
@@ -331,7 +331,7 @@ static int hpet_write(
         h->hpet.mc64 = new_val;
         if ( hpet_enabled(h) )
         {
-            gdprintk(XENLOG_WARNING, 
+            gdprintk(XENLOG_WARNING,
                      "HPET: writing main counter but it's not halted!\n");
             for ( i = 0; i < HPET_TIMER_NUM; i++ )
                 if ( timer_enabled(h, i) )
@@ -396,7 +396,7 @@ static int hpet_write(
              * timer's accumulator."  That is, set the comparator without
              * adjusting the period.  Much the same as just setting the
              * comparator on an enabled one-shot timer.
-             * 
+             *
              * This configuration bit clears when the comparator is written.
              */
             h->hpet.timers[tn].config &= ~HPET_TN_SETVAL;
@@ -553,7 +553,7 @@ static int hpet_load(struct domain *d, hvm_domain_context_t *h)
         hp->hpet.timers[i].cmp = cmp;
     }
 #undef C
-    
+
     /* Recalculate the offset between the main counter and guest time */
     hp->mc_offset = hp->hpet.mc64 - guest_time_hpet(hp);
 
@@ -563,7 +563,7 @@ static int hpet_load(struct domain *d, hvm_domain_context_t *h)
         for ( i = 0; i < HPET_TIMER_NUM; i++ )
             if ( timer_enabled(hp, i) )
                 hpet_set_timer(hp, i);
- 
+
     spin_unlock(&hp->lock);
 
     return 0;
@@ -595,7 +595,7 @@ void hpet_init(struct vcpu *v)
 
     for ( i = 0; i < HPET_TIMER_NUM; i++ )
     {
-        h->hpet.timers[i].config = 
+        h->hpet.timers[i].config =
             HPET_TN_INT_ROUTE_CAP | HPET_TN_64BIT_CAP | HPET_TN_PERIODIC_CAP;
         h->hpet.timers[i].cmp = ~0ULL;
         h->pt[i].source = PTSRC_isa;
diff --git a/xen/include/asm-x86/hpet.h b/xen/include/asm-x86/hpet.h
index 98c1237..875f1de 100644
--- a/xen/include/asm-x86/hpet.h
+++ b/xen/include/asm-x86/hpet.h
@@ -3,8 +3,8 @@
 
 /*
  * Documentation on HPET can be found at:
- *      http://www.intel.com/ial/home/sp/pcmmspec.htm
- *      ftp://download.intel.com/ial/home/sp/mmts098.pdf
+ *      http://www.intel.com/content/dam/www/public/us/en/documents/
+ *      technical-specifications/software-developers-hpet-spec-1-0a.pdf
  */
 
 #define HPET_MMAP_SIZE	1024
@@ -24,9 +24,7 @@
 #define HPET_ID_NUMBER	0x00001f00
 #define HPET_ID_REV	0x000000ff
 #define	HPET_ID_NUMBER_SHIFT	8
-
 #define HPET_ID_VENDOR_SHIFT	16
-#define HPET_ID_VENDOR_8086	0x8086
 
 #define HPET_CFG_ENABLE	0x001
 #define HPET_CFG_LEGACY	0x002
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:11:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUPO3-0008OF-KR; Thu, 10 Oct 2013 23:11: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 1VUPO2-0008Nu-1v
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:18 +0000
Received: from [85.158.139.211:18041] by server-15.bemta-5.messagelabs.com id
	2B/1F-01145-51437525; Thu, 10 Oct 2013 23:11:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1381446675!705805!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32597 invoked from network); 10 Oct 2013 23:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPNy-00041U-QG
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPNy-0005fi-HX
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:14 +0000
Date: Thu, 10 Oct 2013 23:11:14 +0000
Message-Id: <E1VUPNy-0005fi-HX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HPET: basic cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 081c4d400db24790b43ce344e6b5449b0800c253
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 8 11:09:22 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 8 11:09:22 2013 +0200

    x86/HPET: basic cleanup
    
    * Strip trailing whitespace
    * Remove redundant definitions
    * Update stale documentation links
    * Move hpet_address into __initdata
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hpet.c        |    6 +++---
 xen/arch/x86/hvm/hpet.c    |   18 +++++++++---------
 xen/include/asm-x86/hpet.h |    6 ++----
 3 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 7e0d332..99882b1 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -1,6 +1,6 @@
 /******************************************************************************
  * arch/x86/hpet.c
- * 
+ *
  * HPET management.
  */
 
@@ -50,7 +50,7 @@ static unsigned int __read_mostly num_hpets_used;
 
 DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
 
-unsigned long __read_mostly hpet_address;
+unsigned long __initdata hpet_address;
 u8 __initdata hpet_blockid;
 
 /*
@@ -540,7 +540,7 @@ static void handle_rtc_once(uint8_t index, uint8_t value)
 {
     if ( index != RTC_REG_B )
         return;
-    
+
     /* RTC Reg B, contain PIE/AIE/UIE */
     if ( value & (RTC_PIE | RTC_AIE | RTC_UIE ) )
     {
diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index 4b4b905..4324b52 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -47,7 +47,7 @@
 
 /* can be routed to IOAPIC.redirect_table[23..20] */
 #define HPET_TN_INT_ROUTE_CAP      (0x00f00000ULL \
-                    << HPET_TN_INT_ROUTE_CAP_SHIFT) 
+                    << HPET_TN_INT_ROUTE_CAP_SHIFT)
 
 #define HPET_TN_INT_ROUTE_CAP_MASK (0xffffffffULL \
                     << HPET_TN_INT_ROUTE_CAP_SHIFT)
@@ -79,7 +79,7 @@ static inline uint64_t hpet_read_maincounter(HPETState *h)
 
     if ( hpet_enabled(h) )
         return guest_time_hpet(h) + h->mc_offset;
-    else 
+    else
         return h->hpet.mc64;
 }
 
@@ -100,7 +100,7 @@ static uint64_t hpet_get_comparator(HPETState *h, unsigned int tn)
             h->hpet.comparator64[tn] = comparator;
         }
     }
-    
+
     /* truncate if timer is in 32 bit mode */
     if ( timer_is_32bit(h, tn) )
         comparator = (uint32_t)comparator;
@@ -249,7 +249,7 @@ static void hpet_set_timer(HPETState *h, unsigned int tn)
         irq = timer_int_route(h, tn);
 
     /*
-     * diff is the time from now when the timer should fire, for a periodic 
+     * diff is the time from now when the timer should fire, for a periodic
      * timer we also need the period which may be different because time may
      * have elapsed between the time the comparator was written and the timer
      * being enabled (now).
@@ -331,7 +331,7 @@ static int hpet_write(
         h->hpet.mc64 = new_val;
         if ( hpet_enabled(h) )
         {
-            gdprintk(XENLOG_WARNING, 
+            gdprintk(XENLOG_WARNING,
                      "HPET: writing main counter but it's not halted!\n");
             for ( i = 0; i < HPET_TIMER_NUM; i++ )
                 if ( timer_enabled(h, i) )
@@ -396,7 +396,7 @@ static int hpet_write(
              * timer's accumulator."  That is, set the comparator without
              * adjusting the period.  Much the same as just setting the
              * comparator on an enabled one-shot timer.
-             * 
+             *
              * This configuration bit clears when the comparator is written.
              */
             h->hpet.timers[tn].config &= ~HPET_TN_SETVAL;
@@ -553,7 +553,7 @@ static int hpet_load(struct domain *d, hvm_domain_context_t *h)
         hp->hpet.timers[i].cmp = cmp;
     }
 #undef C
-    
+
     /* Recalculate the offset between the main counter and guest time */
     hp->mc_offset = hp->hpet.mc64 - guest_time_hpet(hp);
 
@@ -563,7 +563,7 @@ static int hpet_load(struct domain *d, hvm_domain_context_t *h)
         for ( i = 0; i < HPET_TIMER_NUM; i++ )
             if ( timer_enabled(hp, i) )
                 hpet_set_timer(hp, i);
- 
+
     spin_unlock(&hp->lock);
 
     return 0;
@@ -595,7 +595,7 @@ void hpet_init(struct vcpu *v)
 
     for ( i = 0; i < HPET_TIMER_NUM; i++ )
     {
-        h->hpet.timers[i].config = 
+        h->hpet.timers[i].config =
             HPET_TN_INT_ROUTE_CAP | HPET_TN_64BIT_CAP | HPET_TN_PERIODIC_CAP;
         h->hpet.timers[i].cmp = ~0ULL;
         h->pt[i].source = PTSRC_isa;
diff --git a/xen/include/asm-x86/hpet.h b/xen/include/asm-x86/hpet.h
index 98c1237..875f1de 100644
--- a/xen/include/asm-x86/hpet.h
+++ b/xen/include/asm-x86/hpet.h
@@ -3,8 +3,8 @@
 
 /*
  * Documentation on HPET can be found at:
- *      http://www.intel.com/ial/home/sp/pcmmspec.htm
- *      ftp://download.intel.com/ial/home/sp/mmts098.pdf
+ *      http://www.intel.com/content/dam/www/public/us/en/documents/
+ *      technical-specifications/software-developers-hpet-spec-1-0a.pdf
  */
 
 #define HPET_MMAP_SIZE	1024
@@ -24,9 +24,7 @@
 #define HPET_ID_NUMBER	0x00001f00
 #define HPET_ID_REV	0x000000ff
 #define	HPET_ID_NUMBER_SHIFT	8
-
 #define HPET_ID_VENDOR_SHIFT	16
-#define HPET_ID_VENDOR_8086	0x8086
 
 #define HPET_CFG_ENABLE	0x001
 #define HPET_CFG_LEGACY	0x002
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:11:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:11: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 1VUPOC-0008PT-N5; Thu, 10 Oct 2013 23:11: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 1VUPOB-0008PC-Dh
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:27 +0000
Received: from [193.109.254.147:50281] by server-15.bemta-14.messagelabs.com
	id 97/C4-10716-E1437525; Thu, 10 Oct 2013 23:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1381446685!1424249!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19061 invoked from network); 10 Oct 2013 23:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPO9-00041a-1S
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPO8-0005gt-UC
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:24 +0000
Date: Thu, 10 Oct 2013 23:11:24 +0000
Message-Id: <E1VUPO8-0005gt-UC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: Add macros MB and GB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 983843e7907ce75bdf97efa0b9f67db7b64e5765
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Sep 27 17:56:33 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 8 15:45:45 2013 +0100

    xen: Add macros MB and GB
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-arm/config.h |    1 -
 xen/include/xen/config.h     |    3 +++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 9e395c2..5b7b1a8 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -142,7 +142,6 @@
 #define SLOT0_ENTRY_BITS  39
 #define SLOT0(slot) (_AT(vaddr_t,slot) << SLOT0_ENTRY_BITS)
 #define SLOT0_ENTRY_SIZE  SLOT0(1)
-#define GB(_gb)     (_AC(_gb, UL) << 30)
 
 #define VMAP_VIRT_START  GB(1)
 #define VMAP_VIRT_END    (VMAP_VIRT_START + GB(1) - 1)
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index a52298e..657c6e5 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -69,6 +69,9 @@
 #define __force
 #define __bitwise
 
+#define MB(_mb)     (_AC(_mb, UL) << 20)
+#define GB(_gb)     (_AC(_gb, UL) << 30)
+
 #ifndef __ASSEMBLY__
 
 int current_domain_id(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:11:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:11: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 1VUPOC-0008PT-N5; Thu, 10 Oct 2013 23:11: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 1VUPOB-0008PC-Dh
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:27 +0000
Received: from [193.109.254.147:50281] by server-15.bemta-14.messagelabs.com
	id 97/C4-10716-E1437525; Thu, 10 Oct 2013 23:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1381446685!1424249!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19061 invoked from network); 10 Oct 2013 23:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPO9-00041a-1S
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPO8-0005gt-UC
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:24 +0000
Date: Thu, 10 Oct 2013 23:11:24 +0000
Message-Id: <E1VUPO8-0005gt-UC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: Add macros MB and GB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 983843e7907ce75bdf97efa0b9f67db7b64e5765
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Sep 27 17:56:33 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 8 15:45:45 2013 +0100

    xen: Add macros MB and GB
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-arm/config.h |    1 -
 xen/include/xen/config.h     |    3 +++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 9e395c2..5b7b1a8 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -142,7 +142,6 @@
 #define SLOT0_ENTRY_BITS  39
 #define SLOT0(slot) (_AT(vaddr_t,slot) << SLOT0_ENTRY_BITS)
 #define SLOT0_ENTRY_SIZE  SLOT0(1)
-#define GB(_gb)     (_AC(_gb, UL) << 30)
 
 #define VMAP_VIRT_START  GB(1)
 #define VMAP_VIRT_END    (VMAP_VIRT_START + GB(1) - 1)
diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h
index a52298e..657c6e5 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -69,6 +69,9 @@
 #define __force
 #define __bitwise
 
+#define MB(_mb)     (_AC(_mb, UL) << 20)
+#define GB(_gb)     (_AC(_gb, UL) << 30)
+
 #ifndef __ASSEMBLY__
 
 int current_domain_id(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:11:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:11: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 1VUPOM-0008Qu-Px; Thu, 10 Oct 2013 23:11: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 1VUPOL-0008Qc-KG
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:37 +0000
Received: from [85.158.143.35:2271] by server-3.bemta-4.messagelabs.com id
	5C/75-24907-82437525; Thu, 10 Oct 2013 23:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1381446695!429871!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5140 invoked from network); 10 Oct 2013 23:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOJ-00041i-6t
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOJ-0005hJ-5B
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:35 +0000
Date: Thu, 10 Oct 2013 23:11:35 +0000
Message-Id: <E1VUPOJ-0005hJ-5B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: Add macro ROUNDUP
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7ac2e731e94616fd156f16d86ddcf23beabcb1fc
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Sep 27 17:56:34 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 8 15:45:48 2013 +0100

    xen: Add macro ROUNDUP
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/lib.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 4768b0e..5b258fd 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -63,6 +63,8 @@ do {                                                            \
 #define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
 #define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
 
+#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
+
 #define reserve_bootmem(_p,_l) ((void)0)
 
 struct 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 Oct 10 23:11:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:11: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 1VUPOM-0008Qu-Px; Thu, 10 Oct 2013 23:11: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 1VUPOL-0008Qc-KG
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:37 +0000
Received: from [85.158.143.35:2271] by server-3.bemta-4.messagelabs.com id
	5C/75-24907-82437525; Thu, 10 Oct 2013 23:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1381446695!429871!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5140 invoked from network); 10 Oct 2013 23:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOJ-00041i-6t
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOJ-0005hJ-5B
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:35 +0000
Date: Thu, 10 Oct 2013 23:11:35 +0000
Message-Id: <E1VUPOJ-0005hJ-5B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: Add macro ROUNDUP
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7ac2e731e94616fd156f16d86ddcf23beabcb1fc
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Sep 27 17:56:34 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 8 15:45:48 2013 +0100

    xen: Add macro ROUNDUP
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/lib.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 4768b0e..5b258fd 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -63,6 +63,8 @@ do {                                                            \
 #define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
 #define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
 
+#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
+
 #define reserve_bootmem(_p,_l) ((void)0)
 
 struct 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 Oct 10 23:11:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:11: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 1VUPOX-0008TG-TB; Thu, 10 Oct 2013 23:11:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOW-0008Sr-KV
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:48 +0000
Received: from [85.158.139.211:20723] by server-12.bemta-5.messagelabs.com id
	0D/AB-18373-33437525; Thu, 10 Oct 2013 23:11:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1381446705!692697!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21634 invoked from network); 10 Oct 2013 23:11:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:11:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOT-00041r-OJ
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOT-0005hk-Bq
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:45 +0000
Date: Thu, 10 Oct 2013 23:11:45 +0000
Message-Id: <E1VUPOT-0005hk-Bq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/dts: Use ROUNDUP macro instead of
	the internal ALIGN
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 14c616eca8630f11b24969e06cacfc945ebf3b12
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Sep 27 17:56:35 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 8 15:46:07 2013 +0100

    xen/dts: Use ROUNDUP macro instead of the internal ALIGN
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/device_tree.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 27ee708..ea8ed56 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -65,8 +65,6 @@ static LIST_HEAD(aliases_lookup);
             printk(fmt, ## __VA_ARGS__);            \
     } while (0)
 
-#define ALIGN(x, a) ((x + (a) - 1) & ~((a) - 1));
-
 // #define DEBUG_DT
 
 #ifdef DEBUG_DT
@@ -457,7 +455,7 @@ static void __init *unflatten_dt_alloc(unsigned long *mem, unsigned long size,
 {
     void *res;
 
-    *mem = ALIGN(*mem, align);
+    *mem = ROUNDUP(*mem, align);
     res = (void *)*mem;
     *mem += size;
 
@@ -1442,7 +1440,7 @@ static unsigned long __init unflatten_dt_node(const void *fdt,
     *p += 4;
     pathp = (char *)*p;
     l = allocl = strlen(pathp) + 1;
-    *p = ALIGN(*p + l, 4);
+    *p = ROUNDUP(*p + l, 4);
 
     /* version 0x10 has a more compact unit name here instead of the full
      * path. we accumulate the full path size using "fpsize", we'll rebuild
@@ -1535,7 +1533,7 @@ static unsigned long __init unflatten_dt_node(const void *fdt,
         noff = be32_to_cpup((__be32 *)((*p) + 4));
         *p += 8;
         if ( fdt_version(fdt) < 0x10 )
-            *p = ALIGN(*p, sz >= 8 ? 8 : 4);
+            *p = ROUNDUP(*p, sz >= 8 ? 8 : 4);
 
         pname = fdt_string(fdt, noff);
         if ( pname == NULL )
@@ -1572,7 +1570,7 @@ static unsigned long __init unflatten_dt_node(const void *fdt,
             *prev_pp = pp;
             prev_pp = &pp->next;
         }
-        *p = ALIGN((*p) + sz, 4);
+        *p = ROUNDUP((*p) + sz, 4);
     }
     /* with version 0x10 we may not have the name property, recreate
      * it here from the unit name if absent
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:11:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:11: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 1VUPOX-0008TG-TB; Thu, 10 Oct 2013 23:11:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOW-0008Sr-KV
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:48 +0000
Received: from [85.158.139.211:20723] by server-12.bemta-5.messagelabs.com id
	0D/AB-18373-33437525; Thu, 10 Oct 2013 23:11:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1381446705!692697!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21634 invoked from network); 10 Oct 2013 23:11:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:11:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOT-00041r-OJ
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOT-0005hk-Bq
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:45 +0000
Date: Thu, 10 Oct 2013 23:11:45 +0000
Message-Id: <E1VUPOT-0005hk-Bq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/dts: Use ROUNDUP macro instead of
	the internal ALIGN
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 14c616eca8630f11b24969e06cacfc945ebf3b12
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Sep 27 17:56:35 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 8 15:46:07 2013 +0100

    xen/dts: Use ROUNDUP macro instead of the internal ALIGN
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/device_tree.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 27ee708..ea8ed56 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -65,8 +65,6 @@ static LIST_HEAD(aliases_lookup);
             printk(fmt, ## __VA_ARGS__);            \
     } while (0)
 
-#define ALIGN(x, a) ((x + (a) - 1) & ~((a) - 1));
-
 // #define DEBUG_DT
 
 #ifdef DEBUG_DT
@@ -457,7 +455,7 @@ static void __init *unflatten_dt_alloc(unsigned long *mem, unsigned long size,
 {
     void *res;
 
-    *mem = ALIGN(*mem, align);
+    *mem = ROUNDUP(*mem, align);
     res = (void *)*mem;
     *mem += size;
 
@@ -1442,7 +1440,7 @@ static unsigned long __init unflatten_dt_node(const void *fdt,
     *p += 4;
     pathp = (char *)*p;
     l = allocl = strlen(pathp) + 1;
-    *p = ALIGN(*p + l, 4);
+    *p = ROUNDUP(*p + l, 4);
 
     /* version 0x10 has a more compact unit name here instead of the full
      * path. we accumulate the full path size using "fpsize", we'll rebuild
@@ -1535,7 +1533,7 @@ static unsigned long __init unflatten_dt_node(const void *fdt,
         noff = be32_to_cpup((__be32 *)((*p) + 4));
         *p += 8;
         if ( fdt_version(fdt) < 0x10 )
-            *p = ALIGN(*p, sz >= 8 ? 8 : 4);
+            *p = ROUNDUP(*p, sz >= 8 ? 8 : 4);
 
         pname = fdt_string(fdt, noff);
         if ( pname == NULL )
@@ -1572,7 +1570,7 @@ static unsigned long __init unflatten_dt_node(const void *fdt,
             *prev_pp = pp;
             prev_pp = &pp->next;
         }
-        *p = ALIGN((*p) + sz, 4);
+        *p = ROUNDUP((*p) + sz, 4);
     }
     /* with version 0x10 we may not have the name property, recreate
      * it here from the unit name if absent
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:12:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:12: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 1VUPOj-0008VY-0B; Thu, 10 Oct 2013 23:12: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 1VUPOh-0008V4-9h
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:59 +0000
Received: from [85.158.139.211:33515] by server-5.bemta-5.messagelabs.com id
	ED/AB-29992-E3437525; Thu, 10 Oct 2013 23:11:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1381446716!705648!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15852 invoked from network); 10 Oct 2013 23:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOd-000421-Uu
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOd-0005iE-T1
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:55 +0000
Date: Thu, 10 Oct 2013 23:11:55 +0000
Message-Id: <E1VUPOd-0005iE-T1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add support to load initrd in
	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 e501dc9aa9100c5a6ffa21234f37d2f66403cc30
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Sep 27 17:56:36 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 8 15:46:39 2013 +0100

    xen/arm: Add support to load initrd in dom0
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |  101 +++++++++++++++++++++++++++++++++++++------
 xen/arch/arm/kernel.c       |   20 +++++---
 xen/arch/arm/kernel.h       |    2 +
 3 files changed, 102 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index fb1fa56..4f91327 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -163,12 +163,16 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
          *
          * * remember xen,dom0-bootargs if we don't already have
          *   bootargs (from module #1, above).
-         * * remove bootargs,  xen,dom0-bootargs and xen,xen-bootargs.
+         * * remove bootargs,  xen,dom0-bootargs, xen,xen-bootargs,
+         *   linux,initrd-start and linux,initrd-end.
          */
         if ( dt_node_path_is_equal(np, "/chosen") )
         {
-            if ( dt_property_name_is_equal(pp, "xen,xen-bootargs") )
+            if ( dt_property_name_is_equal(pp, "xen,xen-bootargs") ||
+                 dt_property_name_is_equal(pp, "linux,initrd-start") ||
+                 dt_property_name_is_equal(pp, "linux,initrd-end") )
                 continue;
+
             if ( dt_property_name_is_equal(pp, "xen,dom0-bootargs") )
             {
                 had_dom0_bootargs = 1;
@@ -214,12 +218,22 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
                            strlen(bootargs) + 1);
         if ( res )
             return res;
-    }
 
-    /*
-     * XXX should populate /chosen/linux,initrd-{start,end} here if we
-     * have module[2]
-     */
+        /*
+         * If the bootloader provides an initrd, we must create a placeholder
+         * for the initrd properties. The values will be replaced later.
+         */
+        if ( early_info.modules.module[MOD_INITRD].size )
+        {
+            res = fdt_property_cell(kinfo->fdt, "linux,initrd-start", 0);
+            if ( res )
+                return res;
+
+            res = fdt_property_cell(kinfo->fdt, "linux,initrd-end", 0);
+            if ( res )
+                return res;
+        }
+    }
 
     return 0;
 }
@@ -765,6 +779,8 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
     int new_size;
     int ret;
     paddr_t end;
+    paddr_t initrd_len;
+    paddr_t dtb_len;
 
     ASSERT(dt_host && (dt_host->sibling == NULL));
 
@@ -791,8 +807,10 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
     if ( ret < 0 )
         goto err;
 
-    /* Actual new size */
-    new_size = fdt_totalsize(kinfo->fdt);
+    /* Align DTB and initrd size to 2Mb. Linux only requires 4 byte alignment */
+    initrd_len = ROUNDUP(early_info.modules.module[MOD_INITRD].size, MB(2));
+    dtb_len = ROUNDUP(fdt_totalsize(kinfo->fdt), MB(2));
+    new_size = initrd_len + dtb_len;
 
     /*
      * DTB must be loaded such that it does not conflict with the
@@ -801,14 +819,14 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
      * the recommendation in Documentation/arm64/booting.txt is below
      * 512MB. Place at 128MB, (or, if we have less RAM, as high as
      * possible) in order to satisfy both.
+     * If the bootloader provides an initrd, it will be loaded just
+     * after the DTB.
      */
     end = kinfo->mem.bank[0].start + kinfo->mem.bank[0].size;
     end = MIN(kinfo->mem.bank[0].start + (128<<20) + new_size, end);
 
-    kinfo->dtb_paddr = end - new_size;
-
-    /* Align the address to 2Mb. Linux only requires 4 byte alignment */
-    kinfo->dtb_paddr &= ~((2 << 20) - 1);
+    kinfo->initrd_paddr = end - initrd_len;
+    kinfo->dtb_paddr = kinfo->initrd_paddr - dtb_len;
 
     if ( kinfo->dtb_paddr < kinfo->mem.bank[0].start ||
          kinfo->mem.bank[0].start + new_size > end )
@@ -841,6 +859,61 @@ static void dtb_load(struct kernel_info *kinfo)
     xfree(kinfo->fdt);
 }
 
+static void initrd_load(struct kernel_info *kinfo)
+{
+    paddr_t load_addr = kinfo->initrd_paddr;
+    paddr_t paddr = early_info.modules.module[MOD_INITRD].start;
+    paddr_t len = early_info.modules.module[MOD_INITRD].size;
+    unsigned long offs;
+    int node;
+    int res;
+
+    if ( !len )
+        return;
+
+    printk("Loading dom0 initrd from %"PRIpaddr" to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
+           paddr, load_addr, load_addr + len);
+
+    /* Fix up linux,initrd-start and linux,initrd-end in /chosen */
+    node = fdt_path_offset(kinfo->fdt, "/chosen");
+    if ( node < 0 )
+        panic("Cannot find the /chosen node");
+
+    res = fdt_setprop_inplace_cell(kinfo->fdt, node, "linux,initrd-start",
+                                   load_addr);
+    if ( res )
+        panic("Cannot fix up \"linux,initrd-start\" property\n");
+
+    res = fdt_setprop_inplace_cell(kinfo->fdt, node, "linux,initrd-end",
+                                   load_addr + len);
+    if ( res )
+        panic("Cannot fix up \"linux,initrd-end\" property\n");
+
+    for ( offs = 0; offs < len; )
+    {
+        int rc;
+        paddr_t s, l, ma;
+        void *dst;
+
+        s = offs & ~PAGE_MASK;
+        l = min(PAGE_SIZE - s, len);
+
+        rc = gvirt_to_maddr(load_addr + offs, &ma);
+        if ( rc )
+        {
+            panic("\nUnable to translate guest address\n");
+            return;
+        }
+
+        dst = map_domain_page(ma>>PAGE_SHIFT);
+
+        copy_from_paddr(dst + s, paddr + offs, l, BUFFERABLE);
+
+        unmap_domain_page(dst);
+        offs += l;
+    }
+}
+
 int construct_dom0(struct domain *d)
 {
     struct kernel_info kinfo = {};
@@ -877,6 +950,8 @@ int construct_dom0(struct domain *d)
     p2m_load_VTTBR(d);
 
     kernel_load(&kinfo);
+    /* initrd_load will fix up the fdt, so call it before dtb_load */
+    initrd_load(&kinfo);
     dtb_load(&kinfo);
 
     discard_initial_modules();
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 6d2c164..315d12c 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -72,15 +72,22 @@ static void kernel_zimage_check_overlap(struct kernel_info *info)
 {
     paddr_t zimage_start = info->zimage.load_addr;
     paddr_t zimage_end = info->zimage.load_addr + info->zimage.len;
-    paddr_t dtb_start = info->dtb_paddr;
-    paddr_t dtb_end = info->dtb_paddr + fdt_totalsize(info->fdt);
+    paddr_t start = info->dtb_paddr;
+    paddr_t end;
 
-    if ( (dtb_start > zimage_end) || (dtb_end < zimage_start) )
+    end = info->initrd_paddr + early_info.modules.module[MOD_INITRD].size;
+
+    /*
+     * In the dom0 memory, the initrd will be just after the DTB. So we
+     * only need to check if the zImage range will overlap the
+     * DTB-initrd range.
+     */
+    if ( (start > zimage_end) || (end < zimage_start) )
         return;
 
     panic(XENLOG_ERR "The kernel(0x%"PRIpaddr"-0x%"PRIpaddr
-          ") is overlapping the DTB(0x%"PRIpaddr"-0x%"PRIpaddr")\n",
-          zimage_start, zimage_end, dtb_start, dtb_end);
+          ") is overlapping the DTB-initrd(0x%"PRIpaddr"-0x%"PRIpaddr")\n",
+          zimage_start, zimage_end, start, end);
 }
 
 static void kernel_zimage_load(struct kernel_info *info)
@@ -335,9 +342,6 @@ int kernel_prepare(struct kernel_info *info)
 
     paddr_t start, size;
 
-    if ( early_info.modules.nr_mods > MOD_INITRD )
-        panic("Cannot handle dom0 initrd yet\n");
-
     if ( early_info.modules.nr_mods < MOD_KERNEL )
     {
         printk("No boot modules found, trying flash\n");
diff --git a/xen/arch/arm/kernel.h b/xen/arch/arm/kernel.h
index c900e74..debf590 100644
--- a/xen/arch/arm/kernel.h
+++ b/xen/arch/arm/kernel.h
@@ -21,6 +21,8 @@ struct kernel_info {
     paddr_t dtb_paddr;
     paddr_t entry;
 
+    paddr_t initrd_paddr;
+
     void *kernel_img;
     unsigned kernel_order;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:12:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:12: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 1VUPOj-0008VY-0B; Thu, 10 Oct 2013 23:12: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 1VUPOh-0008V4-9h
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:59 +0000
Received: from [85.158.139.211:33515] by server-5.bemta-5.messagelabs.com id
	ED/AB-29992-E3437525; Thu, 10 Oct 2013 23:11:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1381446716!705648!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15852 invoked from network); 10 Oct 2013 23:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOd-000421-Uu
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOd-0005iE-T1
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:11:55 +0000
Date: Thu, 10 Oct 2013 23:11:55 +0000
Message-Id: <E1VUPOd-0005iE-T1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add support to load initrd in
	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 e501dc9aa9100c5a6ffa21234f37d2f66403cc30
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Sep 27 17:56:36 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 8 15:46:39 2013 +0100

    xen/arm: Add support to load initrd in dom0
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |  101 +++++++++++++++++++++++++++++++++++++------
 xen/arch/arm/kernel.c       |   20 +++++---
 xen/arch/arm/kernel.h       |    2 +
 3 files changed, 102 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index fb1fa56..4f91327 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -163,12 +163,16 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
          *
          * * remember xen,dom0-bootargs if we don't already have
          *   bootargs (from module #1, above).
-         * * remove bootargs,  xen,dom0-bootargs and xen,xen-bootargs.
+         * * remove bootargs,  xen,dom0-bootargs, xen,xen-bootargs,
+         *   linux,initrd-start and linux,initrd-end.
          */
         if ( dt_node_path_is_equal(np, "/chosen") )
         {
-            if ( dt_property_name_is_equal(pp, "xen,xen-bootargs") )
+            if ( dt_property_name_is_equal(pp, "xen,xen-bootargs") ||
+                 dt_property_name_is_equal(pp, "linux,initrd-start") ||
+                 dt_property_name_is_equal(pp, "linux,initrd-end") )
                 continue;
+
             if ( dt_property_name_is_equal(pp, "xen,dom0-bootargs") )
             {
                 had_dom0_bootargs = 1;
@@ -214,12 +218,22 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
                            strlen(bootargs) + 1);
         if ( res )
             return res;
-    }
 
-    /*
-     * XXX should populate /chosen/linux,initrd-{start,end} here if we
-     * have module[2]
-     */
+        /*
+         * If the bootloader provides an initrd, we must create a placeholder
+         * for the initrd properties. The values will be replaced later.
+         */
+        if ( early_info.modules.module[MOD_INITRD].size )
+        {
+            res = fdt_property_cell(kinfo->fdt, "linux,initrd-start", 0);
+            if ( res )
+                return res;
+
+            res = fdt_property_cell(kinfo->fdt, "linux,initrd-end", 0);
+            if ( res )
+                return res;
+        }
+    }
 
     return 0;
 }
@@ -765,6 +779,8 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
     int new_size;
     int ret;
     paddr_t end;
+    paddr_t initrd_len;
+    paddr_t dtb_len;
 
     ASSERT(dt_host && (dt_host->sibling == NULL));
 
@@ -791,8 +807,10 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
     if ( ret < 0 )
         goto err;
 
-    /* Actual new size */
-    new_size = fdt_totalsize(kinfo->fdt);
+    /* Align DTB and initrd size to 2Mb. Linux only requires 4 byte alignment */
+    initrd_len = ROUNDUP(early_info.modules.module[MOD_INITRD].size, MB(2));
+    dtb_len = ROUNDUP(fdt_totalsize(kinfo->fdt), MB(2));
+    new_size = initrd_len + dtb_len;
 
     /*
      * DTB must be loaded such that it does not conflict with the
@@ -801,14 +819,14 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
      * the recommendation in Documentation/arm64/booting.txt is below
      * 512MB. Place at 128MB, (or, if we have less RAM, as high as
      * possible) in order to satisfy both.
+     * If the bootloader provides an initrd, it will be loaded just
+     * after the DTB.
      */
     end = kinfo->mem.bank[0].start + kinfo->mem.bank[0].size;
     end = MIN(kinfo->mem.bank[0].start + (128<<20) + new_size, end);
 
-    kinfo->dtb_paddr = end - new_size;
-
-    /* Align the address to 2Mb. Linux only requires 4 byte alignment */
-    kinfo->dtb_paddr &= ~((2 << 20) - 1);
+    kinfo->initrd_paddr = end - initrd_len;
+    kinfo->dtb_paddr = kinfo->initrd_paddr - dtb_len;
 
     if ( kinfo->dtb_paddr < kinfo->mem.bank[0].start ||
          kinfo->mem.bank[0].start + new_size > end )
@@ -841,6 +859,61 @@ static void dtb_load(struct kernel_info *kinfo)
     xfree(kinfo->fdt);
 }
 
+static void initrd_load(struct kernel_info *kinfo)
+{
+    paddr_t load_addr = kinfo->initrd_paddr;
+    paddr_t paddr = early_info.modules.module[MOD_INITRD].start;
+    paddr_t len = early_info.modules.module[MOD_INITRD].size;
+    unsigned long offs;
+    int node;
+    int res;
+
+    if ( !len )
+        return;
+
+    printk("Loading dom0 initrd from %"PRIpaddr" to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
+           paddr, load_addr, load_addr + len);
+
+    /* Fix up linux,initrd-start and linux,initrd-end in /chosen */
+    node = fdt_path_offset(kinfo->fdt, "/chosen");
+    if ( node < 0 )
+        panic("Cannot find the /chosen node");
+
+    res = fdt_setprop_inplace_cell(kinfo->fdt, node, "linux,initrd-start",
+                                   load_addr);
+    if ( res )
+        panic("Cannot fix up \"linux,initrd-start\" property\n");
+
+    res = fdt_setprop_inplace_cell(kinfo->fdt, node, "linux,initrd-end",
+                                   load_addr + len);
+    if ( res )
+        panic("Cannot fix up \"linux,initrd-end\" property\n");
+
+    for ( offs = 0; offs < len; )
+    {
+        int rc;
+        paddr_t s, l, ma;
+        void *dst;
+
+        s = offs & ~PAGE_MASK;
+        l = min(PAGE_SIZE - s, len);
+
+        rc = gvirt_to_maddr(load_addr + offs, &ma);
+        if ( rc )
+        {
+            panic("\nUnable to translate guest address\n");
+            return;
+        }
+
+        dst = map_domain_page(ma>>PAGE_SHIFT);
+
+        copy_from_paddr(dst + s, paddr + offs, l, BUFFERABLE);
+
+        unmap_domain_page(dst);
+        offs += l;
+    }
+}
+
 int construct_dom0(struct domain *d)
 {
     struct kernel_info kinfo = {};
@@ -877,6 +950,8 @@ int construct_dom0(struct domain *d)
     p2m_load_VTTBR(d);
 
     kernel_load(&kinfo);
+    /* initrd_load will fix up the fdt, so call it before dtb_load */
+    initrd_load(&kinfo);
     dtb_load(&kinfo);
 
     discard_initial_modules();
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 6d2c164..315d12c 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -72,15 +72,22 @@ static void kernel_zimage_check_overlap(struct kernel_info *info)
 {
     paddr_t zimage_start = info->zimage.load_addr;
     paddr_t zimage_end = info->zimage.load_addr + info->zimage.len;
-    paddr_t dtb_start = info->dtb_paddr;
-    paddr_t dtb_end = info->dtb_paddr + fdt_totalsize(info->fdt);
+    paddr_t start = info->dtb_paddr;
+    paddr_t end;
 
-    if ( (dtb_start > zimage_end) || (dtb_end < zimage_start) )
+    end = info->initrd_paddr + early_info.modules.module[MOD_INITRD].size;
+
+    /*
+     * In the dom0 memory, the initrd will be just after the DTB. So we
+     * only need to check if the zImage range will overlap the
+     * DTB-initrd range.
+     */
+    if ( (start > zimage_end) || (end < zimage_start) )
         return;
 
     panic(XENLOG_ERR "The kernel(0x%"PRIpaddr"-0x%"PRIpaddr
-          ") is overlapping the DTB(0x%"PRIpaddr"-0x%"PRIpaddr")\n",
-          zimage_start, zimage_end, dtb_start, dtb_end);
+          ") is overlapping the DTB-initrd(0x%"PRIpaddr"-0x%"PRIpaddr")\n",
+          zimage_start, zimage_end, start, end);
 }
 
 static void kernel_zimage_load(struct kernel_info *info)
@@ -335,9 +342,6 @@ int kernel_prepare(struct kernel_info *info)
 
     paddr_t start, size;
 
-    if ( early_info.modules.nr_mods > MOD_INITRD )
-        panic("Cannot handle dom0 initrd yet\n");
-
     if ( early_info.modules.nr_mods < MOD_KERNEL )
     {
         printk("No boot modules found, trying flash\n");
diff --git a/xen/arch/arm/kernel.h b/xen/arch/arm/kernel.h
index c900e74..debf590 100644
--- a/xen/arch/arm/kernel.h
+++ b/xen/arch/arm/kernel.h
@@ -21,6 +21,8 @@ struct kernel_info {
     paddr_t dtb_paddr;
     paddr_t entry;
 
+    paddr_t initrd_paddr;
+
     void *kernel_img;
     unsigned kernel_order;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:12:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:12: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 1VUPOt-000062-4i; Thu, 10 Oct 2013 23:12: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 1VUPOr-00005d-Ew
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:09 +0000
Received: from [85.158.137.68:25710] by server-6.bemta-3.messagelabs.com id
	CE/E6-04812-84437525; Thu, 10 Oct 2013 23:12:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1381446726!729988!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11347 invoked from network); 10 Oct 2013 23:12:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:12:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOo-00042Z-5N
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOo-0005ik-2w
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:06 +0000
Date: Thu, 10 Oct 2013 23:12:06 +0000
Message-Id: <E1VUPOo-0005ik-2w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/dts: Support Linux initrd DT
	bindings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d96e7b898136ff88ee5c8fac9e0ae8a695e37d9b
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Sep 27 17:56:37 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 8 15:46:42 2013 +0100

    xen/dts: Support Linux initrd DT bindings
    
    Linux uses the property linux,initrd-start and linux,initrd-end to know where
    the initrd lives in memory.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/device_tree.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index ea8ed56..af0fb04 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -380,6 +380,29 @@ static void __init process_multiboot_node(const void *fdt, int node,
         early_info.modules.nr_mods = nr;
 }
 
+static void __init process_chosen_node(const void *fdt, int node,
+                                       const char *name,
+                                       u32 address_cells, u32 size_cells)
+{
+    struct dt_mb_module *mod = &early_info.modules.module[MOD_INITRD];
+    u32 start, end;
+
+    dt_printk("Checking for initrd in /chosen\n");
+
+    start = device_tree_get_u32(fdt, node, "linux,initrd-start", 0);
+    end = device_tree_get_u32(fdt, node, "linux,initrd-end", 0);
+
+    if ( !start || !end || (start >= end) )
+        return;
+
+    dt_printk("Initrd 0x%x-0x%x\n", start, end);
+
+    mod->start = start;
+    mod->size = end - start;
+
+    early_info.modules.nr_mods = MAX(MOD_INITRD, early_info.modules.nr_mods);
+}
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -389,6 +412,8 @@ static int __init early_scan_node(const void *fdt,
         process_memory_node(fdt, node, name, address_cells, size_cells);
     else if ( device_tree_node_compatible(fdt, node, "xen,multiboot-module" ) )
         process_multiboot_node(fdt, node, name, address_cells, size_cells);
+    else if ( depth == 1 && device_tree_node_matches(fdt, node, "chosen") )
+        process_chosen_node(fdt, node, name, address_cells, size_cells);
 
     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 Oct 10 23:12:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:12: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 1VUPOt-000062-4i; Thu, 10 Oct 2013 23:12: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 1VUPOr-00005d-Ew
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:09 +0000
Received: from [85.158.137.68:25710] by server-6.bemta-3.messagelabs.com id
	CE/E6-04812-84437525; Thu, 10 Oct 2013 23:12:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1381446726!729988!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11347 invoked from network); 10 Oct 2013 23:12:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:12:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOo-00042Z-5N
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOo-0005ik-2w
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:06 +0000
Date: Thu, 10 Oct 2013 23:12:06 +0000
Message-Id: <E1VUPOo-0005ik-2w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/dts: Support Linux initrd DT
	bindings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d96e7b898136ff88ee5c8fac9e0ae8a695e37d9b
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Sep 27 17:56:37 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 8 15:46:42 2013 +0100

    xen/dts: Support Linux initrd DT bindings
    
    Linux uses the property linux,initrd-start and linux,initrd-end to know where
    the initrd lives in memory.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/device_tree.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index ea8ed56..af0fb04 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -380,6 +380,29 @@ static void __init process_multiboot_node(const void *fdt, int node,
         early_info.modules.nr_mods = nr;
 }
 
+static void __init process_chosen_node(const void *fdt, int node,
+                                       const char *name,
+                                       u32 address_cells, u32 size_cells)
+{
+    struct dt_mb_module *mod = &early_info.modules.module[MOD_INITRD];
+    u32 start, end;
+
+    dt_printk("Checking for initrd in /chosen\n");
+
+    start = device_tree_get_u32(fdt, node, "linux,initrd-start", 0);
+    end = device_tree_get_u32(fdt, node, "linux,initrd-end", 0);
+
+    if ( !start || !end || (start >= end) )
+        return;
+
+    dt_printk("Initrd 0x%x-0x%x\n", start, end);
+
+    mod->start = start;
+    mod->size = end - start;
+
+    early_info.modules.nr_mods = MAX(MOD_INITRD, early_info.modules.nr_mods);
+}
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -389,6 +412,8 @@ static int __init early_scan_node(const void *fdt,
         process_memory_node(fdt, node, name, address_cells, size_cells);
     else if ( device_tree_node_compatible(fdt, node, "xen,multiboot-module" ) )
         process_multiboot_node(fdt, node, name, address_cells, size_cells);
+    else if ( depth == 1 && device_tree_node_matches(fdt, node, "chosen") )
+        process_chosen_node(fdt, node, name, address_cells, size_cells);
 
     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 Oct 10 23:12:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:12: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 1VUPP2-00007z-7y; Thu, 10 Oct 2013 23:12: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 1VUPP1-00007h-7K
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:19 +0000
Received: from [85.158.137.68:41909] by server-5.bemta-3.messagelabs.com id
	81/99-23058-25437525; Thu, 10 Oct 2013 23:12:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1381446736!724375!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12608 invoked from network); 10 Oct 2013 23:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOy-00042h-BA
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOy-0005j8-9K
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:16 +0000
Date: Thu, 10 Oct 2013 23:12:16 +0000
Message-Id: <E1VUPOy-0005j8-9K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/x86: Remove GB macro in
	asm-x86/config.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c4d3ccbfb50fa7603595b9bc16b1bba4647d21f1
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Oct 8 17:48:33 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 8 18:08:40 2013 +0100

    xen/x86: Remove GB macro in asm-x86/config.h
    
    Commit 983843e "xen: Add macros MB and GB" introduce a generic GB macro.
    By mistake, the macro in asm-x86/config.h was not removed. This is result to
    a compilation error when Xen is build for x86.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/config.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index 3980e06..99d0e2c 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -129,7 +129,6 @@ extern unsigned char boot_edid_info[128];
 #define PML4_ADDR(_slot)                              \
     (((_AC(_slot, UL) >> 8) * _AC(0xffff000000000000,UL)) | \
      (_AC(_slot, UL) << PML4_ENTRY_BITS))
-#define GB(_gb) (_AC(_gb, UL) << 30)
 
 /*
  * Memory layout:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:12:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:12: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 1VUPP2-00007z-7y; Thu, 10 Oct 2013 23:12: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 1VUPP1-00007h-7K
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:19 +0000
Received: from [85.158.137.68:41909] by server-5.bemta-3.messagelabs.com id
	81/99-23058-25437525; Thu, 10 Oct 2013 23:12:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1381446736!724375!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12608 invoked from network); 10 Oct 2013 23:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOy-00042h-BA
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPOy-0005j8-9K
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:16 +0000
Date: Thu, 10 Oct 2013 23:12:16 +0000
Message-Id: <E1VUPOy-0005j8-9K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/x86: Remove GB macro in
	asm-x86/config.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c4d3ccbfb50fa7603595b9bc16b1bba4647d21f1
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Oct 8 17:48:33 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 8 18:08:40 2013 +0100

    xen/x86: Remove GB macro in asm-x86/config.h
    
    Commit 983843e "xen: Add macros MB and GB" introduce a generic GB macro.
    By mistake, the macro in asm-x86/config.h was not removed. This is result to
    a compilation error when Xen is build for x86.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/config.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index 3980e06..99d0e2c 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -129,7 +129,6 @@ extern unsigned char boot_edid_info[128];
 #define PML4_ADDR(_slot)                              \
     (((_AC(_slot, UL) >> 8) * _AC(0xffff000000000000,UL)) | \
      (_AC(_slot, UL) << PML4_ENTRY_BITS))
-#define GB(_gb) (_AC(_gb, UL) << 30)
 
 /*
  * Memory layout:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:12:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:12: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 1VUPPD-0000AE-BB; Thu, 10 Oct 2013 23:12: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 1VUPPB-00009q-Sr
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:30 +0000
Received: from [85.158.143.35:4043] by server-3.bemta-4.messagelabs.com id
	0F/B5-24907-C5437525; Thu, 10 Oct 2013 23:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1381446746!1094388!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30580 invoked from network); 10 Oct 2013 23:12:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:12:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPP8-00042n-HC
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPP8-0005k0-FH
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:26 +0000
Date: Thu, 10 Oct 2013 23:12:26 +0000
Message-Id: <E1VUPP8-0005k0-FH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: improvements to {rd,
	wr}msr_hypervisor_regs()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 839b966e3f587bbb1a0d954230fb3904330dccb6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 9 12:10:46 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:10:46 2013 +0200

    x86/traps: improvements to {rd,wr}msr_hypervisor_regs()
    
    Coverity ID: 1055249 1055250
    
    Coverity was complaining that the switch statments contained dead code in
    their default statements.  While this is quite minor, the code flow in
    wrmsr_hypervisor_regs() was sufficiently opaque that I felt it approprate to
    fix.
    
    Other improvements include:
     * not shadowing the function parameter 'idx'.
     * use of PAGE_{SHIFT,SIZE} instead of opencoded numbers.
     * a more descriptive error message for attempting to write invalid indicies
       for hypercall pages.
    
    There is no behavioural change as a result.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c |   41 +++++++++++++++--------------------------
 1 files changed, 15 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 6c7bd99..47c71b7 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -595,55 +595,47 @@ DO_ERROR_NOCODE(TRAP_copro_error,     coprocessor_error)
 DO_ERROR(       TRAP_alignment_check, alignment_check)
 DO_ERROR_NOCODE(TRAP_simd_error,      simd_coprocessor_error)
 
+/* Returns 0 if not handled, and non-0 for success. */
 int rdmsr_hypervisor_regs(uint32_t idx, uint64_t *val)
 {
     struct domain *d = current->domain;
     /* Optionally shift out of the way of Viridian architectural MSRs. */
     uint32_t base = is_viridian_domain(d) ? 0x40000200 : 0x40000000;
 
-    idx -= base;
-    if ( idx > 0 )
-        return 0;
-
-    switch ( idx )
+    switch ( idx - base )
     {
-    case 0:
+    case 0: /* Write hypercall page MSR.  Read as zero. */
     {
         *val = 0;
-        break;
+        return 1;
     }
-    default:
-        BUG();
     }
 
-    return 1;
+    return 0;
 }
 
+/* Returns 1 if handled, 0 if not and -Exx for error. */
 int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val)
 {
     struct domain *d = current->domain;
     /* Optionally shift out of the way of Viridian architectural MSRs. */
     uint32_t base = is_viridian_domain(d) ? 0x40000200 : 0x40000000;
 
-    idx -= base;
-    if ( idx > 0 )
-        return 0;
-
-    switch ( idx )
+    switch ( idx - base )
     {
-    case 0:
+    case 0: /* Write hypercall page */
     {
         void *hypercall_page;
-        unsigned long gmfn = val >> 12;
-        unsigned int idx  = val & 0xfff;
+        unsigned long gmfn = val >> PAGE_SHIFT;
+        unsigned int page_index = val & (PAGE_SIZE - 1);
         struct page_info *page;
         p2m_type_t t;
 
-        if ( idx > 0 )
+        if ( page_index > 0 )
         {
             gdprintk(XENLOG_WARNING,
-                     "Out of range index %u to MSR %08x\n",
-                     idx, 0x40000000);
+                     "wrmsr hypercall page index %#x unsupported\n",
+                     page_index);
             return 0;
         }
 
@@ -671,14 +663,11 @@ int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val)
         unmap_domain_page(hypercall_page);
 
         put_page_and_type(page);
-        break;
+        return 1;
     }
-
-    default:
-        BUG();
     }
 
-    return 1;
+    return 0;
 }
 
 int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:12:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:12: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 1VUPPD-0000AE-BB; Thu, 10 Oct 2013 23:12: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 1VUPPB-00009q-Sr
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:30 +0000
Received: from [85.158.143.35:4043] by server-3.bemta-4.messagelabs.com id
	0F/B5-24907-C5437525; Thu, 10 Oct 2013 23:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1381446746!1094388!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30580 invoked from network); 10 Oct 2013 23:12:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:12:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPP8-00042n-HC
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPP8-0005k0-FH
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:26 +0000
Date: Thu, 10 Oct 2013 23:12:26 +0000
Message-Id: <E1VUPP8-0005k0-FH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: improvements to {rd,
	wr}msr_hypervisor_regs()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 839b966e3f587bbb1a0d954230fb3904330dccb6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 9 12:10:46 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:10:46 2013 +0200

    x86/traps: improvements to {rd,wr}msr_hypervisor_regs()
    
    Coverity ID: 1055249 1055250
    
    Coverity was complaining that the switch statments contained dead code in
    their default statements.  While this is quite minor, the code flow in
    wrmsr_hypervisor_regs() was sufficiently opaque that I felt it approprate to
    fix.
    
    Other improvements include:
     * not shadowing the function parameter 'idx'.
     * use of PAGE_{SHIFT,SIZE} instead of opencoded numbers.
     * a more descriptive error message for attempting to write invalid indicies
       for hypercall pages.
    
    There is no behavioural change as a result.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c |   41 +++++++++++++++--------------------------
 1 files changed, 15 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 6c7bd99..47c71b7 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -595,55 +595,47 @@ DO_ERROR_NOCODE(TRAP_copro_error,     coprocessor_error)
 DO_ERROR(       TRAP_alignment_check, alignment_check)
 DO_ERROR_NOCODE(TRAP_simd_error,      simd_coprocessor_error)
 
+/* Returns 0 if not handled, and non-0 for success. */
 int rdmsr_hypervisor_regs(uint32_t idx, uint64_t *val)
 {
     struct domain *d = current->domain;
     /* Optionally shift out of the way of Viridian architectural MSRs. */
     uint32_t base = is_viridian_domain(d) ? 0x40000200 : 0x40000000;
 
-    idx -= base;
-    if ( idx > 0 )
-        return 0;
-
-    switch ( idx )
+    switch ( idx - base )
     {
-    case 0:
+    case 0: /* Write hypercall page MSR.  Read as zero. */
     {
         *val = 0;
-        break;
+        return 1;
     }
-    default:
-        BUG();
     }
 
-    return 1;
+    return 0;
 }
 
+/* Returns 1 if handled, 0 if not and -Exx for error. */
 int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val)
 {
     struct domain *d = current->domain;
     /* Optionally shift out of the way of Viridian architectural MSRs. */
     uint32_t base = is_viridian_domain(d) ? 0x40000200 : 0x40000000;
 
-    idx -= base;
-    if ( idx > 0 )
-        return 0;
-
-    switch ( idx )
+    switch ( idx - base )
     {
-    case 0:
+    case 0: /* Write hypercall page */
     {
         void *hypercall_page;
-        unsigned long gmfn = val >> 12;
-        unsigned int idx  = val & 0xfff;
+        unsigned long gmfn = val >> PAGE_SHIFT;
+        unsigned int page_index = val & (PAGE_SIZE - 1);
         struct page_info *page;
         p2m_type_t t;
 
-        if ( idx > 0 )
+        if ( page_index > 0 )
         {
             gdprintk(XENLOG_WARNING,
-                     "Out of range index %u to MSR %08x\n",
-                     idx, 0x40000000);
+                     "wrmsr hypercall page index %#x unsupported\n",
+                     page_index);
             return 0;
         }
 
@@ -671,14 +663,11 @@ int wrmsr_hypervisor_regs(uint32_t idx, uint64_t val)
         unmap_domain_page(hypercall_page);
 
         put_page_and_type(page);
-        break;
+        return 1;
     }
-
-    default:
-        BUG();
     }
 
-    return 1;
+    return 0;
 }
 
 int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:12:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:12: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 1VUPPM-0000CF-E3; Thu, 10 Oct 2013 23:12: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 1VUPPL-0000Bz-E5
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:39 +0000
Received: from [193.109.254.147:58393] by server-15.bemta-14.messagelabs.com
	id FC/25-10716-66437525; Thu, 10 Oct 2013 23:12:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1381446756!1425528!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14782 invoked from network); 10 Oct 2013 23:12:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPI-00042v-NP
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPI-0005kR-Ki
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:36 +0000
Date: Thu, 10 Oct 2013 23:12:36 +0000
Message-Id: <E1VUPPI-0005kR-Ki@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvm/vidirian: Avoid printing
	page_to_mfn(NULL) on error 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 c56cdf93750fd978aebd69dc113f12cc770ff8e3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 9 12:11:48 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:11:48 2013 +0200

    hvm/vidirian: Avoid printing page_to_mfn(NULL) on error paths
    
    While working in the viridian code, I noticed that 4cb6c4f4941
    
    "x86/hvm: Use get_page_from_gfn() instead of get_gfn()/put_gfn."
    
    introduced two error paths where page_to_mfn(NULL) would be formatted and
    presented as a bad MFN.  This provides junk in the warning rather than
    something useful.
    
    These two codepaths are fixed up to match their counterpart in
    wrmsr_hypervisor_regs()
    
    While auditing the other changes from 4cb6c4f4941, I noticed a small
    optimisation which could be made by changing the order of the validity checks
    to remove 6 NULL pointer checks.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/hvm.c      |   28 ++++++++++++----------------
 xen/arch/x86/hvm/viridian.c |    4 ++--
 2 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index de81e45..6fcd95a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2499,27 +2499,25 @@ static enum hvm_copy_result __hvm_copy(
 
         page = get_page_from_gfn(curr->domain, gfn, &p2mt, P2M_UNSHARE);
 
+        if ( !page )
+            return HVMCOPY_bad_gfn_to_mfn;
+
         if ( p2m_is_paging(p2mt) )
         {
-            if ( page )
-                put_page(page);
+            put_page(page);
             p2m_mem_paging_populate(curr->domain, gfn);
             return HVMCOPY_gfn_paged_out;
         }
         if ( p2m_is_shared(p2mt) )
         {
-            if ( page )
-                put_page(page);
+            put_page(page);
             return HVMCOPY_gfn_shared;
         }
         if ( p2m_is_grant(p2mt) )
         {
-            if ( page )
-                put_page(page);
+            put_page(page);
             return HVMCOPY_unhandleable;
         }
-        if ( !page )
-            return HVMCOPY_bad_gfn_to_mfn;
 
         p = (char *)__map_domain_page(page) + (addr & ~PAGE_MASK);
 
@@ -2597,27 +2595,25 @@ static enum hvm_copy_result __hvm_clear(paddr_t addr, int size)
 
         page = get_page_from_gfn(curr->domain, gfn, &p2mt, P2M_UNSHARE);
 
+        if ( !page )
+            return HVMCOPY_bad_gfn_to_mfn;
+
         if ( p2m_is_paging(p2mt) )
         {
-            if ( page )
-                put_page(page);
+            put_page(page);
             p2m_mem_paging_populate(curr->domain, gfn);
             return HVMCOPY_gfn_paged_out;
         }
         if ( p2m_is_shared(p2mt) )
         {
-            if ( page )
-                put_page(page);
+            put_page(page);
             return HVMCOPY_gfn_shared;
         }
         if ( p2m_is_grant(p2mt) )
         {
-            if ( page )
-                put_page(page);
+            put_page(page);
             return HVMCOPY_unhandleable;
         }
-        if ( !page )
-            return HVMCOPY_bad_gfn_to_mfn;
 
         p = (char *)__map_domain_page(page) + (addr & ~PAGE_MASK);
 
diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
index d5462f2..a6721c3 100644
--- a/xen/arch/x86/hvm/viridian.c
+++ b/xen/arch/x86/hvm/viridian.c
@@ -157,7 +157,7 @@ static void enable_hypercall_page(struct domain *d)
         if ( page )
             put_page(page);
         gdprintk(XENLOG_WARNING, "Bad GMFN %lx (MFN %lx)\n", gmfn,
-                 page_to_mfn(page));
+                 page ? page_to_mfn(page) : INVALID_MFN);
         return;
     }
 
@@ -202,7 +202,7 @@ static void initialize_apic_assist(struct vcpu *v)
         if ( page )
             put_page(page);
         gdprintk(XENLOG_WARNING, "Bad GMFN %lx (MFN %lx)\n", gmfn,
-                 page_to_mfn(page));
+                 page ? page_to_mfn(page) : INVALID_MFN);
         return;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:12:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:12: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 1VUPPM-0000CF-E3; Thu, 10 Oct 2013 23:12: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 1VUPPL-0000Bz-E5
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:39 +0000
Received: from [193.109.254.147:58393] by server-15.bemta-14.messagelabs.com
	id FC/25-10716-66437525; Thu, 10 Oct 2013 23:12:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1381446756!1425528!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14782 invoked from network); 10 Oct 2013 23:12:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPI-00042v-NP
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPI-0005kR-Ki
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:36 +0000
Date: Thu, 10 Oct 2013 23:12:36 +0000
Message-Id: <E1VUPPI-0005kR-Ki@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvm/vidirian: Avoid printing
	page_to_mfn(NULL) on error 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 c56cdf93750fd978aebd69dc113f12cc770ff8e3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 9 12:11:48 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:11:48 2013 +0200

    hvm/vidirian: Avoid printing page_to_mfn(NULL) on error paths
    
    While working in the viridian code, I noticed that 4cb6c4f4941
    
    "x86/hvm: Use get_page_from_gfn() instead of get_gfn()/put_gfn."
    
    introduced two error paths where page_to_mfn(NULL) would be formatted and
    presented as a bad MFN.  This provides junk in the warning rather than
    something useful.
    
    These two codepaths are fixed up to match their counterpart in
    wrmsr_hypervisor_regs()
    
    While auditing the other changes from 4cb6c4f4941, I noticed a small
    optimisation which could be made by changing the order of the validity checks
    to remove 6 NULL pointer checks.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/hvm.c      |   28 ++++++++++++----------------
 xen/arch/x86/hvm/viridian.c |    4 ++--
 2 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index de81e45..6fcd95a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2499,27 +2499,25 @@ static enum hvm_copy_result __hvm_copy(
 
         page = get_page_from_gfn(curr->domain, gfn, &p2mt, P2M_UNSHARE);
 
+        if ( !page )
+            return HVMCOPY_bad_gfn_to_mfn;
+
         if ( p2m_is_paging(p2mt) )
         {
-            if ( page )
-                put_page(page);
+            put_page(page);
             p2m_mem_paging_populate(curr->domain, gfn);
             return HVMCOPY_gfn_paged_out;
         }
         if ( p2m_is_shared(p2mt) )
         {
-            if ( page )
-                put_page(page);
+            put_page(page);
             return HVMCOPY_gfn_shared;
         }
         if ( p2m_is_grant(p2mt) )
         {
-            if ( page )
-                put_page(page);
+            put_page(page);
             return HVMCOPY_unhandleable;
         }
-        if ( !page )
-            return HVMCOPY_bad_gfn_to_mfn;
 
         p = (char *)__map_domain_page(page) + (addr & ~PAGE_MASK);
 
@@ -2597,27 +2595,25 @@ static enum hvm_copy_result __hvm_clear(paddr_t addr, int size)
 
         page = get_page_from_gfn(curr->domain, gfn, &p2mt, P2M_UNSHARE);
 
+        if ( !page )
+            return HVMCOPY_bad_gfn_to_mfn;
+
         if ( p2m_is_paging(p2mt) )
         {
-            if ( page )
-                put_page(page);
+            put_page(page);
             p2m_mem_paging_populate(curr->domain, gfn);
             return HVMCOPY_gfn_paged_out;
         }
         if ( p2m_is_shared(p2mt) )
         {
-            if ( page )
-                put_page(page);
+            put_page(page);
             return HVMCOPY_gfn_shared;
         }
         if ( p2m_is_grant(p2mt) )
         {
-            if ( page )
-                put_page(page);
+            put_page(page);
             return HVMCOPY_unhandleable;
         }
-        if ( !page )
-            return HVMCOPY_bad_gfn_to_mfn;
 
         p = (char *)__map_domain_page(page) + (addr & ~PAGE_MASK);
 
diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
index d5462f2..a6721c3 100644
--- a/xen/arch/x86/hvm/viridian.c
+++ b/xen/arch/x86/hvm/viridian.c
@@ -157,7 +157,7 @@ static void enable_hypercall_page(struct domain *d)
         if ( page )
             put_page(page);
         gdprintk(XENLOG_WARNING, "Bad GMFN %lx (MFN %lx)\n", gmfn,
-                 page_to_mfn(page));
+                 page ? page_to_mfn(page) : INVALID_MFN);
         return;
     }
 
@@ -202,7 +202,7 @@ static void initialize_apic_assist(struct vcpu *v)
         if ( page )
             put_page(page);
         gdprintk(XENLOG_WARNING, "Bad GMFN %lx (MFN %lx)\n", gmfn,
-                 page_to_mfn(page));
+                 page ? page_to_mfn(page) : INVALID_MFN);
         return;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:12:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:12: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 1VUPPX-0000EG-LU; Thu, 10 Oct 2013 23:12:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPW-0000Dx-5X
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:50 +0000
Received: from [85.158.143.35:28589] by server-2.bemta-4.messagelabs.com id
	81/A9-31802-07437525; Thu, 10 Oct 2013 23:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1381446767!1102092!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18959 invoked from network); 10 Oct 2013 23:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPS-000431-TU
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPS-0005kn-RV
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:46 +0000
Date: Thu, 10 Oct 2013 23:12:46 +0000
Message-Id: <E1VUPPS-0005kn-RV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] qemu-xen: Disabling build of
	guest-agent.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9786c7ffe8d6a0362afb629bde6b655274b134f8
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Tue Oct 8 13:59:56 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 09:31:51 2013 +0100

    qemu-xen: Disabling build of guest-agent.
    
    It is not use when QEMU is run with Xen.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 066df66..206b79a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -201,6 +201,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--datadir=$(SHAREDIR)/qemu-xen \
 		--disable-kvm \
 		--disable-docs \
+		--disable-guest-agent \
 		--python=$(PYTHON) \
 		$(IOEMU_CONFIGURE_CROSS); \
 	$(MAKE) all
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:12:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:12: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 1VUPPX-0000EG-LU; Thu, 10 Oct 2013 23:12:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPW-0000Dx-5X
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:50 +0000
Received: from [85.158.143.35:28589] by server-2.bemta-4.messagelabs.com id
	81/A9-31802-07437525; Thu, 10 Oct 2013 23:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1381446767!1102092!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18959 invoked from network); 10 Oct 2013 23:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPS-000431-TU
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPS-0005kn-RV
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:46 +0000
Date: Thu, 10 Oct 2013 23:12:46 +0000
Message-Id: <E1VUPPS-0005kn-RV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] qemu-xen: Disabling build of
	guest-agent.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9786c7ffe8d6a0362afb629bde6b655274b134f8
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Tue Oct 8 13:59:56 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 09:31:51 2013 +0100

    qemu-xen: Disabling build of guest-agent.
    
    It is not use when QEMU is run with Xen.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 066df66..206b79a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -201,6 +201,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--datadir=$(SHAREDIR)/qemu-xen \
 		--disable-kvm \
 		--disable-docs \
+		--disable-guest-agent \
 		--python=$(PYTHON) \
 		$(IOEMU_CONFIGURE_CROSS); \
 	$(MAKE) all
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:13:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:13: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 1VUPPg-0000GA-OZ; Thu, 10 Oct 2013 23:13: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 1VUPPf-0000Fz-M8
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:59 +0000
Received: from [193.109.254.147:55750] by server-8.bemta-14.messagelabs.com id
	4D/31-14324-A7437525; Thu, 10 Oct 2013 23:12:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1381446777!1412569!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1327 invoked from network); 10 Oct 2013 23:12:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:12:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPd-00043A-4Z
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPd-0005l9-1W
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:57 +0000
Date: Thu, 10 Oct 2013 23:12:57 +0000
Message-Id: <E1VUPPd-0005l9-1W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] qemu-xen: Set localstatedir to /var.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f2831c3a4ac803541eaf0a5992665c06ee852441
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Tue Oct 8 13:59:57 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 09:32:04 2013 +0100

    qemu-xen: Set localstatedir to /var.
    
    This path is used by the QEMU build system to create the /run directory.
    If local-state-dir is not set, the result become $prefix/var which
    is not an acceptable path.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 206b79a..b73f0a9 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -199,6 +199,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-L$(XEN_ROOT)/tools/xenstore" \
 		--bindir=$(LIBEXEC) \
 		--datadir=$(SHAREDIR)/qemu-xen \
+		--localstatedir=/var \
 		--disable-kvm \
 		--disable-docs \
 		--disable-guest-agent \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:13:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:13: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 1VUPPg-0000GA-OZ; Thu, 10 Oct 2013 23:13: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 1VUPPf-0000Fz-M8
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:59 +0000
Received: from [193.109.254.147:55750] by server-8.bemta-14.messagelabs.com id
	4D/31-14324-A7437525; Thu, 10 Oct 2013 23:12:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1381446777!1412569!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1327 invoked from network); 10 Oct 2013 23:12:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:12:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPd-00043A-4Z
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPd-0005l9-1W
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:12:57 +0000
Date: Thu, 10 Oct 2013 23:12:57 +0000
Message-Id: <E1VUPPd-0005l9-1W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] qemu-xen: Set localstatedir to /var.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f2831c3a4ac803541eaf0a5992665c06ee852441
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Tue Oct 8 13:59:57 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 09:32:04 2013 +0100

    qemu-xen: Set localstatedir to /var.
    
    This path is used by the QEMU build system to create the /run directory.
    If local-state-dir is not set, the result become $prefix/var which
    is not an acceptable path.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 206b79a..b73f0a9 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -199,6 +199,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-L$(XEN_ROOT)/tools/xenstore" \
 		--bindir=$(LIBEXEC) \
 		--datadir=$(SHAREDIR)/qemu-xen \
+		--localstatedir=/var \
 		--disable-kvm \
 		--disable-docs \
 		--disable-guest-agent \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:13:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:13: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 1VUPPr-0000Ij-Rg; Thu, 10 Oct 2013 23:13: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 1VUPPq-0000IF-00
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:10 +0000
Received: from [193.109.254.147:31515] by server-16.bemta-14.messagelabs.com
	id AF/AC-06264-58437525; Thu, 10 Oct 2013 23:13:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1381446787!1429547!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2037 invoked from network); 10 Oct 2013 23:13:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:13:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPn-00043j-Bk
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPn-0005m4-8Q
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:07 +0000
Date: Thu, 10 Oct 2013 23:13:07 +0000
Message-Id: <E1VUPPn-0005m4-8Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm32: Call start_xen only on the
	boot CPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e08085f0fbd35386eeecbec036114ce80406e90
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Oct 7 15:44:35 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:25:56 2013 +0100

    xen/arm32: Call start_xen only on the boot CPU
    
    The boot CPU can have a CPU ID non-equal to zero. Xen needs to check the
    logical CPU ID (in r12) to know if the CPU is the boot one.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/head.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 92b3c48..ce1d21a 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -403,7 +403,8 @@ launch:
         sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
         mov   r0, r10                /* Marshal args: - phys_offset */
         mov   r1, r8                 /*               - DTB address */
-        movs  r2, r7                 /*               - CPU ID */
+        mov   r2, r7                 /*               - CPU ID */
+        teq   r12, #0
         beq   start_xen              /* and disappear into the land of C */
         b     start_secondary        /* (to the appropriate entry point) */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:13:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:13: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 1VUPPr-0000Ij-Rg; Thu, 10 Oct 2013 23:13: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 1VUPPq-0000IF-00
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:10 +0000
Received: from [193.109.254.147:31515] by server-16.bemta-14.messagelabs.com
	id AF/AC-06264-58437525; Thu, 10 Oct 2013 23:13:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1381446787!1429547!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2037 invoked from network); 10 Oct 2013 23:13:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:13:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPn-00043j-Bk
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPn-0005m4-8Q
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:07 +0000
Date: Thu, 10 Oct 2013 23:13:07 +0000
Message-Id: <E1VUPPn-0005m4-8Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm32: Call start_xen only on the
	boot CPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e08085f0fbd35386eeecbec036114ce80406e90
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Oct 7 15:44:35 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:25:56 2013 +0100

    xen/arm32: Call start_xen only on the boot CPU
    
    The boot CPU can have a CPU ID non-equal to zero. Xen needs to check the
    logical CPU ID (in r12) to know if the CPU is the boot one.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/head.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 92b3c48..ce1d21a 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -403,7 +403,8 @@ launch:
         sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
         mov   r0, r10                /* Marshal args: - phys_offset */
         mov   r1, r8                 /*               - DTB address */
-        movs  r2, r7                 /*               - CPU ID */
+        mov   r2, r7                 /*               - CPU ID */
+        teq   r12, #0
         beq   start_xen              /* and disappear into the land of C */
         b     start_secondary        /* (to the appropriate entry point) */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:13:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:13:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUPQ0-0000Kf-Ud; Thu, 10 Oct 2013 23:13: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 1VUPPz-0000KL-WC
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:20 +0000
Received: from [85.158.143.35:5973] by server-3.bemta-4.messagelabs.com id
	A7/06-24907-F8437525; Thu, 10 Oct 2013 23:13:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1381446797!1093417!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13914 invoked from network); 10 Oct 2013 23:13:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:13:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPx-00043p-JJ
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPx-0005nB-Fq
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:17 +0000
Date: Thu, 10 Oct 2013 23:13:17 +0000
Message-Id: <E1VUPPx-0005nB-Fq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: adds tracer on qemu-xen debug
	configure options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a825dd6515aa8eab804789ad8bba39df9ca9be08
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Fri Sep 27 16:00:46 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:27:26 2013 +0100

    tools: adds tracer on qemu-xen debug configure options
    
    When building tools in debug mode (debug=y), pass also
    --enable-trace-backend=stderr when configuring qemu-xen.
    Useful to improve debug.
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 tools/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index b73f0a9..00c69ee 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -174,7 +174,7 @@ qemu-xen-dir-force-update:
 	fi
 
 ifeq ($(debug),y)
-QEMU_XEN_ENABLE_DEBUG := --enable-debug
+QEMU_XEN_ENABLE_DEBUG := --enable-debug --enable-trace-backend=stderr
 else
 QEMU_XEN_ENABLE_DEBUG :=
 endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:13:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:13:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUPQ0-0000Kf-Ud; Thu, 10 Oct 2013 23:13: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 1VUPPz-0000KL-WC
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:20 +0000
Received: from [85.158.143.35:5973] by server-3.bemta-4.messagelabs.com id
	A7/06-24907-F8437525; Thu, 10 Oct 2013 23:13:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1381446797!1093417!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13914 invoked from network); 10 Oct 2013 23:13:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:13:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPx-00043p-JJ
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPPx-0005nB-Fq
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:17 +0000
Date: Thu, 10 Oct 2013 23:13:17 +0000
Message-Id: <E1VUPPx-0005nB-Fq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: adds tracer on qemu-xen debug
	configure options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a825dd6515aa8eab804789ad8bba39df9ca9be08
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Fri Sep 27 16:00:46 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:27:26 2013 +0100

    tools: adds tracer on qemu-xen debug configure options
    
    When building tools in debug mode (debug=y), pass also
    --enable-trace-backend=stderr when configuring qemu-xen.
    Useful to improve debug.
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 tools/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index b73f0a9..00c69ee 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -174,7 +174,7 @@ qemu-xen-dir-force-update:
 	fi
 
 ifeq ($(debug),y)
-QEMU_XEN_ENABLE_DEBUG := --enable-debug
+QEMU_XEN_ENABLE_DEBUG := --enable-debug --enable-trace-backend=stderr
 else
 QEMU_XEN_ENABLE_DEBUG :=
 endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:13:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:13: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 1VUPQD-0000N3-3l; Thu, 10 Oct 2013 23:13:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQB-0000MZ-32
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:31 +0000
Received: from [193.109.254.147:36212] by server-14.bemta-14.messagelabs.com
	id 3F/29-07546-A9437525; Thu, 10 Oct 2013 23:13:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1381446808!1425600!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17322 invoked from network); 10 Oct 2013 23:13:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:13:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQ7-00043v-R2
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQ7-0005nX-Oh
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:27 +0000
Date: Thu, 10 Oct 2013 23:13:27 +0000
Message-Id: <E1VUPQ7-0005nX-Oh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/migrate: Fix regression when
	migrating from older version of Xen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7051d5c872e3e708b2d4b2088215d6ab1b33de1b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 10 12:23:10 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:28:21 2013 +0100

    tools/migrate: Fix regression when migrating from older version of Xen
    
    Commit 00a4b65f8534c9e6521eab2e6ce796ae36037774 Sep 7 2010
      "libxc: provide notification of final checkpoint to restore end"
    broke migration from any version of Xen using tools from prior to that commit
    
    Older tools have no idea about an XC_SAVE_ID_LAST_CHECKPOINT, causing newer
    tools xc_domain_restore() to start reading the qemu save record, as
    ctx->last_checkpoint is 0.
    
    The failure looks like:
      xc: error: Max batch size exceeded (1970103633). Giving up.
    where 1970103633 = 0x756d6551 = *(uint32_t*)"Qemu"
    
    With this fix in place, the behaviour for normal migrations is reverted to how
    it was before the regression; the migration is considered non-checkpointed
    right from the start.  A XC_SAVE_ID_LAST_CHECKPOINT chunk seen in the
    migration stream is a nop.  For checkpointed migrations the behaviour is
    unchanged.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> (Remus bits)
---
 tools/libxc/xc_domain_restore.c         |    3 +-
 tools/libxc/xc_nomigrate.c              |    2 +-
 tools/libxc/xenguest.h                  |    3 +-
 tools/libxl/libxl.h                     |   33 ++++++++++++++++++++++++++++++-
 tools/libxl/libxl_create.c              |   11 ++++++---
 tools/libxl/libxl_internal.h            |    1 +
 tools/libxl/libxl_save_callout.c        |    2 +-
 tools/libxl/libxl_save_helper.c         |    3 +-
 tools/libxl/libxl_types.idl             |    4 +++
 tools/libxl/xl_cmdimpl.c                |    5 ++++
 tools/python/xen/xend/XendCheckpoint.py |    2 +-
 tools/xcutils/xc_restore.c              |   14 ++++++++----
 12 files changed, 67 insertions(+), 16 deletions(-)

diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
index 939a76b..ecaf25d 100644
--- a/tools/libxc/xc_domain_restore.c
+++ b/tools/libxc/xc_domain_restore.c
@@ -1402,7 +1402,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       domid_t store_domid, unsigned int console_evtchn,
                       unsigned long *console_mfn, domid_t console_domid,
                       unsigned int hvm, unsigned int pae, int superpages,
-                      int no_incr_generationid,
+                      int no_incr_generationid, int checkpointed_stream,
                       unsigned long *vm_generationid_addr,
                       struct restore_callbacks *callbacks)
 {
@@ -1474,6 +1474,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
 
     ctx->superpages = superpages;
     ctx->hvm = hvm;
+    ctx->last_checkpoint = !checkpointed_stream;
 
     ctxt = xc_hypercall_buffer_alloc(xch, ctxt, sizeof(*ctxt));
 
diff --git a/tools/libxc/xc_nomigrate.c b/tools/libxc/xc_nomigrate.c
index 73e7566..fb6d53e 100644
--- a/tools/libxc/xc_nomigrate.c
+++ b/tools/libxc/xc_nomigrate.c
@@ -35,7 +35,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       domid_t store_domid, unsigned int console_evtchn,
                       unsigned long *console_mfn, domid_t console_domid,
                       unsigned int hvm, unsigned int pae, int superpages,
-                      int no_incr_generationid,
+                      int no_incr_generationid, int checkpointed_stream,
                       unsigned long *vm_generationid_addr,
                       struct restore_callbacks *callbacks)
 {
diff --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
index c12091f..a0e30e1 100644
--- a/tools/libxc/xenguest.h
+++ b/tools/libxc/xenguest.h
@@ -114,6 +114,7 @@ struct restore_callbacks {
  * @parm pae non-zero if this HVM domain has PAE support enabled
  * @parm superpages non-zero to allocate guest memory with superpages
  * @parm no_incr_generationid non-zero if generation id is NOT to be incremented
+ * @parm checkpointed_stream non-zero if the far end of the stream is using checkpointing
  * @parm vm_generationid_addr returned with the address of the generation id buffer
  * @parm callbacks non-NULL to receive a callback to restore toolstack
  *       specific data
@@ -124,7 +125,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       domid_t store_domid, unsigned int console_evtchn,
                       unsigned long *console_mfn, domid_t console_domid,
                       unsigned int hvm, unsigned int pae, int superpages,
-                      int no_incr_generationid,
+                      int no_incr_generationid, int checkpointed_stream,
                       unsigned long *vm_generationid_addr,
                       struct restore_callbacks *callbacks);
 /**
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 4cab294..c9d9535 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -283,7 +283,8 @@
 
 /* API compatibility. */
 #ifdef LIBXL_API_VERSION
-#if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300
+#if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300 && \
+    LIBXL_API_VERSION != 0x040400
 #error Unknown LIBXL_API_VERSION
 #endif
 #endif
@@ -355,6 +356,14 @@
  */
 #define LIBXL_HAVE_SPICE_VDAGENT 1
 
+/*
+ * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
+ *
+ * If this is defined, libxl_domain_create_restore()'s API has changed to
+ * include a params structure.
+ */
+#define LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
@@ -578,9 +587,31 @@ int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config,
                             LIBXL_EXTERNAL_CALLERS_ONLY;
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config,
                                 uint32_t *domid, int restore_fd,
+                                const libxl_domain_restore_params *params,
                                 const libxl_asyncop_how *ao_how,
                                 const libxl_asyncprogress_how *aop_console_how)
                                 LIBXL_EXTERNAL_CALLERS_ONLY;
+
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040400
+
+int static inline libxl_domain_create_restore_0x040200(
+    libxl_ctx *ctx, libxl_domain_config *d_config,
+    uint32_t *domid, int restore_fd,
+    const libxl_asyncop_how *ao_how,
+    const libxl_asyncprogress_how *aop_console_how)
+    LIBXL_EXTERNAL_CALLERS_ONLY
+{
+    libxl_domain_restore_params params;
+    params.checkpointed_stream = 0;
+
+    return libxl_domain_create_restore(
+        ctx, d_config, domid, restore_fd, &params, ao_how, aop_console_how);
+}
+
+#define libxl_domain_create_restore libxl_domain_create_restore_0x040200
+
+#endif
+
   /* A progress report will be made via ao_console_how, of type
    * domain_create_console_available, when the domain's primary
    * console is available and can be connected to.
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 7567238..c5ec577 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1227,7 +1227,8 @@ static void domain_create_cb(libxl__egc *egc,
 
 static int do_domain_create(libxl_ctx *ctx, libxl_domain_config *d_config,
                             uint32_t *domid,
-                            int restore_fd, const libxl_asyncop_how *ao_how,
+                            int restore_fd, int checkpointed_stream,
+                            const libxl_asyncop_how *ao_how,
                             const libxl_asyncprogress_how *aop_console_how)
 {
     AO_CREATE(ctx, 0, ao_how);
@@ -1238,6 +1239,7 @@ static int do_domain_create(libxl_ctx *ctx, libxl_domain_config *d_config,
     cdcs->dcs.guest_config = d_config;
     cdcs->dcs.restore_fd = restore_fd;
     cdcs->dcs.callback = domain_create_cb;
+    cdcs->dcs.checkpointed_stream = checkpointed_stream;
     libxl__ao_progress_gethow(&cdcs->dcs.aop_console_how, aop_console_how);
     cdcs->domid_out = domid;
 
@@ -1264,17 +1266,18 @@ int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config,
                             const libxl_asyncop_how *ao_how,
                             const libxl_asyncprogress_how *aop_console_how)
 {
-    return do_domain_create(ctx, d_config, domid, -1,
+    return do_domain_create(ctx, d_config, domid, -1, 0,
                             ao_how, aop_console_how);
 }
 
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config,
                                 uint32_t *domid, int restore_fd,
+                                const libxl_domain_restore_params *params,
                                 const libxl_asyncop_how *ao_how,
-                            const libxl_asyncprogress_how *aop_console_how)
+                                const libxl_asyncprogress_how *aop_console_how)
 {
     return do_domain_create(ctx, d_config, domid, restore_fd,
-                            ao_how, aop_console_how);
+                            params->checkpointed_stream, ao_how, aop_console_how);
 }
 
 /*
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index f051d91..4e15055 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2514,6 +2514,7 @@ struct libxl__domain_create_state {
     libxl_asyncprogress_how aop_console_how;
     /* private to domain_create */
     int guest_domid;
+    int checkpointed_stream;
     libxl__domain_build_state build_state;
     libxl__bootloader_state bl;
     libxl__stub_dm_spawn_state dmss;
diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c
index f164e98..6e45b2f 100644
--- a/tools/libxl/libxl_save_callout.c
+++ b/tools/libxl/libxl_save_callout.c
@@ -60,7 +60,7 @@ void libxl__xc_domain_restore(libxl__egc *egc, libxl__domain_create_state *dcs,
         state->store_domid, state->console_port,
         state->console_domid,
         hvm, pae, superpages, no_incr_generationid,
-        cbflags,
+        cbflags, dcs->checkpointed_stream,
     };
 
     dcs->shs.ao = ao;
diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c
index 772251a..880565e 100644
--- a/tools/libxl/libxl_save_helper.c
+++ b/tools/libxl/libxl_save_helper.c
@@ -252,6 +252,7 @@ int main(int argc, char **argv)
         int superpages =           strtoul(NEXTARG,0,10);
         int no_incr_genidad =      strtoul(NEXTARG,0,10);
         unsigned cbflags =         strtoul(NEXTARG,0,10);
+        int checkpointed =         strtoul(NEXTARG,0,10);
         assert(!*++argv);
 
         helper_setcallbacks_restore(&helper_restore_callbacks, cbflags);
@@ -264,7 +265,7 @@ int main(int argc, char **argv)
         r = xc_domain_restore(xch, io_fd, dom, store_evtchn, &store_mfn,
                               store_domid, console_evtchn, &console_mfn,
                               console_domid, hvm, pae, superpages,
-                              no_incr_genidad, &genidad,
+                              no_incr_genidad, checkpointed, &genidad,
                               &helper_restore_callbacks);
         helper_stub_restore_results(store_mfn,console_mfn,genidad,0);
         complete(r);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 049dbb5..b5d0b70 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -259,6 +259,10 @@ libxl_domain_create_info = Struct("domain_create_info",[
     ("run_hotplug_scripts",libxl_defbool),
     ], dir=DIR_IN)
 
+libxl_domain_restore_params = Struct("domain_restore_params", [
+    ("checkpointed_stream", integer),
+    ])
+
 MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
 
 libxl_domain_sched_params = Struct("domain_sched_params",[
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index a91b427..cb0bf72 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -132,6 +132,7 @@ struct domain_create {
     int vnc;
     int vncautopass;
     int console_autoconnect;
+    int checkpointed_stream;
     const char *config_file;
     const char *extra_config; /* extra config string */
     const char *restore_file;
@@ -2064,8 +2065,11 @@ start:
     }
 
     if ( restoring ) {
+        libxl_domain_restore_params params;
+        params.checkpointed_stream = dom_info->checkpointed_stream;
         ret = libxl_domain_create_restore(ctx, &d_config,
                                           &domid, restore_fd,
+                                          &params,
                                           0, autoconnect_console_how);
         /*
          * On subsequent reboot etc we should create the domain, not
@@ -3679,6 +3683,7 @@ static void migrate_receive(int debug, int daemonize, int monitor,
     dom_info.paused = 1;
     dom_info.migrate_fd = recv_fd;
     dom_info.migration_domname_r = &migration_domname;
+    dom_info.checkpointed_stream = remus;
 
     rc = create_domain(&dom_info);
     if (rc < 0) {
diff --git a/tools/python/xen/xend/XendCheckpoint.py b/tools/python/xen/xend/XendCheckpoint.py
index fa09757..a433ffa 100644
--- a/tools/python/xen/xend/XendCheckpoint.py
+++ b/tools/python/xen/xend/XendCheckpoint.py
@@ -301,7 +301,7 @@ def restore(xd, fd, dominfo = None, paused = False, relocating = False):
 
         cmd = map(str, [xen.util.auxbin.pathTo(XC_RESTORE),
                         fd, dominfo.getDomid(),
-                        store_port, console_port, int(is_hvm), pae, apic, superpages])
+                        store_port, console_port, int(is_hvm), pae, apic, superpages, 1])
         log.debug("[xc_restore]: %s", string.join(cmd))
 
         handler = RestoreInputHandler()
diff --git a/tools/xcutils/xc_restore.c b/tools/xcutils/xc_restore.c
index 35d725c..5ec90ac 100644
--- a/tools/xcutils/xc_restore.c
+++ b/tools/xcutils/xc_restore.c
@@ -19,7 +19,7 @@ int
 main(int argc, char **argv)
 {
     unsigned int domid, store_evtchn, console_evtchn;
-    unsigned int hvm, pae, apic, lflags;
+    unsigned int hvm, pae, apic, lflags, checkpointed;
     xc_interface *xch;
     int io_fd, ret;
     int superpages;
@@ -27,9 +27,9 @@ main(int argc, char **argv)
     xentoollog_level lvl;
     xentoollog_logger *l;
 
-    if ( (argc != 8) && (argc != 9) )
+    if ( !( argc >= 8 && argc <= 10) )
         errx(1, "usage: %s iofd domid store_evtchn "
-             "console_evtchn hvm pae apic [superpages]", argv[0]);
+             "console_evtchn hvm pae apic [superpages [checkpointed]]", argv[0]);
 
     lvl = XTL_DETAIL;
     lflags = XTL_STDIOSTREAM_SHOW_PID | XTL_STDIOSTREAM_HIDE_PROGRESS;
@@ -45,14 +45,18 @@ main(int argc, char **argv)
     hvm  = atoi(argv[5]);
     pae  = atoi(argv[6]);
     apic = atoi(argv[7]);
-    if ( argc == 9 )
+    if ( argc >= 9 )
 	    superpages = atoi(argv[8]);
     else
 	    superpages = !!hvm;
+    if ( argc >= 10 )
+        checkpointed = atoi(argv[9]);
+    else
+        checkpointed = 0;
 
     ret = xc_domain_restore(xch, io_fd, domid, store_evtchn, &store_mfn, 0,
                             console_evtchn, &console_mfn, 0, hvm, pae, superpages,
-                            0, NULL, NULL);
+                            0, checkpointed, NULL, NULL);
 
     if ( ret == 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 Oct 10 23:13:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:13: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 1VUPQD-0000N3-3l; Thu, 10 Oct 2013 23:13:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQB-0000MZ-32
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:31 +0000
Received: from [193.109.254.147:36212] by server-14.bemta-14.messagelabs.com
	id 3F/29-07546-A9437525; Thu, 10 Oct 2013 23:13:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1381446808!1425600!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17322 invoked from network); 10 Oct 2013 23:13:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:13:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQ7-00043v-R2
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQ7-0005nX-Oh
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:27 +0000
Date: Thu, 10 Oct 2013 23:13:27 +0000
Message-Id: <E1VUPQ7-0005nX-Oh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/migrate: Fix regression when
	migrating from older version of Xen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7051d5c872e3e708b2d4b2088215d6ab1b33de1b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 10 12:23:10 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:28:21 2013 +0100

    tools/migrate: Fix regression when migrating from older version of Xen
    
    Commit 00a4b65f8534c9e6521eab2e6ce796ae36037774 Sep 7 2010
      "libxc: provide notification of final checkpoint to restore end"
    broke migration from any version of Xen using tools from prior to that commit
    
    Older tools have no idea about an XC_SAVE_ID_LAST_CHECKPOINT, causing newer
    tools xc_domain_restore() to start reading the qemu save record, as
    ctx->last_checkpoint is 0.
    
    The failure looks like:
      xc: error: Max batch size exceeded (1970103633). Giving up.
    where 1970103633 = 0x756d6551 = *(uint32_t*)"Qemu"
    
    With this fix in place, the behaviour for normal migrations is reverted to how
    it was before the regression; the migration is considered non-checkpointed
    right from the start.  A XC_SAVE_ID_LAST_CHECKPOINT chunk seen in the
    migration stream is a nop.  For checkpointed migrations the behaviour is
    unchanged.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> (Remus bits)
---
 tools/libxc/xc_domain_restore.c         |    3 +-
 tools/libxc/xc_nomigrate.c              |    2 +-
 tools/libxc/xenguest.h                  |    3 +-
 tools/libxl/libxl.h                     |   33 ++++++++++++++++++++++++++++++-
 tools/libxl/libxl_create.c              |   11 ++++++---
 tools/libxl/libxl_internal.h            |    1 +
 tools/libxl/libxl_save_callout.c        |    2 +-
 tools/libxl/libxl_save_helper.c         |    3 +-
 tools/libxl/libxl_types.idl             |    4 +++
 tools/libxl/xl_cmdimpl.c                |    5 ++++
 tools/python/xen/xend/XendCheckpoint.py |    2 +-
 tools/xcutils/xc_restore.c              |   14 ++++++++----
 12 files changed, 67 insertions(+), 16 deletions(-)

diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
index 939a76b..ecaf25d 100644
--- a/tools/libxc/xc_domain_restore.c
+++ b/tools/libxc/xc_domain_restore.c
@@ -1402,7 +1402,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       domid_t store_domid, unsigned int console_evtchn,
                       unsigned long *console_mfn, domid_t console_domid,
                       unsigned int hvm, unsigned int pae, int superpages,
-                      int no_incr_generationid,
+                      int no_incr_generationid, int checkpointed_stream,
                       unsigned long *vm_generationid_addr,
                       struct restore_callbacks *callbacks)
 {
@@ -1474,6 +1474,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
 
     ctx->superpages = superpages;
     ctx->hvm = hvm;
+    ctx->last_checkpoint = !checkpointed_stream;
 
     ctxt = xc_hypercall_buffer_alloc(xch, ctxt, sizeof(*ctxt));
 
diff --git a/tools/libxc/xc_nomigrate.c b/tools/libxc/xc_nomigrate.c
index 73e7566..fb6d53e 100644
--- a/tools/libxc/xc_nomigrate.c
+++ b/tools/libxc/xc_nomigrate.c
@@ -35,7 +35,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       domid_t store_domid, unsigned int console_evtchn,
                       unsigned long *console_mfn, domid_t console_domid,
                       unsigned int hvm, unsigned int pae, int superpages,
-                      int no_incr_generationid,
+                      int no_incr_generationid, int checkpointed_stream,
                       unsigned long *vm_generationid_addr,
                       struct restore_callbacks *callbacks)
 {
diff --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
index c12091f..a0e30e1 100644
--- a/tools/libxc/xenguest.h
+++ b/tools/libxc/xenguest.h
@@ -114,6 +114,7 @@ struct restore_callbacks {
  * @parm pae non-zero if this HVM domain has PAE support enabled
  * @parm superpages non-zero to allocate guest memory with superpages
  * @parm no_incr_generationid non-zero if generation id is NOT to be incremented
+ * @parm checkpointed_stream non-zero if the far end of the stream is using checkpointing
  * @parm vm_generationid_addr returned with the address of the generation id buffer
  * @parm callbacks non-NULL to receive a callback to restore toolstack
  *       specific data
@@ -124,7 +125,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       domid_t store_domid, unsigned int console_evtchn,
                       unsigned long *console_mfn, domid_t console_domid,
                       unsigned int hvm, unsigned int pae, int superpages,
-                      int no_incr_generationid,
+                      int no_incr_generationid, int checkpointed_stream,
                       unsigned long *vm_generationid_addr,
                       struct restore_callbacks *callbacks);
 /**
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 4cab294..c9d9535 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -283,7 +283,8 @@
 
 /* API compatibility. */
 #ifdef LIBXL_API_VERSION
-#if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300
+#if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300 && \
+    LIBXL_API_VERSION != 0x040400
 #error Unknown LIBXL_API_VERSION
 #endif
 #endif
@@ -355,6 +356,14 @@
  */
 #define LIBXL_HAVE_SPICE_VDAGENT 1
 
+/*
+ * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
+ *
+ * If this is defined, libxl_domain_create_restore()'s API has changed to
+ * include a params structure.
+ */
+#define LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
@@ -578,9 +587,31 @@ int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config,
                             LIBXL_EXTERNAL_CALLERS_ONLY;
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config,
                                 uint32_t *domid, int restore_fd,
+                                const libxl_domain_restore_params *params,
                                 const libxl_asyncop_how *ao_how,
                                 const libxl_asyncprogress_how *aop_console_how)
                                 LIBXL_EXTERNAL_CALLERS_ONLY;
+
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040400
+
+int static inline libxl_domain_create_restore_0x040200(
+    libxl_ctx *ctx, libxl_domain_config *d_config,
+    uint32_t *domid, int restore_fd,
+    const libxl_asyncop_how *ao_how,
+    const libxl_asyncprogress_how *aop_console_how)
+    LIBXL_EXTERNAL_CALLERS_ONLY
+{
+    libxl_domain_restore_params params;
+    params.checkpointed_stream = 0;
+
+    return libxl_domain_create_restore(
+        ctx, d_config, domid, restore_fd, &params, ao_how, aop_console_how);
+}
+
+#define libxl_domain_create_restore libxl_domain_create_restore_0x040200
+
+#endif
+
   /* A progress report will be made via ao_console_how, of type
    * domain_create_console_available, when the domain's primary
    * console is available and can be connected to.
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 7567238..c5ec577 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -1227,7 +1227,8 @@ static void domain_create_cb(libxl__egc *egc,
 
 static int do_domain_create(libxl_ctx *ctx, libxl_domain_config *d_config,
                             uint32_t *domid,
-                            int restore_fd, const libxl_asyncop_how *ao_how,
+                            int restore_fd, int checkpointed_stream,
+                            const libxl_asyncop_how *ao_how,
                             const libxl_asyncprogress_how *aop_console_how)
 {
     AO_CREATE(ctx, 0, ao_how);
@@ -1238,6 +1239,7 @@ static int do_domain_create(libxl_ctx *ctx, libxl_domain_config *d_config,
     cdcs->dcs.guest_config = d_config;
     cdcs->dcs.restore_fd = restore_fd;
     cdcs->dcs.callback = domain_create_cb;
+    cdcs->dcs.checkpointed_stream = checkpointed_stream;
     libxl__ao_progress_gethow(&cdcs->dcs.aop_console_how, aop_console_how);
     cdcs->domid_out = domid;
 
@@ -1264,17 +1266,18 @@ int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config,
                             const libxl_asyncop_how *ao_how,
                             const libxl_asyncprogress_how *aop_console_how)
 {
-    return do_domain_create(ctx, d_config, domid, -1,
+    return do_domain_create(ctx, d_config, domid, -1, 0,
                             ao_how, aop_console_how);
 }
 
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config,
                                 uint32_t *domid, int restore_fd,
+                                const libxl_domain_restore_params *params,
                                 const libxl_asyncop_how *ao_how,
-                            const libxl_asyncprogress_how *aop_console_how)
+                                const libxl_asyncprogress_how *aop_console_how)
 {
     return do_domain_create(ctx, d_config, domid, restore_fd,
-                            ao_how, aop_console_how);
+                            params->checkpointed_stream, ao_how, aop_console_how);
 }
 
 /*
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index f051d91..4e15055 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2514,6 +2514,7 @@ struct libxl__domain_create_state {
     libxl_asyncprogress_how aop_console_how;
     /* private to domain_create */
     int guest_domid;
+    int checkpointed_stream;
     libxl__domain_build_state build_state;
     libxl__bootloader_state bl;
     libxl__stub_dm_spawn_state dmss;
diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c
index f164e98..6e45b2f 100644
--- a/tools/libxl/libxl_save_callout.c
+++ b/tools/libxl/libxl_save_callout.c
@@ -60,7 +60,7 @@ void libxl__xc_domain_restore(libxl__egc *egc, libxl__domain_create_state *dcs,
         state->store_domid, state->console_port,
         state->console_domid,
         hvm, pae, superpages, no_incr_generationid,
-        cbflags,
+        cbflags, dcs->checkpointed_stream,
     };
 
     dcs->shs.ao = ao;
diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c
index 772251a..880565e 100644
--- a/tools/libxl/libxl_save_helper.c
+++ b/tools/libxl/libxl_save_helper.c
@@ -252,6 +252,7 @@ int main(int argc, char **argv)
         int superpages =           strtoul(NEXTARG,0,10);
         int no_incr_genidad =      strtoul(NEXTARG,0,10);
         unsigned cbflags =         strtoul(NEXTARG,0,10);
+        int checkpointed =         strtoul(NEXTARG,0,10);
         assert(!*++argv);
 
         helper_setcallbacks_restore(&helper_restore_callbacks, cbflags);
@@ -264,7 +265,7 @@ int main(int argc, char **argv)
         r = xc_domain_restore(xch, io_fd, dom, store_evtchn, &store_mfn,
                               store_domid, console_evtchn, &console_mfn,
                               console_domid, hvm, pae, superpages,
-                              no_incr_genidad, &genidad,
+                              no_incr_genidad, checkpointed, &genidad,
                               &helper_restore_callbacks);
         helper_stub_restore_results(store_mfn,console_mfn,genidad,0);
         complete(r);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 049dbb5..b5d0b70 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -259,6 +259,10 @@ libxl_domain_create_info = Struct("domain_create_info",[
     ("run_hotplug_scripts",libxl_defbool),
     ], dir=DIR_IN)
 
+libxl_domain_restore_params = Struct("domain_restore_params", [
+    ("checkpointed_stream", integer),
+    ])
+
 MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
 
 libxl_domain_sched_params = Struct("domain_sched_params",[
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index a91b427..cb0bf72 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -132,6 +132,7 @@ struct domain_create {
     int vnc;
     int vncautopass;
     int console_autoconnect;
+    int checkpointed_stream;
     const char *config_file;
     const char *extra_config; /* extra config string */
     const char *restore_file;
@@ -2064,8 +2065,11 @@ start:
     }
 
     if ( restoring ) {
+        libxl_domain_restore_params params;
+        params.checkpointed_stream = dom_info->checkpointed_stream;
         ret = libxl_domain_create_restore(ctx, &d_config,
                                           &domid, restore_fd,
+                                          &params,
                                           0, autoconnect_console_how);
         /*
          * On subsequent reboot etc we should create the domain, not
@@ -3679,6 +3683,7 @@ static void migrate_receive(int debug, int daemonize, int monitor,
     dom_info.paused = 1;
     dom_info.migrate_fd = recv_fd;
     dom_info.migration_domname_r = &migration_domname;
+    dom_info.checkpointed_stream = remus;
 
     rc = create_domain(&dom_info);
     if (rc < 0) {
diff --git a/tools/python/xen/xend/XendCheckpoint.py b/tools/python/xen/xend/XendCheckpoint.py
index fa09757..a433ffa 100644
--- a/tools/python/xen/xend/XendCheckpoint.py
+++ b/tools/python/xen/xend/XendCheckpoint.py
@@ -301,7 +301,7 @@ def restore(xd, fd, dominfo = None, paused = False, relocating = False):
 
         cmd = map(str, [xen.util.auxbin.pathTo(XC_RESTORE),
                         fd, dominfo.getDomid(),
-                        store_port, console_port, int(is_hvm), pae, apic, superpages])
+                        store_port, console_port, int(is_hvm), pae, apic, superpages, 1])
         log.debug("[xc_restore]: %s", string.join(cmd))
 
         handler = RestoreInputHandler()
diff --git a/tools/xcutils/xc_restore.c b/tools/xcutils/xc_restore.c
index 35d725c..5ec90ac 100644
--- a/tools/xcutils/xc_restore.c
+++ b/tools/xcutils/xc_restore.c
@@ -19,7 +19,7 @@ int
 main(int argc, char **argv)
 {
     unsigned int domid, store_evtchn, console_evtchn;
-    unsigned int hvm, pae, apic, lflags;
+    unsigned int hvm, pae, apic, lflags, checkpointed;
     xc_interface *xch;
     int io_fd, ret;
     int superpages;
@@ -27,9 +27,9 @@ main(int argc, char **argv)
     xentoollog_level lvl;
     xentoollog_logger *l;
 
-    if ( (argc != 8) && (argc != 9) )
+    if ( !( argc >= 8 && argc <= 10) )
         errx(1, "usage: %s iofd domid store_evtchn "
-             "console_evtchn hvm pae apic [superpages]", argv[0]);
+             "console_evtchn hvm pae apic [superpages [checkpointed]]", argv[0]);
 
     lvl = XTL_DETAIL;
     lflags = XTL_STDIOSTREAM_SHOW_PID | XTL_STDIOSTREAM_HIDE_PROGRESS;
@@ -45,14 +45,18 @@ main(int argc, char **argv)
     hvm  = atoi(argv[5]);
     pae  = atoi(argv[6]);
     apic = atoi(argv[7]);
-    if ( argc == 9 )
+    if ( argc >= 9 )
 	    superpages = atoi(argv[8]);
     else
 	    superpages = !!hvm;
+    if ( argc >= 10 )
+        checkpointed = atoi(argv[9]);
+    else
+        checkpointed = 0;
 
     ret = xc_domain_restore(xch, io_fd, domid, store_evtchn, &store_mfn, 0,
                             console_evtchn, &console_mfn, 0, hvm, pae, superpages,
-                            0, NULL, NULL);
+                            0, checkpointed, NULL, NULL);
 
     if ( ret == 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 Oct 10 23:13:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23: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 1VUPQM-0000PE-6z; Thu, 10 Oct 2013 23:13: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 1VUPQK-0000Oo-KO
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:40 +0000
Received: from [193.109.254.147:57195] by server-14.bemta-14.messagelabs.com
	id 69/39-07546-3A437525; Thu, 10 Oct 2013 23:13:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1381446818!1419859!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7328 invoked from network); 10 Oct 2013 23:13:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:13:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQI-000441-08
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQH-0005ny-Uf
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:37 +0000
Date: Thu, 10 Oct 2013 23:13:37 +0000
Message-Id: <E1VUPQH-0005ny-Uf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: update the manpage about "cpus="
	and NUMA node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e174e07bb45346385f3eed89deebce25f42f450e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Thu Oct 3 19:45:38 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:28:56 2013 +0100

    xl: update the manpage about "cpus=" and NUMA node-affinity
    
    Since d06b1bf169a01a9c7b0947d7825e58cb455a0ba5 ('libxl: automatic placement
    deals with node-affinity') it is no longer true that, if no "cpus=" option
    is specified, xl picks up some pCPUs by default and pin the domain there.
    
    In fact, it is the NUMA node-affinity that is affected by automatic
    placement, not vCPU to pCPU pinning.
    
    Update the xl config file documenation accordingly, as it seems to have
    been forgotten at that time.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5 |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index d57cd4d..cd96969 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -104,8 +104,8 @@ created online and the remainder will be offline.
 
 =item B<cpus="CPU-LIST">
 
-List of which cpus the guest is allowed to use. By default xl will pick
-some cpus on its own (see below). A C<CPU-LIST> may be specified as follows:
+List of which cpus the guest is allowed to use. Default is no pinning at
+all (more on this below). A C<CPU-LIST> may be specified as follows:
 
 =over 4
 
@@ -125,11 +125,19 @@ run on cpu #3 of the host.
 
 =back
 
-If this option is not specified, libxl automatically tries to place the new
-domain on the host's NUMA nodes (provided the host has more than one NUMA
-node) by pinning it to the cpus of those nodes. A heuristic approach is
-utilized with the goals of maximizing performance for the domain and, at
-the same time, achieving efficient utilization of the host's CPUs and RAM.
+If this option is not specified, no vcpu to cpu pinning is established,
+and the vcpus of the guest can run on all the cpus of the host.
+
+If we are on a NUMA machine (i.e., if the host has more than one NUMA
+node) and this option is not specified, libxl automatically tries to
+place the guest on the least possible number of nodes. That, however,
+will not affect vcpu pinning, so the guest will still be able to run on
+all the cpus, it will just prefer the ones from the node it has been
+placed on. A heuristic approach is used for choosing the best node (or
+set of nodes), with the goals of maximizing performance for the guest
+and, at the same time, achieving efficient utilization of host cpus
+and memory. See F<docs/misc/xl-numa-placement.markdown> for more
+details.
 
 =back
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:13:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23: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 1VUPQM-0000PE-6z; Thu, 10 Oct 2013 23:13: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 1VUPQK-0000Oo-KO
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:40 +0000
Received: from [193.109.254.147:57195] by server-14.bemta-14.messagelabs.com
	id 69/39-07546-3A437525; Thu, 10 Oct 2013 23:13:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1381446818!1419859!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7328 invoked from network); 10 Oct 2013 23:13:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:13:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQI-000441-08
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQH-0005ny-Uf
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:37 +0000
Date: Thu, 10 Oct 2013 23:13:37 +0000
Message-Id: <E1VUPQH-0005ny-Uf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: update the manpage about "cpus="
	and NUMA node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e174e07bb45346385f3eed89deebce25f42f450e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Thu Oct 3 19:45:38 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:28:56 2013 +0100

    xl: update the manpage about "cpus=" and NUMA node-affinity
    
    Since d06b1bf169a01a9c7b0947d7825e58cb455a0ba5 ('libxl: automatic placement
    deals with node-affinity') it is no longer true that, if no "cpus=" option
    is specified, xl picks up some pCPUs by default and pin the domain there.
    
    In fact, it is the NUMA node-affinity that is affected by automatic
    placement, not vCPU to pCPU pinning.
    
    Update the xl config file documenation accordingly, as it seems to have
    been forgotten at that time.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5 |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index d57cd4d..cd96969 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -104,8 +104,8 @@ created online and the remainder will be offline.
 
 =item B<cpus="CPU-LIST">
 
-List of which cpus the guest is allowed to use. By default xl will pick
-some cpus on its own (see below). A C<CPU-LIST> may be specified as follows:
+List of which cpus the guest is allowed to use. Default is no pinning at
+all (more on this below). A C<CPU-LIST> may be specified as follows:
 
 =over 4
 
@@ -125,11 +125,19 @@ run on cpu #3 of the host.
 
 =back
 
-If this option is not specified, libxl automatically tries to place the new
-domain on the host's NUMA nodes (provided the host has more than one NUMA
-node) by pinning it to the cpus of those nodes. A heuristic approach is
-utilized with the goals of maximizing performance for the domain and, at
-the same time, achieving efficient utilization of the host's CPUs and RAM.
+If this option is not specified, no vcpu to cpu pinning is established,
+and the vcpus of the guest can run on all the cpus of the host.
+
+If we are on a NUMA machine (i.e., if the host has more than one NUMA
+node) and this option is not specified, libxl automatically tries to
+place the guest on the least possible number of nodes. That, however,
+will not affect vcpu pinning, so the guest will still be able to run on
+all the cpus, it will just prefer the ones from the node it has been
+placed on. A heuristic approach is used for choosing the best node (or
+set of nodes), with the goals of maximizing performance for the guest
+and, at the same time, achieving efficient utilization of host cpus
+and memory. See F<docs/misc/xl-numa-placement.markdown> for more
+details.
 
 =back
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:13:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:13: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 1VUPQX-0000RI-AA; Thu, 10 Oct 2013 23:13:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQV-0000R0-8J
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:51 +0000
Received: from [85.158.137.68:38322] by server-11.bemta-3.messagelabs.com id
	B8/E5-16607-EA437525; Thu, 10 Oct 2013 23:13:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1381446828!736733!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23219 invoked from network); 10 Oct 2013 23:13:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:13:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQS-000449-68
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQS-0005oj-4y
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:48 +0000
Date: Thu, 10 Oct 2013 23:13:48 +0000
Message-Id: <E1VUPQS-0005oj-4y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: fix a typo in main_vcpulist()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 54a3ea3ab405faf8c3a81e88db21909e8bdfdef3
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Thu Oct 3 19:45:47 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:29:09 2013 +0100

    xl: fix a typo in main_vcpulist()
    
    which was preventing `xl vcpu-list -h' to work.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index cb0bf72..14bb385 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4501,7 +4501,7 @@ int main_vcpulist(int argc, char **argv)
 {
     int opt;
 
-    SWITCH_FOREACH_OPT(opt, "", NULL, "cpu-list", 0) {
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vcpu-list", 0) {
         /* No options */
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:13:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:13: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 1VUPQX-0000RI-AA; Thu, 10 Oct 2013 23:13:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQV-0000R0-8J
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:51 +0000
Received: from [85.158.137.68:38322] by server-11.bemta-3.messagelabs.com id
	B8/E5-16607-EA437525; Thu, 10 Oct 2013 23:13:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1381446828!736733!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23219 invoked from network); 10 Oct 2013 23:13:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:13:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQS-000449-68
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQS-0005oj-4y
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:48 +0000
Date: Thu, 10 Oct 2013 23:13:48 +0000
Message-Id: <E1VUPQS-0005oj-4y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: fix a typo in main_vcpulist()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 54a3ea3ab405faf8c3a81e88db21909e8bdfdef3
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Thu Oct 3 19:45:47 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:29:09 2013 +0100

    xl: fix a typo in main_vcpulist()
    
    which was preventing `xl vcpu-list -h' to work.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index cb0bf72..14bb385 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4501,7 +4501,7 @@ int main_vcpulist(int argc, char **argv)
 {
     int opt;
 
-    SWITCH_FOREACH_OPT(opt, "", NULL, "cpu-list", 0) {
+    SWITCH_FOREACH_OPT(opt, "", NULL, "vcpu-list", 0) {
         /* No options */
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:14:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:14: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 1VUPQh-0000TT-D7; Thu, 10 Oct 2013 23:14: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 1VUPQf-0000T8-86
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:01 +0000
Received: from [85.158.139.211:41231] by server-10.bemta-5.messagelabs.com id
	B3/B7-23973-8B437525; Thu, 10 Oct 2013 23:14:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1381446838!705922!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21030 invoked from network); 10 Oct 2013 23:13:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:13:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQc-00044I-At
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQc-0005pb-9p
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:58 +0000
Date: Thu, 10 Oct 2013 23:13:58 +0000
Message-Id: <E1VUPQc-0005pb-9p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: introduce libxl_node_to_cpumap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1dc5178097e62fc7137cf17cd16628675f0b5ee1
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Thu Oct 3 19:46:02 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:29:39 2013 +0100

    libxl: introduce libxl_node_to_cpumap
    
    As an helper for the special case (of libxl_nodemap_to_cpumap) when
    one wants the cpumap for just one node.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_utils.c |   22 ++++++++++++++++++++++
 tools/libxl/libxl_utils.h |    3 +++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 244725b..1bcac7e 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -668,6 +668,28 @@ int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
     return rc;
 }
 
+int libxl_node_to_cpumap(libxl_ctx *ctx, int node,
+                         libxl_bitmap *cpumap)
+{
+    libxl_bitmap nodemap;
+    int rc = 0;
+
+    libxl_bitmap_init(&nodemap);
+
+    rc = libxl_node_bitmap_alloc(ctx, &nodemap, 0);
+    if (rc)
+        goto out;
+
+    libxl_bitmap_set_none(&nodemap);
+    libxl_bitmap_set(&nodemap, node);
+
+    rc = libxl_nodemap_to_cpumap(ctx, &nodemap, cpumap);
+
+ out:
+    libxl_bitmap_dispose(&nodemap);
+    return rc;
+}
+
 int libxl_cpumap_to_nodemap(libxl_ctx *ctx,
                             const libxl_bitmap *cpumap,
                             libxl_bitmap *nodemap)
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index a430362..7b84e6a 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -129,6 +129,9 @@ static inline int libxl_node_bitmap_alloc(libxl_ctx *ctx,
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
                             const libxl_bitmap *nodemap,
                             libxl_bitmap *cpumap);
+/* Populate cpumap with the cpus spanned by node */
+int libxl_node_to_cpumap(libxl_ctx *ctx, int node,
+                         libxl_bitmap *cpumap);
 /* Populate nodemap with the nodes of the cpus in cpumap */
 int libxl_cpumap_to_nodemap(libxl_ctx *ctx,
                             const libxl_bitmap *cpuemap,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:14:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:14: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 1VUPQh-0000TT-D7; Thu, 10 Oct 2013 23:14: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 1VUPQf-0000T8-86
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:01 +0000
Received: from [85.158.139.211:41231] by server-10.bemta-5.messagelabs.com id
	B3/B7-23973-8B437525; Thu, 10 Oct 2013 23:14:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1381446838!705922!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21030 invoked from network); 10 Oct 2013 23:13:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:13:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQc-00044I-At
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQc-0005pb-9p
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:13:58 +0000
Date: Thu, 10 Oct 2013 23:13:58 +0000
Message-Id: <E1VUPQc-0005pb-9p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: introduce libxl_node_to_cpumap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1dc5178097e62fc7137cf17cd16628675f0b5ee1
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Thu Oct 3 19:46:02 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:29:39 2013 +0100

    libxl: introduce libxl_node_to_cpumap
    
    As an helper for the special case (of libxl_nodemap_to_cpumap) when
    one wants the cpumap for just one node.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_utils.c |   22 ++++++++++++++++++++++
 tools/libxl/libxl_utils.h |    3 +++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 244725b..1bcac7e 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -668,6 +668,28 @@ int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
     return rc;
 }
 
+int libxl_node_to_cpumap(libxl_ctx *ctx, int node,
+                         libxl_bitmap *cpumap)
+{
+    libxl_bitmap nodemap;
+    int rc = 0;
+
+    libxl_bitmap_init(&nodemap);
+
+    rc = libxl_node_bitmap_alloc(ctx, &nodemap, 0);
+    if (rc)
+        goto out;
+
+    libxl_bitmap_set_none(&nodemap);
+    libxl_bitmap_set(&nodemap, node);
+
+    rc = libxl_nodemap_to_cpumap(ctx, &nodemap, cpumap);
+
+ out:
+    libxl_bitmap_dispose(&nodemap);
+    return rc;
+}
+
 int libxl_cpumap_to_nodemap(libxl_ctx *ctx,
                             const libxl_bitmap *cpumap,
                             libxl_bitmap *nodemap)
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index a430362..7b84e6a 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -129,6 +129,9 @@ static inline int libxl_node_bitmap_alloc(libxl_ctx *ctx,
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
                             const libxl_bitmap *nodemap,
                             libxl_bitmap *cpumap);
+/* Populate cpumap with the cpus spanned by node */
+int libxl_node_to_cpumap(libxl_ctx *ctx, int node,
+                         libxl_bitmap *cpumap);
 /* Populate nodemap with the nodes of the cpus in cpumap */
 int libxl_cpumap_to_nodemap(libxl_ctx *ctx,
                             const libxl_bitmap *cpuemap,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:14:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:14: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 1VUPQs-0000Vm-IZ; Thu, 10 Oct 2013 23:14: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 1VUPQq-0000VQ-9N
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:12 +0000
Received: from [85.158.139.211:28980] by server-10.bemta-5.messagelabs.com id
	66/C7-23973-3C437525; Thu, 10 Oct 2013 23:14:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1381446848!692899!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29144 invoked from network); 10 Oct 2013 23:14:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:14:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQm-00044r-PE
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQm-0005qK-MW
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:08 +0000
Date: Thu, 10 Oct 2013 23:14:08 +0000
Message-Id: <E1VUPQm-0005qK-MW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm32: Call start_xen only on the
	boot CPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bd7a85f9a4040a117696c43985932243df70def7
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Oct 7 15:44:35 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 11:18:25 2013 +0100

    xen/arm32: Call start_xen only on the boot CPU
    
    The boot CPU can have a CPU ID non-equal to zero. Xen needs to check the
    logical CPU ID (in r12) to know if the CPU is the boot one.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/head.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 92b3c48..ce1d21a 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -403,7 +403,8 @@ launch:
         sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
         mov   r0, r10                /* Marshal args: - phys_offset */
         mov   r1, r8                 /*               - DTB address */
-        movs  r2, r7                 /*               - CPU ID */
+        mov   r2, r7                 /*               - CPU ID */
+        teq   r12, #0
         beq   start_xen              /* and disappear into the land of C */
         b     start_secondary        /* (to the appropriate entry point) */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:14:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:14: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 1VUPQs-0000Vm-IZ; Thu, 10 Oct 2013 23:14: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 1VUPQq-0000VQ-9N
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:12 +0000
Received: from [85.158.139.211:28980] by server-10.bemta-5.messagelabs.com id
	66/C7-23973-3C437525; Thu, 10 Oct 2013 23:14:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1381446848!692899!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29144 invoked from network); 10 Oct 2013 23:14:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:14:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQm-00044r-PE
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQm-0005qK-MW
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:08 +0000
Date: Thu, 10 Oct 2013 23:14:08 +0000
Message-Id: <E1VUPQm-0005qK-MW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm32: Call start_xen only on the
	boot CPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bd7a85f9a4040a117696c43985932243df70def7
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Oct 7 15:44:35 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 11:18:25 2013 +0100

    xen/arm32: Call start_xen only on the boot CPU
    
    The boot CPU can have a CPU ID non-equal to zero. Xen needs to check the
    logical CPU ID (in r12) to know if the CPU is the boot one.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/head.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 92b3c48..ce1d21a 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -403,7 +403,8 @@ launch:
         sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
         mov   r0, r10                /* Marshal args: - phys_offset */
         mov   r1, r8                 /*               - DTB address */
-        movs  r2, r7                 /*               - CPU ID */
+        mov   r2, r7                 /*               - CPU ID */
+        teq   r12, #0
         beq   start_xen              /* and disappear into the land of C */
         b     start_secondary        /* (to the appropriate entry point) */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:14:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:14: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 1VUPR0-0000XJ-LR; Thu, 10 Oct 2013 23:14:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQz-0000X2-E3
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:21 +0000
Received: from [85.158.143.35:14111] by server-1.bemta-4.messagelabs.com id
	10/97-11076-CC437525; Thu, 10 Oct 2013 23:14:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1381446859!430123!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10393 invoked from network); 10 Oct 2013 23:14:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:14:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQw-000450-Vb
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQw-0005rd-Tp
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:18 +0000
Date: Thu, 10 Oct 2013 23:14:18 +0000
Message-Id: <E1VUPQw-0005rd-Tp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5814c599256907d53a3c99ad530bad2ed2565d9e
Merge: 1dc5178097e62fc7137cf17cd16628675f0b5ee1 bd7a85f9a4040a117696c43985932243df70def7
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 12:41:10 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:41:10 2013 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:14:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:14: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 1VUPR0-0000XJ-LR; Thu, 10 Oct 2013 23:14:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQz-0000X2-E3
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:21 +0000
Received: from [85.158.143.35:14111] by server-1.bemta-4.messagelabs.com id
	10/97-11076-CC437525; Thu, 10 Oct 2013 23:14:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1381446859!430123!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10393 invoked from network); 10 Oct 2013 23:14:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:14:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQw-000450-Vb
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPQw-0005rd-Tp
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:18 +0000
Date: Thu, 10 Oct 2013 23:14:18 +0000
Message-Id: <E1VUPQw-0005rd-Tp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5814c599256907d53a3c99ad530bad2ed2565d9e
Merge: 1dc5178097e62fc7137cf17cd16628675f0b5ee1 bd7a85f9a4040a117696c43985932243df70def7
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 12:41:10 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:41:10 2013 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:14:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:14:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUPRA-0000ZQ-OA; Thu, 10 Oct 2013 23:14: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 1VUPR9-0000ZB-Uu
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:32 +0000
Received: from [85.158.139.211:46031] by server-16.bemta-5.messagelabs.com id
	C1/37-03533-7D437525; Thu, 10 Oct 2013 23:14:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1381446869!700175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8253 invoked from network); 10 Oct 2013 23:14:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:14:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPR7-000458-4V
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPR7-0005rz-3M
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:29 +0000
Date: Thu, 10 Oct 2013 23:14:29 +0000
Message-Id: <E1VUPR7-0005rz-3M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Fixing clear_guest_offset
	macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e9ee35826e46e4f9a40f9fdafcc609016cb2a23b
Author:     Jaeyong Yoo <jaeyong.yoo@samsung.com>
AuthorDate: Fri Oct 4 13:44:02 2013 +0900
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:50:31 2013 +0100

    xen/arm: Fixing clear_guest_offset macro
    
    Fix the the broken macro 'clear_guest_offset' in arm.
    
    Signed-off-by: Jaeyong Yoo <jaeyong.yoo@samsung.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/guest_access.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-arm/guest_access.h b/xen/include/asm-arm/guest_access.h
index 34aae14..8ff088f 100644
--- a/xen/include/asm-arm/guest_access.h
+++ b/xen/include/asm-arm/guest_access.h
@@ -77,8 +77,9 @@ unsigned long raw_clear_guest(void *to, unsigned len);
  * Clear an array of objects in guest context via a guest handle,
  * specifying an offset into the guest array.
  */
-#define clear_guest_offset(hnd, off, ptr, nr) ({      \
-    raw_clear_guest(_d+(off), nr);  \
+#define clear_guest_offset(hnd, off, nr) ({    \
+    void *_d = (hnd).p;                        \
+    raw_clear_guest(_d+(off), nr);             \
 })
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:14:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:14:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUPRA-0000ZQ-OA; Thu, 10 Oct 2013 23:14: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 1VUPR9-0000ZB-Uu
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:32 +0000
Received: from [85.158.139.211:46031] by server-16.bemta-5.messagelabs.com id
	C1/37-03533-7D437525; Thu, 10 Oct 2013 23:14:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1381446869!700175!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8253 invoked from network); 10 Oct 2013 23:14:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:14:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPR7-000458-4V
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPR7-0005rz-3M
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:29 +0000
Date: Thu, 10 Oct 2013 23:14:29 +0000
Message-Id: <E1VUPR7-0005rz-3M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Fixing clear_guest_offset
	macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e9ee35826e46e4f9a40f9fdafcc609016cb2a23b
Author:     Jaeyong Yoo <jaeyong.yoo@samsung.com>
AuthorDate: Fri Oct 4 13:44:02 2013 +0900
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 10 12:50:31 2013 +0100

    xen/arm: Fixing clear_guest_offset macro
    
    Fix the the broken macro 'clear_guest_offset' in arm.
    
    Signed-off-by: Jaeyong Yoo <jaeyong.yoo@samsung.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/guest_access.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-arm/guest_access.h b/xen/include/asm-arm/guest_access.h
index 34aae14..8ff088f 100644
--- a/xen/include/asm-arm/guest_access.h
+++ b/xen/include/asm-arm/guest_access.h
@@ -77,8 +77,9 @@ unsigned long raw_clear_guest(void *to, unsigned len);
  * Clear an array of objects in guest context via a guest handle,
  * specifying an offset into the guest array.
  */
-#define clear_guest_offset(hnd, off, ptr, nr) ({      \
-    raw_clear_guest(_d+(off), nr);  \
+#define clear_guest_offset(hnd, off, nr) ({    \
+    void *_d = (hnd).p;                        \
+    raw_clear_guest(_d+(off), nr);             \
 })
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:14:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:14: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 1VUPRK-0000bN-Re; Thu, 10 Oct 2013 23:14: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 1VUPRJ-0000b4-K6
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:41 +0000
Received: from [85.158.143.35:14806] by server-3.bemta-4.messagelabs.com id
	58/66-24907-0E437525; Thu, 10 Oct 2013 23:14:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1381446879!1095184!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24319 invoked from network); 10 Oct 2013 23:14:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:14:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRH-00045E-AQ
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRH-0005sP-9K
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:39 +0000
Date: Thu, 10 Oct 2013 23:14:39 +0000
Message-Id: <E1VUPRH-0005sP-9K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: check segment descriptor read
	result in 64-bit OUTS emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0771faba163769089c9f05f7f76b63e397677613
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Thu Oct 10 15:19:53 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 10 15:19:53 2013 +0200

    x86: check segment descriptor read result in 64-bit OUTS emulation
    
    When emulating such an operation from a 64-bit context (CS has long
    mode set), and the data segment is overridden to FS/GS, the result of
    reading the overridden segment's descriptor (read_descriptor) is not
    checked. If it fails, data_base is left uninitialized.
    
    This can lead to 8 bytes of Xen's stack being leaked to the guest
    (implicitly, i.e. via the address given in a #PF).
    
    Coverity-ID: 1055116
    
    This is CVE-2013-4368 / XSA-67.
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix formatting.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/traps.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 47c71b7..4a09502 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1986,10 +1986,10 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                     break;
                 }
             }
-            else
-                read_descriptor(data_sel, v, regs,
-                                &data_base, &data_limit, &ar,
-                                0);
+            else if ( !read_descriptor(data_sel, v, regs,
+                                       &data_base, &data_limit, &ar, 0) ||
+                      !(ar & _SEGMENT_S) || !(ar & _SEGMENT_P) )
+                goto fail;
             data_limit = ~0UL;
             ar = _SEGMENT_WR|_SEGMENT_S|_SEGMENT_DPL|_SEGMENT_P;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:14:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:14: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 1VUPRK-0000bN-Re; Thu, 10 Oct 2013 23:14: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 1VUPRJ-0000b4-K6
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:41 +0000
Received: from [85.158.143.35:14806] by server-3.bemta-4.messagelabs.com id
	58/66-24907-0E437525; Thu, 10 Oct 2013 23:14:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1381446879!1095184!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24319 invoked from network); 10 Oct 2013 23:14:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:14:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRH-00045E-AQ
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRH-0005sP-9K
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:39 +0000
Date: Thu, 10 Oct 2013 23:14:39 +0000
Message-Id: <E1VUPRH-0005sP-9K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: check segment descriptor read
	result in 64-bit OUTS emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0771faba163769089c9f05f7f76b63e397677613
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Thu Oct 10 15:19:53 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 10 15:19:53 2013 +0200

    x86: check segment descriptor read result in 64-bit OUTS emulation
    
    When emulating such an operation from a 64-bit context (CS has long
    mode set), and the data segment is overridden to FS/GS, the result of
    reading the overridden segment's descriptor (read_descriptor) is not
    checked. If it fails, data_base is left uninitialized.
    
    This can lead to 8 bytes of Xen's stack being leaked to the guest
    (implicitly, i.e. via the address given in a #PF).
    
    Coverity-ID: 1055116
    
    This is CVE-2013-4368 / XSA-67.
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix formatting.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/traps.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 47c71b7..4a09502 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1986,10 +1986,10 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                     break;
                 }
             }
-            else
-                read_descriptor(data_sel, v, regs,
-                                &data_base, &data_limit, &ar,
-                                0);
+            else if ( !read_descriptor(data_sel, v, regs,
+                                       &data_base, &data_limit, &ar, 0) ||
+                      !(ar & _SEGMENT_S) || !(ar & _SEGMENT_P) )
+                goto fail;
             data_limit = ~0UL;
             ar = _SEGMENT_WR|_SEGMENT_S|_SEGMENT_DPL|_SEGMENT_P;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:14:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:14: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 1VUPRU-0000dH-Ul; Thu, 10 Oct 2013 23:14: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 1VUPRT-0000d1-R0
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:52 +0000
Received: from [85.158.143.35:15243] by server-1.bemta-4.messagelabs.com id
	91/C7-11076-BE437525; Thu, 10 Oct 2013 23:14:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1381446889!1086428!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6070 invoked from network); 10 Oct 2013 23:14:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:14:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRR-00045K-F9
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRR-0005sl-Dr
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:49 +0000
Date: Thu, 10 Oct 2013 23:14:49 +0000
Message-Id: <E1VUPRR-0005sl-Dr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix vif rate parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c53702cee1d6f9f1b72f0cae0b412e21bcda8724
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 10 15:48:55 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 15:48:55 2013 +0100

    libxl: fix vif rate parsing
    
    strtok can return NULL here. We don't need to use strtok anyway, so just
    use a simple strchr method.
    
    Coverity-ID: 1055642
    
    This is CVE-2013-4369 / XSA-68
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix type. Add test case
    
    Signed-off-by: Ian Campbell <Ian.campbell@citrix.com>
---
 tools/libxl/check-xl-vif-parse |    4 ++++
 tools/libxl/libxlu_vif.c       |   19 +++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/check-xl-vif-parse b/tools/libxl/check-xl-vif-parse
index 0473182..02c6dba 100755
--- a/tools/libxl/check-xl-vif-parse
+++ b/tools/libxl/check-xl-vif-parse
@@ -206,4 +206,8 @@ expected </dev/null
 one $e rate=4294967295GB/s@5us
 one $e rate=4296MB/s@4294s
 
+# test include of single '@'
+expected </dev/null
+one $e rate=@
+
 complete
diff --git a/tools/libxl/libxlu_vif.c b/tools/libxl/libxlu_vif.c
index 3b3de0f..0665e62 100644
--- a/tools/libxl/libxlu_vif.c
+++ b/tools/libxl/libxlu_vif.c
@@ -95,23 +95,30 @@ int xlu_vif_parse_rate(XLU_Config *cfg, const char *rate, libxl_device_nic *nic)
     uint64_t bytes_per_sec = 0;
     uint64_t bytes_per_interval = 0;
     uint32_t interval_usecs = 50000UL; /* Default to 50ms */
-    char *ratetok, *tmprate;
+    char *p, *tmprate;
     int rc = 0;
 
     tmprate = strdup(rate);
+    if (tmprate == NULL) {
+        rc = ENOMEM;
+        goto out;
+    }
+
+    p = strchr(tmprate, '@');
+    if (p != NULL)
+        *p++ = 0;
+
     if (!strcmp(tmprate,"")) {
         xlu__vif_err(cfg, "no rate specified", rate);
         rc = EINVAL;
         goto out;
     }
 
-    ratetok = strtok(tmprate, "@");
-    rc = vif_parse_rate_bytes_per_sec(cfg, ratetok, &bytes_per_sec);
+    rc = vif_parse_rate_bytes_per_sec(cfg, tmprate, &bytes_per_sec);
     if (rc) goto out;
 
-    ratetok = strtok(NULL, "@");
-    if (ratetok != NULL) {
-        rc = vif_parse_rate_interval_usecs(cfg, ratetok, &interval_usecs);
+    if (p != NULL) {
+        rc = vif_parse_rate_interval_usecs(cfg, p, &interval_usecs);
         if (rc) goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:14:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:14: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 1VUPRU-0000dH-Ul; Thu, 10 Oct 2013 23:14: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 1VUPRT-0000d1-R0
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:52 +0000
Received: from [85.158.143.35:15243] by server-1.bemta-4.messagelabs.com id
	91/C7-11076-BE437525; Thu, 10 Oct 2013 23:14:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1381446889!1086428!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6070 invoked from network); 10 Oct 2013 23:14:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:14:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRR-00045K-F9
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRR-0005sl-Dr
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:49 +0000
Date: Thu, 10 Oct 2013 23:14:49 +0000
Message-Id: <E1VUPRR-0005sl-Dr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix vif rate parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c53702cee1d6f9f1b72f0cae0b412e21bcda8724
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 10 15:48:55 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 15:48:55 2013 +0100

    libxl: fix vif rate parsing
    
    strtok can return NULL here. We don't need to use strtok anyway, so just
    use a simple strchr method.
    
    Coverity-ID: 1055642
    
    This is CVE-2013-4369 / XSA-68
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix type. Add test case
    
    Signed-off-by: Ian Campbell <Ian.campbell@citrix.com>
---
 tools/libxl/check-xl-vif-parse |    4 ++++
 tools/libxl/libxlu_vif.c       |   19 +++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/check-xl-vif-parse b/tools/libxl/check-xl-vif-parse
index 0473182..02c6dba 100755
--- a/tools/libxl/check-xl-vif-parse
+++ b/tools/libxl/check-xl-vif-parse
@@ -206,4 +206,8 @@ expected </dev/null
 one $e rate=4294967295GB/s@5us
 one $e rate=4296MB/s@4294s
 
+# test include of single '@'
+expected </dev/null
+one $e rate=@
+
 complete
diff --git a/tools/libxl/libxlu_vif.c b/tools/libxl/libxlu_vif.c
index 3b3de0f..0665e62 100644
--- a/tools/libxl/libxlu_vif.c
+++ b/tools/libxl/libxlu_vif.c
@@ -95,23 +95,30 @@ int xlu_vif_parse_rate(XLU_Config *cfg, const char *rate, libxl_device_nic *nic)
     uint64_t bytes_per_sec = 0;
     uint64_t bytes_per_interval = 0;
     uint32_t interval_usecs = 50000UL; /* Default to 50ms */
-    char *ratetok, *tmprate;
+    char *p, *tmprate;
     int rc = 0;
 
     tmprate = strdup(rate);
+    if (tmprate == NULL) {
+        rc = ENOMEM;
+        goto out;
+    }
+
+    p = strchr(tmprate, '@');
+    if (p != NULL)
+        *p++ = 0;
+
     if (!strcmp(tmprate,"")) {
         xlu__vif_err(cfg, "no rate specified", rate);
         rc = EINVAL;
         goto out;
     }
 
-    ratetok = strtok(tmprate, "@");
-    rc = vif_parse_rate_bytes_per_sec(cfg, ratetok, &bytes_per_sec);
+    rc = vif_parse_rate_bytes_per_sec(cfg, tmprate, &bytes_per_sec);
     if (rc) goto out;
 
-    ratetok = strtok(NULL, "@");
-    if (ratetok != NULL) {
-        rc = vif_parse_rate_interval_usecs(cfg, ratetok, &interval_usecs);
+    if (p != NULL) {
+        rc = vif_parse_rate_interval_usecs(cfg, p, &interval_usecs);
         if (rc) goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:15:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:15: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 1VUPRg-0000f7-3t; Thu, 10 Oct 2013 23:15: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 1VUPRd-0000er-V1
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:15:02 +0000
Received: from [85.158.143.35:15664] by server-2.bemta-4.messagelabs.com id
	E2/5A-31802-5F437525; Thu, 10 Oct 2013 23:15:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1381446899!1091151!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8576 invoked from network); 10 Oct 2013 23:15:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:15:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRb-00045T-KA
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRb-0005t7-Ij
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:59 +0000
Date: Thu, 10 Oct 2013 23:14:59 +0000
Message-Id: <E1VUPRb-0005t7-Ij@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ocaml: fix erroneous free of
	cpumap in stub_xc_vcpu_getaffinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3cd10fd21220f2b814324e6e732004f8f0487d0a
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Tue Sep 10 23:12:45 2013 +1200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 15:49:40 2013 +0100

    tools/ocaml: fix erroneous free of cpumap in stub_xc_vcpu_getaffinity
    
    Not sure how it got there...
    
    Coverity-ID: 1056196
    
    This is CVE-2013-4370 / XSA-69
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index df756ad..f5cf0ed 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -461,8 +461,6 @@ CAMLprim value stub_xc_vcpu_getaffinity(value xch, value domid,
 
 	retval = xc_vcpu_getaffinity(_H(xch), _D(domid),
 	                             Int_val(vcpu), c_cpumap);
-	free(c_cpumap);
-
 	if (retval < 0) {
 		free(c_cpumap);
 		failwith_xc(_H(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 Oct 10 23:15:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:15: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 1VUPRg-0000f7-3t; Thu, 10 Oct 2013 23:15: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 1VUPRd-0000er-V1
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:15:02 +0000
Received: from [85.158.143.35:15664] by server-2.bemta-4.messagelabs.com id
	E2/5A-31802-5F437525; Thu, 10 Oct 2013 23:15:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1381446899!1091151!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8576 invoked from network); 10 Oct 2013 23:15:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:15:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRb-00045T-KA
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRb-0005t7-Ij
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:14:59 +0000
Date: Thu, 10 Oct 2013 23:14:59 +0000
Message-Id: <E1VUPRb-0005t7-Ij@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ocaml: fix erroneous free of
	cpumap in stub_xc_vcpu_getaffinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3cd10fd21220f2b814324e6e732004f8f0487d0a
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Tue Sep 10 23:12:45 2013 +1200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 15:49:40 2013 +0100

    tools/ocaml: fix erroneous free of cpumap in stub_xc_vcpu_getaffinity
    
    Not sure how it got there...
    
    Coverity-ID: 1056196
    
    This is CVE-2013-4370 / XSA-69
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index df756ad..f5cf0ed 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -461,8 +461,6 @@ CAMLprim value stub_xc_vcpu_getaffinity(value xch, value domid,
 
 	retval = xc_vcpu_getaffinity(_H(xch), _D(domid),
 	                             Int_val(vcpu), c_cpumap);
-	free(c_cpumap);
-
 	if (retval < 0) {
 		free(c_cpumap);
 		failwith_xc(_H(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 Oct 10 23:15:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:15: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 1VUPRq-0000gq-7K; Thu, 10 Oct 2013 23:15:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRp-0000gb-CH
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:15:13 +0000
Received: from [85.158.143.35:36113] by server-1.bemta-4.messagelabs.com id
	A3/E7-11076-00537525; Thu, 10 Oct 2013 23:15:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1381446910!1090493!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13072 invoked from network); 10 Oct 2013 23:15:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:15:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRm-00046R-Np
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:15:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRl-0005tn-OD
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:15:10 +0000
Date: Thu, 10 Oct 2013 23:15:09 +0000
Message-Id: <E1VUPRl-0005tn-OD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix out-of-memory error
	handling in libxl_list_cpupool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4c37ed562224295c0f8b00211287d57cae629782
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Tue Sep 10 22:18:46 2013 +1200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 15:49:54 2013 +0100

    libxl: fix out-of-memory error handling in libxl_list_cpupool
    
    ...otherwise it will return freed memory. All the current users of this
    function check already for a NULL return, so use that.
    
    Coverity-ID: 1056194
    
    This is CVE-2013-4371 / XSA-70
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index b6dacea..29e66f2 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -654,6 +654,7 @@ libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx, int *nb_pool_out)
         if (!tmp) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpupool info");
             libxl_cpupoolinfo_list_free(ptr, i);
+            ptr = NULL;
             goto out;
         }
         ptr = tmp;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 10 23:15:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 10 Oct 2013 23:15: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 1VUPRq-0000gq-7K; Thu, 10 Oct 2013 23:15:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRp-0000gb-CH
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:15:13 +0000
Received: from [85.158.143.35:36113] by server-1.bemta-4.messagelabs.com id
	A3/E7-11076-00537525; Thu, 10 Oct 2013 23:15:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1381446910!1090493!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13072 invoked from network); 10 Oct 2013 23:15:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Oct 2013 23:15:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRm-00046R-Np
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:15:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUPRl-0005tn-OD
	for xen-changelog@lists.xensource.com; Thu, 10 Oct 2013 23:15:10 +0000
Date: Thu, 10 Oct 2013 23:15:09 +0000
Message-Id: <E1VUPRl-0005tn-OD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix out-of-memory error
	handling in libxl_list_cpupool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4c37ed562224295c0f8b00211287d57cae629782
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Tue Sep 10 22:18:46 2013 +1200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 15:49:54 2013 +0100

    libxl: fix out-of-memory error handling in libxl_list_cpupool
    
    ...otherwise it will return freed memory. All the current users of this
    function check already for a NULL return, so use that.
    
    Coverity-ID: 1056194
    
    This is CVE-2013-4371 / XSA-70
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index b6dacea..29e66f2 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -654,6 +654,7 @@ libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx, int *nb_pool_out)
         if (!tmp) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpupool info");
             libxl_cpupoolinfo_list_free(ptr, i);
+            ptr = NULL;
             goto out;
         }
         ptr = tmp;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 11 00:33:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUQfC-0001mn-Ob; Fri, 11 Oct 2013 00:33:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfC-0001mg-19
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:06 +0000
Received: from [85.158.143.35:20368] by server-3.bemta-4.messagelabs.com id
	11/1B-24907-14747525; Fri, 11 Oct 2013 00:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1381451583!1100885!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9603 invoked from network); 11 Oct 2013 00:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQf9-0005JM-AG
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQf9-0008Uo-4K
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:03 +0000
Date: Fri, 11 Oct 2013 00:33:03 +0000
Message-Id: <E1VUQf9-0008Uo-4K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: don't blindly create L3
	tables for the direct 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 af727606a59af3d87e9126dea612110af3fbc711
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 9 12:00:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:00:05 2013 +0200

    x86: don't blindly create L3 tables for the direct map
    
    Now that the direct map area can extend all the way up to almost the
    end of address space, this is wasteful.
    
    Also fold two almost redundant messages in SRAT parsing into one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: ca145fe70bad3a25ad54c6ded1ef237e45a2311e
    master date: 2013-09-30 15:28:12 +0200
---
 xen/arch/x86/mm.c        |    2 +-
 xen/arch/x86/srat.c      |   15 ++++++---------
 xen/arch/x86/x86_64/mm.c |   29 ++++++++++++-----------------
 xen/include/asm-x86/mm.h |    2 +-
 4 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f151dec..1db363e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -137,7 +137,7 @@ l1_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
 #define PTE_UPDATE_WITH_CMPXCHG
 #endif
 
-bool_t __read_mostly mem_hotplug = 0;
+paddr_t __read_mostly mem_hotplug;
 
 /* Private domain structs for DOMID_XEN and DOMID_IO. */
 struct domain *dom_xen, *dom_io, *dom_cow;
diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index ff73881..2b05272 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -113,6 +113,7 @@ static __init void bad_srat(void)
 		apicid_to_node[i] = NUMA_NO_NODE;
 	for (i = 0; i < ARRAY_SIZE(pxm2node); i++)
 		pxm2node[i] = NUMA_NO_NODE;
+	mem_hotplug = 0;
 }
 
 /*
@@ -257,13 +258,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 		return;
 	}
 	/* It is fine to add this area to the nodes data it will be used later*/
-	if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)
-	{
-		printk(KERN_INFO "SRAT: hot plug zone found %"PRIx64" - %"PRIx64" \n",
-				start, end);
-		mem_hotplug = 1;
-	}
-
 	i = conflicting_memblks(start, end);
 	if (i == node) {
 		printk(KERN_WARNING
@@ -287,8 +281,11 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 		if (nd->end < end)
 			nd->end = end;
 	}
-	printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIx64"-%"PRIx64"\n", node, pxm,
-	       start, end);
+	if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && end > mem_hotplug)
+		mem_hotplug = end;
+	printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIx64"-%"PRIx64"%s\n",
+	       node, pxm, start, end,
+	       ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE ? " (hotplug)" : "");
 
 	node_memblk_range[num_node_memblks].start = start;
 	node_memblk_range[num_node_memblks].end = end;
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 96a033b..d1a1c02 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -621,25 +621,20 @@ void __init paging_init(void)
      * We setup the L3s for 1:1 mapping if host support memory hotplug
      * to avoid sync the 1:1 mapping on page fault handler
      */
-    if ( mem_hotplug )
+    for ( va = DIRECTMAP_VIRT_START;
+          va < DIRECTMAP_VIRT_END && (void *)va < __va(mem_hotplug);
+          va += (1UL << L4_PAGETABLE_SHIFT) )
     {
-        unsigned long va;
-
-        for ( va = DIRECTMAP_VIRT_START;
-              va < DIRECTMAP_VIRT_END;
-              va += (1UL << L4_PAGETABLE_SHIFT) )
+        if ( !(l4e_get_flags(idle_pg_table[l4_table_offset(va)]) &
+              _PAGE_PRESENT) )
         {
-            if ( !(l4e_get_flags(idle_pg_table[l4_table_offset(va)]) &
-                  _PAGE_PRESENT) )
-            {
-                l3_pg = alloc_domheap_page(NULL, 0);
-                if ( !l3_pg )
-                    goto nomem;
-                l3_ro_mpt = page_to_virt(l3_pg);
-                clear_page(l3_ro_mpt);
-                l4e_write(&idle_pg_table[l4_table_offset(va)],
-                  l4e_from_page(l3_pg, __PAGE_HYPERVISOR));
-            }
+            l3_pg = alloc_domheap_page(NULL, 0);
+            if ( !l3_pg )
+                goto nomem;
+            l3_ro_mpt = page_to_virt(l3_pg);
+            clear_page(l3_ro_mpt);
+            l4e_write(&idle_pg_table[l4_table_offset(va)],
+                      l4e_from_page(l3_pg, __PAGE_HYPERVISOR));
         }
     }
 
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 213fc9c..5f03875 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -399,7 +399,7 @@ static inline int get_page_and_type(struct page_info *page,
 int check_descriptor(const struct domain *, struct desc_struct *d);
 
 extern bool_t opt_allow_superpage;
-extern bool_t mem_hotplug;
+extern paddr_t mem_hotplug;
 
 /******************************************************************************
  * With shadow pagetables, the different kinds of address start 
--
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 Oct 11 00:33:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUQfC-0001mn-Ob; Fri, 11 Oct 2013 00:33:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfC-0001mg-19
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:06 +0000
Received: from [85.158.143.35:20368] by server-3.bemta-4.messagelabs.com id
	11/1B-24907-14747525; Fri, 11 Oct 2013 00:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1381451583!1100885!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9603 invoked from network); 11 Oct 2013 00:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQf9-0005JM-AG
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQf9-0008Uo-4K
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:03 +0000
Date: Fri, 11 Oct 2013 00:33:03 +0000
Message-Id: <E1VUQf9-0008Uo-4K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: don't blindly create L3
	tables for the direct 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 af727606a59af3d87e9126dea612110af3fbc711
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 9 12:00:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:00:05 2013 +0200

    x86: don't blindly create L3 tables for the direct map
    
    Now that the direct map area can extend all the way up to almost the
    end of address space, this is wasteful.
    
    Also fold two almost redundant messages in SRAT parsing into one.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: ca145fe70bad3a25ad54c6ded1ef237e45a2311e
    master date: 2013-09-30 15:28:12 +0200
---
 xen/arch/x86/mm.c        |    2 +-
 xen/arch/x86/srat.c      |   15 ++++++---------
 xen/arch/x86/x86_64/mm.c |   29 ++++++++++++-----------------
 xen/include/asm-x86/mm.h |    2 +-
 4 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f151dec..1db363e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -137,7 +137,7 @@ l1_pgentry_t __attribute__ ((__section__ (".bss.page_aligned")))
 #define PTE_UPDATE_WITH_CMPXCHG
 #endif
 
-bool_t __read_mostly mem_hotplug = 0;
+paddr_t __read_mostly mem_hotplug;
 
 /* Private domain structs for DOMID_XEN and DOMID_IO. */
 struct domain *dom_xen, *dom_io, *dom_cow;
diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c
index ff73881..2b05272 100644
--- a/xen/arch/x86/srat.c
+++ b/xen/arch/x86/srat.c
@@ -113,6 +113,7 @@ static __init void bad_srat(void)
 		apicid_to_node[i] = NUMA_NO_NODE;
 	for (i = 0; i < ARRAY_SIZE(pxm2node); i++)
 		pxm2node[i] = NUMA_NO_NODE;
+	mem_hotplug = 0;
 }
 
 /*
@@ -257,13 +258,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 		return;
 	}
 	/* It is fine to add this area to the nodes data it will be used later*/
-	if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)
-	{
-		printk(KERN_INFO "SRAT: hot plug zone found %"PRIx64" - %"PRIx64" \n",
-				start, end);
-		mem_hotplug = 1;
-	}
-
 	i = conflicting_memblks(start, end);
 	if (i == node) {
 		printk(KERN_WARNING
@@ -287,8 +281,11 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 		if (nd->end < end)
 			nd->end = end;
 	}
-	printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIx64"-%"PRIx64"\n", node, pxm,
-	       start, end);
+	if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && end > mem_hotplug)
+		mem_hotplug = end;
+	printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIx64"-%"PRIx64"%s\n",
+	       node, pxm, start, end,
+	       ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE ? " (hotplug)" : "");
 
 	node_memblk_range[num_node_memblks].start = start;
 	node_memblk_range[num_node_memblks].end = end;
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 96a033b..d1a1c02 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -621,25 +621,20 @@ void __init paging_init(void)
      * We setup the L3s for 1:1 mapping if host support memory hotplug
      * to avoid sync the 1:1 mapping on page fault handler
      */
-    if ( mem_hotplug )
+    for ( va = DIRECTMAP_VIRT_START;
+          va < DIRECTMAP_VIRT_END && (void *)va < __va(mem_hotplug);
+          va += (1UL << L4_PAGETABLE_SHIFT) )
     {
-        unsigned long va;
-
-        for ( va = DIRECTMAP_VIRT_START;
-              va < DIRECTMAP_VIRT_END;
-              va += (1UL << L4_PAGETABLE_SHIFT) )
+        if ( !(l4e_get_flags(idle_pg_table[l4_table_offset(va)]) &
+              _PAGE_PRESENT) )
         {
-            if ( !(l4e_get_flags(idle_pg_table[l4_table_offset(va)]) &
-                  _PAGE_PRESENT) )
-            {
-                l3_pg = alloc_domheap_page(NULL, 0);
-                if ( !l3_pg )
-                    goto nomem;
-                l3_ro_mpt = page_to_virt(l3_pg);
-                clear_page(l3_ro_mpt);
-                l4e_write(&idle_pg_table[l4_table_offset(va)],
-                  l4e_from_page(l3_pg, __PAGE_HYPERVISOR));
-            }
+            l3_pg = alloc_domheap_page(NULL, 0);
+            if ( !l3_pg )
+                goto nomem;
+            l3_ro_mpt = page_to_virt(l3_pg);
+            clear_page(l3_ro_mpt);
+            l4e_write(&idle_pg_table[l4_table_offset(va)],
+                      l4e_from_page(l3_pg, __PAGE_HYPERVISOR));
         }
     }
 
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 213fc9c..5f03875 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -399,7 +399,7 @@ static inline int get_page_and_type(struct page_info *page,
 int check_descriptor(const struct domain *, struct desc_struct *d);
 
 extern bool_t opt_allow_superpage;
-extern bool_t mem_hotplug;
+extern paddr_t mem_hotplug;
 
 /******************************************************************************
  * With shadow pagetables, the different kinds of address start 
--
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 Oct 11 00:33:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUQfN-0001nm-HN; Fri, 11 Oct 2013 00:33: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 1VUQfM-0001nZ-8x
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:16 +0000
Received: from [85.158.143.35:65000] by server-1.bemta-4.messagelabs.com id
	6F/DB-11076-B4747525; Fri, 11 Oct 2013 00:33:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1381451593!1098065!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 496 invoked from network); 11 Oct 2013 00:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfJ-0005JP-G1
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfJ-0008VC-Dp
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:13 +0000
Date: Fri, 11 Oct 2013 00:33:13 +0000
Message-Id: <E1VUQfJ-0008VC-Dp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/idle: Fix
	get_cpu_idle_time()'s interaction with offline pcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ff239813b463309a7d41f9dacc84ac91e7aa9bd5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 9 12:01:24 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:01:24 2013 +0200

    x86/idle: Fix get_cpu_idle_time()'s interaction with offline pcpus
    
    Checking for "idle_vcpu[cpu] != NULL" is insufficient protection against
    offline pcpus.  From a hypercall, vcpu_runstate_get() will determine "v !=
    current", and try to take the vcpu_schedule_lock().  This will try to look up
    per_cpu(schedule_data, v->processor) and promptly suffer a NULL structure
    deference as v->processors' __per_cpu_offset is INVALID_PERCPU_AREA.
    
    One example might look like this:
    
    ...
    Xen call trace:
       [<ffff82c4c0126ddb>] vcpu_runstate_get+0x50/0x113
       [<ffff82c4c0126ec6>] get_cpu_idle_time+0x28/0x2e
       [<ffff82c4c012b5cb>] do_sysctl+0x3db/0xeb8
       [<ffff82c4c023280d>] compat_hypercall+0xbd/0x116
    
    Pagetable walk from 0000000000000040:
     L4[0x000] = 0000000186df8027 0000000000028207
     L3[0x000] = 0000000188e36027 00000000000261c9
     L2[0x000] = 0000000000000000 ffffffffffffffff
    
    ****************************************
    Panic on CPU 11:
    ...
    
    get_cpu_idle_time() has been updated to correctly deal with offline pcpus
    itself by returning 0, in the same way as it would if it was missing the
    idle_vcpu[] pointer.
    
    In doing so, XENPF_getidletime needed updating to correctly retain its
    described behaviour of clearing bits in the cpumap for offline pcpus.
    
    As this crash can only be triggered with toolstack hypercalls, it is not a
    security issue and just a simple bug.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 0aa27ce3351f7eb09d13e863a1d5f303086aa32a
    master date: 2013-10-04 12:23:23 +0200
---
 xen/arch/x86/platform_hypercall.c |    8 ++++++--
 xen/common/schedule.c             |    9 ++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 7175a82..2162811 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -355,10 +355,14 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
         for_each_cpu ( cpu, cpumap )
         {
-            if ( idle_vcpu[cpu] == NULL )
-                cpumask_clear_cpu(cpu, cpumap);
             idletime = get_cpu_idle_time(cpu);
 
+            if ( !idletime )
+            {
+                cpumask_clear_cpu(cpu, cpumap);
+                continue;
+            }
+
             if ( copy_to_guest_offset(idletimes, cpu, &idletime, 1) )
             {
                 ret = -EFAULT;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index a8398bd..1ddfb22 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -176,13 +176,12 @@ void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate)
 
 uint64_t get_cpu_idle_time(unsigned int cpu)
 {
-    struct vcpu_runstate_info state;
-    struct vcpu *v;
+    struct vcpu_runstate_info state = { 0 };
+    struct vcpu *v = idle_vcpu[cpu];
 
-    if ( (v = idle_vcpu[cpu]) == NULL )
-        return 0;
+    if ( cpu_online(cpu) && v )
+        vcpu_runstate_get(v, &state);
 
-    vcpu_runstate_get(v, &state);
     return state.time[RUNSTATE_running];
 }
 
--
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 Oct 11 00:33:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUQfN-0001nm-HN; Fri, 11 Oct 2013 00:33: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 1VUQfM-0001nZ-8x
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:16 +0000
Received: from [85.158.143.35:65000] by server-1.bemta-4.messagelabs.com id
	6F/DB-11076-B4747525; Fri, 11 Oct 2013 00:33:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1381451593!1098065!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 496 invoked from network); 11 Oct 2013 00:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfJ-0005JP-G1
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfJ-0008VC-Dp
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:13 +0000
Date: Fri, 11 Oct 2013 00:33:13 +0000
Message-Id: <E1VUQfJ-0008VC-Dp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/idle: Fix
	get_cpu_idle_time()'s interaction with offline pcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ff239813b463309a7d41f9dacc84ac91e7aa9bd5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 9 12:01:24 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:01:24 2013 +0200

    x86/idle: Fix get_cpu_idle_time()'s interaction with offline pcpus
    
    Checking for "idle_vcpu[cpu] != NULL" is insufficient protection against
    offline pcpus.  From a hypercall, vcpu_runstate_get() will determine "v !=
    current", and try to take the vcpu_schedule_lock().  This will try to look up
    per_cpu(schedule_data, v->processor) and promptly suffer a NULL structure
    deference as v->processors' __per_cpu_offset is INVALID_PERCPU_AREA.
    
    One example might look like this:
    
    ...
    Xen call trace:
       [<ffff82c4c0126ddb>] vcpu_runstate_get+0x50/0x113
       [<ffff82c4c0126ec6>] get_cpu_idle_time+0x28/0x2e
       [<ffff82c4c012b5cb>] do_sysctl+0x3db/0xeb8
       [<ffff82c4c023280d>] compat_hypercall+0xbd/0x116
    
    Pagetable walk from 0000000000000040:
     L4[0x000] = 0000000186df8027 0000000000028207
     L3[0x000] = 0000000188e36027 00000000000261c9
     L2[0x000] = 0000000000000000 ffffffffffffffff
    
    ****************************************
    Panic on CPU 11:
    ...
    
    get_cpu_idle_time() has been updated to correctly deal with offline pcpus
    itself by returning 0, in the same way as it would if it was missing the
    idle_vcpu[] pointer.
    
    In doing so, XENPF_getidletime needed updating to correctly retain its
    described behaviour of clearing bits in the cpumap for offline pcpus.
    
    As this crash can only be triggered with toolstack hypercalls, it is not a
    security issue and just a simple bug.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 0aa27ce3351f7eb09d13e863a1d5f303086aa32a
    master date: 2013-10-04 12:23:23 +0200
---
 xen/arch/x86/platform_hypercall.c |    8 ++++++--
 xen/common/schedule.c             |    9 ++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 7175a82..2162811 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -355,10 +355,14 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
         for_each_cpu ( cpu, cpumap )
         {
-            if ( idle_vcpu[cpu] == NULL )
-                cpumask_clear_cpu(cpu, cpumap);
             idletime = get_cpu_idle_time(cpu);
 
+            if ( !idletime )
+            {
+                cpumask_clear_cpu(cpu, cpumap);
+                continue;
+            }
+
             if ( copy_to_guest_offset(idletimes, cpu, &idletime, 1) )
             {
                 ret = -EFAULT;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index a8398bd..1ddfb22 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -176,13 +176,12 @@ void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate)
 
 uint64_t get_cpu_idle_time(unsigned int cpu)
 {
-    struct vcpu_runstate_info state;
-    struct vcpu *v;
+    struct vcpu_runstate_info state = { 0 };
+    struct vcpu *v = idle_vcpu[cpu];
 
-    if ( (v = idle_vcpu[cpu]) == NULL )
-        return 0;
+    if ( cpu_online(cpu) && v )
+        vcpu_runstate_get(v, &state);
 
-    vcpu_runstate_get(v, &state);
     return state.time[RUNSTATE_running];
 }
 
--
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 Oct 11 00:33:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUQfY-0001ow-9l; Fri, 11 Oct 2013 00:33: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 1VUQfW-0001oc-HJ
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:26 +0000
Received: from [85.158.137.68:21468] by server-11.bemta-3.messagelabs.com id
	CD/18-16607-55747525; Fri, 11 Oct 2013 00:33:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1381451603!730946!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11056 invoked from network); 11 Oct 2013 00:33:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:33:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfT-0005JV-N8
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfT-0008WH-L2
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:23 +0000
Date: Fri, 11 Oct 2013 00:33:23 +0000
Message-Id: <E1VUQfT-0008WH-L2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/percpu: Force
	INVALID_PERCPU_AREA into the non-canonical address region
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 97fbee0d96f7057bd3b8e19fdeefeca9c657ae77
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 9 12:02:14 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:02:14 2013 +0200

    x86/percpu: Force INVALID_PERCPU_AREA into the non-canonical address region
    
    This causes accidental uses of per_cpu() on a pcpu with an INVALID_PERCPU_AREA
    to result in a #GF for attempting to access the middle of the non-canonical
    virtual address region.
    
    This is preferable to the current behaviour, where incorrect use of per_cpu()
    will result in an effective NULL structure dereference which has security
    implication in the context of PV guests.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 7cfb0053629c4dd1a6f01dc43cca7c0c25b8b7bf
    master date: 2013-10-04 12:24:34 +0200
---
 xen/arch/x86/percpu.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index e545024..1c1dad9 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -6,7 +6,14 @@
 #include <xen/rcupdate.h>
 
 unsigned long __per_cpu_offset[NR_CPUS];
-#define INVALID_PERCPU_AREA (-(long)__per_cpu_start)
+
+/*
+ * Force uses of per_cpu() with an invalid area to attempt to access the
+ * middle of the non-canonical address space resulting in a #GP, rather than a
+ * possible #PF at (NULL + a little) which has security implications in the
+ * context of PV guests.
+ */
+#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
 #define PERCPU_ORDER (get_order_from_bytes(__per_cpu_data_end-__per_cpu_start))
 
 void __init percpu_init_areas(void)
--
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 Oct 11 00:33:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUQfY-0001ow-9l; Fri, 11 Oct 2013 00:33: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 1VUQfW-0001oc-HJ
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:26 +0000
Received: from [85.158.137.68:21468] by server-11.bemta-3.messagelabs.com id
	CD/18-16607-55747525; Fri, 11 Oct 2013 00:33:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1381451603!730946!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11056 invoked from network); 11 Oct 2013 00:33:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:33:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfT-0005JV-N8
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfT-0008WH-L2
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:23 +0000
Date: Fri, 11 Oct 2013 00:33:23 +0000
Message-Id: <E1VUQfT-0008WH-L2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/percpu: Force
	INVALID_PERCPU_AREA into the non-canonical address region
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 97fbee0d96f7057bd3b8e19fdeefeca9c657ae77
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Oct 9 12:02:14 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:02:14 2013 +0200

    x86/percpu: Force INVALID_PERCPU_AREA into the non-canonical address region
    
    This causes accidental uses of per_cpu() on a pcpu with an INVALID_PERCPU_AREA
    to result in a #GF for attempting to access the middle of the non-canonical
    virtual address region.
    
    This is preferable to the current behaviour, where incorrect use of per_cpu()
    will result in an effective NULL structure dereference which has security
    implication in the context of PV guests.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 7cfb0053629c4dd1a6f01dc43cca7c0c25b8b7bf
    master date: 2013-10-04 12:24:34 +0200
---
 xen/arch/x86/percpu.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index e545024..1c1dad9 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -6,7 +6,14 @@
 #include <xen/rcupdate.h>
 
 unsigned long __per_cpu_offset[NR_CPUS];
-#define INVALID_PERCPU_AREA (-(long)__per_cpu_start)
+
+/*
+ * Force uses of per_cpu() with an invalid area to attempt to access the
+ * middle of the non-canonical address space resulting in a #GP, rather than a
+ * possible #PF at (NULL + a little) which has security implications in the
+ * context of PV guests.
+ */
+#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
 #define PERCPU_ORDER (get_order_from_bytes(__per_cpu_data_end-__per_cpu_start))
 
 void __init percpu_init_areas(void)
--
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 Oct 11 00:33:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:33:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUQfi-0001qM-D9; Fri, 11 Oct 2013 00:33: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 1VUQfg-0001q0-LC
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:36 +0000
Received: from [193.109.254.147:21440] by server-1.bemta-14.messagelabs.com id
	0D/CC-04740-F5747525; Fri, 11 Oct 2013 00:33:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1381451614!1426672!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17057 invoked from network); 11 Oct 2013 00:33:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:33:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfd-0005Jd-TV
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfd-000051-Rc
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:33 +0000
Date: Fri, 11 Oct 2013 00:33:33 +0000
Message-Id: <E1VUQfd-000051-Rc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Nested VMX: check VMX capability
	before read VMX related 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 4e9144f848a8909b1ce4ccbf59e00d0553465499
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Wed Oct 9 12:02:49 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:02:49 2013 +0200

    Nested VMX: check VMX capability before read VMX related MSRs
    
    VMX MSRs only available when the CPU support the VMX feature. In addition,
    VMX_TRUE* MSRs only available when bit 55 of VMX_BASIC MSR is set.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    
    Cleanup.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: 190b667ac20e8175758f4a3a0f13c4d990e6af7e
    master date: 2013-10-04 12:28:14 +0200
---
 xen/arch/x86/hvm/vmx/vmcs.c        |    3 +++
 xen/arch/x86/hvm/vmx/vvmx.c        |   21 +++++++++++++++++++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 6ef9739..2ed25c7 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -78,6 +78,7 @@ static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
 static DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
+u64 __read_mostly vmx_basic_msr;
 
 static void __init vmx_display_features(void)
 {
@@ -301,6 +302,8 @@ static int vmx_init_vmcs_config(void)
         vmx_vmexit_control         = _vmx_vmexit_control;
         vmx_vmentry_control        = _vmx_vmentry_control;
         cpu_has_vmx_ins_outs_instr_info = !!(vmx_basic_msr_high & (1U<<22));
+        vmx_basic_msr              = ((u64)vmx_basic_msr_high << 32) |
+                                     vmx_basic_msr_low;
         vmx_display_features();
     }
     else
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 2c4801c..e500f14 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1814,12 +1814,33 @@ int nvmx_handle_invvpid(struct cpu_user_regs *regs)
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
     struct vcpu *v = current;
+    unsigned int ecx, dummy;
     u64 data = 0, host_data = 0;
     int r = 1;
 
     if ( !nestedhvm_enabled(v->domain) )
         return 0;
 
+    /* VMX capablity MSRs are available only when guest supports VMX. */
+    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &dummy);
+    if ( !(ecx & cpufeat_mask(X86_FEATURE_VMXE)) )
+        return 0;
+
+    /*
+     * Those MSRs are available only when bit 55 of
+     * MSR_IA32_VMX_BASIC is set.
+     */
+    switch ( msr )
+    {
+    case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
+    case MSR_IA32_VMX_TRUE_PROCBASED_CTLS:
+    case MSR_IA32_VMX_TRUE_EXIT_CTLS:
+    case MSR_IA32_VMX_TRUE_ENTRY_CTLS:
+        if ( !(vmx_basic_msr & VMX_BASIC_DEFAULT1_ZERO) )
+            return 0;
+        break;
+    }
+
     rdmsrl(msr, host_data);
 
     /*
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index f30e5ac..21f6777 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -284,6 +284,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr_info;
  */
 #define VMX_BASIC_DEFAULT1_ZERO		(1ULL << 55)
 
+extern u64 vmx_basic_msr;
+
 /* Guest interrupt status */
 #define VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK  0x0FF
 #define VMX_GUEST_INTR_STATUS_SVI_OFFSET        8
--
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 Oct 11 00:33:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:33:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUQfi-0001qM-D9; Fri, 11 Oct 2013 00:33: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 1VUQfg-0001q0-LC
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:36 +0000
Received: from [193.109.254.147:21440] by server-1.bemta-14.messagelabs.com id
	0D/CC-04740-F5747525; Fri, 11 Oct 2013 00:33:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1381451614!1426672!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17057 invoked from network); 11 Oct 2013 00:33:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:33:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfd-0005Jd-TV
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfd-000051-Rc
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:33 +0000
Date: Fri, 11 Oct 2013 00:33:33 +0000
Message-Id: <E1VUQfd-000051-Rc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Nested VMX: check VMX capability
	before read VMX related 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 4e9144f848a8909b1ce4ccbf59e00d0553465499
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Wed Oct 9 12:02:49 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:02:49 2013 +0200

    Nested VMX: check VMX capability before read VMX related MSRs
    
    VMX MSRs only available when the CPU support the VMX feature. In addition,
    VMX_TRUE* MSRs only available when bit 55 of VMX_BASIC MSR is set.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    
    Cleanup.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: 190b667ac20e8175758f4a3a0f13c4d990e6af7e
    master date: 2013-10-04 12:28:14 +0200
---
 xen/arch/x86/hvm/vmx/vmcs.c        |    3 +++
 xen/arch/x86/hvm/vmx/vvmx.c        |   21 +++++++++++++++++++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 6ef9739..2ed25c7 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -78,6 +78,7 @@ static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
 static DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
+u64 __read_mostly vmx_basic_msr;
 
 static void __init vmx_display_features(void)
 {
@@ -301,6 +302,8 @@ static int vmx_init_vmcs_config(void)
         vmx_vmexit_control         = _vmx_vmexit_control;
         vmx_vmentry_control        = _vmx_vmentry_control;
         cpu_has_vmx_ins_outs_instr_info = !!(vmx_basic_msr_high & (1U<<22));
+        vmx_basic_msr              = ((u64)vmx_basic_msr_high << 32) |
+                                     vmx_basic_msr_low;
         vmx_display_features();
     }
     else
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 2c4801c..e500f14 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1814,12 +1814,33 @@ int nvmx_handle_invvpid(struct cpu_user_regs *regs)
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
     struct vcpu *v = current;
+    unsigned int ecx, dummy;
     u64 data = 0, host_data = 0;
     int r = 1;
 
     if ( !nestedhvm_enabled(v->domain) )
         return 0;
 
+    /* VMX capablity MSRs are available only when guest supports VMX. */
+    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &dummy);
+    if ( !(ecx & cpufeat_mask(X86_FEATURE_VMXE)) )
+        return 0;
+
+    /*
+     * Those MSRs are available only when bit 55 of
+     * MSR_IA32_VMX_BASIC is set.
+     */
+    switch ( msr )
+    {
+    case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
+    case MSR_IA32_VMX_TRUE_PROCBASED_CTLS:
+    case MSR_IA32_VMX_TRUE_EXIT_CTLS:
+    case MSR_IA32_VMX_TRUE_ENTRY_CTLS:
+        if ( !(vmx_basic_msr & VMX_BASIC_DEFAULT1_ZERO) )
+            return 0;
+        break;
+    }
+
     rdmsrl(msr, host_data);
 
     /*
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index f30e5ac..21f6777 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -284,6 +284,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr_info;
  */
 #define VMX_BASIC_DEFAULT1_ZERO		(1ULL << 55)
 
+extern u64 vmx_basic_msr;
+
 /* Guest interrupt status */
 #define VMX_GUEST_INTR_STATUS_SUBFIELD_BITMASK  0x0FF
 #define VMX_GUEST_INTR_STATUS_SVI_OFFSET        8
--
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 Oct 11 00:33:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUQft-0001ry-Gn; Fri, 11 Oct 2013 00: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 1VUQfr-0001ra-DJ
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:47 +0000
Received: from [85.158.137.68:24314] by server-15.bemta-3.messagelabs.com id
	50/2E-21409-A6747525; Fri, 11 Oct 2013 00:33:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1381451624!743760!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 874 invoked from network); 11 Oct 2013 00:33:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:33:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfo-0005Jm-3p
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfo-00005O-1M
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:44 +0000
Date: Fri, 11 Oct 2013 00:33:44 +0000
Message-Id: <E1VUQfo-00005O-1M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Nested VMX: fix
	IA32_VMX_CR4_FIXED1 msr emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6903c281d4d5eb84571a79b652a135c5687e616
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Wed Oct 9 12:03:41 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:03:41 2013 +0200

    Nested VMX: fix IA32_VMX_CR4_FIXED1 msr emulation
    
    Currently, it use hardcode value for IA32_VMX_CR4_FIXED1. This is wrong.
    We should check guest's cpuid to know which bits are writeable in CR4 by guest
    and allow the guest to set the corresponding bit only when guest has the feature.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    
    Cleanup.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: c6f92aed0e209df823d2cb5780dbb1ea12fc6d4a
    master date: 2013-10-04 12:30:09 +0200
---
 xen/arch/x86/hvm/vmx/vvmx.c      |   55 +++++++++++++++++++++++++++++++++++---
 xen/include/asm-x86/cpufeature.h |    1 +
 xen/include/asm-x86/processor.h  |    1 +
 3 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index e500f14..2acdf33 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1814,7 +1814,7 @@ int nvmx_handle_invvpid(struct cpu_user_regs *regs)
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
     struct vcpu *v = current;
-    unsigned int ecx, dummy;
+    unsigned int eax, ebx, ecx, edx, dummy;
     u64 data = 0, host_data = 0;
     int r = 1;
 
@@ -1822,7 +1822,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         return 0;
 
     /* VMX capablity MSRs are available only when guest supports VMX. */
-    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &dummy);
+    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &edx);
     if ( !(ecx & cpufeat_mask(X86_FEATURE_VMXE)) )
         return 0;
 
@@ -1946,8 +1946,55 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         data = X86_CR4_VMXE;
         break;
     case MSR_IA32_VMX_CR4_FIXED1:
-        /* allow 0-settings except SMXE */
-        data = 0x267ff & ~X86_CR4_SMXE;
+        if ( edx & cpufeat_mask(X86_FEATURE_VME) )
+            data |= X86_CR4_VME | X86_CR4_PVI;
+        if ( edx & cpufeat_mask(X86_FEATURE_TSC) )
+            data |= X86_CR4_TSD;
+        if ( edx & cpufeat_mask(X86_FEATURE_DE) )
+            data |= X86_CR4_DE;
+        if ( edx & cpufeat_mask(X86_FEATURE_PSE) )
+            data |= X86_CR4_PSE;
+        if ( edx & cpufeat_mask(X86_FEATURE_PAE) )
+            data |= X86_CR4_PAE;
+        if ( edx & cpufeat_mask(X86_FEATURE_MCE) )
+            data |= X86_CR4_MCE;
+        if ( edx & cpufeat_mask(X86_FEATURE_PGE) )
+            data |= X86_CR4_PGE;
+        if ( edx & cpufeat_mask(X86_FEATURE_FXSR) )
+            data |= X86_CR4_OSFXSR;
+        if ( edx & cpufeat_mask(X86_FEATURE_XMM) )
+            data |= X86_CR4_OSXMMEXCPT;
+        if ( ecx & cpufeat_mask(X86_FEATURE_VMXE) )
+            data |= X86_CR4_VMXE;
+        if ( ecx & cpufeat_mask(X86_FEATURE_SMXE) )
+            data |= X86_CR4_SMXE;
+        if ( ecx & cpufeat_mask(X86_FEATURE_PCID) )
+            data |= X86_CR4_PCIDE;
+        if ( ecx & cpufeat_mask(X86_FEATURE_XSAVE) )
+            data |= X86_CR4_OSXSAVE;
+
+        hvm_cpuid(0x0, &eax, &dummy, &dummy, &dummy);
+        switch ( eax )
+        {
+        default:
+            hvm_cpuid(0xa, &eax, &dummy, &dummy, &dummy);
+            /* Check whether guest has the perf monitor feature. */
+            if ( (eax & 0xff) && (eax & 0xff00) )
+                data |= X86_CR4_PCE;
+            /* fall through */
+        case 0x7 ... 0x9:
+            ecx = 0;
+            hvm_cpuid(0x7, &dummy, &ebx, &ecx, &dummy);
+            if ( ebx & cpufeat_mask(X86_FEATURE_FSGSBASE) )
+                data |= X86_CR4_FSGSBASE;
+            if ( ebx & cpufeat_mask(X86_FEATURE_SMEP) )
+                data |= X86_CR4_SMEP;
+            if ( ebx & cpufeat_mask(X86_FEATURE_SMAP) )
+                data |= X86_CR4_SMAP;
+            /* fall through */
+        case 0x0 ... 0x6:
+            break;
+        }
         break;
     case MSR_IA32_VMX_MISC:
         /* Do not support CR3-target feature now */
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 065c265..1cfaf94 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -148,6 +148,7 @@
 #define X86_FEATURE_INVPCID	(7*32+10) /* Invalidate Process Context ID */
 #define X86_FEATURE_RTM 	(7*32+11) /* Restricted Transactional Memory */
 #define X86_FEATURE_NO_FPU_SEL 	(7*32+13) /* FPU CS/DS stored as zero */
+#define X86_FEATURE_SMAP	(7*32+20) /* Supervisor Mode Access Prevention */
 
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)	test_bit(bit, boot_cpu_data.x86_capability)
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 5cdacc7..893afa3 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -87,6 +87,7 @@
 #define X86_CR4_PCIDE		0x20000 /* enable PCID */
 #define X86_CR4_OSXSAVE	0x40000 /* enable XSAVE/XRSTOR */
 #define X86_CR4_SMEP		0x100000/* enable SMEP */
+#define X86_CR4_SMAP		0x200000/* enable SMAP */
 
 /*
  * Trap/fault mnemonics.
--
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 Oct 11 00:33:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUQft-0001ry-Gn; Fri, 11 Oct 2013 00: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 1VUQfr-0001ra-DJ
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:47 +0000
Received: from [85.158.137.68:24314] by server-15.bemta-3.messagelabs.com id
	50/2E-21409-A6747525; Fri, 11 Oct 2013 00:33:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1381451624!743760!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 874 invoked from network); 11 Oct 2013 00:33:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:33:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfo-0005Jm-3p
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfo-00005O-1M
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:44 +0000
Date: Fri, 11 Oct 2013 00:33:44 +0000
Message-Id: <E1VUQfo-00005O-1M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Nested VMX: fix
	IA32_VMX_CR4_FIXED1 msr emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6903c281d4d5eb84571a79b652a135c5687e616
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Wed Oct 9 12:03:41 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:03:41 2013 +0200

    Nested VMX: fix IA32_VMX_CR4_FIXED1 msr emulation
    
    Currently, it use hardcode value for IA32_VMX_CR4_FIXED1. This is wrong.
    We should check guest's cpuid to know which bits are writeable in CR4 by guest
    and allow the guest to set the corresponding bit only when guest has the feature.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    
    Cleanup.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: c6f92aed0e209df823d2cb5780dbb1ea12fc6d4a
    master date: 2013-10-04 12:30:09 +0200
---
 xen/arch/x86/hvm/vmx/vvmx.c      |   55 +++++++++++++++++++++++++++++++++++---
 xen/include/asm-x86/cpufeature.h |    1 +
 xen/include/asm-x86/processor.h  |    1 +
 3 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index e500f14..2acdf33 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1814,7 +1814,7 @@ int nvmx_handle_invvpid(struct cpu_user_regs *regs)
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
     struct vcpu *v = current;
-    unsigned int ecx, dummy;
+    unsigned int eax, ebx, ecx, edx, dummy;
     u64 data = 0, host_data = 0;
     int r = 1;
 
@@ -1822,7 +1822,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         return 0;
 
     /* VMX capablity MSRs are available only when guest supports VMX. */
-    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &dummy);
+    hvm_cpuid(0x1, &dummy, &dummy, &ecx, &edx);
     if ( !(ecx & cpufeat_mask(X86_FEATURE_VMXE)) )
         return 0;
 
@@ -1946,8 +1946,55 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         data = X86_CR4_VMXE;
         break;
     case MSR_IA32_VMX_CR4_FIXED1:
-        /* allow 0-settings except SMXE */
-        data = 0x267ff & ~X86_CR4_SMXE;
+        if ( edx & cpufeat_mask(X86_FEATURE_VME) )
+            data |= X86_CR4_VME | X86_CR4_PVI;
+        if ( edx & cpufeat_mask(X86_FEATURE_TSC) )
+            data |= X86_CR4_TSD;
+        if ( edx & cpufeat_mask(X86_FEATURE_DE) )
+            data |= X86_CR4_DE;
+        if ( edx & cpufeat_mask(X86_FEATURE_PSE) )
+            data |= X86_CR4_PSE;
+        if ( edx & cpufeat_mask(X86_FEATURE_PAE) )
+            data |= X86_CR4_PAE;
+        if ( edx & cpufeat_mask(X86_FEATURE_MCE) )
+            data |= X86_CR4_MCE;
+        if ( edx & cpufeat_mask(X86_FEATURE_PGE) )
+            data |= X86_CR4_PGE;
+        if ( edx & cpufeat_mask(X86_FEATURE_FXSR) )
+            data |= X86_CR4_OSFXSR;
+        if ( edx & cpufeat_mask(X86_FEATURE_XMM) )
+            data |= X86_CR4_OSXMMEXCPT;
+        if ( ecx & cpufeat_mask(X86_FEATURE_VMXE) )
+            data |= X86_CR4_VMXE;
+        if ( ecx & cpufeat_mask(X86_FEATURE_SMXE) )
+            data |= X86_CR4_SMXE;
+        if ( ecx & cpufeat_mask(X86_FEATURE_PCID) )
+            data |= X86_CR4_PCIDE;
+        if ( ecx & cpufeat_mask(X86_FEATURE_XSAVE) )
+            data |= X86_CR4_OSXSAVE;
+
+        hvm_cpuid(0x0, &eax, &dummy, &dummy, &dummy);
+        switch ( eax )
+        {
+        default:
+            hvm_cpuid(0xa, &eax, &dummy, &dummy, &dummy);
+            /* Check whether guest has the perf monitor feature. */
+            if ( (eax & 0xff) && (eax & 0xff00) )
+                data |= X86_CR4_PCE;
+            /* fall through */
+        case 0x7 ... 0x9:
+            ecx = 0;
+            hvm_cpuid(0x7, &dummy, &ebx, &ecx, &dummy);
+            if ( ebx & cpufeat_mask(X86_FEATURE_FSGSBASE) )
+                data |= X86_CR4_FSGSBASE;
+            if ( ebx & cpufeat_mask(X86_FEATURE_SMEP) )
+                data |= X86_CR4_SMEP;
+            if ( ebx & cpufeat_mask(X86_FEATURE_SMAP) )
+                data |= X86_CR4_SMAP;
+            /* fall through */
+        case 0x0 ... 0x6:
+            break;
+        }
         break;
     case MSR_IA32_VMX_MISC:
         /* Do not support CR3-target feature now */
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 065c265..1cfaf94 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -148,6 +148,7 @@
 #define X86_FEATURE_INVPCID	(7*32+10) /* Invalidate Process Context ID */
 #define X86_FEATURE_RTM 	(7*32+11) /* Restricted Transactional Memory */
 #define X86_FEATURE_NO_FPU_SEL 	(7*32+13) /* FPU CS/DS stored as zero */
+#define X86_FEATURE_SMAP	(7*32+20) /* Supervisor Mode Access Prevention */
 
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)	test_bit(bit, boot_cpu_data.x86_capability)
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 5cdacc7..893afa3 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -87,6 +87,7 @@
 #define X86_CR4_PCIDE		0x20000 /* enable PCID */
 #define X86_CR4_OSXSAVE	0x40000 /* enable XSAVE/XRSTOR */
 #define X86_CR4_SMEP		0x100000/* enable SMEP */
+#define X86_CR4_SMAP		0x200000/* enable SMAP */
 
 /*
  * Trap/fault mnemonics.
--
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 Oct 11 00:34:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:34: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 1VUQg3-0001ta-SQ; Fri, 11 Oct 2013 00:34: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 1VUQg1-0001tC-EZ
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:57 +0000
Received: from [85.158.137.68:24615] by server-12.bemta-3.messagelabs.com id
	9F/D2-11891-47747525; Fri, 11 Oct 2013 00:33:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1381451634!740076!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4440 invoked from network); 11 Oct 2013 00:33:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:33:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfy-0005Js-CJ
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfy-00005v-Aa
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:54 +0000
Date: Fri, 11 Oct 2013 00:33:54 +0000
Message-Id: <E1VUQfy-00005v-Aa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] xsm: forbid PV guest console reads
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b267a5a2cae14c97ab9198336f1529e7e48fad22
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Wed Oct 9 12:04:29 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:04:29 2013 +0200

    xsm: forbid PV guest console reads
    
    The CONSOLEIO_read operation was incorrectly allowed to PV guests if the
    hypervisor was compiled in debug mode (with VERBOSE defined).
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 65ba631bcb62c79eb33ebfde8a0471fd012c37a8
    master date: 2013-10-04 12:51:44 +0200
---
 xen/include/xsm/dummy.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index cc0a5a8..ecf262b 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -222,10 +222,10 @@ static XSM_INLINE int xsm_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
 #ifdef VERBOSE
-    return xsm_default_action(XSM_HOOK, current->domain, NULL);
-#else
-    return xsm_default_action(XSM_PRIV, current->domain, NULL);
+    if ( cmd == CONSOLEIO_write )
+        return xsm_default_action(XSM_HOOK, d, NULL);
 #endif
+    return xsm_default_action(XSM_PRIV, d, NULL);
 }
 
 static XSM_INLINE int xsm_profile(XSM_DEFAULT_ARG struct domain *d, int op)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 00:34:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:34: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 1VUQg3-0001ta-SQ; Fri, 11 Oct 2013 00:34: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 1VUQg1-0001tC-EZ
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:57 +0000
Received: from [85.158.137.68:24615] by server-12.bemta-3.messagelabs.com id
	9F/D2-11891-47747525; Fri, 11 Oct 2013 00:33:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1381451634!740076!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4440 invoked from network); 11 Oct 2013 00:33:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:33:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfy-0005Js-CJ
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQfy-00005v-Aa
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:33:54 +0000
Date: Fri, 11 Oct 2013 00:33:54 +0000
Message-Id: <E1VUQfy-00005v-Aa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] xsm: forbid PV guest console reads
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b267a5a2cae14c97ab9198336f1529e7e48fad22
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Wed Oct 9 12:04:29 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 9 12:04:29 2013 +0200

    xsm: forbid PV guest console reads
    
    The CONSOLEIO_read operation was incorrectly allowed to PV guests if the
    hypervisor was compiled in debug mode (with VERBOSE defined).
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 65ba631bcb62c79eb33ebfde8a0471fd012c37a8
    master date: 2013-10-04 12:51:44 +0200
---
 xen/include/xsm/dummy.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index cc0a5a8..ecf262b 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -222,10 +222,10 @@ static XSM_INLINE int xsm_console_io(XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
 #ifdef VERBOSE
-    return xsm_default_action(XSM_HOOK, current->domain, NULL);
-#else
-    return xsm_default_action(XSM_PRIV, current->domain, NULL);
+    if ( cmd == CONSOLEIO_write )
+        return xsm_default_action(XSM_HOOK, d, NULL);
 #endif
+    return xsm_default_action(XSM_PRIV, d, NULL);
 }
 
 static XSM_INLINE int xsm_profile(XSM_DEFAULT_ARG struct domain *d, int op)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 00:34:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:34: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 1VUQgD-0001vF-Nl; Fri, 11 Oct 2013 00:34: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 1VUQgB-0001uo-J8
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:07 +0000
Received: from [85.158.139.211:25098] by server-3.bemta-5.messagelabs.com id
	68/2B-19273-E7747525; Fri, 11 Oct 2013 00:34:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1381451644!706978!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4912 invoked from network); 11 Oct 2013 00:34:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:34:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQg8-0005KR-Hf
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQg8-00006U-G8
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:04 +0000
Date: Fri, 11 Oct 2013 00:34:04 +0000
Message-Id: <E1VUQg8-00006U-G8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: check segment descriptor read
	result in 64-bit OUTS emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 889f547790953d30cd88a465aac5954e5f407e53
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Thu Oct 10 15:22:55 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 10 15:22:55 2013 +0200

    x86: check segment descriptor read result in 64-bit OUTS emulation
    
    When emulating such an operation from a 64-bit context (CS has long
    mode set), and the data segment is overridden to FS/GS, the result of
    reading the overridden segment's descriptor (read_descriptor) is not
    checked. If it fails, data_base is left uninitialized.
    
    This can lead to 8 bytes of Xen's stack being leaked to the guest
    (implicitly, i.e. via the address given in a #PF).
    
    Coverity-ID: 1055116
    
    This is CVE-2013-4368 / XSA-67.
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix formatting.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 0771faba163769089c9f05f7f76b63e397677613
    master date: 2013-10-10 15:19:53 +0200
---
 xen/arch/x86/traps.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 2e6895c..eb426ec 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1990,10 +1990,10 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                     break;
                 }
             }
-            else
-                read_descriptor(data_sel, v, regs,
-                                &data_base, &data_limit, &ar,
-                                0);
+            else if ( !read_descriptor(data_sel, v, regs,
+                                       &data_base, &data_limit, &ar, 0) ||
+                      !(ar & _SEGMENT_S) || !(ar & _SEGMENT_P) )
+                goto fail;
             data_limit = ~0UL;
             ar = _SEGMENT_WR|_SEGMENT_S|_SEGMENT_DPL|_SEGMENT_P;
         }
--
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 Oct 11 00:34:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:34: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 1VUQgD-0001vF-Nl; Fri, 11 Oct 2013 00:34: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 1VUQgB-0001uo-J8
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:07 +0000
Received: from [85.158.139.211:25098] by server-3.bemta-5.messagelabs.com id
	68/2B-19273-E7747525; Fri, 11 Oct 2013 00:34:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1381451644!706978!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4912 invoked from network); 11 Oct 2013 00:34:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:34:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQg8-0005KR-Hf
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQg8-00006U-G8
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:04 +0000
Date: Fri, 11 Oct 2013 00:34:04 +0000
Message-Id: <E1VUQg8-00006U-G8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: check segment descriptor read
	result in 64-bit OUTS emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 889f547790953d30cd88a465aac5954e5f407e53
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Thu Oct 10 15:22:55 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 10 15:22:55 2013 +0200

    x86: check segment descriptor read result in 64-bit OUTS emulation
    
    When emulating such an operation from a 64-bit context (CS has long
    mode set), and the data segment is overridden to FS/GS, the result of
    reading the overridden segment's descriptor (read_descriptor) is not
    checked. If it fails, data_base is left uninitialized.
    
    This can lead to 8 bytes of Xen's stack being leaked to the guest
    (implicitly, i.e. via the address given in a #PF).
    
    Coverity-ID: 1055116
    
    This is CVE-2013-4368 / XSA-67.
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix formatting.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 0771faba163769089c9f05f7f76b63e397677613
    master date: 2013-10-10 15:19:53 +0200
---
 xen/arch/x86/traps.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 2e6895c..eb426ec 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1990,10 +1990,10 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                     break;
                 }
             }
-            else
-                read_descriptor(data_sel, v, regs,
-                                &data_base, &data_limit, &ar,
-                                0);
+            else if ( !read_descriptor(data_sel, v, regs,
+                                       &data_base, &data_limit, &ar, 0) ||
+                      !(ar & _SEGMENT_S) || !(ar & _SEGMENT_P) )
+                goto fail;
             data_limit = ~0UL;
             ar = _SEGMENT_WR|_SEGMENT_S|_SEGMENT_DPL|_SEGMENT_P;
         }
--
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 Oct 11 00:34:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:34:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUQgN-0001wz-G3; Fri, 11 Oct 2013 00:34: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 1VUQgL-0001wa-5z
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:17 +0000
Received: from [193.109.254.147:22547] by server-2.bemta-14.messagelabs.com id
	99/A3-18933-88747525; Fri, 11 Oct 2013 00:34:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1381451654!1428901!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10049 invoked from network); 11 Oct 2013 00:34:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:34:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQgI-0005Ka-Nm
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQgI-00006s-LC
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:14 +0000
Date: Fri, 11 Oct 2013 00:34:14 +0000
Message-Id: <E1VUQgI-00006s-LC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] libxl: fix vif rate parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 60aefd150bc0ad0c7d325da5ffea0bf4e0544130
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 10 15:48:55 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 16:06:13 2013 +0100

    libxl: fix vif rate parsing
    
    strtok can return NULL here. We don't need to use strtok anyway, so just
    use a simple strchr method.
    
    Coverity-ID: 1055642
    
    This is CVE-2013-4369 / XSA-68
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix type. Add test case
    
    Signed-off-by: Ian Campbell <Ian.campbell@citrix.com>
    (cherry picked from commit c53702cee1d6f9f1b72f0cae0b412e21bcda8724)
---
 tools/libxl/check-xl-vif-parse |    4 ++++
 tools/libxl/libxlu_vif.c       |   19 +++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/check-xl-vif-parse b/tools/libxl/check-xl-vif-parse
index 0473182..02c6dba 100755
--- a/tools/libxl/check-xl-vif-parse
+++ b/tools/libxl/check-xl-vif-parse
@@ -206,4 +206,8 @@ expected </dev/null
 one $e rate=4294967295GB/s@5us
 one $e rate=4296MB/s@4294s
 
+# test include of single '@'
+expected </dev/null
+one $e rate=@
+
 complete
diff --git a/tools/libxl/libxlu_vif.c b/tools/libxl/libxlu_vif.c
index 3b3de0f..0665e62 100644
--- a/tools/libxl/libxlu_vif.c
+++ b/tools/libxl/libxlu_vif.c
@@ -95,23 +95,30 @@ int xlu_vif_parse_rate(XLU_Config *cfg, const char *rate, libxl_device_nic *nic)
     uint64_t bytes_per_sec = 0;
     uint64_t bytes_per_interval = 0;
     uint32_t interval_usecs = 50000UL; /* Default to 50ms */
-    char *ratetok, *tmprate;
+    char *p, *tmprate;
     int rc = 0;
 
     tmprate = strdup(rate);
+    if (tmprate == NULL) {
+        rc = ENOMEM;
+        goto out;
+    }
+
+    p = strchr(tmprate, '@');
+    if (p != NULL)
+        *p++ = 0;
+
     if (!strcmp(tmprate,"")) {
         xlu__vif_err(cfg, "no rate specified", rate);
         rc = EINVAL;
         goto out;
     }
 
-    ratetok = strtok(tmprate, "@");
-    rc = vif_parse_rate_bytes_per_sec(cfg, ratetok, &bytes_per_sec);
+    rc = vif_parse_rate_bytes_per_sec(cfg, tmprate, &bytes_per_sec);
     if (rc) goto out;
 
-    ratetok = strtok(NULL, "@");
-    if (ratetok != NULL) {
-        rc = vif_parse_rate_interval_usecs(cfg, ratetok, &interval_usecs);
+    if (p != NULL) {
+        rc = vif_parse_rate_interval_usecs(cfg, p, &interval_usecs);
         if (rc) goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 00:34:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:34:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUQgN-0001wz-G3; Fri, 11 Oct 2013 00:34: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 1VUQgL-0001wa-5z
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:17 +0000
Received: from [193.109.254.147:22547] by server-2.bemta-14.messagelabs.com id
	99/A3-18933-88747525; Fri, 11 Oct 2013 00:34:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1381451654!1428901!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10049 invoked from network); 11 Oct 2013 00:34:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:34:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQgI-0005Ka-Nm
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQgI-00006s-LC
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:14 +0000
Date: Fri, 11 Oct 2013 00:34:14 +0000
Message-Id: <E1VUQgI-00006s-LC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] libxl: fix vif rate parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 60aefd150bc0ad0c7d325da5ffea0bf4e0544130
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 10 15:48:55 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 16:06:13 2013 +0100

    libxl: fix vif rate parsing
    
    strtok can return NULL here. We don't need to use strtok anyway, so just
    use a simple strchr method.
    
    Coverity-ID: 1055642
    
    This is CVE-2013-4369 / XSA-68
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix type. Add test case
    
    Signed-off-by: Ian Campbell <Ian.campbell@citrix.com>
    (cherry picked from commit c53702cee1d6f9f1b72f0cae0b412e21bcda8724)
---
 tools/libxl/check-xl-vif-parse |    4 ++++
 tools/libxl/libxlu_vif.c       |   19 +++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/check-xl-vif-parse b/tools/libxl/check-xl-vif-parse
index 0473182..02c6dba 100755
--- a/tools/libxl/check-xl-vif-parse
+++ b/tools/libxl/check-xl-vif-parse
@@ -206,4 +206,8 @@ expected </dev/null
 one $e rate=4294967295GB/s@5us
 one $e rate=4296MB/s@4294s
 
+# test include of single '@'
+expected </dev/null
+one $e rate=@
+
 complete
diff --git a/tools/libxl/libxlu_vif.c b/tools/libxl/libxlu_vif.c
index 3b3de0f..0665e62 100644
--- a/tools/libxl/libxlu_vif.c
+++ b/tools/libxl/libxlu_vif.c
@@ -95,23 +95,30 @@ int xlu_vif_parse_rate(XLU_Config *cfg, const char *rate, libxl_device_nic *nic)
     uint64_t bytes_per_sec = 0;
     uint64_t bytes_per_interval = 0;
     uint32_t interval_usecs = 50000UL; /* Default to 50ms */
-    char *ratetok, *tmprate;
+    char *p, *tmprate;
     int rc = 0;
 
     tmprate = strdup(rate);
+    if (tmprate == NULL) {
+        rc = ENOMEM;
+        goto out;
+    }
+
+    p = strchr(tmprate, '@');
+    if (p != NULL)
+        *p++ = 0;
+
     if (!strcmp(tmprate,"")) {
         xlu__vif_err(cfg, "no rate specified", rate);
         rc = EINVAL;
         goto out;
     }
 
-    ratetok = strtok(tmprate, "@");
-    rc = vif_parse_rate_bytes_per_sec(cfg, ratetok, &bytes_per_sec);
+    rc = vif_parse_rate_bytes_per_sec(cfg, tmprate, &bytes_per_sec);
     if (rc) goto out;
 
-    ratetok = strtok(NULL, "@");
-    if (ratetok != NULL) {
-        rc = vif_parse_rate_interval_usecs(cfg, ratetok, &interval_usecs);
+    if (p != NULL) {
+        rc = vif_parse_rate_interval_usecs(cfg, p, &interval_usecs);
         if (rc) goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 00:34:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:34: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 1VUQgX-0001yx-NI; Fri, 11 Oct 2013 00:34: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 1VUQgW-0001yS-6A
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:28 +0000
Received: from [193.109.254.147:22800] by server-9.bemta-14.messagelabs.com id
	8A/90-30026-29747525; Fri, 11 Oct 2013 00:34:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1381451665!1418002!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13687 invoked from network); 11 Oct 2013 00:34:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:34:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQgS-0005Kd-TE
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQgS-00007l-Qg
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:24 +0000
Date: Fri, 11 Oct 2013 00:34:24 +0000
Message-Id: <E1VUQgS-00007l-Qg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools/ocaml: fix erroneous free of
	cpumap in stub_xc_vcpu_getaffinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit debfacf7d68de8e39a06ebc7f7b22386b28ce6fb
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Tue Sep 10 23:12:45 2013 +1200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 16:06:17 2013 +0100

    tools/ocaml: fix erroneous free of cpumap in stub_xc_vcpu_getaffinity
    
    Not sure how it got there...
    
    Coverity-ID: 1056196
    
    This is CVE-2013-4370 / XSA-69
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 3cd10fd21220f2b814324e6e732004f8f0487d0a)
---
 tools/ocaml/libs/xc/xenctrl_stubs.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index df756ad..f5cf0ed 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -461,8 +461,6 @@ CAMLprim value stub_xc_vcpu_getaffinity(value xch, value domid,
 
 	retval = xc_vcpu_getaffinity(_H(xch), _D(domid),
 	                             Int_val(vcpu), c_cpumap);
-	free(c_cpumap);
-
 	if (retval < 0) {
 		free(c_cpumap);
 		failwith_xc(_H(xch));
--
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 Oct 11 00:34:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:34: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 1VUQgX-0001yx-NI; Fri, 11 Oct 2013 00:34: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 1VUQgW-0001yS-6A
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:28 +0000
Received: from [193.109.254.147:22800] by server-9.bemta-14.messagelabs.com id
	8A/90-30026-29747525; Fri, 11 Oct 2013 00:34:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1381451665!1418002!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13687 invoked from network); 11 Oct 2013 00:34:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:34:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQgS-0005Kd-TE
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQgS-00007l-Qg
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:24 +0000
Date: Fri, 11 Oct 2013 00:34:24 +0000
Message-Id: <E1VUQgS-00007l-Qg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools/ocaml: fix erroneous free of
	cpumap in stub_xc_vcpu_getaffinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit debfacf7d68de8e39a06ebc7f7b22386b28ce6fb
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Tue Sep 10 23:12:45 2013 +1200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 16:06:17 2013 +0100

    tools/ocaml: fix erroneous free of cpumap in stub_xc_vcpu_getaffinity
    
    Not sure how it got there...
    
    Coverity-ID: 1056196
    
    This is CVE-2013-4370 / XSA-69
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 3cd10fd21220f2b814324e6e732004f8f0487d0a)
---
 tools/ocaml/libs/xc/xenctrl_stubs.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index df756ad..f5cf0ed 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -461,8 +461,6 @@ CAMLprim value stub_xc_vcpu_getaffinity(value xch, value domid,
 
 	retval = xc_vcpu_getaffinity(_H(xch), _D(domid),
 	                             Int_val(vcpu), c_cpumap);
-	free(c_cpumap);
-
 	if (retval < 0) {
 		free(c_cpumap);
 		failwith_xc(_H(xch));
--
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 Oct 11 00:34:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:34: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 1VUQgg-00020w-Rs; Fri, 11 Oct 2013 00:34: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 1VUQgf-00020Y-Gi
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:37 +0000
Received: from [193.109.254.147:23127] by server-4.bemta-14.messagelabs.com id
	61/C4-05823-C9747525; Fri, 11 Oct 2013 00:34:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1381451675!1419415!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5624 invoked from network); 11 Oct 2013 00:34:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:34:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQgd-0005Ko-2e
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQgd-00008B-0m
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:35 +0000
Date: Fri, 11 Oct 2013 00:34:35 +0000
Message-Id: <E1VUQgd-00008B-0m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] libxl: fix out-of-memory error
	handling in libxl_list_cpupool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2350e70ee06c903a927340f7a0bf9ca25acce3f3
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Tue Sep 10 22:18:46 2013 +1200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 16:06:21 2013 +0100

    libxl: fix out-of-memory error handling in libxl_list_cpupool
    
    ...otherwise it will return freed memory. All the current users of this
    function check already for a NULL return, so use that.
    
    Coverity-ID: 1056194
    
    This is CVE-2013-4371 / XSA-70
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 4c37ed562224295c0f8b00211287d57cae629782)
---
 tools/libxl/libxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index dcb3df9..826236f 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -649,6 +649,7 @@ libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx, int *nb_pool_out)
         if (!tmp) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpupool info");
             libxl_cpupoolinfo_list_free(ptr, i);
+            ptr = NULL;
             goto out;
         }
         ptr = tmp;
--
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 Oct 11 00:34:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 00:34: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 1VUQgg-00020w-Rs; Fri, 11 Oct 2013 00:34: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 1VUQgf-00020Y-Gi
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:37 +0000
Received: from [193.109.254.147:23127] by server-4.bemta-14.messagelabs.com id
	61/C4-05823-C9747525; Fri, 11 Oct 2013 00:34:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1381451675!1419415!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5624 invoked from network); 11 Oct 2013 00:34:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 00:34:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQgd-0005Ko-2e
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUQgd-00008B-0m
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 00:34:35 +0000
Date: Fri, 11 Oct 2013 00:34:35 +0000
Message-Id: <E1VUQgd-00008B-0m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] libxl: fix out-of-memory error
	handling in libxl_list_cpupool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2350e70ee06c903a927340f7a0bf9ca25acce3f3
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Tue Sep 10 22:18:46 2013 +1200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 16:06:21 2013 +0100

    libxl: fix out-of-memory error handling in libxl_list_cpupool
    
    ...otherwise it will return freed memory. All the current users of this
    function check already for a NULL return, so use that.
    
    Coverity-ID: 1056194
    
    This is CVE-2013-4371 / XSA-70
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 4c37ed562224295c0f8b00211287d57cae629782)
---
 tools/libxl/libxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index dcb3df9..826236f 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -649,6 +649,7 @@ libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx, int *nb_pool_out)
         if (!tmp) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpupool info");
             libxl_cpupoolinfo_list_free(ptr, i);
+            ptr = NULL;
             goto out;
         }
         ptr = tmp;
--
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 Oct 11 03:22:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 03: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 1VUTIk-0007bK-50; Fri, 11 Oct 2013 03:22: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 1VUTIj-0007bE-Di
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 03:22:05 +0000
Received: from [85.158.139.211:20212] by server-2.bemta-5.messagelabs.com id
	99/5F-26841-CDE67525; Fri, 11 Oct 2013 03:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1381461723!721056!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20347 invoked from network); 11 Oct 2013 03:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 03:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUTIg-0005Qg-TL
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 03:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUTIg-000581-Nw
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 03:22:02 +0000
Date: Fri, 11 Oct 2013 03:22:02 +0000
Message-Id: <E1VUTIg-000581-Nw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: check segment descriptor read
	result in 64-bit OUTS emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5ceec62beb350d37515341f400b170c5425d065f
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Thu Oct 10 15:25:58 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 10 15:25:58 2013 +0200

    x86: check segment descriptor read result in 64-bit OUTS emulation
    
    When emulating such an operation from a 64-bit context (CS has long
    mode set), and the data segment is overridden to FS/GS, the result of
    reading the overridden segment's descriptor (read_descriptor) is not
    checked. If it fails, data_base is left uninitialized.
    
    This can lead to 8 bytes of Xen's stack being leaked to the guest
    (implicitly, i.e. via the address given in a #PF).
    
    Coverity-ID: 1055116
    
    This is CVE-2013-4368 / XSA-67.
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix formatting.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 0771faba163769089c9f05f7f76b63e397677613
    master date: 2013-10-10 15:19:53 +0200
---
 xen/arch/x86/traps.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index f69ca0b..d33a6ec 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1965,10 +1965,10 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                     break;
                 }
             }
-            else
-                read_descriptor(data_sel, v, regs,
-                                &data_base, &data_limit, &ar,
-                                0);
+            else if ( !read_descriptor(data_sel, v, regs,
+                                       &data_base, &data_limit, &ar, 0) ||
+                      !(ar & _SEGMENT_S) || !(ar & _SEGMENT_P) )
+                goto fail;
             data_limit = ~0UL;
             ar = _SEGMENT_WR|_SEGMENT_S|_SEGMENT_DPL|_SEGMENT_P;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 03:22:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 03: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 1VUTIk-0007bK-50; Fri, 11 Oct 2013 03:22: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 1VUTIj-0007bE-Di
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 03:22:05 +0000
Received: from [85.158.139.211:20212] by server-2.bemta-5.messagelabs.com id
	99/5F-26841-CDE67525; Fri, 11 Oct 2013 03:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1381461723!721056!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20347 invoked from network); 11 Oct 2013 03:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 03:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUTIg-0005Qg-TL
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 03:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUTIg-000581-Nw
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 03:22:02 +0000
Date: Fri, 11 Oct 2013 03:22:02 +0000
Message-Id: <E1VUTIg-000581-Nw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: check segment descriptor read
	result in 64-bit OUTS emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5ceec62beb350d37515341f400b170c5425d065f
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Thu Oct 10 15:25:58 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 10 15:25:58 2013 +0200

    x86: check segment descriptor read result in 64-bit OUTS emulation
    
    When emulating such an operation from a 64-bit context (CS has long
    mode set), and the data segment is overridden to FS/GS, the result of
    reading the overridden segment's descriptor (read_descriptor) is not
    checked. If it fails, data_base is left uninitialized.
    
    This can lead to 8 bytes of Xen's stack being leaked to the guest
    (implicitly, i.e. via the address given in a #PF).
    
    Coverity-ID: 1055116
    
    This is CVE-2013-4368 / XSA-67.
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix formatting.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 0771faba163769089c9f05f7f76b63e397677613
    master date: 2013-10-10 15:19:53 +0200
---
 xen/arch/x86/traps.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index f69ca0b..d33a6ec 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1965,10 +1965,10 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                     break;
                 }
             }
-            else
-                read_descriptor(data_sel, v, regs,
-                                &data_base, &data_limit, &ar,
-                                0);
+            else if ( !read_descriptor(data_sel, v, regs,
+                                       &data_base, &data_limit, &ar, 0) ||
+                      !(ar & _SEGMENT_S) || !(ar & _SEGMENT_P) )
+                goto fail;
             data_limit = ~0UL;
             ar = _SEGMENT_WR|_SEGMENT_S|_SEGMENT_DPL|_SEGMENT_P;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 18:11:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 18:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUhB5-0003AE-5h; Fri, 11 Oct 2013 18:11: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 1VUhB4-0003A7-0o
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 18:11:06 +0000
Received: from [85.158.137.68:44091] by server-4.bemta-3.messagelabs.com id
	7A/57-13758-93F38525; Fri, 11 Oct 2013 18:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1381515063!934414!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13326 invoked from network); 11 Oct 2013 18:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 18:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUhB1-0007WU-2X
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 18:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUhB0-0004hr-P3
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 18:11:02 +0000
Date: Fri, 11 Oct 2013 18:11:02 +0000
Message-Id: <E1VUhB0-0004hr-P3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.3-testing] passthrough: Correctly
	expose PCH ISA bridge for IGD passthrough
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0bd3d991be73031b8d9c07ccf43e5785ca26ca71
Author:     G.R <firemeteor.guo@gmail.com>
AuthorDate: Thu Jul 25 08:11:55 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 11 19:04:04 2013 +0100

    passthrough: Correctly expose PCH ISA bridge for IGD passthrough
    
    The i915 driver probes chip version through PCH ISA bridge device / vendor ID.
    Previously, the PCH ISA bridge is exposed as PCI-PCI bridge in qemu-xen-trad,
    which breaks the assumption of the driver. This change fixes the issue by
    correctly exposing the ISA bridge to domU.
    
    Signed-off-by: Rui Guo <firemeteor@users.sourceforge.net>
    Tested-by: Rui Guo <firemeteor@users.sourceforge.net>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Jan Beulich <JBeulich@suse.com>
    (cherry picked from commit 73c4ad5a3d065267b878c8ae31ff0b4833f093e4)
---
 hw/pci.c         |   10 ++++++++++
 hw/pci.h         |    3 +++
 hw/pt-graphics.c |    9 ++++++---
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/hw/pci.c b/hw/pci.c
index f051de1..c423285 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -938,6 +938,16 @@ PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
     return s->bus;
 }
 
+PCIBus *pci_isa_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
+                            uint8_t rid, pci_map_irq_fn map_irq, const char *name)
+{
+    PCIBus *s = pci_bridge_init(bus, devfn, vid, did, rid, map_irq, name);
+
+    pci_config_set_class(s->parent_dev->config, PCI_CLASS_BRIDGE_ISA);
+    s->parent_dev->config[PCI_HEADER_TYPE] = 0x80;
+    return s;
+}
+
 int pt_chk_bar_overlap(PCIBus *bus, int devfn, uint32_t addr,
                         uint32_t size, uint8_t type)
 {
diff --git a/hw/pci.h b/hw/pci.h
index edc58b6..cacbdd2 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -271,6 +271,9 @@ void pci_info(void);
 PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
                         uint8_t rid, pci_map_irq_fn map_irq, const char *name);
 
+PCIBus *pci_isa_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
+                            uint8_t rid, pci_map_irq_fn map_irq, const char *name);
+
 #define NR_PCI_FUNC          8
 #define NR_PCI_DEV           32
 #define NR_PCI_DEVFN         (NR_PCI_FUNC * NR_PCI_DEV)
diff --git a/hw/pt-graphics.c b/hw/pt-graphics.c
index c6f8869..7302b25 100644
--- a/hw/pt-graphics.c
+++ b/hw/pt-graphics.c
@@ -3,6 +3,7 @@
  */
 
 #include "pass-through.h"
+#include "pci.h"
 #include "pci/header.h"
 #include "pci/pci.h"
 
@@ -40,9 +41,11 @@ void intel_pch_init(PCIBus *bus)
     did = pt_pci_host_read(pci_dev_1f, PCI_DEVICE_ID, 2);
     rid = pt_pci_host_read(pci_dev_1f, PCI_REVISION, 1);
 
-    if ( vid == PCI_VENDOR_ID_INTEL )
-        pci_bridge_init(bus, PCI_DEVFN(0x1f, 0), vid, did, rid,
-                        pch_map_irq, "intel_bridge_1f");
+    if (vid == PCI_VENDOR_ID_INTEL) {
+        pci_isa_bridge_init(bus, PCI_DEVFN(0x1f, 0), vid, did, rid,
+                            pch_map_irq, "intel_bridge_1f");
+
+    }
 }
 
 uint32_t igd_read_opregion(struct pt_dev *pci_dev)
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.3-testing.git

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 18:11:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 18:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUhB5-0003AE-5h; Fri, 11 Oct 2013 18:11: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 1VUhB4-0003A7-0o
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 18:11:06 +0000
Received: from [85.158.137.68:44091] by server-4.bemta-3.messagelabs.com id
	7A/57-13758-93F38525; Fri, 11 Oct 2013 18:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1381515063!934414!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13326 invoked from network); 11 Oct 2013 18:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 18:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUhB1-0007WU-2X
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 18:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUhB0-0004hr-P3
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 18:11:02 +0000
Date: Fri, 11 Oct 2013 18:11:02 +0000
Message-Id: <E1VUhB0-0004hr-P3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.3-testing] passthrough: Correctly
	expose PCH ISA bridge for IGD passthrough
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0bd3d991be73031b8d9c07ccf43e5785ca26ca71
Author:     G.R <firemeteor.guo@gmail.com>
AuthorDate: Thu Jul 25 08:11:55 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 11 19:04:04 2013 +0100

    passthrough: Correctly expose PCH ISA bridge for IGD passthrough
    
    The i915 driver probes chip version through PCH ISA bridge device / vendor ID.
    Previously, the PCH ISA bridge is exposed as PCI-PCI bridge in qemu-xen-trad,
    which breaks the assumption of the driver. This change fixes the issue by
    correctly exposing the ISA bridge to domU.
    
    Signed-off-by: Rui Guo <firemeteor@users.sourceforge.net>
    Tested-by: Rui Guo <firemeteor@users.sourceforge.net>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Jan Beulich <JBeulich@suse.com>
    (cherry picked from commit 73c4ad5a3d065267b878c8ae31ff0b4833f093e4)
---
 hw/pci.c         |   10 ++++++++++
 hw/pci.h         |    3 +++
 hw/pt-graphics.c |    9 ++++++---
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/hw/pci.c b/hw/pci.c
index f051de1..c423285 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -938,6 +938,16 @@ PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
     return s->bus;
 }
 
+PCIBus *pci_isa_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
+                            uint8_t rid, pci_map_irq_fn map_irq, const char *name)
+{
+    PCIBus *s = pci_bridge_init(bus, devfn, vid, did, rid, map_irq, name);
+
+    pci_config_set_class(s->parent_dev->config, PCI_CLASS_BRIDGE_ISA);
+    s->parent_dev->config[PCI_HEADER_TYPE] = 0x80;
+    return s;
+}
+
 int pt_chk_bar_overlap(PCIBus *bus, int devfn, uint32_t addr,
                         uint32_t size, uint8_t type)
 {
diff --git a/hw/pci.h b/hw/pci.h
index edc58b6..cacbdd2 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -271,6 +271,9 @@ void pci_info(void);
 PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
                         uint8_t rid, pci_map_irq_fn map_irq, const char *name);
 
+PCIBus *pci_isa_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
+                            uint8_t rid, pci_map_irq_fn map_irq, const char *name);
+
 #define NR_PCI_FUNC          8
 #define NR_PCI_DEV           32
 #define NR_PCI_DEVFN         (NR_PCI_FUNC * NR_PCI_DEV)
diff --git a/hw/pt-graphics.c b/hw/pt-graphics.c
index c6f8869..7302b25 100644
--- a/hw/pt-graphics.c
+++ b/hw/pt-graphics.c
@@ -3,6 +3,7 @@
  */
 
 #include "pass-through.h"
+#include "pci.h"
 #include "pci/header.h"
 #include "pci/pci.h"
 
@@ -40,9 +41,11 @@ void intel_pch_init(PCIBus *bus)
     did = pt_pci_host_read(pci_dev_1f, PCI_DEVICE_ID, 2);
     rid = pt_pci_host_read(pci_dev_1f, PCI_REVISION, 1);
 
-    if ( vid == PCI_VENDOR_ID_INTEL )
-        pci_bridge_init(bus, PCI_DEVFN(0x1f, 0), vid, did, rid,
-                        pch_map_irq, "intel_bridge_1f");
+    if (vid == PCI_VENDOR_ID_INTEL) {
+        pci_isa_bridge_init(bus, PCI_DEVFN(0x1f, 0), vid, did, rid,
+                            pch_map_irq, "intel_bridge_1f");
+
+    }
 }
 
 uint32_t igd_read_opregion(struct pt_dev *pci_dev)
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.3-testing.git

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 22:11:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 22: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 1VUkvQ-0001Ia-DX; Fri, 11 Oct 2013 22:11: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 1VUkvP-0001IV-B5
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:11 +0000
Received: from [85.158.139.211:31187] by server-11.bemta-5.messagelabs.com id
	89/66-04166-E7778525; Fri, 11 Oct 2013 22:11:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1381529463!913470!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11085 invoked from network); 11 Oct 2013 22:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 22:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvH-0001kf-5R
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvG-0002mi-Ui
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:03 +0000
Date: Fri, 11 Oct 2013 22:11:02 +0000
Message-Id: <E1VUkvG-0002mi-Ui@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: check segment descriptor read
	result in 64-bit OUTS emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a3b0fb38ee4cf4eadfb108534acf5ac4665633a
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Thu Oct 10 15:24:15 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 10 15:24:15 2013 +0200

    x86: check segment descriptor read result in 64-bit OUTS emulation
    
    When emulating such an operation from a 64-bit context (CS has long
    mode set), and the data segment is overridden to FS/GS, the result of
    reading the overridden segment's descriptor (read_descriptor) is not
    checked. If it fails, data_base is left uninitialized.
    
    This can lead to 8 bytes of Xen's stack being leaked to the guest
    (implicitly, i.e. via the address given in a #PF).
    
    Coverity-ID: 1055116
    
    This is CVE-2013-4368 / XSA-67.
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix formatting.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 0771faba163769089c9f05f7f76b63e397677613
    master date: 2013-10-10 15:19:53 +0200
---
 xen/arch/x86/traps.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index dfe3da9..2fc9927 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2063,10 +2063,10 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                     break;
                 }
             }
-            else
-                read_descriptor(data_sel, v, regs,
-                                &data_base, &data_limit, &ar,
-                                0);
+            else if ( !read_descriptor(data_sel, v, regs,
+                                       &data_base, &data_limit, &ar, 0) ||
+                      !(ar & _SEGMENT_S) || !(ar & _SEGMENT_P) )
+                goto fail;
             data_limit = ~0UL;
             ar = _SEGMENT_WR|_SEGMENT_S|_SEGMENT_DPL|_SEGMENT_P;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 22:11:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 22: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 1VUkvQ-0001Ia-DX; Fri, 11 Oct 2013 22:11: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 1VUkvP-0001IV-B5
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:11 +0000
Received: from [85.158.139.211:31187] by server-11.bemta-5.messagelabs.com id
	89/66-04166-E7778525; Fri, 11 Oct 2013 22:11:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1381529463!913470!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11085 invoked from network); 11 Oct 2013 22:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 22:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvH-0001kf-5R
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvG-0002mi-Ui
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:03 +0000
Date: Fri, 11 Oct 2013 22:11:02 +0000
Message-Id: <E1VUkvG-0002mi-Ui@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: check segment descriptor read
	result in 64-bit OUTS emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a3b0fb38ee4cf4eadfb108534acf5ac4665633a
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Thu Oct 10 15:24:15 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 10 15:24:15 2013 +0200

    x86: check segment descriptor read result in 64-bit OUTS emulation
    
    When emulating such an operation from a 64-bit context (CS has long
    mode set), and the data segment is overridden to FS/GS, the result of
    reading the overridden segment's descriptor (read_descriptor) is not
    checked. If it fails, data_base is left uninitialized.
    
    This can lead to 8 bytes of Xen's stack being leaked to the guest
    (implicitly, i.e. via the address given in a #PF).
    
    Coverity-ID: 1055116
    
    This is CVE-2013-4368 / XSA-67.
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix formatting.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 0771faba163769089c9f05f7f76b63e397677613
    master date: 2013-10-10 15:19:53 +0200
---
 xen/arch/x86/traps.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index dfe3da9..2fc9927 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2063,10 +2063,10 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
                     break;
                 }
             }
-            else
-                read_descriptor(data_sel, v, regs,
-                                &data_base, &data_limit, &ar,
-                                0);
+            else if ( !read_descriptor(data_sel, v, regs,
+                                       &data_base, &data_limit, &ar, 0) ||
+                      !(ar & _SEGMENT_S) || !(ar & _SEGMENT_P) )
+                goto fail;
             data_limit = ~0UL;
             ar = _SEGMENT_WR|_SEGMENT_S|_SEGMENT_DPL|_SEGMENT_P;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 22:11:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 22:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUkvV-0001Io-GI; Fri, 11 Oct 2013 22:11: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 1VUkvU-0001Ii-7m
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:16 +0000
Received: from [193.109.254.147:40766] by server-14.bemta-14.messagelabs.com
	id FD/61-07546-38778525; Fri, 11 Oct 2013 22:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1381529473!1650047!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9364 invoked from network); 11 Oct 2013 22:11:14 -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;
	11 Oct 2013 22:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvR-0001ki-H4
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvR-0002nq-9R
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:13 +0000
Date: Fri, 11 Oct 2013 22:11:13 +0000
Message-Id: <E1VUkvR-0002nq-9R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] libxl: fix vif rate parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8f749b254def91001124367d687e9fc6a2793f6b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 10 15:48:55 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 16:59:37 2013 +0100

    libxl: fix vif rate parsing
    
    strtok can return NULL here. We don't need to use strtok anyway, so just
    use a simple strchr method.
    
    Coverity-ID: 1055642
    
    This is CVE-2013-4369 / XSA-68
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix type. Add test case
    
    Signed-off-by: Ian Campbell <Ian.campbell@citrix.com>
    (cherry picked from commit c53702cee1d6f9f1b72f0cae0b412e21bcda8724)
    (cherry picked from commit 60aefd150bc0ad0c7d325da5ffea0bf4e0544130)
---
 tools/libxl/check-xl-vif-parse |    4 ++++
 tools/libxl/libxlu_vif.c       |   19 +++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/check-xl-vif-parse b/tools/libxl/check-xl-vif-parse
index 0473182..02c6dba 100755
--- a/tools/libxl/check-xl-vif-parse
+++ b/tools/libxl/check-xl-vif-parse
@@ -206,4 +206,8 @@ expected </dev/null
 one $e rate=4294967295GB/s@5us
 one $e rate=4296MB/s@4294s
 
+# test include of single '@'
+expected </dev/null
+one $e rate=@
+
 complete
diff --git a/tools/libxl/libxlu_vif.c b/tools/libxl/libxlu_vif.c
index 3b3de0f..0665e62 100644
--- a/tools/libxl/libxlu_vif.c
+++ b/tools/libxl/libxlu_vif.c
@@ -95,23 +95,30 @@ int xlu_vif_parse_rate(XLU_Config *cfg, const char *rate, libxl_device_nic *nic)
     uint64_t bytes_per_sec = 0;
     uint64_t bytes_per_interval = 0;
     uint32_t interval_usecs = 50000UL; /* Default to 50ms */
-    char *ratetok, *tmprate;
+    char *p, *tmprate;
     int rc = 0;
 
     tmprate = strdup(rate);
+    if (tmprate == NULL) {
+        rc = ENOMEM;
+        goto out;
+    }
+
+    p = strchr(tmprate, '@');
+    if (p != NULL)
+        *p++ = 0;
+
     if (!strcmp(tmprate,"")) {
         xlu__vif_err(cfg, "no rate specified", rate);
         rc = EINVAL;
         goto out;
     }
 
-    ratetok = strtok(tmprate, "@");
-    rc = vif_parse_rate_bytes_per_sec(cfg, ratetok, &bytes_per_sec);
+    rc = vif_parse_rate_bytes_per_sec(cfg, tmprate, &bytes_per_sec);
     if (rc) goto out;
 
-    ratetok = strtok(NULL, "@");
-    if (ratetok != NULL) {
-        rc = vif_parse_rate_interval_usecs(cfg, ratetok, &interval_usecs);
+    if (p != NULL) {
+        rc = vif_parse_rate_interval_usecs(cfg, p, &interval_usecs);
         if (rc) goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 22:11:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 22:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUkvV-0001Io-GI; Fri, 11 Oct 2013 22:11: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 1VUkvU-0001Ii-7m
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:16 +0000
Received: from [193.109.254.147:40766] by server-14.bemta-14.messagelabs.com
	id FD/61-07546-38778525; Fri, 11 Oct 2013 22:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1381529473!1650047!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9364 invoked from network); 11 Oct 2013 22:11:14 -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;
	11 Oct 2013 22:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvR-0001ki-H4
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvR-0002nq-9R
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:13 +0000
Date: Fri, 11 Oct 2013 22:11:13 +0000
Message-Id: <E1VUkvR-0002nq-9R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] libxl: fix vif rate parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8f749b254def91001124367d687e9fc6a2793f6b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 10 15:48:55 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 16:59:37 2013 +0100

    libxl: fix vif rate parsing
    
    strtok can return NULL here. We don't need to use strtok anyway, so just
    use a simple strchr method.
    
    Coverity-ID: 1055642
    
    This is CVE-2013-4369 / XSA-68
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    
    Fix type. Add test case
    
    Signed-off-by: Ian Campbell <Ian.campbell@citrix.com>
    (cherry picked from commit c53702cee1d6f9f1b72f0cae0b412e21bcda8724)
    (cherry picked from commit 60aefd150bc0ad0c7d325da5ffea0bf4e0544130)
---
 tools/libxl/check-xl-vif-parse |    4 ++++
 tools/libxl/libxlu_vif.c       |   19 +++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/check-xl-vif-parse b/tools/libxl/check-xl-vif-parse
index 0473182..02c6dba 100755
--- a/tools/libxl/check-xl-vif-parse
+++ b/tools/libxl/check-xl-vif-parse
@@ -206,4 +206,8 @@ expected </dev/null
 one $e rate=4294967295GB/s@5us
 one $e rate=4296MB/s@4294s
 
+# test include of single '@'
+expected </dev/null
+one $e rate=@
+
 complete
diff --git a/tools/libxl/libxlu_vif.c b/tools/libxl/libxlu_vif.c
index 3b3de0f..0665e62 100644
--- a/tools/libxl/libxlu_vif.c
+++ b/tools/libxl/libxlu_vif.c
@@ -95,23 +95,30 @@ int xlu_vif_parse_rate(XLU_Config *cfg, const char *rate, libxl_device_nic *nic)
     uint64_t bytes_per_sec = 0;
     uint64_t bytes_per_interval = 0;
     uint32_t interval_usecs = 50000UL; /* Default to 50ms */
-    char *ratetok, *tmprate;
+    char *p, *tmprate;
     int rc = 0;
 
     tmprate = strdup(rate);
+    if (tmprate == NULL) {
+        rc = ENOMEM;
+        goto out;
+    }
+
+    p = strchr(tmprate, '@');
+    if (p != NULL)
+        *p++ = 0;
+
     if (!strcmp(tmprate,"")) {
         xlu__vif_err(cfg, "no rate specified", rate);
         rc = EINVAL;
         goto out;
     }
 
-    ratetok = strtok(tmprate, "@");
-    rc = vif_parse_rate_bytes_per_sec(cfg, ratetok, &bytes_per_sec);
+    rc = vif_parse_rate_bytes_per_sec(cfg, tmprate, &bytes_per_sec);
     if (rc) goto out;
 
-    ratetok = strtok(NULL, "@");
-    if (ratetok != NULL) {
-        rc = vif_parse_rate_interval_usecs(cfg, ratetok, &interval_usecs);
+    if (p != NULL) {
+        rc = vif_parse_rate_interval_usecs(cfg, p, &interval_usecs);
         if (rc) goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 22:11:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 22:11: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 1VUkvf-0001K4-JE; Fri, 11 Oct 2013 22:11:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkve-0001Jq-7t
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:26 +0000
Received: from [85.158.143.35:56213] by server-1.bemta-4.messagelabs.com id
	07/EA-11076-D8778525; Fri, 11 Oct 2013 22:11:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1381529483!1341074!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31664 invoked from network); 11 Oct 2013 22:11:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 22:11:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvb-0001km-OM
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvb-0002oC-Mc
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:23 +0000
Date: Fri, 11 Oct 2013 22:11:23 +0000
Message-Id: <E1VUkvb-0002oC-Mc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools/ocaml: fix erroneous free of
	cpumap in stub_xc_vcpu_getaffinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d747f7c638b6cc6fce8f98ce89b53b4eefc991a
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Tue Sep 10 23:12:45 2013 +1200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 16:59:41 2013 +0100

    tools/ocaml: fix erroneous free of cpumap in stub_xc_vcpu_getaffinity
    
    Not sure how it got there...
    
    Coverity-ID: 1056196
    
    This is CVE-2013-4370 / XSA-69
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 3cd10fd21220f2b814324e6e732004f8f0487d0a)
    (cherry picked from commit debfacf7d68de8e39a06ebc7f7b22386b28ce6fb)
---
 tools/ocaml/libs/xc/xenctrl_stubs.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 0e26ae9..a144313 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -461,8 +461,6 @@ CAMLprim value stub_xc_vcpu_getaffinity(value xch, value domid,
 
 	retval = xc_vcpu_getaffinity(_H(xch), _D(domid),
 	                             Int_val(vcpu), c_cpumap);
-	free(c_cpumap);
-
 	if (retval < 0) {
 		free(c_cpumap);
 		failwith_xc(_H(xch));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 22:11:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 22:11: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 1VUkvf-0001K4-JE; Fri, 11 Oct 2013 22:11:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkve-0001Jq-7t
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:26 +0000
Received: from [85.158.143.35:56213] by server-1.bemta-4.messagelabs.com id
	07/EA-11076-D8778525; Fri, 11 Oct 2013 22:11:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1381529483!1341074!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31664 invoked from network); 11 Oct 2013 22:11:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 22:11:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvb-0001km-OM
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvb-0002oC-Mc
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:23 +0000
Date: Fri, 11 Oct 2013 22:11:23 +0000
Message-Id: <E1VUkvb-0002oC-Mc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools/ocaml: fix erroneous free of
	cpumap in stub_xc_vcpu_getaffinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d747f7c638b6cc6fce8f98ce89b53b4eefc991a
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Tue Sep 10 23:12:45 2013 +1200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 16:59:41 2013 +0100

    tools/ocaml: fix erroneous free of cpumap in stub_xc_vcpu_getaffinity
    
    Not sure how it got there...
    
    Coverity-ID: 1056196
    
    This is CVE-2013-4370 / XSA-69
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 3cd10fd21220f2b814324e6e732004f8f0487d0a)
    (cherry picked from commit debfacf7d68de8e39a06ebc7f7b22386b28ce6fb)
---
 tools/ocaml/libs/xc/xenctrl_stubs.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 0e26ae9..a144313 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -461,8 +461,6 @@ CAMLprim value stub_xc_vcpu_getaffinity(value xch, value domid,
 
 	retval = xc_vcpu_getaffinity(_H(xch), _D(domid),
 	                             Int_val(vcpu), c_cpumap);
-	free(c_cpumap);
-
 	if (retval < 0) {
 		free(c_cpumap);
 		failwith_xc(_H(xch));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 22:11:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 22:11: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 1VUkvp-0001LB-ME; Fri, 11 Oct 2013 22:11: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 1VUkvo-0001Kw-C6
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:36 +0000
Received: from [85.158.143.35:12685] by server-2.bemta-4.messagelabs.com id
	56/E7-31802-79778525; Fri, 11 Oct 2013 22:11:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1381529494!1338882!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29803 invoked from network); 11 Oct 2013 22:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 22:11:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvl-0001kw-T9
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvl-0002oc-Rx
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:33 +0000
Date: Fri, 11 Oct 2013 22:11:33 +0000
Message-Id: <E1VUkvl-0002oc-Rx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] libxl: fix out-of-memory error
	handling in libxl_list_cpupool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eba971d94289d91e4a3959d2c083a59deb100568
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Tue Sep 10 22:18:46 2013 +1200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 16:59:45 2013 +0100

    libxl: fix out-of-memory error handling in libxl_list_cpupool
    
    ...otherwise it will return freed memory. All the current users of this
    function check already for a NULL return, so use that.
    
    Coverity-ID: 1056194
    
    This is CVE-2013-4371 / XSA-70
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 4c37ed562224295c0f8b00211287d57cae629782)
    (cherry picked from commit 2350e70ee06c903a927340f7a0bf9ca25acce3f3)
---
 tools/libxl/libxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 32d788a..e8d798e 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -648,6 +648,7 @@ libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx, int *nb_pool_out)
         if (!tmp) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpupool info");
             libxl_cpupoolinfo_list_free(ptr, i);
+            ptr = NULL;
             goto out;
         }
         ptr = tmp;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri Oct 11 22:11:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 11 Oct 2013 22:11: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 1VUkvp-0001LB-ME; Fri, 11 Oct 2013 22:11: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 1VUkvo-0001Kw-C6
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:36 +0000
Received: from [85.158.143.35:12685] by server-2.bemta-4.messagelabs.com id
	56/E7-31802-79778525; Fri, 11 Oct 2013 22:11:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1381529494!1338882!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29803 invoked from network); 11 Oct 2013 22:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Oct 2013 22:11:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvl-0001kw-T9
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUkvl-0002oc-Rx
	for xen-changelog@lists.xensource.com; Fri, 11 Oct 2013 22:11:33 +0000
Date: Fri, 11 Oct 2013 22:11:33 +0000
Message-Id: <E1VUkvl-0002oc-Rx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] libxl: fix out-of-memory error
	handling in libxl_list_cpupool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eba971d94289d91e4a3959d2c083a59deb100568
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Tue Sep 10 22:18:46 2013 +1200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 10 16:59:45 2013 +0100

    libxl: fix out-of-memory error handling in libxl_list_cpupool
    
    ...otherwise it will return freed memory. All the current users of this
    function check already for a NULL return, so use that.
    
    Coverity-ID: 1056194
    
    This is CVE-2013-4371 / XSA-70
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 4c37ed562224295c0f8b00211287d57cae629782)
    (cherry picked from commit 2350e70ee06c903a927340f7a0bf9ca25acce3f3)
---
 tools/libxl/libxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 32d788a..e8d798e 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -648,6 +648,7 @@ libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx *ctx, int *nb_pool_out)
         if (!tmp) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpupool info");
             libxl_cpupoolinfo_list_free(ptr, i);
+            ptr = NULL;
             goto out;
         }
         ptr = tmp;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 01:55:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 01:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUoQ8-0001SV-GV; Sat, 12 Oct 2013 01: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 1VUoQ7-0001SN-Jv
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 01:55:07 +0000
Received: from [85.158.137.68:50509] by server-9.bemta-3.messagelabs.com id
	D2/A8-15303-AFBA8525; Sat, 12 Oct 2013 01:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1381542905!977215!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1527 invoked from network); 12 Oct 2013 01:55:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 01:55:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUoQ4-0002SR-Mc
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 01:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUoQ4-0000rL-C4
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 01:55:04 +0000
Date: Sat, 12 Oct 2013 01:55:04 +0000
Message-Id: <E1VUoQ4-0000rL-C4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] xl: fix `xl cpupool-list' behavior
	in case no pool name is provided
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 375888802b035082e91a1c63df6defcf2694987e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Sep 11 13:06:22 2013 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 11 18:54:06 2013 +0100

    xl: fix `xl cpupool-list' behavior in case no pool name is provided
    
    since it errors out, asking for at least one argument, and does
    not display any useful output, which is wrong (we want the list
    and the info about all the existing cpupools).
    
    IOW, the output is as follows:
    
     ~# xl cpupool-list -c
     'xl cpupool-list' requires at least 1 argument.
     ...
    
    While it should be as follows:
    
     ~# xl cpupool-list -c
     Name               CPU list
     Pool-0             0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    (cherry picked from commit 3998afdbf99959582dcd9f9f4df5a6fe7ce4ded8)
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 8a478ba..f5943a4 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -6540,7 +6540,7 @@ int main_cpupoollist(int argc, char **argv)
     char *name;
     int ret = 0;
 
-    SWITCH_FOREACH_OPT(opt, "hc", opts, "cpupool-list", 1) {
+    SWITCH_FOREACH_OPT(opt, "hc", opts, "cpupool-list", 0) {
     case 'c':
         opt_cpus = 1;
         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 Sat Oct 12 01:55:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 01:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUoQ8-0001SV-GV; Sat, 12 Oct 2013 01: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 1VUoQ7-0001SN-Jv
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 01:55:07 +0000
Received: from [85.158.137.68:50509] by server-9.bemta-3.messagelabs.com id
	D2/A8-15303-AFBA8525; Sat, 12 Oct 2013 01:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1381542905!977215!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1527 invoked from network); 12 Oct 2013 01:55:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 01:55:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUoQ4-0002SR-Mc
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 01:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUoQ4-0000rL-C4
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 01:55:04 +0000
Date: Sat, 12 Oct 2013 01:55:04 +0000
Message-Id: <E1VUoQ4-0000rL-C4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] xl: fix `xl cpupool-list' behavior
	in case no pool name is provided
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 375888802b035082e91a1c63df6defcf2694987e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Sep 11 13:06:22 2013 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 11 18:54:06 2013 +0100

    xl: fix `xl cpupool-list' behavior in case no pool name is provided
    
    since it errors out, asking for at least one argument, and does
    not display any useful output, which is wrong (we want the list
    and the info about all the existing cpupools).
    
    IOW, the output is as follows:
    
     ~# xl cpupool-list -c
     'xl cpupool-list' requires at least 1 argument.
     ...
    
    While it should be as follows:
    
     ~# xl cpupool-list -c
     Name               CPU list
     Pool-0             0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    (cherry picked from commit 3998afdbf99959582dcd9f9f4df5a6fe7ce4ded8)
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 8a478ba..f5943a4 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -6540,7 +6540,7 @@ int main_cpupoollist(int argc, char **argv)
     char *name;
     int ret = 0;
 
-    SWITCH_FOREACH_OPT(opt, "hc", opts, "cpupool-list", 1) {
+    SWITCH_FOREACH_OPT(opt, "hc", opts, "cpupool-list", 0) {
     case 'c':
         opt_cpus = 1;
         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 Sat Oct 12 01:55:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 01:55:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUoQJ-0001T3-JP; Sat, 12 Oct 2013 01: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 1VUoQH-0001Sh-RP
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 01:55:17 +0000
Received: from [85.158.139.211:48838] by server-10.bemta-5.messagelabs.com id
	5E/FC-29301-40CA8525; Sat, 12 Oct 2013 01:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1381542915!928476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14631 invoked from network); 12 Oct 2013 01:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 01:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUoQE-0002SU-VK
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 01:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUoQE-0000rj-Q5
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 01:55:14 +0000
Date: Sat, 12 Oct 2013 01:55:14 +0000
Message-Id: <E1VUoQE-0000rj-Q5@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 66414e76c5abab743c031e688a863966f3b16664
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 11 19:06:36 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 11 19:06:36 2013 +0100

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

diff --git a/Config.mk b/Config.mk
index 11d7a7d..474e24f 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 ?= xen-4.3.0
-# Mon Jun 17 17:39:51 2013 +0100
-# qemu-xen-traditional: disable docs
+QEMU_TAG ?= 0bd3d991be73031b8d9c07ccf43e5785ca26ca71
+# Thu Jul 25 08:11:55 2013 +0000
+# passthrough: Correctly expose PCH ISA bridge for IGD passthrough
 
 # 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 Sat Oct 12 01:55:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 01:55:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUoQJ-0001T3-JP; Sat, 12 Oct 2013 01: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 1VUoQH-0001Sh-RP
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 01:55:17 +0000
Received: from [85.158.139.211:48838] by server-10.bemta-5.messagelabs.com id
	5E/FC-29301-40CA8525; Sat, 12 Oct 2013 01:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1381542915!928476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14631 invoked from network); 12 Oct 2013 01:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 01:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUoQE-0002SU-VK
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 01:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUoQE-0000rj-Q5
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 01:55:14 +0000
Date: Sat, 12 Oct 2013 01:55:14 +0000
Message-Id: <E1VUoQE-0000rj-Q5@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 66414e76c5abab743c031e688a863966f3b16664
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 11 19:06:36 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 11 19:06:36 2013 +0100

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

diff --git a/Config.mk b/Config.mk
index 11d7a7d..474e24f 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 ?= xen-4.3.0
-# Mon Jun 17 17:39:51 2013 +0100
-# qemu-xen-traditional: disable docs
+QEMU_TAG ?= 0bd3d991be73031b8d9c07ccf43e5785ca26ca71
+# Thu Jul 25 08:11:55 2013 +0000
+# passthrough: Correctly expose PCH ISA bridge for IGD passthrough
 
 # 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 Sat Oct 12 06:33:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUslA-0007Bj-9I; Sat, 12 Oct 2013 06:33: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 1VUsl8-0007BW-7Q
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:06 +0000
Received: from [85.158.139.211:45008] by server-16.bemta-5.messagelabs.com id
	5A/93-17576-12DE8525; Sat, 12 Oct 2013 06:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1381559583!953367!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19384 invoked from network); 12 Oct 2013 06:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUsl5-0005v5-1E
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUsl4-0000CM-Q0
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:02 +0000
Date: Sat, 12 Oct 2013 06:33:02 +0000
Message-Id: <E1VUsl4-0000CM-Q0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: correct LDT 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 40d66baa46ca8a9ffa6df3e063a967d08ec92bcf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 11 09:28:26 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 11 09:28:26 2013 +0200

    x86: correct LDT checks
    
    - MMUEXT_SET_LDT should behave as similarly to the LLDT instruction as
      possible: fail only if the base address is non-canonical
    - instead LDT descriptor accesses should fault if the descriptor
      address ends up being non-canonical (by ensuring this we at once
      avoid reading an entry from the mach-to-phys table and consider it a
      page table entry)
    - fault propagation on using LDT selectors must distinguish #PF and #GP
      (the latter must be raised for a non-canonical descriptor address,
      which also applies to several other uses of propagate_page_fault(),
      and hence the problem is being fixed there)
    - map_ldt_shadow_page() should properly wrap addresses for 32-bit VMs
    
    At once remove the odd invokation of map_ldt_shadow_page() from the
    MMUEXT_SET_LDT handler: There's nothing really telling us that the
    first LDT page is going to be preferred over others.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domain.c        |   20 ++++++--------------
 xen/arch/x86/mm.c            |    9 ++++-----
 xen/arch/x86/traps.c         |   27 ++++++++++++++++++++++-----
 xen/include/asm-x86/mm.h     |    2 +-
 xen/include/asm-x86/paging.h |    3 ++-
 5 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 316ef04..52b7a37 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -674,12 +674,7 @@ int arch_set_info_guest(
                 fixup_guest_code_selector(d, c.nat->trap_ctxt[i].cs);
             }
 
-            /* LDT safety checks. */
-            if ( ((c.nat->ldt_base & (PAGE_SIZE-1)) != 0) ||
-                 (c.nat->ldt_ents > 8192) ||
-                 !array_access_ok(c.nat->ldt_base,
-                                  c.nat->ldt_ents,
-                                  LDT_ENTRY_SIZE) )
+            if ( !__addr_ok(c.nat->ldt_base) )
                 return -EINVAL;
         }
         else
@@ -692,15 +687,12 @@ int arch_set_info_guest(
 
             for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); i++ )
                 fixup_guest_code_selector(d, c.cmp->trap_ctxt[i].cs);
-
-            /* LDT safety checks. */
-            if ( ((c.cmp->ldt_base & (PAGE_SIZE-1)) != 0) ||
-                 (c.cmp->ldt_ents > 8192) ||
-                 !compat_array_access_ok(c.cmp->ldt_base,
-                                         c.cmp->ldt_ents,
-                                         LDT_ENTRY_SIZE) )
-                return -EINVAL;
         }
+
+        /* LDT safety checks. */
+        if ( ((c(ldt_base) & (PAGE_SIZE - 1)) != 0) ||
+             (c(ldt_ents) > 8192) )
+            return -EINVAL;
     }
 
     v->fpu_initialised = !!(flags & VGCF_I387_VALID);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 7d4215d..43aaceb 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -582,6 +582,8 @@ int map_ldt_shadow_page(unsigned int off)
 
     BUG_ON(unlikely(in_irq()));
 
+    if ( is_pv_32bit_domain(d) )
+        gva = (u32)gva;
     guest_get_eff_kern_l1e(v, gva, &l1e);
     if ( unlikely(!(l1e_get_flags(l1e) & _PAGE_PRESENT)) )
         return 0;
@@ -3229,9 +3231,8 @@ long do_mmuext_op(
                 MEM_LOG("ignoring SET_LDT hypercall from external domain");
                 okay = 0;
             }
-            else if ( ((ptr & (PAGE_SIZE-1)) != 0) || 
-                      (ents > 8192) ||
-                      !array_access_ok(ptr, ents, LDT_ENTRY_SIZE) )
+            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);
@@ -3244,8 +3245,6 @@ long do_mmuext_op(
                 curr->arch.pv_vcpu.ldt_base = ptr;
                 curr->arch.pv_vcpu.ldt_ents = ents;
                 load_LDT(curr);
-                if ( ents != 0 )
-                    (void)map_ldt_shadow_page(0);
             }
             break;
         }
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 4a09502..35be017 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1065,12 +1065,24 @@ static void reserved_bit_page_fault(
     show_execution_state(regs);
 }
 
-void propagate_page_fault(unsigned long addr, u16 error_code)
+struct trap_bounce *propagate_page_fault(unsigned long addr, u16 error_code)
 {
     struct trap_info *ti;
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.pv_vcpu.trap_bounce;
 
+    if ( unlikely(!is_canonical_address(addr)) )
+    {
+        ti = &v->arch.pv_vcpu.trap_ctxt[TRAP_gp_fault];
+        tb->flags      = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE;
+        tb->error_code = 0;
+        tb->cs         = ti->cs;
+        tb->eip        = ti->address;
+        if ( TI_GET_IF(ti) )
+            tb->flags |= TBF_INTERRUPT;
+        return tb;
+    }
+
     v->arch.pv_vcpu.ctrlreg[2] = addr;
     arch_set_cr2(v, addr);
 
@@ -1097,6 +1109,8 @@ void propagate_page_fault(unsigned long addr, u16 error_code)
 
     if ( unlikely(error_code & PFEC_reserved_bit) )
         reserved_bit_page_fault(addr, guest_cpu_user_regs());
+
+    return NULL;
 }
 
 static int handle_gdt_ldt_mapping_fault(
@@ -1130,13 +1144,16 @@ static int handle_gdt_ldt_mapping_fault(
         }
         else
         {
+            struct trap_bounce *tb;
+
             /* In hypervisor mode? Leave it to the #PF handler to fix up. */
             if ( !guest_mode(regs) )
                 return 0;
-            /* In guest mode? Propagate #PF to guest, with adjusted %cr2. */
-            propagate_page_fault(
-                curr->arch.pv_vcpu.ldt_base + offset,
-                regs->error_code);
+            /* In guest mode? Propagate fault to guest, with adjusted %cr2. */
+            tb = propagate_page_fault(curr->arch.pv_vcpu.ldt_base + offset,
+                                      regs->error_code);
+            if ( tb )
+                tb->error_code = ((u16)offset & ~3) | 4;
         }
     }
     else
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 5f03875..c835f76 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -555,7 +555,7 @@ int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
 int vcpu_destroy_pagetables(struct vcpu *);
-void propagate_page_fault(unsigned long addr, u16 error_code);
+struct trap_bounce *propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
 int __sync_local_execstate(void);
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 9553e43..105a0ca 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -386,7 +386,8 @@ guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
     if ( likely(!paging_mode_translate(v->domain)) )
     {
         ASSERT(!paging_mode_external(v->domain));
-        if ( __copy_from_user(eff_l1e, 
+        if ( !__addr_ok(addr) ||
+             __copy_from_user(eff_l1e,
                               &__linear_l1_table[l1_linear_offset(addr)],
                               sizeof(l1_pgentry_t)) != 0 )
             *(l1_pgentry_t *)eff_l1e = l1e_empty();
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:33:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUslA-0007Bj-9I; Sat, 12 Oct 2013 06:33: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 1VUsl8-0007BW-7Q
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:06 +0000
Received: from [85.158.139.211:45008] by server-16.bemta-5.messagelabs.com id
	5A/93-17576-12DE8525; Sat, 12 Oct 2013 06:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1381559583!953367!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19384 invoked from network); 12 Oct 2013 06:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUsl5-0005v5-1E
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUsl4-0000CM-Q0
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:02 +0000
Date: Sat, 12 Oct 2013 06:33:02 +0000
Message-Id: <E1VUsl4-0000CM-Q0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: correct LDT 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 40d66baa46ca8a9ffa6df3e063a967d08ec92bcf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 11 09:28:26 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 11 09:28:26 2013 +0200

    x86: correct LDT checks
    
    - MMUEXT_SET_LDT should behave as similarly to the LLDT instruction as
      possible: fail only if the base address is non-canonical
    - instead LDT descriptor accesses should fault if the descriptor
      address ends up being non-canonical (by ensuring this we at once
      avoid reading an entry from the mach-to-phys table and consider it a
      page table entry)
    - fault propagation on using LDT selectors must distinguish #PF and #GP
      (the latter must be raised for a non-canonical descriptor address,
      which also applies to several other uses of propagate_page_fault(),
      and hence the problem is being fixed there)
    - map_ldt_shadow_page() should properly wrap addresses for 32-bit VMs
    
    At once remove the odd invokation of map_ldt_shadow_page() from the
    MMUEXT_SET_LDT handler: There's nothing really telling us that the
    first LDT page is going to be preferred over others.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domain.c        |   20 ++++++--------------
 xen/arch/x86/mm.c            |    9 ++++-----
 xen/arch/x86/traps.c         |   27 ++++++++++++++++++++++-----
 xen/include/asm-x86/mm.h     |    2 +-
 xen/include/asm-x86/paging.h |    3 ++-
 5 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 316ef04..52b7a37 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -674,12 +674,7 @@ int arch_set_info_guest(
                 fixup_guest_code_selector(d, c.nat->trap_ctxt[i].cs);
             }
 
-            /* LDT safety checks. */
-            if ( ((c.nat->ldt_base & (PAGE_SIZE-1)) != 0) ||
-                 (c.nat->ldt_ents > 8192) ||
-                 !array_access_ok(c.nat->ldt_base,
-                                  c.nat->ldt_ents,
-                                  LDT_ENTRY_SIZE) )
+            if ( !__addr_ok(c.nat->ldt_base) )
                 return -EINVAL;
         }
         else
@@ -692,15 +687,12 @@ int arch_set_info_guest(
 
             for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); i++ )
                 fixup_guest_code_selector(d, c.cmp->trap_ctxt[i].cs);
-
-            /* LDT safety checks. */
-            if ( ((c.cmp->ldt_base & (PAGE_SIZE-1)) != 0) ||
-                 (c.cmp->ldt_ents > 8192) ||
-                 !compat_array_access_ok(c.cmp->ldt_base,
-                                         c.cmp->ldt_ents,
-                                         LDT_ENTRY_SIZE) )
-                return -EINVAL;
         }
+
+        /* LDT safety checks. */
+        if ( ((c(ldt_base) & (PAGE_SIZE - 1)) != 0) ||
+             (c(ldt_ents) > 8192) )
+            return -EINVAL;
     }
 
     v->fpu_initialised = !!(flags & VGCF_I387_VALID);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 7d4215d..43aaceb 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -582,6 +582,8 @@ int map_ldt_shadow_page(unsigned int off)
 
     BUG_ON(unlikely(in_irq()));
 
+    if ( is_pv_32bit_domain(d) )
+        gva = (u32)gva;
     guest_get_eff_kern_l1e(v, gva, &l1e);
     if ( unlikely(!(l1e_get_flags(l1e) & _PAGE_PRESENT)) )
         return 0;
@@ -3229,9 +3231,8 @@ long do_mmuext_op(
                 MEM_LOG("ignoring SET_LDT hypercall from external domain");
                 okay = 0;
             }
-            else if ( ((ptr & (PAGE_SIZE-1)) != 0) || 
-                      (ents > 8192) ||
-                      !array_access_ok(ptr, ents, LDT_ENTRY_SIZE) )
+            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);
@@ -3244,8 +3245,6 @@ long do_mmuext_op(
                 curr->arch.pv_vcpu.ldt_base = ptr;
                 curr->arch.pv_vcpu.ldt_ents = ents;
                 load_LDT(curr);
-                if ( ents != 0 )
-                    (void)map_ldt_shadow_page(0);
             }
             break;
         }
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 4a09502..35be017 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1065,12 +1065,24 @@ static void reserved_bit_page_fault(
     show_execution_state(regs);
 }
 
-void propagate_page_fault(unsigned long addr, u16 error_code)
+struct trap_bounce *propagate_page_fault(unsigned long addr, u16 error_code)
 {
     struct trap_info *ti;
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.pv_vcpu.trap_bounce;
 
+    if ( unlikely(!is_canonical_address(addr)) )
+    {
+        ti = &v->arch.pv_vcpu.trap_ctxt[TRAP_gp_fault];
+        tb->flags      = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE;
+        tb->error_code = 0;
+        tb->cs         = ti->cs;
+        tb->eip        = ti->address;
+        if ( TI_GET_IF(ti) )
+            tb->flags |= TBF_INTERRUPT;
+        return tb;
+    }
+
     v->arch.pv_vcpu.ctrlreg[2] = addr;
     arch_set_cr2(v, addr);
 
@@ -1097,6 +1109,8 @@ void propagate_page_fault(unsigned long addr, u16 error_code)
 
     if ( unlikely(error_code & PFEC_reserved_bit) )
         reserved_bit_page_fault(addr, guest_cpu_user_regs());
+
+    return NULL;
 }
 
 static int handle_gdt_ldt_mapping_fault(
@@ -1130,13 +1144,16 @@ static int handle_gdt_ldt_mapping_fault(
         }
         else
         {
+            struct trap_bounce *tb;
+
             /* In hypervisor mode? Leave it to the #PF handler to fix up. */
             if ( !guest_mode(regs) )
                 return 0;
-            /* In guest mode? Propagate #PF to guest, with adjusted %cr2. */
-            propagate_page_fault(
-                curr->arch.pv_vcpu.ldt_base + offset,
-                regs->error_code);
+            /* In guest mode? Propagate fault to guest, with adjusted %cr2. */
+            tb = propagate_page_fault(curr->arch.pv_vcpu.ldt_base + offset,
+                                      regs->error_code);
+            if ( tb )
+                tb->error_code = ((u16)offset & ~3) | 4;
         }
     }
     else
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 5f03875..c835f76 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -555,7 +555,7 @@ int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
 int vcpu_destroy_pagetables(struct vcpu *);
-void propagate_page_fault(unsigned long addr, u16 error_code);
+struct trap_bounce *propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
 int __sync_local_execstate(void);
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 9553e43..105a0ca 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -386,7 +386,8 @@ guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
     if ( likely(!paging_mode_translate(v->domain)) )
     {
         ASSERT(!paging_mode_external(v->domain));
-        if ( __copy_from_user(eff_l1e, 
+        if ( !__addr_ok(addr) ||
+             __copy_from_user(eff_l1e,
                               &__linear_l1_table[l1_linear_offset(addr)],
                               sizeof(l1_pgentry_t)) != 0 )
             *(l1_pgentry_t *)eff_l1e = l1e_empty();
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:33:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUslJ-0007Cd-Ej; Sat, 12 Oct 2013 06:33: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 1VUslH-0007CE-To
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:16 +0000
Received: from [85.158.139.211:45168] by server-7.bemta-5.messagelabs.com id
	50/E3-09614-B2DE8525; Sat, 12 Oct 2013 06:33:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1381559593!950506!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30984 invoked from network); 12 Oct 2013 06:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslF-0005vC-6w
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslF-0000Cl-3s
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:13 +0000
Date: Sat, 12 Oct 2013 06:33:13 +0000
Message-Id: <E1VUslF-0000Cl-3s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: add address validity check to
	guest_map_l1e()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d06a0d715ec1423b6c42141ab1b0ff69a3effb56
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 11 09:29:43 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 11 09:29:43 2013 +0200

    x86: add address validity check to guest_map_l1e()
    
    Just like for guest_get_eff_l1e() this prevents accessing as page
    tables (and with the wrong memory attribute) internal data inside Xen
    happening to be mapped with 1Gb pages.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/asm-x86/paging.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 105a0ca..e957b2f 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -360,7 +360,8 @@ guest_map_l1e(struct vcpu *v, unsigned long addr, unsigned long *gl1mfn)
         return paging_get_hostmode(v)->guest_map_l1e(v, addr, gl1mfn);
 
     /* Find this l1e and its enclosing l1mfn in the linear map */
-    if ( __copy_from_user(&l2e, 
+    if ( !__addr_ok(addr) ||
+         __copy_from_user(&l2e,
                           &__linear_l2_table[l2_linear_offset(addr)],
                           sizeof(l2_pgentry_t)) != 0 )
         return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:33:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUslJ-0007Cd-Ej; Sat, 12 Oct 2013 06:33: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 1VUslH-0007CE-To
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:16 +0000
Received: from [85.158.139.211:45168] by server-7.bemta-5.messagelabs.com id
	50/E3-09614-B2DE8525; Sat, 12 Oct 2013 06:33:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1381559593!950506!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30984 invoked from network); 12 Oct 2013 06:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslF-0005vC-6w
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslF-0000Cl-3s
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:13 +0000
Date: Sat, 12 Oct 2013 06:33:13 +0000
Message-Id: <E1VUslF-0000Cl-3s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: add address validity check to
	guest_map_l1e()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d06a0d715ec1423b6c42141ab1b0ff69a3effb56
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 11 09:29:43 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 11 09:29:43 2013 +0200

    x86: add address validity check to guest_map_l1e()
    
    Just like for guest_get_eff_l1e() this prevents accessing as page
    tables (and with the wrong memory attribute) internal data inside Xen
    happening to be mapped with 1Gb pages.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/asm-x86/paging.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 105a0ca..e957b2f 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -360,7 +360,8 @@ guest_map_l1e(struct vcpu *v, unsigned long addr, unsigned long *gl1mfn)
         return paging_get_hostmode(v)->guest_map_l1e(v, addr, gl1mfn);
 
     /* Find this l1e and its enclosing l1mfn in the linear map */
-    if ( __copy_from_user(&l2e, 
+    if ( !__addr_ok(addr) ||
+         __copy_from_user(&l2e,
                           &__linear_l2_table[l2_linear_offset(addr)],
                           sizeof(l2_pgentry_t)) != 0 )
         return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:33:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUslT-0007Dk-Ii; Sat, 12 Oct 2013 06:33:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslS-0007DK-Eg
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:26 +0000
Received: from [85.158.143.35:50874] by server-3.bemta-4.messagelabs.com id
	59/1D-24907-53DE8525; Sat, 12 Oct 2013 06:33:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1381559603!1376948!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29863 invoked from network); 12 Oct 2013 06:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:33:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslP-0005vI-Fp
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslP-0000DB-AW
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:23 +0000
Date: Sat, 12 Oct 2013 06:33:23 +0000
Message-Id: <E1VUslP-0000DB-AW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: use {rd, wr}{fs,
	gs}base when available
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4b46e7be783df641b2889e514e85643febd378c2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 11 09:30:31 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 11 09:30:31 2013 +0200

    x86: use {rd,wr}{fs,gs}base when available
    
    ... as being intended to be faster than MSR reads/writes.
    
    In the case of emulate_privileged_op() also use these in favor of the
    cached (but possibly stale) addresses from arch.pv_vcpu. This allows
    entirely removing the code that was the subject of XSA-67.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/Rules.mk        |    1 +
 xen/arch/x86/acpi/suspend.c  |    8 +++---
 xen/arch/x86/domain.c        |    4 +-
 xen/arch/x86/setup.c         |    3 ++
 xen/arch/x86/traps.c         |   30 +++++++---------------
 xen/include/asm-x86/domain.h |    6 ++--
 xen/include/asm-x86/msr.h    |   56 ++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 79 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index c93d2af..576985e 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -31,6 +31,7 @@ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
 $(call as-insn-check,CFLAGS,CC,"vmcall",-DHAVE_GAS_VMX)
 $(call as-insn-check,CFLAGS,CC,"invept (%rax)$$(comma)%rax",-DHAVE_GAS_EPT)
+$(call as-insn-check,CFLAGS,CC,"rdfsbase %rax",-DHAVE_GAS_FSGSBASE)
 
 ifeq ($(supervisor_mode_kernel),y)
 CFLAGS += -DCONFIG_X86_SUPERVISOR_MODE_KERNEL=1
diff --git a/xen/arch/x86/acpi/suspend.c b/xen/arch/x86/acpi/suspend.c
index c690b45..9c3cf38 100644
--- a/xen/arch/x86/acpi/suspend.c
+++ b/xen/arch/x86/acpi/suspend.c
@@ -27,8 +27,8 @@ void save_rest_processor_state(void)
     asm volatile (
         "movw %%ds,(%0); movw %%es,2(%0); movw %%fs,4(%0); movw %%gs,6(%0)"
         : : "r" (saved_segs) : "memory" );
-    rdmsrl(MSR_FS_BASE, saved_fs_base);
-    rdmsrl(MSR_GS_BASE, saved_gs_base);
+    saved_fs_base = rdfsbase();
+    saved_gs_base = rdgsbase();
     rdmsrl(MSR_SHADOW_GS_BASE, saved_kernel_gs_base);
     rdmsrl(MSR_CSTAR, saved_cstar);
     rdmsrl(MSR_LSTAR, saved_lstar);
@@ -56,8 +56,8 @@ void restore_rest_processor_state(void)
           X86_EFLAGS_DF|X86_EFLAGS_IF|X86_EFLAGS_TF,
           0U);
 
-    wrmsrl(MSR_FS_BASE, saved_fs_base);
-    wrmsrl(MSR_GS_BASE, saved_gs_base);
+    wrfsbase(saved_fs_base);
+    wrgsbase(saved_gs_base);
     wrmsrl(MSR_SHADOW_GS_BASE, saved_kernel_gs_base);
 
     if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ||
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 52b7a37..b67fcb8 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1092,7 +1092,7 @@ static void load_segments(struct vcpu *n)
     {
         /* This can only be non-zero if selector is NULL. */
         if ( n->arch.pv_vcpu.fs_base )
-            wrmsrl(MSR_FS_BASE, n->arch.pv_vcpu.fs_base);
+            wrfsbase(n->arch.pv_vcpu.fs_base);
 
         /* Most kernels have non-zero GS base, so don't bother testing. */
         /* (This is also a serialising instruction, avoiding AMD erratum #88.) */
@@ -1100,7 +1100,7 @@ static void load_segments(struct vcpu *n)
 
         /* This can only be non-zero if selector is NULL. */
         if ( n->arch.pv_vcpu.gs_base_user )
-            wrmsrl(MSR_GS_BASE, n->arch.pv_vcpu.gs_base_user);
+            wrgsbase(n->arch.pv_vcpu.gs_base_user);
 
         /* If in kernel mode then switch the GS bases around. */
         if ( (n->arch.flags & TF_kernel_mode) )
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 637f1f9..30a4fd6 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1264,6 +1264,9 @@ void __init __start_xen(unsigned long mbi_p)
     if ( cpu_has_smep )
         set_in_cr4(X86_CR4_SMEP);
 
+    if ( cpu_has_fsgsbase )
+        set_in_cr4(X86_CR4_FSGSBASE);
+
     local_irq_enable();
 
     pt_pci_init();
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 35be017..8dcb70a 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1985,28 +1985,18 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         }
         else
         {
-            if ( lm_ovr == lm_seg_none || data_sel < 4 )
+            switch ( lm_ovr )
             {
-                switch ( lm_ovr )
-                {
-                case lm_seg_none:
-                    data_base = 0UL;
-                    break;
-                case lm_seg_fs:
-                    data_base = v->arch.pv_vcpu.fs_base;
-                    break;
-                case lm_seg_gs:
-                    if ( guest_kernel_mode(v, regs) )
-                        data_base = v->arch.pv_vcpu.gs_base_kernel;
-                    else
-                        data_base = v->arch.pv_vcpu.gs_base_user;
-                    break;
-                }
+            default:
+                data_base = 0UL;
+                break;
+            case lm_seg_fs:
+                data_base = rdfsbase();
+                break;
+            case lm_seg_gs:
+                data_base = rdgsbase();
+                break;
             }
-            else if ( !read_descriptor(data_sel, v, regs,
-                                       &data_base, &data_limit, &ar, 0) ||
-                      !(ar & _SEGMENT_S) || !(ar & _SEGMENT_P) )
-                goto fail;
             data_limit = ~0UL;
             ar = _SEGMENT_WR|_SEGMENT_S|_SEGMENT_DPL|_SEGMENT_P;
         }
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 909f449..e42651e 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -457,12 +457,12 @@ unsigned long pv_guest_cr4_fixup(const struct vcpu *, unsigned long guest_cr4);
     (((v)->arch.pv_vcpu.ctrlreg[4]                          \
       | (mmu_cr4_features                                   \
          & (X86_CR4_PGE | X86_CR4_PSE | X86_CR4_SMEP |      \
-            X86_CR4_OSXSAVE))                               \
+            X86_CR4_OSXSAVE | X86_CR4_FSGSBASE))            \
       | ((v)->domain->arch.vtsc ? X86_CR4_TSD : 0))         \
      & ~X86_CR4_DE)
 #define real_cr4_to_pv_guest_cr4(c)                         \
-    ((c) & ~(X86_CR4_PGE | X86_CR4_PSE | X86_CR4_TSD        \
-             | X86_CR4_OSXSAVE | X86_CR4_SMEP))
+    ((c) & ~(X86_CR4_PGE | X86_CR4_PSE | X86_CR4_TSD |      \
+             X86_CR4_OSXSAVE | X86_CR4_SMEP | X86_CR4_FSGSBASE))
 
 void domain_cpuid(struct domain *d,
                   unsigned int  input,
diff --git a/xen/include/asm-x86/msr.h b/xen/include/asm-x86/msr.h
index 06c46a8..5277c2b 100644
--- a/xen/include/asm-x86/msr.h
+++ b/xen/include/asm-x86/msr.h
@@ -9,6 +9,7 @@
 #include <xen/percpu.h>
 #include <xen/errno.h>
 #include <asm/asm_defns.h>
+#include <asm/cpufeature.h>
 
 #define rdmsr(msr,val1,val2) \
      __asm__ __volatile__("rdmsr" \
@@ -97,6 +98,61 @@ static inline int wrmsr_safe(unsigned int msr, uint64_t val)
 			  : "=a" (low), "=d" (high) \
 			  : "c" (counter))
 
+static inline unsigned long rdfsbase(void)
+{
+    unsigned long base;
+
+    if ( cpu_has_fsgsbase )
+#ifdef HAVE_GAS_FSGSBASE
+        asm volatile ( "rdfsbase %0" : "=r" (base) );
+#else
+        asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xc0" : "=a" (base) );
+#endif
+    else
+        rdmsrl(MSR_FS_BASE, base);
+
+    return base;
+}
+
+static inline unsigned long rdgsbase(void)
+{
+    unsigned long base;
+
+    if ( cpu_has_fsgsbase )
+#ifdef HAVE_GAS_FSGSBASE
+        asm volatile ( "rdgsbase %0" : "=r" (base) );
+#else
+        asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xc8" : "=a" (base) );
+#endif
+    else
+        rdmsrl(MSR_GS_BASE, base);
+
+    return base;
+}
+
+static inline void wrfsbase(unsigned long base)
+{
+    if ( cpu_has_fsgsbase )
+#ifdef HAVE_GAS_FSGSBASE
+        asm volatile ( "wrfsbase %0" :: "r" (base) );
+#else
+        asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd0" :: "a" (base) );
+#endif
+    else
+        wrmsrl(MSR_FS_BASE, base);
+}
+
+static inline void wrgsbase(unsigned long base)
+{
+    if ( cpu_has_fsgsbase )
+#ifdef HAVE_GAS_FSGSBASE
+        asm volatile ( "wrgsbase %0" :: "r" (base) );
+#else
+        asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd8" :: "a" (base) );
+#endif
+    else
+        wrmsrl(MSR_GS_BASE, base);
+}
 
 DECLARE_PER_CPU(u64, efer);
 u64 read_efer(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:33:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUslT-0007Dk-Ii; Sat, 12 Oct 2013 06:33:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslS-0007DK-Eg
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:26 +0000
Received: from [85.158.143.35:50874] by server-3.bemta-4.messagelabs.com id
	59/1D-24907-53DE8525; Sat, 12 Oct 2013 06:33:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1381559603!1376948!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29863 invoked from network); 12 Oct 2013 06:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:33:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslP-0005vI-Fp
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslP-0000DB-AW
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:23 +0000
Date: Sat, 12 Oct 2013 06:33:23 +0000
Message-Id: <E1VUslP-0000DB-AW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: use {rd, wr}{fs,
	gs}base when available
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4b46e7be783df641b2889e514e85643febd378c2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 11 09:30:31 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 11 09:30:31 2013 +0200

    x86: use {rd,wr}{fs,gs}base when available
    
    ... as being intended to be faster than MSR reads/writes.
    
    In the case of emulate_privileged_op() also use these in favor of the
    cached (but possibly stale) addresses from arch.pv_vcpu. This allows
    entirely removing the code that was the subject of XSA-67.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/Rules.mk        |    1 +
 xen/arch/x86/acpi/suspend.c  |    8 +++---
 xen/arch/x86/domain.c        |    4 +-
 xen/arch/x86/setup.c         |    3 ++
 xen/arch/x86/traps.c         |   30 +++++++---------------
 xen/include/asm-x86/domain.h |    6 ++--
 xen/include/asm-x86/msr.h    |   56 ++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 79 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index c93d2af..576985e 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -31,6 +31,7 @@ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
 $(call as-insn-check,CFLAGS,CC,"vmcall",-DHAVE_GAS_VMX)
 $(call as-insn-check,CFLAGS,CC,"invept (%rax)$$(comma)%rax",-DHAVE_GAS_EPT)
+$(call as-insn-check,CFLAGS,CC,"rdfsbase %rax",-DHAVE_GAS_FSGSBASE)
 
 ifeq ($(supervisor_mode_kernel),y)
 CFLAGS += -DCONFIG_X86_SUPERVISOR_MODE_KERNEL=1
diff --git a/xen/arch/x86/acpi/suspend.c b/xen/arch/x86/acpi/suspend.c
index c690b45..9c3cf38 100644
--- a/xen/arch/x86/acpi/suspend.c
+++ b/xen/arch/x86/acpi/suspend.c
@@ -27,8 +27,8 @@ void save_rest_processor_state(void)
     asm volatile (
         "movw %%ds,(%0); movw %%es,2(%0); movw %%fs,4(%0); movw %%gs,6(%0)"
         : : "r" (saved_segs) : "memory" );
-    rdmsrl(MSR_FS_BASE, saved_fs_base);
-    rdmsrl(MSR_GS_BASE, saved_gs_base);
+    saved_fs_base = rdfsbase();
+    saved_gs_base = rdgsbase();
     rdmsrl(MSR_SHADOW_GS_BASE, saved_kernel_gs_base);
     rdmsrl(MSR_CSTAR, saved_cstar);
     rdmsrl(MSR_LSTAR, saved_lstar);
@@ -56,8 +56,8 @@ void restore_rest_processor_state(void)
           X86_EFLAGS_DF|X86_EFLAGS_IF|X86_EFLAGS_TF,
           0U);
 
-    wrmsrl(MSR_FS_BASE, saved_fs_base);
-    wrmsrl(MSR_GS_BASE, saved_gs_base);
+    wrfsbase(saved_fs_base);
+    wrgsbase(saved_gs_base);
     wrmsrl(MSR_SHADOW_GS_BASE, saved_kernel_gs_base);
 
     if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ||
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 52b7a37..b67fcb8 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1092,7 +1092,7 @@ static void load_segments(struct vcpu *n)
     {
         /* This can only be non-zero if selector is NULL. */
         if ( n->arch.pv_vcpu.fs_base )
-            wrmsrl(MSR_FS_BASE, n->arch.pv_vcpu.fs_base);
+            wrfsbase(n->arch.pv_vcpu.fs_base);
 
         /* Most kernels have non-zero GS base, so don't bother testing. */
         /* (This is also a serialising instruction, avoiding AMD erratum #88.) */
@@ -1100,7 +1100,7 @@ static void load_segments(struct vcpu *n)
 
         /* This can only be non-zero if selector is NULL. */
         if ( n->arch.pv_vcpu.gs_base_user )
-            wrmsrl(MSR_GS_BASE, n->arch.pv_vcpu.gs_base_user);
+            wrgsbase(n->arch.pv_vcpu.gs_base_user);
 
         /* If in kernel mode then switch the GS bases around. */
         if ( (n->arch.flags & TF_kernel_mode) )
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 637f1f9..30a4fd6 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1264,6 +1264,9 @@ void __init __start_xen(unsigned long mbi_p)
     if ( cpu_has_smep )
         set_in_cr4(X86_CR4_SMEP);
 
+    if ( cpu_has_fsgsbase )
+        set_in_cr4(X86_CR4_FSGSBASE);
+
     local_irq_enable();
 
     pt_pci_init();
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 35be017..8dcb70a 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1985,28 +1985,18 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         }
         else
         {
-            if ( lm_ovr == lm_seg_none || data_sel < 4 )
+            switch ( lm_ovr )
             {
-                switch ( lm_ovr )
-                {
-                case lm_seg_none:
-                    data_base = 0UL;
-                    break;
-                case lm_seg_fs:
-                    data_base = v->arch.pv_vcpu.fs_base;
-                    break;
-                case lm_seg_gs:
-                    if ( guest_kernel_mode(v, regs) )
-                        data_base = v->arch.pv_vcpu.gs_base_kernel;
-                    else
-                        data_base = v->arch.pv_vcpu.gs_base_user;
-                    break;
-                }
+            default:
+                data_base = 0UL;
+                break;
+            case lm_seg_fs:
+                data_base = rdfsbase();
+                break;
+            case lm_seg_gs:
+                data_base = rdgsbase();
+                break;
             }
-            else if ( !read_descriptor(data_sel, v, regs,
-                                       &data_base, &data_limit, &ar, 0) ||
-                      !(ar & _SEGMENT_S) || !(ar & _SEGMENT_P) )
-                goto fail;
             data_limit = ~0UL;
             ar = _SEGMENT_WR|_SEGMENT_S|_SEGMENT_DPL|_SEGMENT_P;
         }
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 909f449..e42651e 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -457,12 +457,12 @@ unsigned long pv_guest_cr4_fixup(const struct vcpu *, unsigned long guest_cr4);
     (((v)->arch.pv_vcpu.ctrlreg[4]                          \
       | (mmu_cr4_features                                   \
          & (X86_CR4_PGE | X86_CR4_PSE | X86_CR4_SMEP |      \
-            X86_CR4_OSXSAVE))                               \
+            X86_CR4_OSXSAVE | X86_CR4_FSGSBASE))            \
       | ((v)->domain->arch.vtsc ? X86_CR4_TSD : 0))         \
      & ~X86_CR4_DE)
 #define real_cr4_to_pv_guest_cr4(c)                         \
-    ((c) & ~(X86_CR4_PGE | X86_CR4_PSE | X86_CR4_TSD        \
-             | X86_CR4_OSXSAVE | X86_CR4_SMEP))
+    ((c) & ~(X86_CR4_PGE | X86_CR4_PSE | X86_CR4_TSD |      \
+             X86_CR4_OSXSAVE | X86_CR4_SMEP | X86_CR4_FSGSBASE))
 
 void domain_cpuid(struct domain *d,
                   unsigned int  input,
diff --git a/xen/include/asm-x86/msr.h b/xen/include/asm-x86/msr.h
index 06c46a8..5277c2b 100644
--- a/xen/include/asm-x86/msr.h
+++ b/xen/include/asm-x86/msr.h
@@ -9,6 +9,7 @@
 #include <xen/percpu.h>
 #include <xen/errno.h>
 #include <asm/asm_defns.h>
+#include <asm/cpufeature.h>
 
 #define rdmsr(msr,val1,val2) \
      __asm__ __volatile__("rdmsr" \
@@ -97,6 +98,61 @@ static inline int wrmsr_safe(unsigned int msr, uint64_t val)
 			  : "=a" (low), "=d" (high) \
 			  : "c" (counter))
 
+static inline unsigned long rdfsbase(void)
+{
+    unsigned long base;
+
+    if ( cpu_has_fsgsbase )
+#ifdef HAVE_GAS_FSGSBASE
+        asm volatile ( "rdfsbase %0" : "=r" (base) );
+#else
+        asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xc0" : "=a" (base) );
+#endif
+    else
+        rdmsrl(MSR_FS_BASE, base);
+
+    return base;
+}
+
+static inline unsigned long rdgsbase(void)
+{
+    unsigned long base;
+
+    if ( cpu_has_fsgsbase )
+#ifdef HAVE_GAS_FSGSBASE
+        asm volatile ( "rdgsbase %0" : "=r" (base) );
+#else
+        asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xc8" : "=a" (base) );
+#endif
+    else
+        rdmsrl(MSR_GS_BASE, base);
+
+    return base;
+}
+
+static inline void wrfsbase(unsigned long base)
+{
+    if ( cpu_has_fsgsbase )
+#ifdef HAVE_GAS_FSGSBASE
+        asm volatile ( "wrfsbase %0" :: "r" (base) );
+#else
+        asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd0" :: "a" (base) );
+#endif
+    else
+        wrmsrl(MSR_FS_BASE, base);
+}
+
+static inline void wrgsbase(unsigned long base)
+{
+    if ( cpu_has_fsgsbase )
+#ifdef HAVE_GAS_FSGSBASE
+        asm volatile ( "wrgsbase %0" :: "r" (base) );
+#else
+        asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd8" :: "a" (base) );
+#endif
+    else
+        wrmsrl(MSR_GS_BASE, base);
+}
 
 DECLARE_PER_CPU(u64, efer);
 u64 read_efer(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:33:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUsld-0007F5-N4; Sat, 12 Oct 2013 06:33:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslc-0007Ep-Ln
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:36 +0000
Received: from [85.158.139.211:45660] by server-5.bemta-5.messagelabs.com id
	E4/E6-12511-F3DE8525; Sat, 12 Oct 2013 06:33:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1381559614!956162!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13648 invoked from network); 12 Oct 2013 06:33:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:33:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslZ-0005vQ-UW
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslZ-0000Dd-MS
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:33 +0000
Date: Sat, 12 Oct 2013 06:33:33 +0000
Message-Id: <E1VUslZ-0000Dd-MS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: check for canonical address
	before doing page walks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6fd9b0361e2eb5a7f12bdd5cbf7e42c0d1937d26
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 11 09:31:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 11 09:31:16 2013 +0200

    x86: check for canonical address before doing page walks
    
    ... as there doesn't really exists any valid mapping for them.
    
    Particularly in the case of do_page_walk() this also avoids returning
    non-NULL for such invalid input.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/x86_64/mm.c    |    2 +-
 xen/arch/x86/x86_64/traps.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 84a2434..2bdbad0 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -73,7 +73,7 @@ void *do_page_walk(struct vcpu *v, unsigned long addr)
     l2_pgentry_t l2e, *l2t;
     l1_pgentry_t l1e, *l1t;
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_vcpu(v) || !is_canonical_address(addr) )
         return NULL;
 
     l4t = map_domain_page(mfn);
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 1cc977c..0316d7c 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -170,6 +170,8 @@ void show_page_walk(unsigned long addr)
     l1_pgentry_t l1e, *l1t;
 
     printk("Pagetable walk from %016lx:\n", addr);
+    if ( !is_canonical_address(addr) )
+        return;
 
     l4t = map_domain_page(mfn);
     l4e = l4t[l4_table_offset(addr)];
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:33:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUsld-0007F5-N4; Sat, 12 Oct 2013 06:33:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslc-0007Ep-Ln
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:36 +0000
Received: from [85.158.139.211:45660] by server-5.bemta-5.messagelabs.com id
	E4/E6-12511-F3DE8525; Sat, 12 Oct 2013 06:33:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1381559614!956162!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13648 invoked from network); 12 Oct 2013 06:33:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:33:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslZ-0005vQ-UW
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslZ-0000Dd-MS
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:33 +0000
Date: Sat, 12 Oct 2013 06:33:33 +0000
Message-Id: <E1VUslZ-0000Dd-MS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: check for canonical address
	before doing page walks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6fd9b0361e2eb5a7f12bdd5cbf7e42c0d1937d26
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 11 09:31:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 11 09:31:16 2013 +0200

    x86: check for canonical address before doing page walks
    
    ... as there doesn't really exists any valid mapping for them.
    
    Particularly in the case of do_page_walk() this also avoids returning
    non-NULL for such invalid input.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/x86_64/mm.c    |    2 +-
 xen/arch/x86/x86_64/traps.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 84a2434..2bdbad0 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -73,7 +73,7 @@ void *do_page_walk(struct vcpu *v, unsigned long addr)
     l2_pgentry_t l2e, *l2t;
     l1_pgentry_t l1e, *l1t;
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_vcpu(v) || !is_canonical_address(addr) )
         return NULL;
 
     l4t = map_domain_page(mfn);
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 1cc977c..0316d7c 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -170,6 +170,8 @@ void show_page_walk(unsigned long addr)
     l1_pgentry_t l1e, *l1t;
 
     printk("Pagetable walk from %016lx:\n", addr);
+    if ( !is_canonical_address(addr) )
+        return;
 
     l4t = map_domain_page(mfn);
     l4e = l4t[l4_table_offset(addr)];
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:33:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:33:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUsln-0007Gf-QR; Sat, 12 Oct 2013 06:33:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslm-0007GL-TC
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:47 +0000
Received: from [85.158.137.68:13043] by server-8.bemta-3.messagelabs.com id
	FB/87-28652-A4DE8525; Sat, 12 Oct 2013 06:33:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1381559624!992708!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18296 invoked from network); 12 Oct 2013 06:33:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:33:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslk-0005vW-4U
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslk-0000Ej-1l
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:44 +0000
Date: Sat, 12 Oct 2013 06:33:44 +0000
Message-Id: <E1VUslk-0000Ej-1l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: make libxl__poller_put tolerate
	p==NULL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6ed09e37722f601661fff42f80279a41773c574e
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 11 12:10:45 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 11 15:50:21 2013 +0100

    libxl: make libxl__poller_put tolerate p==NULL
    
    This is less fragile, and more in keeping with the usual style of
    initialising everything to 0 and freeing things unconditionally.
    
    Correspondingly, remove the tests at the call sites.
    
    Apropos of c1f3f174.  No overall functional change.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_event.c    |    6 +++---
 tools/libxl/libxl_internal.h |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 6f033dd..a5c52bc 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1347,6 +1347,7 @@ libxl__poller *libxl__poller_get(libxl_ctx *ctx)
 
 void libxl__poller_put(libxl_ctx *ctx, libxl__poller *p)
 {
+    if (!p) return;
     LIBXL_LIST_INSERT_HEAD(&ctx->pollers_idle, p, entry);
 }
 
@@ -1476,8 +1477,7 @@ int libxl_event_wait(libxl_ctx *ctx, libxl_event **event_r,
     }
 
  out:
-    if (poller)
-        libxl__poller_put(ctx, poller);
+    libxl__poller_put(ctx, poller);
 
     CTX_UNLOCK;
     EGC_FREE;
@@ -1540,7 +1540,7 @@ void libxl__ao__destroy(libxl_ctx *ctx, libxl__ao *ao)
     AO_GC;
     if (!ao) return;
     LOG(DEBUG,"ao %p: destroy",ao);
-    if (ao->poller) libxl__poller_put(ctx, ao->poller);
+    libxl__poller_put(ctx, ao->poller);
     ao->magic = LIBXL__AO_MAGIC_DESTROYED;
     libxl__free_all(&ao->gc);
     free(ao);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 4e15055..165dc00 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -829,7 +829,7 @@ _hidden void libxl__poller_dispose(libxl__poller *p);
  * away again afterwards.  _get can fail, returning NULL.
  * ctx must be locked. */
 _hidden libxl__poller *libxl__poller_get(libxl_ctx *ctx);
-_hidden void libxl__poller_put(libxl_ctx *ctx, libxl__poller *p);
+_hidden void libxl__poller_put(libxl_ctx*, libxl__poller *p /* may be NULL */);
 
 /* Notifies whoever is polling using p that they should wake up.
  * ctx must be locked. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:33:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:33:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VUsln-0007Gf-QR; Sat, 12 Oct 2013 06:33:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslm-0007GL-TC
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:47 +0000
Received: from [85.158.137.68:13043] by server-8.bemta-3.messagelabs.com id
	FB/87-28652-A4DE8525; Sat, 12 Oct 2013 06:33:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1381559624!992708!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18296 invoked from network); 12 Oct 2013 06:33:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:33:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslk-0005vW-4U
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslk-0000Ej-1l
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:44 +0000
Date: Sat, 12 Oct 2013 06:33:44 +0000
Message-Id: <E1VUslk-0000Ej-1l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: make libxl__poller_put tolerate
	p==NULL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6ed09e37722f601661fff42f80279a41773c574e
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 11 12:10:45 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 11 15:50:21 2013 +0100

    libxl: make libxl__poller_put tolerate p==NULL
    
    This is less fragile, and more in keeping with the usual style of
    initialising everything to 0 and freeing things unconditionally.
    
    Correspondingly, remove the tests at the call sites.
    
    Apropos of c1f3f174.  No overall functional change.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_event.c    |    6 +++---
 tools/libxl/libxl_internal.h |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 6f033dd..a5c52bc 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1347,6 +1347,7 @@ libxl__poller *libxl__poller_get(libxl_ctx *ctx)
 
 void libxl__poller_put(libxl_ctx *ctx, libxl__poller *p)
 {
+    if (!p) return;
     LIBXL_LIST_INSERT_HEAD(&ctx->pollers_idle, p, entry);
 }
 
@@ -1476,8 +1477,7 @@ int libxl_event_wait(libxl_ctx *ctx, libxl_event **event_r,
     }
 
  out:
-    if (poller)
-        libxl__poller_put(ctx, poller);
+    libxl__poller_put(ctx, poller);
 
     CTX_UNLOCK;
     EGC_FREE;
@@ -1540,7 +1540,7 @@ void libxl__ao__destroy(libxl_ctx *ctx, libxl__ao *ao)
     AO_GC;
     if (!ao) return;
     LOG(DEBUG,"ao %p: destroy",ao);
-    if (ao->poller) libxl__poller_put(ctx, ao->poller);
+    libxl__poller_put(ctx, ao->poller);
     ao->magic = LIBXL__AO_MAGIC_DESTROYED;
     libxl__free_all(&ao->gc);
     free(ao);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 4e15055..165dc00 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -829,7 +829,7 @@ _hidden void libxl__poller_dispose(libxl__poller *p);
  * away again afterwards.  _get can fail, returning NULL.
  * ctx must be locked. */
 _hidden libxl__poller *libxl__poller_get(libxl_ctx *ctx);
-_hidden void libxl__poller_put(libxl_ctx *ctx, libxl__poller *p);
+_hidden void libxl__poller_put(libxl_ctx*, libxl__poller *p /* may be NULL */);
 
 /* Notifies whoever is polling using p that they should wake up.
  * ctx must be locked. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:34:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:34: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 1VUsly-0007Id-3z; Sat, 12 Oct 2013 06:33:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslx-0007ID-65
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:57 +0000
Received: from [85.158.137.68:49155] by server-14.bemta-3.messagelabs.com id
	79/EE-00990-45DE8525; Sat, 12 Oct 2013 06:33:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1381559634!989129!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19596 invoked from network); 12 Oct 2013 06:33:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:33:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslu-0005vi-9W
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslu-0000F5-71
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:54 +0000
Date: Sat, 12 Oct 2013 06:33:54 +0000
Message-Id: <E1VUslu-0000F5-71@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 363cfda13a58eab51a4a85f30c7c740990b53c3a
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 11 19:04:25 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 11 19:04:25 2013 +0100

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

diff --git a/Config.mk b/Config.mk
index a26c7c0..1486436 100644
--- a/Config.mk
+++ b/Config.mk
@@ -245,9 +245,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 84411871262363200e70fa087d7b21647091a450
-# Wed Jul 31 16:16:16 2013 +0100
-# qemu-xen-traditional: allow build without blktap1
+QEMU_TAG ?= 0bd3d991be73031b8d9c07ccf43e5785ca26ca71
+# Thu Jul 25 08:11:55 2013 +0000
+# passthrough: Correctly expose PCH ISA bridge for IGD passthrough
 
 # 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#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:34:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:34: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 1VUsly-0007Id-3z; Sat, 12 Oct 2013 06:33:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslx-0007ID-65
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:57 +0000
Received: from [85.158.137.68:49155] by server-14.bemta-3.messagelabs.com id
	79/EE-00990-45DE8525; Sat, 12 Oct 2013 06:33:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1381559634!989129!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19596 invoked from network); 12 Oct 2013 06:33:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:33:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslu-0005vi-9W
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUslu-0000F5-71
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:33:54 +0000
Date: Sat, 12 Oct 2013 06:33:54 +0000
Message-Id: <E1VUslu-0000F5-71@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 363cfda13a58eab51a4a85f30c7c740990b53c3a
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 11 19:04:25 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 11 19:04:25 2013 +0100

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

diff --git a/Config.mk b/Config.mk
index a26c7c0..1486436 100644
--- a/Config.mk
+++ b/Config.mk
@@ -245,9 +245,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 84411871262363200e70fa087d7b21647091a450
-# Wed Jul 31 16:16:16 2013 +0100
-# qemu-xen-traditional: allow build without blktap1
+QEMU_TAG ?= 0bd3d991be73031b8d9c07ccf43e5785ca26ca71
+# Thu Jul 25 08:11:55 2013 +0000
+# passthrough: Correctly expose PCH ISA bridge for IGD passthrough
 
 # 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#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:34:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:34: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 1VUsm8-0007KN-8e; Sat, 12 Oct 2013 06:34: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 1VUsm6-0007Jz-VX
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:34:07 +0000
Received: from [85.158.139.211:63299] by server-7.bemta-5.messagelabs.com id
	3F/34-09614-E5DE8525; Sat, 12 Oct 2013 06:34:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1381559644!956202!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14412 invoked from network); 12 Oct 2013 06:34:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:34:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUsm4-0005wE-Dt
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:34:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUsm4-0000Fb-CY
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:34:04 +0000
Date: Sat, 12 Oct 2013 06:34:04 +0000
Message-Id: <E1VUsm4-0000Fb-CY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "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 1a510f3c447452006fa2a661b387fdc5410c41d5
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 11 19:05:31 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 11 19:05:31 2013 +0100

    Revert "QEMU_TAG update"
    
    (My script edited the wrong xen.git branch)
    
    This reverts commit 363cfda13a58eab51a4a85f30c7c740990b53c3a.
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1486436..a26c7c0 100644
--- a/Config.mk
+++ b/Config.mk
@@ -245,9 +245,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 0bd3d991be73031b8d9c07ccf43e5785ca26ca71
-# Thu Jul 25 08:11:55 2013 +0000
-# passthrough: Correctly expose PCH ISA bridge for IGD passthrough
+QEMU_TAG ?= 84411871262363200e70fa087d7b21647091a450
+# Wed Jul 31 16:16:16 2013 +0100
+# qemu-xen-traditional: allow build without blktap1
 
 # 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#master

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

From xen-changelog-bounces@lists.xen.org Sat Oct 12 06:34:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 12 Oct 2013 06:34: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 1VUsm8-0007KN-8e; Sat, 12 Oct 2013 06:34: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 1VUsm6-0007Jz-VX
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:34:07 +0000
Received: from [85.158.139.211:63299] by server-7.bemta-5.messagelabs.com id
	3F/34-09614-E5DE8525; Sat, 12 Oct 2013 06:34:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1381559644!956202!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14412 invoked from network); 12 Oct 2013 06:34:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Oct 2013 06:34:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUsm4-0005wE-Dt
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:34:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VUsm4-0000Fb-CY
	for xen-changelog@lists.xensource.com; Sat, 12 Oct 2013 06:34:04 +0000
Date: Sat, 12 Oct 2013 06:34:04 +0000
Message-Id: <E1VUsm4-0000Fb-CY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "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 1a510f3c447452006fa2a661b387fdc5410c41d5
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 11 19:05:31 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Oct 11 19:05:31 2013 +0100

    Revert "QEMU_TAG update"
    
    (My script edited the wrong xen.git branch)
    
    This reverts commit 363cfda13a58eab51a4a85f30c7c740990b53c3a.
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1486436..a26c7c0 100644
--- a/Config.mk
+++ b/Config.mk
@@ -245,9 +245,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 0bd3d991be73031b8d9c07ccf43e5785ca26ca71
-# Thu Jul 25 08:11:55 2013 +0000
-# passthrough: Correctly expose PCH ISA bridge for IGD passthrough
+QEMU_TAG ?= 84411871262363200e70fa087d7b21647091a450
+# Wed Jul 31 16:16:16 2013 +0100
+# qemu-xen-traditional: allow build without blktap1
 
 # 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#master

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

From xen-changelog-bounces@lists.xen.org Wed Oct 16 03:44:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 03:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWI1o-0007NV-Q5; Wed, 16 Oct 2013 03:44:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI1n-0007NG-1I
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:07 +0000
Received: from [85.158.139.211:11169] by server-17.bemta-5.messagelabs.com id
	A6/3B-17059-68B0E525; Wed, 16 Oct 2013 03:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1381895043!1594546!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14662 invoked from network); 16 Oct 2013 03:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 03:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI1j-0005II-Lb
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI1j-0004vi-HV
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:03 +0000
Date: Wed, 16 Oct 2013 03:44:03 +0000
Message-Id: <E1VWI1j-0004vi-HV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: correct LDT 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 32ff880f6e8f8898a1cefead79a65513140d2791
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 11:16:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 11:16:32 2013 +0200

    x86: correct LDT checks
    
    - MMUEXT_SET_LDT should behave as similarly to the LLDT instruction as
      possible: fail only if the base address is non-canonical
    - instead LDT descriptor accesses should fault if the descriptor
      address ends up being non-canonical (by ensuring this we at once
      avoid reading an entry from the mach-to-phys table and consider it a
      page table entry)
    - fault propagation on using LDT selectors must distinguish #PF and #GP
      (the latter must be raised for a non-canonical descriptor address,
      which also applies to several other uses of propagate_page_fault(),
      and hence the problem is being fixed there)
    - map_ldt_shadow_page() should properly wrap addresses for 32-bit VMs
    
    At once remove the odd invokation of map_ldt_shadow_page() from the
    MMUEXT_SET_LDT handler: There's nothing really telling us that the
    first LDT page is going to be preferred over others.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 40d66baa46ca8a9ffa6df3e063a967d08ec92bcf
    master date: 2013-10-11 09:28:26 +0200
---
 xen/arch/x86/domain.c        |   20 ++++++--------------
 xen/arch/x86/mm.c            |    9 ++++-----
 xen/arch/x86/traps.c         |   27 ++++++++++++++++++++++-----
 xen/include/asm-x86/mm.h     |    2 +-
 xen/include/asm-x86/paging.h |    3 ++-
 5 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 8009e0b..146fb9f 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -674,12 +674,7 @@ int arch_set_info_guest(
                 fixup_guest_code_selector(d, c.nat->trap_ctxt[i].cs);
             }
 
-            /* LDT safety checks. */
-            if ( ((c.nat->ldt_base & (PAGE_SIZE-1)) != 0) ||
-                 (c.nat->ldt_ents > 8192) ||
-                 !array_access_ok(c.nat->ldt_base,
-                                  c.nat->ldt_ents,
-                                  LDT_ENTRY_SIZE) )
+            if ( !__addr_ok(c.nat->ldt_base) )
                 return -EINVAL;
         }
         else
@@ -692,15 +687,12 @@ int arch_set_info_guest(
 
             for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); i++ )
                 fixup_guest_code_selector(d, c.cmp->trap_ctxt[i].cs);
-
-            /* LDT safety checks. */
-            if ( ((c.cmp->ldt_base & (PAGE_SIZE-1)) != 0) ||
-                 (c.cmp->ldt_ents > 8192) ||
-                 !compat_array_access_ok(c.cmp->ldt_base,
-                                         c.cmp->ldt_ents,
-                                         LDT_ENTRY_SIZE) )
-                return -EINVAL;
         }
+
+        /* LDT safety checks. */
+        if ( ((c(ldt_base) & (PAGE_SIZE - 1)) != 0) ||
+             (c(ldt_ents) > 8192) )
+            return -EINVAL;
     }
 
     v->fpu_initialised = !!(flags & VGCF_I387_VALID);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1db363e..91d2c2b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -582,6 +582,8 @@ int map_ldt_shadow_page(unsigned int off)
 
     BUG_ON(unlikely(in_irq()));
 
+    if ( is_pv_32bit_domain(d) )
+        gva = (u32)gva;
     guest_get_eff_kern_l1e(v, gva, &l1e);
     if ( unlikely(!(l1e_get_flags(l1e) & _PAGE_PRESENT)) )
         return 0;
@@ -3229,9 +3231,8 @@ long do_mmuext_op(
                 MEM_LOG("ignoring SET_LDT hypercall from external domain");
                 okay = 0;
             }
-            else if ( ((ptr & (PAGE_SIZE-1)) != 0) || 
-                      (ents > 8192) ||
-                      !array_access_ok(ptr, ents, LDT_ENTRY_SIZE) )
+            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);
@@ -3244,8 +3245,6 @@ long do_mmuext_op(
                 curr->arch.pv_vcpu.ldt_base = ptr;
                 curr->arch.pv_vcpu.ldt_ents = ents;
                 load_LDT(curr);
-                if ( ents != 0 )
-                    (void)map_ldt_shadow_page(0);
             }
             break;
         }
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index eb426ec..adc5009 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1070,12 +1070,24 @@ static void reserved_bit_page_fault(
     show_execution_state(regs);
 }
 
-void propagate_page_fault(unsigned long addr, u16 error_code)
+struct trap_bounce *propagate_page_fault(unsigned long addr, u16 error_code)
 {
     struct trap_info *ti;
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.pv_vcpu.trap_bounce;
 
+    if ( unlikely(!is_canonical_address(addr)) )
+    {
+        ti = &v->arch.pv_vcpu.trap_ctxt[TRAP_gp_fault];
+        tb->flags      = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE;
+        tb->error_code = 0;
+        tb->cs         = ti->cs;
+        tb->eip        = ti->address;
+        if ( TI_GET_IF(ti) )
+            tb->flags |= TBF_INTERRUPT;
+        return tb;
+    }
+
     v->arch.pv_vcpu.ctrlreg[2] = addr;
     arch_set_cr2(v, addr);
 
@@ -1102,6 +1114,8 @@ void propagate_page_fault(unsigned long addr, u16 error_code)
 
     if ( unlikely(error_code & PFEC_reserved_bit) )
         reserved_bit_page_fault(addr, guest_cpu_user_regs());
+
+    return NULL;
 }
 
 static int handle_gdt_ldt_mapping_fault(
@@ -1135,13 +1149,16 @@ static int handle_gdt_ldt_mapping_fault(
         }
         else
         {
+            struct trap_bounce *tb;
+
             /* In hypervisor mode? Leave it to the #PF handler to fix up. */
             if ( !guest_mode(regs) )
                 return 0;
-            /* In guest mode? Propagate #PF to guest, with adjusted %cr2. */
-            propagate_page_fault(
-                curr->arch.pv_vcpu.ldt_base + offset,
-                regs->error_code);
+            /* In guest mode? Propagate fault to guest, with adjusted %cr2. */
+            tb = propagate_page_fault(curr->arch.pv_vcpu.ldt_base + offset,
+                                      regs->error_code);
+            if ( tb )
+                tb->error_code = ((u16)offset & ~3) | 4;
         }
     }
     else
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 5f03875..c835f76 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -555,7 +555,7 @@ int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
 int vcpu_destroy_pagetables(struct vcpu *);
-void propagate_page_fault(unsigned long addr, u16 error_code);
+struct trap_bounce *propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
 int __sync_local_execstate(void);
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 9553e43..105a0ca 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -386,7 +386,8 @@ guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
     if ( likely(!paging_mode_translate(v->domain)) )
     {
         ASSERT(!paging_mode_external(v->domain));
-        if ( __copy_from_user(eff_l1e, 
+        if ( !__addr_ok(addr) ||
+             __copy_from_user(eff_l1e,
                               &__linear_l1_table[l1_linear_offset(addr)],
                               sizeof(l1_pgentry_t)) != 0 )
             *(l1_pgentry_t *)eff_l1e = l1e_empty();
--
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 Wed Oct 16 03:44:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 03:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWI1o-0007NV-Q5; Wed, 16 Oct 2013 03:44:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI1n-0007NG-1I
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:07 +0000
Received: from [85.158.139.211:11169] by server-17.bemta-5.messagelabs.com id
	A6/3B-17059-68B0E525; Wed, 16 Oct 2013 03:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1381895043!1594546!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14662 invoked from network); 16 Oct 2013 03:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 03:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI1j-0005II-Lb
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI1j-0004vi-HV
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:03 +0000
Date: Wed, 16 Oct 2013 03:44:03 +0000
Message-Id: <E1VWI1j-0004vi-HV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: correct LDT 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 32ff880f6e8f8898a1cefead79a65513140d2791
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 11:16:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 11:16:32 2013 +0200

    x86: correct LDT checks
    
    - MMUEXT_SET_LDT should behave as similarly to the LLDT instruction as
      possible: fail only if the base address is non-canonical
    - instead LDT descriptor accesses should fault if the descriptor
      address ends up being non-canonical (by ensuring this we at once
      avoid reading an entry from the mach-to-phys table and consider it a
      page table entry)
    - fault propagation on using LDT selectors must distinguish #PF and #GP
      (the latter must be raised for a non-canonical descriptor address,
      which also applies to several other uses of propagate_page_fault(),
      and hence the problem is being fixed there)
    - map_ldt_shadow_page() should properly wrap addresses for 32-bit VMs
    
    At once remove the odd invokation of map_ldt_shadow_page() from the
    MMUEXT_SET_LDT handler: There's nothing really telling us that the
    first LDT page is going to be preferred over others.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 40d66baa46ca8a9ffa6df3e063a967d08ec92bcf
    master date: 2013-10-11 09:28:26 +0200
---
 xen/arch/x86/domain.c        |   20 ++++++--------------
 xen/arch/x86/mm.c            |    9 ++++-----
 xen/arch/x86/traps.c         |   27 ++++++++++++++++++++++-----
 xen/include/asm-x86/mm.h     |    2 +-
 xen/include/asm-x86/paging.h |    3 ++-
 5 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 8009e0b..146fb9f 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -674,12 +674,7 @@ int arch_set_info_guest(
                 fixup_guest_code_selector(d, c.nat->trap_ctxt[i].cs);
             }
 
-            /* LDT safety checks. */
-            if ( ((c.nat->ldt_base & (PAGE_SIZE-1)) != 0) ||
-                 (c.nat->ldt_ents > 8192) ||
-                 !array_access_ok(c.nat->ldt_base,
-                                  c.nat->ldt_ents,
-                                  LDT_ENTRY_SIZE) )
+            if ( !__addr_ok(c.nat->ldt_base) )
                 return -EINVAL;
         }
         else
@@ -692,15 +687,12 @@ int arch_set_info_guest(
 
             for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); i++ )
                 fixup_guest_code_selector(d, c.cmp->trap_ctxt[i].cs);
-
-            /* LDT safety checks. */
-            if ( ((c.cmp->ldt_base & (PAGE_SIZE-1)) != 0) ||
-                 (c.cmp->ldt_ents > 8192) ||
-                 !compat_array_access_ok(c.cmp->ldt_base,
-                                         c.cmp->ldt_ents,
-                                         LDT_ENTRY_SIZE) )
-                return -EINVAL;
         }
+
+        /* LDT safety checks. */
+        if ( ((c(ldt_base) & (PAGE_SIZE - 1)) != 0) ||
+             (c(ldt_ents) > 8192) )
+            return -EINVAL;
     }
 
     v->fpu_initialised = !!(flags & VGCF_I387_VALID);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1db363e..91d2c2b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -582,6 +582,8 @@ int map_ldt_shadow_page(unsigned int off)
 
     BUG_ON(unlikely(in_irq()));
 
+    if ( is_pv_32bit_domain(d) )
+        gva = (u32)gva;
     guest_get_eff_kern_l1e(v, gva, &l1e);
     if ( unlikely(!(l1e_get_flags(l1e) & _PAGE_PRESENT)) )
         return 0;
@@ -3229,9 +3231,8 @@ long do_mmuext_op(
                 MEM_LOG("ignoring SET_LDT hypercall from external domain");
                 okay = 0;
             }
-            else if ( ((ptr & (PAGE_SIZE-1)) != 0) || 
-                      (ents > 8192) ||
-                      !array_access_ok(ptr, ents, LDT_ENTRY_SIZE) )
+            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);
@@ -3244,8 +3245,6 @@ long do_mmuext_op(
                 curr->arch.pv_vcpu.ldt_base = ptr;
                 curr->arch.pv_vcpu.ldt_ents = ents;
                 load_LDT(curr);
-                if ( ents != 0 )
-                    (void)map_ldt_shadow_page(0);
             }
             break;
         }
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index eb426ec..adc5009 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1070,12 +1070,24 @@ static void reserved_bit_page_fault(
     show_execution_state(regs);
 }
 
-void propagate_page_fault(unsigned long addr, u16 error_code)
+struct trap_bounce *propagate_page_fault(unsigned long addr, u16 error_code)
 {
     struct trap_info *ti;
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.pv_vcpu.trap_bounce;
 
+    if ( unlikely(!is_canonical_address(addr)) )
+    {
+        ti = &v->arch.pv_vcpu.trap_ctxt[TRAP_gp_fault];
+        tb->flags      = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE;
+        tb->error_code = 0;
+        tb->cs         = ti->cs;
+        tb->eip        = ti->address;
+        if ( TI_GET_IF(ti) )
+            tb->flags |= TBF_INTERRUPT;
+        return tb;
+    }
+
     v->arch.pv_vcpu.ctrlreg[2] = addr;
     arch_set_cr2(v, addr);
 
@@ -1102,6 +1114,8 @@ void propagate_page_fault(unsigned long addr, u16 error_code)
 
     if ( unlikely(error_code & PFEC_reserved_bit) )
         reserved_bit_page_fault(addr, guest_cpu_user_regs());
+
+    return NULL;
 }
 
 static int handle_gdt_ldt_mapping_fault(
@@ -1135,13 +1149,16 @@ static int handle_gdt_ldt_mapping_fault(
         }
         else
         {
+            struct trap_bounce *tb;
+
             /* In hypervisor mode? Leave it to the #PF handler to fix up. */
             if ( !guest_mode(regs) )
                 return 0;
-            /* In guest mode? Propagate #PF to guest, with adjusted %cr2. */
-            propagate_page_fault(
-                curr->arch.pv_vcpu.ldt_base + offset,
-                regs->error_code);
+            /* In guest mode? Propagate fault to guest, with adjusted %cr2. */
+            tb = propagate_page_fault(curr->arch.pv_vcpu.ldt_base + offset,
+                                      regs->error_code);
+            if ( tb )
+                tb->error_code = ((u16)offset & ~3) | 4;
         }
     }
     else
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 5f03875..c835f76 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -555,7 +555,7 @@ int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
 int vcpu_destroy_pagetables(struct vcpu *);
-void propagate_page_fault(unsigned long addr, u16 error_code);
+struct trap_bounce *propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
 int __sync_local_execstate(void);
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 9553e43..105a0ca 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -386,7 +386,8 @@ guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
     if ( likely(!paging_mode_translate(v->domain)) )
     {
         ASSERT(!paging_mode_external(v->domain));
-        if ( __copy_from_user(eff_l1e, 
+        if ( !__addr_ok(addr) ||
+             __copy_from_user(eff_l1e,
                               &__linear_l1_table[l1_linear_offset(addr)],
                               sizeof(l1_pgentry_t)) != 0 )
             *(l1_pgentry_t *)eff_l1e = l1e_empty();
--
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 Wed Oct 16 03:44:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 03:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWI1x-0007OG-TE; Wed, 16 Oct 2013 03:44: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 1VWI1w-0007O2-7v
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:16 +0000
Received: from [85.158.143.35:4033] by server-2.bemta-4.messagelabs.com id
	92/43-06473-F8B0E525; Wed, 16 Oct 2013 03:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1381895054!2099760!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20472 invoked from network); 16 Oct 2013 03:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 03:44:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI1t-0005IL-S5
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI1t-0004wV-Q9
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:13 +0000
Date: Wed, 16 Oct 2013 03:44:13 +0000
Message-Id: <E1VWI1t-0004wV-Q9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: add address validity check to
	guest_map_l1e()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6ab2551502847834c9c4e581d546ccfcf72a51a6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 11:17:45 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 11:17:45 2013 +0200

    x86: add address validity check to guest_map_l1e()
    
    Just like for guest_get_eff_l1e() this prevents accessing as page
    tables (and with the wrong memory attribute) internal data inside Xen
    happening to be mapped with 1Gb pages.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: d06a0d715ec1423b6c42141ab1b0ff69a3effb56
    master date: 2013-10-11 09:29:43 +0200
---
 xen/include/asm-x86/paging.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 105a0ca..e957b2f 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -360,7 +360,8 @@ guest_map_l1e(struct vcpu *v, unsigned long addr, unsigned long *gl1mfn)
         return paging_get_hostmode(v)->guest_map_l1e(v, addr, gl1mfn);
 
     /* Find this l1e and its enclosing l1mfn in the linear map */
-    if ( __copy_from_user(&l2e, 
+    if ( !__addr_ok(addr) ||
+         __copy_from_user(&l2e,
                           &__linear_l2_table[l2_linear_offset(addr)],
                           sizeof(l2_pgentry_t)) != 0 )
         return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Wed Oct 16 03:44:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 03:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWI1x-0007OG-TE; Wed, 16 Oct 2013 03:44: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 1VWI1w-0007O2-7v
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:16 +0000
Received: from [85.158.143.35:4033] by server-2.bemta-4.messagelabs.com id
	92/43-06473-F8B0E525; Wed, 16 Oct 2013 03:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1381895054!2099760!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20472 invoked from network); 16 Oct 2013 03:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 03:44:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI1t-0005IL-S5
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI1t-0004wV-Q9
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:13 +0000
Date: Wed, 16 Oct 2013 03:44:13 +0000
Message-Id: <E1VWI1t-0004wV-Q9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: add address validity check to
	guest_map_l1e()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6ab2551502847834c9c4e581d546ccfcf72a51a6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 11:17:45 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 11:17:45 2013 +0200

    x86: add address validity check to guest_map_l1e()
    
    Just like for guest_get_eff_l1e() this prevents accessing as page
    tables (and with the wrong memory attribute) internal data inside Xen
    happening to be mapped with 1Gb pages.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: d06a0d715ec1423b6c42141ab1b0ff69a3effb56
    master date: 2013-10-11 09:29:43 +0200
---
 xen/include/asm-x86/paging.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 105a0ca..e957b2f 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -360,7 +360,8 @@ guest_map_l1e(struct vcpu *v, unsigned long addr, unsigned long *gl1mfn)
         return paging_get_hostmode(v)->guest_map_l1e(v, addr, gl1mfn);
 
     /* Find this l1e and its enclosing l1mfn in the linear map */
-    if ( __copy_from_user(&l2e, 
+    if ( !__addr_ok(addr) ||
+         __copy_from_user(&l2e,
                           &__linear_l2_table[l2_linear_offset(addr)],
                           sizeof(l2_pgentry_t)) != 0 )
         return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Wed Oct 16 03:44:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 03:44:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWI28-0007PR-0B; Wed, 16 Oct 2013 03:44: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 1VWI26-0007PD-Rw
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:27 +0000
Received: from [85.158.137.68:61120] by server-10.bemta-3.messagelabs.com id
	3E/8D-17212-A9B0E525; Wed, 16 Oct 2013 03:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1381895064!1669464!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15522 invoked from network); 16 Oct 2013 03:44:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 03:44:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI24-0005IR-3M
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI24-0004wr-0K
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:24 +0000
Date: Wed, 16 Oct 2013 03:44:24 +0000
Message-Id: <E1VWI24-0004wr-0K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: check for canonical address
	before doing page walks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7b17418d1a09fa386222394c0ba30be3bd179c8a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 11:18:20 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 11:18:20 2013 +0200

    x86: check for canonical address before doing page walks
    
    ... as there doesn't really exists any valid mapping for them.
    
    Particularly in the case of do_page_walk() this also avoids returning
    non-NULL for such invalid input.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 6fd9b0361e2eb5a7f12bdd5cbf7e42c0d1937d26
    master date: 2013-10-11 09:31:16 +0200
---
 xen/arch/x86/x86_64/mm.c    |    2 +-
 xen/arch/x86/x86_64/traps.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index d1a1c02..c491b98 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -135,7 +135,7 @@ void *do_page_walk(struct vcpu *v, unsigned long addr)
     l2_pgentry_t l2e, *l2t;
     l1_pgentry_t l1e, *l1t;
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_vcpu(v) || !is_canonical_address(addr) )
         return NULL;
 
     l4t = map_domain_page(mfn);
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 1054480..fe02261 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -169,6 +169,8 @@ void show_page_walk(unsigned long addr)
     l1_pgentry_t l1e, *l1t;
 
     printk("Pagetable walk from %016lx:\n", addr);
+    if ( !is_canonical_address(addr) )
+        return;
 
     l4t = map_domain_page(mfn);
     l4e = l4t[l4_table_offset(addr)];
--
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 Wed Oct 16 03:44:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 03:44:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWI28-0007PR-0B; Wed, 16 Oct 2013 03:44: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 1VWI26-0007PD-Rw
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:27 +0000
Received: from [85.158.137.68:61120] by server-10.bemta-3.messagelabs.com id
	3E/8D-17212-A9B0E525; Wed, 16 Oct 2013 03:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1381895064!1669464!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15522 invoked from network); 16 Oct 2013 03:44:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 03:44:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI24-0005IR-3M
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWI24-0004wr-0K
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 03:44:24 +0000
Date: Wed, 16 Oct 2013 03:44:24 +0000
Message-Id: <E1VWI24-0004wr-0K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: check for canonical address
	before doing page walks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7b17418d1a09fa386222394c0ba30be3bd179c8a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 11:18:20 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 11:18:20 2013 +0200

    x86: check for canonical address before doing page walks
    
    ... as there doesn't really exists any valid mapping for them.
    
    Particularly in the case of do_page_walk() this also avoids returning
    non-NULL for such invalid input.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 6fd9b0361e2eb5a7f12bdd5cbf7e42c0d1937d26
    master date: 2013-10-11 09:31:16 +0200
---
 xen/arch/x86/x86_64/mm.c    |    2 +-
 xen/arch/x86/x86_64/traps.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index d1a1c02..c491b98 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -135,7 +135,7 @@ void *do_page_walk(struct vcpu *v, unsigned long addr)
     l2_pgentry_t l2e, *l2t;
     l1_pgentry_t l1e, *l1t;
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_vcpu(v) || !is_canonical_address(addr) )
         return NULL;
 
     l4t = map_domain_page(mfn);
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 1054480..fe02261 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -169,6 +169,8 @@ void show_page_walk(unsigned long addr)
     l1_pgentry_t l1e, *l1t;
 
     printk("Pagetable walk from %016lx:\n", addr);
+    if ( !is_canonical_address(addr) )
+        return;
 
     l4t = map_domain_page(mfn);
     l4e = l4t[l4_table_offset(addr)];
--
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 Wed Oct 16 05:11:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWJO4-00082c-6e; Wed, 16 Oct 2013 05:11: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 1VWJO2-00082X-PY
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:10 +0000
Received: from [193.109.254.147:16143] by server-1.bemta-14.messagelabs.com id
	8F/5B-09804-EEF1E525; Wed, 16 Oct 2013 05:11:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1381900268!2374375!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7666 invoked from network); 16 Oct 2013 05:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:11:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJNw-0006QH-72
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJNv-0007FO-PR
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:03 +0000
Date: Wed, 16 Oct 2013 05:11:03 +0000
Message-Id: <E1VWJNv-0007FO-PR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix bug_line()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 48830988a28b7fb1eed225354e25572aa955749a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 08:52:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 08:52:18 2013 +0200

    x86: fix bug_line()
    
    Due to the packing into a bit field together with a relocated field,
    the computation can overflow when the relocated field ends up getting a
    negative value stored. Hence it isn't sufficient to correct the value
    by 1 in this case, but we also need to mask the result to the width of
    the original bit field.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/asm-x86/bug.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-x86/bug.h b/xen/include/asm-x86/bug.h
index 956bfd2..cd862e3 100644
--- a/xen/include/asm-x86/bug.h
+++ b/xen/include/asm-x86/bug.h
@@ -15,9 +15,11 @@ struct bug_frame {
 
 #define bug_loc(b) ((const void *)(b) + (b)->loc_disp)
 #define bug_ptr(b) ((const void *)(b) + (b)->ptr_disp)
-#define bug_line(b) ((((b)->line_hi + ((b)->loc_disp < 0)) <<                \
+#define bug_line(b) (((((b)->line_hi + ((b)->loc_disp < 0)) &                \
+                       ((1 << BUG_LINE_HI_WIDTH) - 1)) <<                    \
                       BUG_LINE_LO_WIDTH) +                                   \
-                     (b)->line_lo + ((b)->ptr_disp < 0))
+                     (((b)->line_lo + ((b)->ptr_disp < 0)) &                 \
+                      ((1 << BUG_LINE_LO_WIDTH) - 1)))
 #define bug_msg(b) ((const char *)(b) + (b)->msg_disp[1])
 
 #define BUGFRAME_run_fn 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 Oct 16 05:11:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWJO4-00082c-6e; Wed, 16 Oct 2013 05:11: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 1VWJO2-00082X-PY
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:10 +0000
Received: from [193.109.254.147:16143] by server-1.bemta-14.messagelabs.com id
	8F/5B-09804-EEF1E525; Wed, 16 Oct 2013 05:11:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1381900268!2374375!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7666 invoked from network); 16 Oct 2013 05:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:11:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJNw-0006QH-72
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJNv-0007FO-PR
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:03 +0000
Date: Wed, 16 Oct 2013 05:11:03 +0000
Message-Id: <E1VWJNv-0007FO-PR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix bug_line()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 48830988a28b7fb1eed225354e25572aa955749a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 08:52:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 08:52:18 2013 +0200

    x86: fix bug_line()
    
    Due to the packing into a bit field together with a relocated field,
    the computation can overflow when the relocated field ends up getting a
    negative value stored. Hence it isn't sufficient to correct the value
    by 1 in this case, but we also need to mask the result to the width of
    the original bit field.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/asm-x86/bug.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-x86/bug.h b/xen/include/asm-x86/bug.h
index 956bfd2..cd862e3 100644
--- a/xen/include/asm-x86/bug.h
+++ b/xen/include/asm-x86/bug.h
@@ -15,9 +15,11 @@ struct bug_frame {
 
 #define bug_loc(b) ((const void *)(b) + (b)->loc_disp)
 #define bug_ptr(b) ((const void *)(b) + (b)->ptr_disp)
-#define bug_line(b) ((((b)->line_hi + ((b)->loc_disp < 0)) <<                \
+#define bug_line(b) (((((b)->line_hi + ((b)->loc_disp < 0)) &                \
+                       ((1 << BUG_LINE_HI_WIDTH) - 1)) <<                    \
                       BUG_LINE_LO_WIDTH) +                                   \
-                     (b)->line_lo + ((b)->ptr_disp < 0))
+                     (((b)->line_lo + ((b)->ptr_disp < 0)) &                 \
+                      ((1 << BUG_LINE_LO_WIDTH) - 1)))
 #define bug_msg(b) ((const char *)(b) + (b)->msg_disp[1])
 
 #define BUGFRAME_run_fn 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 Oct 16 05:11:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:11: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 1VWJOK-00083R-9t; Wed, 16 Oct 2013 05:11: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 1VWJOJ-00083J-6U
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:27 +0000
Received: from [193.109.254.147:16770] by server-6.bemta-14.messagelabs.com id
	2E/26-03516-EFF1E525; Wed, 16 Oct 2013 05:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1381900284!2368555!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32556 invoked from network); 16 Oct 2013 05:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOG-0006QQ-ML
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOG-0007G8-JG
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:24 +0000
Date: Wed, 16 Oct 2013 05:11:24 +0000
Message-Id: <E1VWJOG-0007G8-JG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: fix race between
	sched_move_domain() and vcpu_wake()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef55257bc81204e34691f1c2aa9e01f2d0768bdd
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 08:58:31 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 08:58:31 2013 +0200

    sched: fix race between sched_move_domain() and vcpu_wake()
    
    From: David Vrabel <david.vrabel@citrix.com>
    
    sched_move_domain() changes v->processor for all the domain's VCPUs.
    If another domain, softirq etc. triggers a simultaneous call to
    vcpu_wake() (e.g., by setting an event channel as pending), then
    vcpu_wake() may lock one schedule lock and try to unlock another.
    
    vcpu_schedule_lock() attempts to handle this but only does so for the
    window between reading the schedule_lock from the per-CPU data and the
    spin_lock() call.  This does not help with sched_move_domain()
    changing v->processor between the calls to vcpu_schedule_lock() and
    vcpu_schedule_unlock().
    
    Fix the race by taking the schedule_lock for v->processor in
    sched_move_domain().
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    
    Use vcpu_schedule_lock_irq() (which now returns the lock) to properly
    retry the locking should the to be used lock have changed in the course
    of acquiring it (issue pointed out by George Dunlap).
    
    Add a comment explaining the state after the v->processor adjustment.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/schedule.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 95472ba..af3abc2 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -276,6 +276,8 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     new_p = cpumask_first(c->cpu_valid);
     for_each_vcpu ( d, v )
     {
+        spinlock_t *lock;
+
         vcpudata = v->sched_priv;
 
         migrate_timer(&v->periodic_timer, new_p);
@@ -283,7 +285,16 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         migrate_timer(&v->poll_timer, new_p);
 
         cpumask_setall(v->cpu_affinity);
+
+        lock = vcpu_schedule_lock_irq(v);
         v->processor = new_p;
+        /*
+         * With v->processor modified we must not
+         * - make any further changes assuming we hold the scheduler lock,
+         * - use vcpu_schedule_unlock_irq().
+         */
+        spin_unlock_irq(lock);
+
         v->sched_priv = vcpu_priv[v->vcpu_id];
         evtchn_move_pirqs(v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Oct 16 05:11:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:11: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 1VWJOK-00083R-9t; Wed, 16 Oct 2013 05:11: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 1VWJOJ-00083J-6U
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:27 +0000
Received: from [193.109.254.147:16770] by server-6.bemta-14.messagelabs.com id
	2E/26-03516-EFF1E525; Wed, 16 Oct 2013 05:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1381900284!2368555!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32556 invoked from network); 16 Oct 2013 05:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOG-0006QQ-ML
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOG-0007G8-JG
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:24 +0000
Date: Wed, 16 Oct 2013 05:11:24 +0000
Message-Id: <E1VWJOG-0007G8-JG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: fix race between
	sched_move_domain() and vcpu_wake()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef55257bc81204e34691f1c2aa9e01f2d0768bdd
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 08:58:31 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 08:58:31 2013 +0200

    sched: fix race between sched_move_domain() and vcpu_wake()
    
    From: David Vrabel <david.vrabel@citrix.com>
    
    sched_move_domain() changes v->processor for all the domain's VCPUs.
    If another domain, softirq etc. triggers a simultaneous call to
    vcpu_wake() (e.g., by setting an event channel as pending), then
    vcpu_wake() may lock one schedule lock and try to unlock another.
    
    vcpu_schedule_lock() attempts to handle this but only does so for the
    window between reading the schedule_lock from the per-CPU data and the
    spin_lock() call.  This does not help with sched_move_domain()
    changing v->processor between the calls to vcpu_schedule_lock() and
    vcpu_schedule_unlock().
    
    Fix the race by taking the schedule_lock for v->processor in
    sched_move_domain().
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    
    Use vcpu_schedule_lock_irq() (which now returns the lock) to properly
    retry the locking should the to be used lock have changed in the course
    of acquiring it (issue pointed out by George Dunlap).
    
    Add a comment explaining the state after the v->processor adjustment.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/schedule.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 95472ba..af3abc2 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -276,6 +276,8 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
     new_p = cpumask_first(c->cpu_valid);
     for_each_vcpu ( d, v )
     {
+        spinlock_t *lock;
+
         vcpudata = v->sched_priv;
 
         migrate_timer(&v->periodic_timer, new_p);
@@ -283,7 +285,16 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         migrate_timer(&v->poll_timer, new_p);
 
         cpumask_setall(v->cpu_affinity);
+
+        lock = vcpu_schedule_lock_irq(v);
         v->processor = new_p;
+        /*
+         * With v->processor modified we must not
+         * - make any further changes assuming we hold the scheduler lock,
+         * - use vcpu_schedule_unlock_irq().
+         */
+        spin_unlock_irq(lock);
+
         v->sched_priv = vcpu_priv[v->vcpu_id];
         evtchn_move_pirqs(v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Oct 16 05:11:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:11:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWJOU-00085g-J4; Wed, 16 Oct 2013 05:11: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 1VWJOT-00085S-LG
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:37 +0000
Received: from [85.158.137.68:14423] by server-17.bemta-3.messagelabs.com id
	4A/09-12030-8002E525; Wed, 16 Oct 2013 05:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1381900295!1670685!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8498 invoked from network); 16 Oct 2013 05:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOQ-0006QV-UK
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOQ-0007GZ-Qd
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:34 +0000
Date: Wed, 16 Oct 2013 05:11:34 +0000
Message-Id: <E1VWJOQ-0007GZ-Qd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI: fix locking in
	pci_restore_msi_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 dfd1fe582367933924a1e3318ac0a0da7d2bc7e3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 09:07:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:07:02 2013 +0200

    x86/MSI: fix locking in pci_restore_msi_state()
    
    Right after the loop the lock is being dropped, so all loop exits
    should happen with the lock still held.
    
    Reported-by: Kristoffer Egefelt <kristoffer@itoc.dk>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Kristoffer Egefelt <kristoffer@itoc.dk>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index e17e5b2..b43c36a 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1158,11 +1158,11 @@ int pci_restore_msi_state(struct pci_dev *pdev)
         for ( i = 0; ; )
         {
             msi_set_mask_bit(desc, entry[i].msi_attrib.masked);
-            spin_unlock_irqrestore(&desc->lock, flags);
 
             if ( !--nr )
                 break;
 
+            spin_unlock_irqrestore(&desc->lock, flags);
             desc = &irq_desc[entry[++i].irq];
             spin_lock_irqsave(&desc->lock, flags);
             if ( desc->msi_desc != entry + i )
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:11:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:11:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWJOU-00085g-J4; Wed, 16 Oct 2013 05:11: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 1VWJOT-00085S-LG
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:37 +0000
Received: from [85.158.137.68:14423] by server-17.bemta-3.messagelabs.com id
	4A/09-12030-8002E525; Wed, 16 Oct 2013 05:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1381900295!1670685!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8498 invoked from network); 16 Oct 2013 05:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOQ-0006QV-UK
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOQ-0007GZ-Qd
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:34 +0000
Date: Wed, 16 Oct 2013 05:11:34 +0000
Message-Id: <E1VWJOQ-0007GZ-Qd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI: fix locking in
	pci_restore_msi_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 dfd1fe582367933924a1e3318ac0a0da7d2bc7e3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 09:07:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:07:02 2013 +0200

    x86/MSI: fix locking in pci_restore_msi_state()
    
    Right after the loop the lock is being dropped, so all loop exits
    should happen with the lock still held.
    
    Reported-by: Kristoffer Egefelt <kristoffer@itoc.dk>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Kristoffer Egefelt <kristoffer@itoc.dk>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/msi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index e17e5b2..b43c36a 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -1158,11 +1158,11 @@ int pci_restore_msi_state(struct pci_dev *pdev)
         for ( i = 0; ; )
         {
             msi_set_mask_bit(desc, entry[i].msi_attrib.masked);
-            spin_unlock_irqrestore(&desc->lock, flags);
 
             if ( !--nr )
                 break;
 
+            spin_unlock_irqrestore(&desc->lock, flags);
             desc = &irq_desc[entry[++i].irq];
             spin_lock_irqsave(&desc->lock, flags);
             if ( desc->msi_desc != entry + i )
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:11:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:11: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 1VWJOP-00084i-D1; Wed, 16 Oct 2013 05:11:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOO-00083f-57
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:32 +0000
Received: from [85.158.143.35:24635] by server-1.bemta-4.messagelabs.com id
	59/A2-17304-3002E525; Wed, 16 Oct 2013 05:11:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1381900288!2113609!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.6 required=7.0 tests=DIET_1
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22148 invoked from network); 16 Oct 2013 05:11:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:11:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJO6-0006QK-FA
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJO6-0007Fm-BD
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:14 +0000
Date: Wed, 16 Oct 2013 05:11:14 +0000
Message-Id: <E1VWJO6-0007Fm-BD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] scheduler: adjust internal locking
	interface
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eedd60391610629b4e8a2e8278b857ff884f750d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 08:57:56 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 08:57:56 2013 +0200

    scheduler: adjust internal locking interface
    
    Make the locking functions return the lock pointers, so they can be
    passed to the unlocking functions (which in turn can check that the
    lock is still actually providing the intended protection, i.e. the
    parameters determining which lock is the right one didn't change).
    
    Further use proper spin lock primitives rather than open coded
    local_irq_...() constructs, so that interrupts can be re-enabled as
    appropriate while spinning.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/sched_credit.c  |   11 ++-
 xen/common/sched_credit2.c |   22 ++++---
 xen/common/sched_sedf.c    |   29 ++++++----
 xen/common/schedule.c      |   61 ++++++++++----------
 xen/include/xen/sched-if.h |  138 ++++++++++++++++++--------------------------
 5 files changed, 125 insertions(+), 136 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 3d6ea7a..192c653 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1166,6 +1166,7 @@ csched_runq_sort(struct csched_private *prv, unsigned int cpu)
     struct csched_pcpu * const spc = CSCHED_PCPU(cpu);
     struct list_head *runq, *elem, *next, *last_under;
     struct csched_vcpu *svc_elem;
+    spinlock_t *lock;
     unsigned long flags;
     int sort_epoch;
 
@@ -1175,7 +1176,7 @@ csched_runq_sort(struct csched_private *prv, unsigned int cpu)
 
     spc->runq_sort_last = sort_epoch;
 
-    pcpu_schedule_lock_irqsave(cpu, flags);
+    lock = pcpu_schedule_lock_irqsave(cpu, &flags);
 
     runq = &spc->runq;
     elem = runq->next;
@@ -1200,7 +1201,7 @@ csched_runq_sort(struct csched_private *prv, unsigned int cpu)
         elem = next;
     }
 
-    pcpu_schedule_unlock_irqrestore(cpu, flags);
+    pcpu_schedule_unlock_irqrestore(lock, flags, cpu);
 }
 
 static void
@@ -1563,7 +1564,9 @@ csched_load_balance(struct csched_private *prv, int cpu,
                  * could cause a deadlock if the peer CPU is also load
                  * balancing and trying to lock this CPU.
                  */
-                if ( !pcpu_schedule_trylock(peer_cpu) )
+                spinlock_t *lock = pcpu_schedule_trylock(peer_cpu);
+
+                if ( !lock )
                 {
                     SCHED_STAT_CRANK(steal_trylock_failed);
                     peer_cpu = cpumask_cycle(peer_cpu, &workers);
@@ -1573,7 +1576,7 @@ csched_load_balance(struct csched_private *prv, int cpu,
                 /* Any work over there to steal? */
                 speer = cpumask_test_cpu(peer_cpu, online) ?
                     csched_runq_steal(peer_cpu, cpu, snext->pri, bstep) : NULL;
-                pcpu_schedule_unlock(peer_cpu);
+                pcpu_schedule_unlock(lock, peer_cpu);
 
                 /* As soon as one vcpu is found, balancing ends */
                 if ( speer != NULL )
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index ae0abc2..84e547b 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -882,15 +882,17 @@ csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
      */
     if ( ! is_idle_vcpu(vc) )
     {
+        spinlock_t *lock;
+
         /* FIXME: Do we need the private lock here? */
         list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
 
         /* Add vcpu to runqueue of initial processor */
-        vcpu_schedule_lock_irq(vc);
+        lock = vcpu_schedule_lock_irq(vc);
 
         runq_assign(ops, vc);
 
-        vcpu_schedule_unlock_irq(vc);
+        vcpu_schedule_unlock_irq(lock, vc);
 
         sdom->nr_vcpus++;
     }
@@ -917,14 +919,16 @@ csched_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
 
     if ( ! is_idle_vcpu(vc) )
     {
+        spinlock_t *lock;
+
         SCHED_STAT_CRANK(vcpu_destroy);
 
         /* Remove from runqueue */
-        vcpu_schedule_lock_irq(vc);
+        lock = vcpu_schedule_lock_irq(vc);
 
         runq_deassign(ops, vc);
 
-        vcpu_schedule_unlock_irq(vc);
+        vcpu_schedule_unlock_irq(lock, vc);
 
         /* Remove from sdom list.  Don't need a lock for this, as it's called
          * syncronously when nothing else can happen. */
@@ -1011,8 +1015,7 @@ csched_context_saved(const struct scheduler *ops, struct vcpu *vc)
 {
     struct csched_vcpu * const svc = CSCHED_VCPU(vc);
     s_time_t now = NOW();
-
-    vcpu_schedule_lock_irq(vc);
+    spinlock_t *lock = vcpu_schedule_lock_irq(vc);
 
     BUG_ON( !is_idle_vcpu(vc) && svc->rqd != RQD(ops, vc->processor));
 
@@ -1038,7 +1041,7 @@ csched_context_saved(const struct scheduler *ops, struct vcpu *vc)
     else if ( !is_idle_vcpu(vc) )
         update_load(ops, svc->rqd, svc, -1, now);
 
-    vcpu_schedule_unlock_irq(vc);
+    vcpu_schedule_unlock_irq(lock, vc);
 }
 
 #define MAX_LOAD (1ULL<<60);
@@ -1456,14 +1459,14 @@ csched_dom_cntl(
                  * must never lock csched_priv.lock if we're holding a runqueue lock.
                  * Also, calling vcpu_schedule_lock() is enough, since IRQs have already
                  * been disabled. */
-                vcpu_schedule_lock(svc->vcpu);
+                spinlock_t *lock = vcpu_schedule_lock(svc->vcpu);
 
                 BUG_ON(svc->rqd != RQD(ops, svc->vcpu->processor));
 
                 svc->weight = sdom->weight;
                 update_max_weight(svc->rqd, svc->weight, old_weight);
 
-                vcpu_schedule_unlock(svc->vcpu);
+                vcpu_schedule_unlock(lock, svc->vcpu);
             }
         }
     }
@@ -1993,6 +1996,7 @@ static void init_pcpu(const struct scheduler *ops, int cpu)
     cpumask_set_cpu(cpu, &rqd->idle);
     cpumask_set_cpu(cpu, &rqd->active);
 
+    /* _Not_ pcpu_schedule_unlock(): per_cpu().schedule_lock changed! */
     spin_unlock(old_lock);
 
     cpumask_set_cpu(cpu, &prv->initialized);
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c
index d1812b6..7c24171 100644
--- a/xen/common/sched_sedf.c
+++ b/xen/common/sched_sedf.c
@@ -1350,14 +1350,16 @@ static int sedf_adjust_weights(struct cpupool *c, int nr_cpus, int *sumw, s_time
             if ( EDOM_INFO(p)->weight )
             {
                 /* Interrupts already off */
-                vcpu_schedule_lock(p);
+                spinlock_t *lock = vcpu_schedule_lock(p);
+
                 EDOM_INFO(p)->period_orig = 
                     EDOM_INFO(p)->period  = WEIGHT_PERIOD;
                 EDOM_INFO(p)->slice_orig  =
                     EDOM_INFO(p)->slice   = 
                     (EDOM_INFO(p)->weight *
                      (WEIGHT_PERIOD - WEIGHT_SAFETY - sumt[cpu])) / sumw[cpu];
-                vcpu_schedule_unlock(p);
+
+                vcpu_schedule_unlock(lock, p);
             }
         }
     }
@@ -1418,21 +1420,24 @@ static int sedf_adjust(const struct scheduler *ops, struct domain *p, struct xen
                 {
                     /* (Here and everywhere in the following) IRQs are already off,
                      * hence vcpu_spin_lock() is the one. */
-                    vcpu_schedule_lock(v);
+                    spinlock_t *lock = vcpu_schedule_lock(v);
+
                     EDOM_INFO(v)->extraweight = op->u.sedf.weight;
                     EDOM_INFO(v)->weight = 0;
                     EDOM_INFO(v)->slice = 0;
                     EDOM_INFO(v)->period = WEIGHT_PERIOD;
-                    vcpu_schedule_unlock(v);
+                    vcpu_schedule_unlock(lock, v);
                 }
             }
             else
             {
                 /* Weight-driven domains with real-time execution */
-                for_each_vcpu ( p, v ) {
-                    vcpu_schedule_lock(v);
+                for_each_vcpu ( p, v )
+                {
+                    spinlock_t *lock = vcpu_schedule_lock(v);
+
                     EDOM_INFO(v)->weight = op->u.sedf.weight;
-                    vcpu_schedule_unlock(v);
+                    vcpu_schedule_unlock(lock, v);
                 }
             }
         }
@@ -1454,14 +1459,15 @@ static int sedf_adjust(const struct scheduler *ops, struct domain *p, struct xen
             /* Time-driven domains */
             for_each_vcpu ( p, v )
             {
-                vcpu_schedule_lock(v);
+                spinlock_t *lock = vcpu_schedule_lock(v);
+
                 EDOM_INFO(v)->weight = 0;
                 EDOM_INFO(v)->extraweight = 0;
                 EDOM_INFO(v)->period_orig = 
                     EDOM_INFO(v)->period  = op->u.sedf.period;
                 EDOM_INFO(v)->slice_orig  = 
                     EDOM_INFO(v)->slice   = op->u.sedf.slice;
-                vcpu_schedule_unlock(v);
+                vcpu_schedule_unlock(lock, v);
             }
         }
 
@@ -1471,13 +1477,14 @@ static int sedf_adjust(const struct scheduler *ops, struct domain *p, struct xen
 
         for_each_vcpu ( p, v )
         {
-            vcpu_schedule_lock(v);
+            spinlock_t *lock = vcpu_schedule_lock(v);
+
             EDOM_INFO(v)->status  = 
                 (EDOM_INFO(v)->status &
                  ~EXTRA_AWARE) | (op->u.sedf.extratime & EXTRA_AWARE);
             EDOM_INFO(v)->latency = op->u.sedf.latency;
             extraq_check(v);
-            vcpu_schedule_unlock(v);
+            vcpu_schedule_unlock(lock, v);
         }
     }
     else if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo )
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 1ddfb22..95472ba 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -160,18 +160,16 @@ static inline void vcpu_runstate_change(
 
 void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate)
 {
+    spinlock_t *lock = likely(v == current) ? NULL : vcpu_schedule_lock_irq(v);
     s_time_t delta;
 
-    if ( unlikely(v != current) )
-        vcpu_schedule_lock_irq(v);
-
     memcpy(runstate, &v->runstate, sizeof(*runstate));
     delta = NOW() - runstate->state_entry_time;
     if ( delta > 0 )
         runstate->time[runstate->state] += delta;
 
-    if ( unlikely(v != current) )
-        vcpu_schedule_unlock_irq(v);
+    if ( unlikely(lock != NULL) )
+        vcpu_schedule_unlock_irq(lock, v);
 }
 
 uint64_t get_cpu_idle_time(unsigned int cpu)
@@ -333,8 +331,7 @@ void sched_destroy_domain(struct domain *d)
 void vcpu_sleep_nosync(struct vcpu *v)
 {
     unsigned long flags;
-
-    vcpu_schedule_lock_irqsave(v, flags);
+    spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags);
 
     if ( likely(!vcpu_runnable(v)) )
     {
@@ -344,7 +341,7 @@ void vcpu_sleep_nosync(struct vcpu *v)
         SCHED_OP(VCPU2OP(v), sleep, v);
     }
 
-    vcpu_schedule_unlock_irqrestore(v, flags);
+    vcpu_schedule_unlock_irqrestore(lock, flags, v);
 
     TRACE_2D(TRC_SCHED_SLEEP, v->domain->domain_id, v->vcpu_id);
 }
@@ -362,8 +359,7 @@ void vcpu_sleep_sync(struct vcpu *v)
 void vcpu_wake(struct vcpu *v)
 {
     unsigned long flags;
-
-    vcpu_schedule_lock_irqsave(v, flags);
+    spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags);
 
     if ( likely(vcpu_runnable(v)) )
     {
@@ -377,7 +373,7 @@ void vcpu_wake(struct vcpu *v)
             vcpu_runstate_change(v, RUNSTATE_offline, NOW());
     }
 
-    vcpu_schedule_unlock_irqrestore(v, flags);
+    vcpu_schedule_unlock_irqrestore(lock, flags, v);
 
     TRACE_2D(TRC_SCHED_WAKE, v->domain->domain_id, v->vcpu_id);
 }
@@ -528,10 +524,11 @@ static void vcpu_migrate(struct vcpu *v)
  */
 void vcpu_force_reschedule(struct vcpu *v)
 {
-    vcpu_schedule_lock_irq(v);
+    spinlock_t *lock = vcpu_schedule_lock_irq(v);
+
     if ( v->is_running )
         set_bit(_VPF_migrating, &v->pause_flags);
-    vcpu_schedule_unlock_irq(v);
+    vcpu_schedule_unlock_irq(lock, v);
 
     if ( test_bit(_VPF_migrating, &v->pause_flags) )
     {
@@ -546,7 +543,7 @@ void restore_vcpu_affinity(struct domain *d)
 
     for_each_vcpu ( d, v )
     {
-        vcpu_schedule_lock_irq(v);
+        spinlock_t *lock = vcpu_schedule_lock_irq(v);
 
         if ( v->affinity_broken )
         {
@@ -559,13 +556,13 @@ void restore_vcpu_affinity(struct domain *d)
         if ( v->processor == smp_processor_id() )
         {
             set_bit(_VPF_migrating, &v->pause_flags);
-            vcpu_schedule_unlock_irq(v);
+            vcpu_schedule_unlock_irq(lock, v);
             vcpu_sleep_nosync(v);
             vcpu_migrate(v);
         }
         else
         {
-            vcpu_schedule_unlock_irq(v);
+            vcpu_schedule_unlock_irq(lock, v);
         }
     }
 
@@ -592,7 +589,7 @@ int cpu_disable_scheduler(unsigned int cpu)
     {
         for_each_vcpu ( d, v )
         {
-            vcpu_schedule_lock_irq(v);
+            spinlock_t *lock = vcpu_schedule_lock_irq(v);
 
             cpumask_and(&online_affinity, v->cpu_affinity, c->cpu_valid);
             if ( cpumask_empty(&online_affinity) &&
@@ -613,13 +610,13 @@ int cpu_disable_scheduler(unsigned int cpu)
             if ( v->processor == cpu )
             {
                 set_bit(_VPF_migrating, &v->pause_flags);
-                vcpu_schedule_unlock_irq(v);
+                vcpu_schedule_unlock_irq(lock, v);
                 vcpu_sleep_nosync(v);
                 vcpu_migrate(v);
             }
             else
             {
-                vcpu_schedule_unlock_irq(v);
+                vcpu_schedule_unlock_irq(lock, v);
             }
 
             /*
@@ -646,6 +643,7 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
 {
     cpumask_t online_affinity;
     cpumask_t *online;
+    spinlock_t *lock;
 
     if ( v->domain->is_pinned )
         return -EINVAL;
@@ -654,7 +652,7 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
     if ( cpumask_empty(&online_affinity) )
         return -EINVAL;
 
-    vcpu_schedule_lock_irq(v);
+    lock = vcpu_schedule_lock_irq(v);
 
     cpumask_copy(v->cpu_affinity, affinity);
 
@@ -662,7 +660,7 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
      * when changing the affinity */
     set_bit(_VPF_migrating, &v->pause_flags);
 
-    vcpu_schedule_unlock_irq(v);
+    vcpu_schedule_unlock_irq(lock, v);
 
     domain_update_node_affinity(v->domain);
 
@@ -776,10 +774,10 @@ static long do_poll(struct sched_poll *sched_poll)
 static long do_yield(void)
 {
     struct vcpu * v=current;
+    spinlock_t *lock = vcpu_schedule_lock_irq(v);
 
-    vcpu_schedule_lock_irq(v);
     SCHED_OP(VCPU2OP(v), yield, v);
-    vcpu_schedule_unlock_irq(v);
+    vcpu_schedule_unlock_irq(lock, v);
 
     TRACE_2D(TRC_SCHED_YIELD, current->domain->domain_id, current->vcpu_id);
     raise_softirq(SCHEDULE_SOFTIRQ);
@@ -1140,6 +1138,7 @@ static void schedule(void)
     unsigned long        *tasklet_work = &this_cpu(tasklet_work_to_do);
     bool_t                tasklet_work_scheduled = 0;
     struct schedule_data *sd;
+    spinlock_t           *lock;
     struct task_slice     next_slice;
     int cpu = smp_processor_id();
 
@@ -1166,7 +1165,7 @@ static void schedule(void)
         BUG();
     }
 
-    pcpu_schedule_lock_irq(cpu);
+    lock = pcpu_schedule_lock_irq(cpu);
 
     stop_timer(&sd->s_timer);
     
@@ -1183,7 +1182,7 @@ static void schedule(void)
 
     if ( unlikely(prev == next) )
     {
-        pcpu_schedule_unlock_irq(cpu);
+        pcpu_schedule_unlock_irq(lock, cpu);
         trace_continue_running(next);
         return continue_running(prev);
     }
@@ -1221,7 +1220,7 @@ static void schedule(void)
     ASSERT(!next->is_running);
     next->is_running = 1;
 
-    pcpu_schedule_unlock_irq(cpu);
+    pcpu_schedule_unlock_irq(lock, cpu);
 
     SCHED_STAT_CRANK(sched_ctx);
 
@@ -1408,6 +1407,7 @@ 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;
     struct scheduler *old_ops = per_cpu(scheduler, cpu);
     struct scheduler *new_ops = (c == NULL) ? &ops : c->sched;
@@ -1426,7 +1426,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
         return -ENOMEM;
     }
 
-    pcpu_schedule_lock_irqsave(cpu, flags);
+    lock = pcpu_schedule_lock_irqsave(cpu, &flags);
 
     SCHED_OP(old_ops, tick_suspend, cpu);
     vpriv_old = idle->sched_priv;
@@ -1437,7 +1437,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
     SCHED_OP(new_ops, tick_resume, cpu);
     SCHED_OP(new_ops, insert_vcpu, idle);
 
-    pcpu_schedule_unlock_irqrestore(cpu, flags);
+    pcpu_schedule_unlock_irqrestore(lock, flags, cpu);
 
     SCHED_OP(old_ops, free_vdata, vpriv_old);
     SCHED_OP(old_ops, free_pdata, ppriv_old, cpu);
@@ -1495,10 +1495,11 @@ void schedule_dump(struct cpupool *c)
 
     for_each_cpu (i, cpus)
     {
-        pcpu_schedule_lock(i);
+        spinlock_t *lock = pcpu_schedule_lock(i);
+
         printk("CPU[%02d] ", i);
         SCHED_OP(sched, dump_cpu_state, i);
-        pcpu_schedule_unlock(i);
+        pcpu_schedule_unlock(lock, i);
     }
 }
 
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index ad4d80c..d95e254 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -47,96 +47,70 @@ DECLARE_PER_CPU(struct schedule_data, schedule_data);
 DECLARE_PER_CPU(struct scheduler *, scheduler);
 DECLARE_PER_CPU(struct cpupool *, cpupool);
 
-static inline spinlock_t * pcpu_schedule_lock(int cpu)
-{
-    spinlock_t * lock=NULL;
-
-    for ( ; ; )
-    {
-        /* The per_cpu(v->processor) may also change, if changing
-         * cpu pool also changes the scheduler lock.  Retry
-         * until they match.
-         */
-        lock=per_cpu(schedule_data, cpu).schedule_lock;
-
-        spin_lock(lock);
-        if ( likely(lock == per_cpu(schedule_data, cpu).schedule_lock) )
-            break;
-        spin_unlock(lock);
-    }
-    return lock;
+#define sched_lock(kind, param, cpu, irq, arg...) \
+static inline spinlock_t *kind##_schedule_lock##irq(param EXTRA_TYPE(arg)) \
+{ \
+    for ( ; ; ) \
+    { \
+        spinlock_t *lock = per_cpu(schedule_data, cpu).schedule_lock; \
+        /* \
+         * v->processor may change when grabbing the lock; but \
+         * per_cpu(v->processor) may also change, if changing cpu pool \
+         * also changes the scheduler lock.  Retry until they match. \
+         * \
+         * It may also be the case that v->processor may change but the \
+         * lock may be the same; this will succeed in that case. \
+         */ \
+        spin_lock##irq(lock, ## arg); \
+        if ( likely(lock == per_cpu(schedule_data, cpu).schedule_lock) ) \
+            return lock; \
+        spin_unlock##irq(lock, ## arg); \
+    } \
 }
 
-static inline int pcpu_schedule_trylock(int cpu)
-{
-    spinlock_t * lock=NULL;
-
-    lock=per_cpu(schedule_data, cpu).schedule_lock;
-    if ( ! spin_trylock(lock) )
-        return 0;
-    if ( lock == per_cpu(schedule_data, cpu).schedule_lock )
-        return 1;
-    else
-    {
-        spin_unlock(lock);
-        return 0;
-    }
-}
-
-#define pcpu_schedule_lock_irq(p) \
-    do { local_irq_disable(); pcpu_schedule_lock(p); } while ( 0 )
-#define pcpu_schedule_lock_irqsave(p, flags) \
-    do { local_irq_save(flags); pcpu_schedule_lock(p); } while ( 0 )
-
-static inline void pcpu_schedule_unlock(int cpu)
-{
-    spin_unlock(per_cpu(schedule_data, cpu).schedule_lock);
+#define sched_unlock(kind, param, cpu, irq, arg...) \
+static inline void kind##_schedule_unlock##irq(spinlock_t *lock \
+                                               EXTRA_TYPE(arg), param) \
+{ \
+    ASSERT(lock == per_cpu(schedule_data, cpu).schedule_lock); \
+    spin_unlock##irq(lock, ## arg); \
 }
 
-#define pcpu_schedule_unlock_irq(p) \
-    do { pcpu_schedule_unlock(p); local_irq_enable(); } while ( 0 )
-#define pcpu_schedule_unlock_irqrestore(p, flags) \
-    do { pcpu_schedule_unlock(p); local_irq_restore(flags); } while ( 0 )
-
-static inline void vcpu_schedule_lock(struct vcpu *v)
+#define EXTRA_TYPE(arg)
+sched_lock(pcpu, unsigned int cpu,     cpu, )
+sched_lock(vcpu, const struct vcpu *v, v->processor, )
+sched_lock(pcpu, unsigned int cpu,     cpu,          _irq)
+sched_lock(vcpu, const struct vcpu *v, v->processor, _irq)
+sched_unlock(pcpu, unsigned int cpu,     cpu, )
+sched_unlock(vcpu, const struct vcpu *v, v->processor, )
+sched_unlock(pcpu, unsigned int cpu,     cpu,          _irq)
+sched_unlock(vcpu, const struct vcpu *v, v->processor, _irq)
+#undef EXTRA_TYPE
+
+#define EXTRA_TYPE(arg) , unsigned long arg
+#define spin_unlock_irqsave spin_unlock_irqrestore
+sched_lock(pcpu, unsigned int cpu,     cpu,          _irqsave, *flags)
+sched_lock(vcpu, const struct vcpu *v, v->processor, _irqsave, *flags)
+#undef spin_unlock_irqsave
+sched_unlock(pcpu, unsigned int cpu,     cpu,          _irqrestore, flags)
+sched_unlock(vcpu, const struct vcpu *v, v->processor, _irqrestore, flags)
+#undef EXTRA_TYPE
+
+#undef sched_unlock
+#undef sched_lock
+
+static inline spinlock_t *pcpu_schedule_trylock(unsigned int cpu)
 {
-    spinlock_t * lock;
-
-    for ( ; ; )
-    {
-        /* v->processor may change when grabbing the lock; but
-         * per_cpu(v->processor) may also change, if changing
-         * cpu pool also changes the scheduler lock.  Retry
-         * until they match.
-         *
-         * It may also be the case that v->processor may change
-         * but the lock may be the same; this will succeed
-         * in that case.
-         */
-        lock=per_cpu(schedule_data, v->processor).schedule_lock;
-
-        spin_lock(lock);
-        if ( likely(lock == per_cpu(schedule_data, v->processor).schedule_lock) )
-            break;
-        spin_unlock(lock);
-    }
-}
-
-#define vcpu_schedule_lock_irq(v) \
-    do { local_irq_disable(); vcpu_schedule_lock(v); } while ( 0 )
-#define vcpu_schedule_lock_irqsave(v, flags) \
-    do { local_irq_save(flags); vcpu_schedule_lock(v); } while ( 0 )
+    spinlock_t *lock = per_cpu(schedule_data, cpu).schedule_lock;
 
-static inline void vcpu_schedule_unlock(struct vcpu *v)
-{
-    spin_unlock(per_cpu(schedule_data, v->processor).schedule_lock);
+    if ( !spin_trylock(lock) )
+        return NULL;
+    if ( lock == per_cpu(schedule_data, cpu).schedule_lock )
+        return lock;
+    spin_unlock(lock);
+    return NULL;
 }
 
-#define vcpu_schedule_unlock_irq(v) \
-    do { vcpu_schedule_unlock(v); local_irq_enable(); } while ( 0 )
-#define vcpu_schedule_unlock_irqrestore(v, flags) \
-    do { vcpu_schedule_unlock(v); local_irq_restore(flags); } while ( 0 )
-
 struct task_slice {
     struct vcpu *task;
     s_time_t     time;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:11:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:11: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 1VWJOP-00084i-D1; Wed, 16 Oct 2013 05:11:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOO-00083f-57
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:32 +0000
Received: from [85.158.143.35:24635] by server-1.bemta-4.messagelabs.com id
	59/A2-17304-3002E525; Wed, 16 Oct 2013 05:11:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1381900288!2113609!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.6 required=7.0 tests=DIET_1
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22148 invoked from network); 16 Oct 2013 05:11:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:11:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJO6-0006QK-FA
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJO6-0007Fm-BD
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:14 +0000
Date: Wed, 16 Oct 2013 05:11:14 +0000
Message-Id: <E1VWJO6-0007Fm-BD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] scheduler: adjust internal locking
	interface
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eedd60391610629b4e8a2e8278b857ff884f750d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 08:57:56 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 08:57:56 2013 +0200

    scheduler: adjust internal locking interface
    
    Make the locking functions return the lock pointers, so they can be
    passed to the unlocking functions (which in turn can check that the
    lock is still actually providing the intended protection, i.e. the
    parameters determining which lock is the right one didn't change).
    
    Further use proper spin lock primitives rather than open coded
    local_irq_...() constructs, so that interrupts can be re-enabled as
    appropriate while spinning.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/sched_credit.c  |   11 ++-
 xen/common/sched_credit2.c |   22 ++++---
 xen/common/sched_sedf.c    |   29 ++++++----
 xen/common/schedule.c      |   61 ++++++++++----------
 xen/include/xen/sched-if.h |  138 ++++++++++++++++++--------------------------
 5 files changed, 125 insertions(+), 136 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 3d6ea7a..192c653 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1166,6 +1166,7 @@ csched_runq_sort(struct csched_private *prv, unsigned int cpu)
     struct csched_pcpu * const spc = CSCHED_PCPU(cpu);
     struct list_head *runq, *elem, *next, *last_under;
     struct csched_vcpu *svc_elem;
+    spinlock_t *lock;
     unsigned long flags;
     int sort_epoch;
 
@@ -1175,7 +1176,7 @@ csched_runq_sort(struct csched_private *prv, unsigned int cpu)
 
     spc->runq_sort_last = sort_epoch;
 
-    pcpu_schedule_lock_irqsave(cpu, flags);
+    lock = pcpu_schedule_lock_irqsave(cpu, &flags);
 
     runq = &spc->runq;
     elem = runq->next;
@@ -1200,7 +1201,7 @@ csched_runq_sort(struct csched_private *prv, unsigned int cpu)
         elem = next;
     }
 
-    pcpu_schedule_unlock_irqrestore(cpu, flags);
+    pcpu_schedule_unlock_irqrestore(lock, flags, cpu);
 }
 
 static void
@@ -1563,7 +1564,9 @@ csched_load_balance(struct csched_private *prv, int cpu,
                  * could cause a deadlock if the peer CPU is also load
                  * balancing and trying to lock this CPU.
                  */
-                if ( !pcpu_schedule_trylock(peer_cpu) )
+                spinlock_t *lock = pcpu_schedule_trylock(peer_cpu);
+
+                if ( !lock )
                 {
                     SCHED_STAT_CRANK(steal_trylock_failed);
                     peer_cpu = cpumask_cycle(peer_cpu, &workers);
@@ -1573,7 +1576,7 @@ csched_load_balance(struct csched_private *prv, int cpu,
                 /* Any work over there to steal? */
                 speer = cpumask_test_cpu(peer_cpu, online) ?
                     csched_runq_steal(peer_cpu, cpu, snext->pri, bstep) : NULL;
-                pcpu_schedule_unlock(peer_cpu);
+                pcpu_schedule_unlock(lock, peer_cpu);
 
                 /* As soon as one vcpu is found, balancing ends */
                 if ( speer != NULL )
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index ae0abc2..84e547b 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -882,15 +882,17 @@ csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
      */
     if ( ! is_idle_vcpu(vc) )
     {
+        spinlock_t *lock;
+
         /* FIXME: Do we need the private lock here? */
         list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
 
         /* Add vcpu to runqueue of initial processor */
-        vcpu_schedule_lock_irq(vc);
+        lock = vcpu_schedule_lock_irq(vc);
 
         runq_assign(ops, vc);
 
-        vcpu_schedule_unlock_irq(vc);
+        vcpu_schedule_unlock_irq(lock, vc);
 
         sdom->nr_vcpus++;
     }
@@ -917,14 +919,16 @@ csched_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
 
     if ( ! is_idle_vcpu(vc) )
     {
+        spinlock_t *lock;
+
         SCHED_STAT_CRANK(vcpu_destroy);
 
         /* Remove from runqueue */
-        vcpu_schedule_lock_irq(vc);
+        lock = vcpu_schedule_lock_irq(vc);
 
         runq_deassign(ops, vc);
 
-        vcpu_schedule_unlock_irq(vc);
+        vcpu_schedule_unlock_irq(lock, vc);
 
         /* Remove from sdom list.  Don't need a lock for this, as it's called
          * syncronously when nothing else can happen. */
@@ -1011,8 +1015,7 @@ csched_context_saved(const struct scheduler *ops, struct vcpu *vc)
 {
     struct csched_vcpu * const svc = CSCHED_VCPU(vc);
     s_time_t now = NOW();
-
-    vcpu_schedule_lock_irq(vc);
+    spinlock_t *lock = vcpu_schedule_lock_irq(vc);
 
     BUG_ON( !is_idle_vcpu(vc) && svc->rqd != RQD(ops, vc->processor));
 
@@ -1038,7 +1041,7 @@ csched_context_saved(const struct scheduler *ops, struct vcpu *vc)
     else if ( !is_idle_vcpu(vc) )
         update_load(ops, svc->rqd, svc, -1, now);
 
-    vcpu_schedule_unlock_irq(vc);
+    vcpu_schedule_unlock_irq(lock, vc);
 }
 
 #define MAX_LOAD (1ULL<<60);
@@ -1456,14 +1459,14 @@ csched_dom_cntl(
                  * must never lock csched_priv.lock if we're holding a runqueue lock.
                  * Also, calling vcpu_schedule_lock() is enough, since IRQs have already
                  * been disabled. */
-                vcpu_schedule_lock(svc->vcpu);
+                spinlock_t *lock = vcpu_schedule_lock(svc->vcpu);
 
                 BUG_ON(svc->rqd != RQD(ops, svc->vcpu->processor));
 
                 svc->weight = sdom->weight;
                 update_max_weight(svc->rqd, svc->weight, old_weight);
 
-                vcpu_schedule_unlock(svc->vcpu);
+                vcpu_schedule_unlock(lock, svc->vcpu);
             }
         }
     }
@@ -1993,6 +1996,7 @@ static void init_pcpu(const struct scheduler *ops, int cpu)
     cpumask_set_cpu(cpu, &rqd->idle);
     cpumask_set_cpu(cpu, &rqd->active);
 
+    /* _Not_ pcpu_schedule_unlock(): per_cpu().schedule_lock changed! */
     spin_unlock(old_lock);
 
     cpumask_set_cpu(cpu, &prv->initialized);
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c
index d1812b6..7c24171 100644
--- a/xen/common/sched_sedf.c
+++ b/xen/common/sched_sedf.c
@@ -1350,14 +1350,16 @@ static int sedf_adjust_weights(struct cpupool *c, int nr_cpus, int *sumw, s_time
             if ( EDOM_INFO(p)->weight )
             {
                 /* Interrupts already off */
-                vcpu_schedule_lock(p);
+                spinlock_t *lock = vcpu_schedule_lock(p);
+
                 EDOM_INFO(p)->period_orig = 
                     EDOM_INFO(p)->period  = WEIGHT_PERIOD;
                 EDOM_INFO(p)->slice_orig  =
                     EDOM_INFO(p)->slice   = 
                     (EDOM_INFO(p)->weight *
                      (WEIGHT_PERIOD - WEIGHT_SAFETY - sumt[cpu])) / sumw[cpu];
-                vcpu_schedule_unlock(p);
+
+                vcpu_schedule_unlock(lock, p);
             }
         }
     }
@@ -1418,21 +1420,24 @@ static int sedf_adjust(const struct scheduler *ops, struct domain *p, struct xen
                 {
                     /* (Here and everywhere in the following) IRQs are already off,
                      * hence vcpu_spin_lock() is the one. */
-                    vcpu_schedule_lock(v);
+                    spinlock_t *lock = vcpu_schedule_lock(v);
+
                     EDOM_INFO(v)->extraweight = op->u.sedf.weight;
                     EDOM_INFO(v)->weight = 0;
                     EDOM_INFO(v)->slice = 0;
                     EDOM_INFO(v)->period = WEIGHT_PERIOD;
-                    vcpu_schedule_unlock(v);
+                    vcpu_schedule_unlock(lock, v);
                 }
             }
             else
             {
                 /* Weight-driven domains with real-time execution */
-                for_each_vcpu ( p, v ) {
-                    vcpu_schedule_lock(v);
+                for_each_vcpu ( p, v )
+                {
+                    spinlock_t *lock = vcpu_schedule_lock(v);
+
                     EDOM_INFO(v)->weight = op->u.sedf.weight;
-                    vcpu_schedule_unlock(v);
+                    vcpu_schedule_unlock(lock, v);
                 }
             }
         }
@@ -1454,14 +1459,15 @@ static int sedf_adjust(const struct scheduler *ops, struct domain *p, struct xen
             /* Time-driven domains */
             for_each_vcpu ( p, v )
             {
-                vcpu_schedule_lock(v);
+                spinlock_t *lock = vcpu_schedule_lock(v);
+
                 EDOM_INFO(v)->weight = 0;
                 EDOM_INFO(v)->extraweight = 0;
                 EDOM_INFO(v)->period_orig = 
                     EDOM_INFO(v)->period  = op->u.sedf.period;
                 EDOM_INFO(v)->slice_orig  = 
                     EDOM_INFO(v)->slice   = op->u.sedf.slice;
-                vcpu_schedule_unlock(v);
+                vcpu_schedule_unlock(lock, v);
             }
         }
 
@@ -1471,13 +1477,14 @@ static int sedf_adjust(const struct scheduler *ops, struct domain *p, struct xen
 
         for_each_vcpu ( p, v )
         {
-            vcpu_schedule_lock(v);
+            spinlock_t *lock = vcpu_schedule_lock(v);
+
             EDOM_INFO(v)->status  = 
                 (EDOM_INFO(v)->status &
                  ~EXTRA_AWARE) | (op->u.sedf.extratime & EXTRA_AWARE);
             EDOM_INFO(v)->latency = op->u.sedf.latency;
             extraq_check(v);
-            vcpu_schedule_unlock(v);
+            vcpu_schedule_unlock(lock, v);
         }
     }
     else if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo )
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 1ddfb22..95472ba 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -160,18 +160,16 @@ static inline void vcpu_runstate_change(
 
 void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate)
 {
+    spinlock_t *lock = likely(v == current) ? NULL : vcpu_schedule_lock_irq(v);
     s_time_t delta;
 
-    if ( unlikely(v != current) )
-        vcpu_schedule_lock_irq(v);
-
     memcpy(runstate, &v->runstate, sizeof(*runstate));
     delta = NOW() - runstate->state_entry_time;
     if ( delta > 0 )
         runstate->time[runstate->state] += delta;
 
-    if ( unlikely(v != current) )
-        vcpu_schedule_unlock_irq(v);
+    if ( unlikely(lock != NULL) )
+        vcpu_schedule_unlock_irq(lock, v);
 }
 
 uint64_t get_cpu_idle_time(unsigned int cpu)
@@ -333,8 +331,7 @@ void sched_destroy_domain(struct domain *d)
 void vcpu_sleep_nosync(struct vcpu *v)
 {
     unsigned long flags;
-
-    vcpu_schedule_lock_irqsave(v, flags);
+    spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags);
 
     if ( likely(!vcpu_runnable(v)) )
     {
@@ -344,7 +341,7 @@ void vcpu_sleep_nosync(struct vcpu *v)
         SCHED_OP(VCPU2OP(v), sleep, v);
     }
 
-    vcpu_schedule_unlock_irqrestore(v, flags);
+    vcpu_schedule_unlock_irqrestore(lock, flags, v);
 
     TRACE_2D(TRC_SCHED_SLEEP, v->domain->domain_id, v->vcpu_id);
 }
@@ -362,8 +359,7 @@ void vcpu_sleep_sync(struct vcpu *v)
 void vcpu_wake(struct vcpu *v)
 {
     unsigned long flags;
-
-    vcpu_schedule_lock_irqsave(v, flags);
+    spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags);
 
     if ( likely(vcpu_runnable(v)) )
     {
@@ -377,7 +373,7 @@ void vcpu_wake(struct vcpu *v)
             vcpu_runstate_change(v, RUNSTATE_offline, NOW());
     }
 
-    vcpu_schedule_unlock_irqrestore(v, flags);
+    vcpu_schedule_unlock_irqrestore(lock, flags, v);
 
     TRACE_2D(TRC_SCHED_WAKE, v->domain->domain_id, v->vcpu_id);
 }
@@ -528,10 +524,11 @@ static void vcpu_migrate(struct vcpu *v)
  */
 void vcpu_force_reschedule(struct vcpu *v)
 {
-    vcpu_schedule_lock_irq(v);
+    spinlock_t *lock = vcpu_schedule_lock_irq(v);
+
     if ( v->is_running )
         set_bit(_VPF_migrating, &v->pause_flags);
-    vcpu_schedule_unlock_irq(v);
+    vcpu_schedule_unlock_irq(lock, v);
 
     if ( test_bit(_VPF_migrating, &v->pause_flags) )
     {
@@ -546,7 +543,7 @@ void restore_vcpu_affinity(struct domain *d)
 
     for_each_vcpu ( d, v )
     {
-        vcpu_schedule_lock_irq(v);
+        spinlock_t *lock = vcpu_schedule_lock_irq(v);
 
         if ( v->affinity_broken )
         {
@@ -559,13 +556,13 @@ void restore_vcpu_affinity(struct domain *d)
         if ( v->processor == smp_processor_id() )
         {
             set_bit(_VPF_migrating, &v->pause_flags);
-            vcpu_schedule_unlock_irq(v);
+            vcpu_schedule_unlock_irq(lock, v);
             vcpu_sleep_nosync(v);
             vcpu_migrate(v);
         }
         else
         {
-            vcpu_schedule_unlock_irq(v);
+            vcpu_schedule_unlock_irq(lock, v);
         }
     }
 
@@ -592,7 +589,7 @@ int cpu_disable_scheduler(unsigned int cpu)
     {
         for_each_vcpu ( d, v )
         {
-            vcpu_schedule_lock_irq(v);
+            spinlock_t *lock = vcpu_schedule_lock_irq(v);
 
             cpumask_and(&online_affinity, v->cpu_affinity, c->cpu_valid);
             if ( cpumask_empty(&online_affinity) &&
@@ -613,13 +610,13 @@ int cpu_disable_scheduler(unsigned int cpu)
             if ( v->processor == cpu )
             {
                 set_bit(_VPF_migrating, &v->pause_flags);
-                vcpu_schedule_unlock_irq(v);
+                vcpu_schedule_unlock_irq(lock, v);
                 vcpu_sleep_nosync(v);
                 vcpu_migrate(v);
             }
             else
             {
-                vcpu_schedule_unlock_irq(v);
+                vcpu_schedule_unlock_irq(lock, v);
             }
 
             /*
@@ -646,6 +643,7 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
 {
     cpumask_t online_affinity;
     cpumask_t *online;
+    spinlock_t *lock;
 
     if ( v->domain->is_pinned )
         return -EINVAL;
@@ -654,7 +652,7 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
     if ( cpumask_empty(&online_affinity) )
         return -EINVAL;
 
-    vcpu_schedule_lock_irq(v);
+    lock = vcpu_schedule_lock_irq(v);
 
     cpumask_copy(v->cpu_affinity, affinity);
 
@@ -662,7 +660,7 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
      * when changing the affinity */
     set_bit(_VPF_migrating, &v->pause_flags);
 
-    vcpu_schedule_unlock_irq(v);
+    vcpu_schedule_unlock_irq(lock, v);
 
     domain_update_node_affinity(v->domain);
 
@@ -776,10 +774,10 @@ static long do_poll(struct sched_poll *sched_poll)
 static long do_yield(void)
 {
     struct vcpu * v=current;
+    spinlock_t *lock = vcpu_schedule_lock_irq(v);
 
-    vcpu_schedule_lock_irq(v);
     SCHED_OP(VCPU2OP(v), yield, v);
-    vcpu_schedule_unlock_irq(v);
+    vcpu_schedule_unlock_irq(lock, v);
 
     TRACE_2D(TRC_SCHED_YIELD, current->domain->domain_id, current->vcpu_id);
     raise_softirq(SCHEDULE_SOFTIRQ);
@@ -1140,6 +1138,7 @@ static void schedule(void)
     unsigned long        *tasklet_work = &this_cpu(tasklet_work_to_do);
     bool_t                tasklet_work_scheduled = 0;
     struct schedule_data *sd;
+    spinlock_t           *lock;
     struct task_slice     next_slice;
     int cpu = smp_processor_id();
 
@@ -1166,7 +1165,7 @@ static void schedule(void)
         BUG();
     }
 
-    pcpu_schedule_lock_irq(cpu);
+    lock = pcpu_schedule_lock_irq(cpu);
 
     stop_timer(&sd->s_timer);
     
@@ -1183,7 +1182,7 @@ static void schedule(void)
 
     if ( unlikely(prev == next) )
     {
-        pcpu_schedule_unlock_irq(cpu);
+        pcpu_schedule_unlock_irq(lock, cpu);
         trace_continue_running(next);
         return continue_running(prev);
     }
@@ -1221,7 +1220,7 @@ static void schedule(void)
     ASSERT(!next->is_running);
     next->is_running = 1;
 
-    pcpu_schedule_unlock_irq(cpu);
+    pcpu_schedule_unlock_irq(lock, cpu);
 
     SCHED_STAT_CRANK(sched_ctx);
 
@@ -1408,6 +1407,7 @@ 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;
     struct scheduler *old_ops = per_cpu(scheduler, cpu);
     struct scheduler *new_ops = (c == NULL) ? &ops : c->sched;
@@ -1426,7 +1426,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
         return -ENOMEM;
     }
 
-    pcpu_schedule_lock_irqsave(cpu, flags);
+    lock = pcpu_schedule_lock_irqsave(cpu, &flags);
 
     SCHED_OP(old_ops, tick_suspend, cpu);
     vpriv_old = idle->sched_priv;
@@ -1437,7 +1437,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
     SCHED_OP(new_ops, tick_resume, cpu);
     SCHED_OP(new_ops, insert_vcpu, idle);
 
-    pcpu_schedule_unlock_irqrestore(cpu, flags);
+    pcpu_schedule_unlock_irqrestore(lock, flags, cpu);
 
     SCHED_OP(old_ops, free_vdata, vpriv_old);
     SCHED_OP(old_ops, free_pdata, ppriv_old, cpu);
@@ -1495,10 +1495,11 @@ void schedule_dump(struct cpupool *c)
 
     for_each_cpu (i, cpus)
     {
-        pcpu_schedule_lock(i);
+        spinlock_t *lock = pcpu_schedule_lock(i);
+
         printk("CPU[%02d] ", i);
         SCHED_OP(sched, dump_cpu_state, i);
-        pcpu_schedule_unlock(i);
+        pcpu_schedule_unlock(lock, i);
     }
 }
 
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index ad4d80c..d95e254 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -47,96 +47,70 @@ DECLARE_PER_CPU(struct schedule_data, schedule_data);
 DECLARE_PER_CPU(struct scheduler *, scheduler);
 DECLARE_PER_CPU(struct cpupool *, cpupool);
 
-static inline spinlock_t * pcpu_schedule_lock(int cpu)
-{
-    spinlock_t * lock=NULL;
-
-    for ( ; ; )
-    {
-        /* The per_cpu(v->processor) may also change, if changing
-         * cpu pool also changes the scheduler lock.  Retry
-         * until they match.
-         */
-        lock=per_cpu(schedule_data, cpu).schedule_lock;
-
-        spin_lock(lock);
-        if ( likely(lock == per_cpu(schedule_data, cpu).schedule_lock) )
-            break;
-        spin_unlock(lock);
-    }
-    return lock;
+#define sched_lock(kind, param, cpu, irq, arg...) \
+static inline spinlock_t *kind##_schedule_lock##irq(param EXTRA_TYPE(arg)) \
+{ \
+    for ( ; ; ) \
+    { \
+        spinlock_t *lock = per_cpu(schedule_data, cpu).schedule_lock; \
+        /* \
+         * v->processor may change when grabbing the lock; but \
+         * per_cpu(v->processor) may also change, if changing cpu pool \
+         * also changes the scheduler lock.  Retry until they match. \
+         * \
+         * It may also be the case that v->processor may change but the \
+         * lock may be the same; this will succeed in that case. \
+         */ \
+        spin_lock##irq(lock, ## arg); \
+        if ( likely(lock == per_cpu(schedule_data, cpu).schedule_lock) ) \
+            return lock; \
+        spin_unlock##irq(lock, ## arg); \
+    } \
 }
 
-static inline int pcpu_schedule_trylock(int cpu)
-{
-    spinlock_t * lock=NULL;
-
-    lock=per_cpu(schedule_data, cpu).schedule_lock;
-    if ( ! spin_trylock(lock) )
-        return 0;
-    if ( lock == per_cpu(schedule_data, cpu).schedule_lock )
-        return 1;
-    else
-    {
-        spin_unlock(lock);
-        return 0;
-    }
-}
-
-#define pcpu_schedule_lock_irq(p) \
-    do { local_irq_disable(); pcpu_schedule_lock(p); } while ( 0 )
-#define pcpu_schedule_lock_irqsave(p, flags) \
-    do { local_irq_save(flags); pcpu_schedule_lock(p); } while ( 0 )
-
-static inline void pcpu_schedule_unlock(int cpu)
-{
-    spin_unlock(per_cpu(schedule_data, cpu).schedule_lock);
+#define sched_unlock(kind, param, cpu, irq, arg...) \
+static inline void kind##_schedule_unlock##irq(spinlock_t *lock \
+                                               EXTRA_TYPE(arg), param) \
+{ \
+    ASSERT(lock == per_cpu(schedule_data, cpu).schedule_lock); \
+    spin_unlock##irq(lock, ## arg); \
 }
 
-#define pcpu_schedule_unlock_irq(p) \
-    do { pcpu_schedule_unlock(p); local_irq_enable(); } while ( 0 )
-#define pcpu_schedule_unlock_irqrestore(p, flags) \
-    do { pcpu_schedule_unlock(p); local_irq_restore(flags); } while ( 0 )
-
-static inline void vcpu_schedule_lock(struct vcpu *v)
+#define EXTRA_TYPE(arg)
+sched_lock(pcpu, unsigned int cpu,     cpu, )
+sched_lock(vcpu, const struct vcpu *v, v->processor, )
+sched_lock(pcpu, unsigned int cpu,     cpu,          _irq)
+sched_lock(vcpu, const struct vcpu *v, v->processor, _irq)
+sched_unlock(pcpu, unsigned int cpu,     cpu, )
+sched_unlock(vcpu, const struct vcpu *v, v->processor, )
+sched_unlock(pcpu, unsigned int cpu,     cpu,          _irq)
+sched_unlock(vcpu, const struct vcpu *v, v->processor, _irq)
+#undef EXTRA_TYPE
+
+#define EXTRA_TYPE(arg) , unsigned long arg
+#define spin_unlock_irqsave spin_unlock_irqrestore
+sched_lock(pcpu, unsigned int cpu,     cpu,          _irqsave, *flags)
+sched_lock(vcpu, const struct vcpu *v, v->processor, _irqsave, *flags)
+#undef spin_unlock_irqsave
+sched_unlock(pcpu, unsigned int cpu,     cpu,          _irqrestore, flags)
+sched_unlock(vcpu, const struct vcpu *v, v->processor, _irqrestore, flags)
+#undef EXTRA_TYPE
+
+#undef sched_unlock
+#undef sched_lock
+
+static inline spinlock_t *pcpu_schedule_trylock(unsigned int cpu)
 {
-    spinlock_t * lock;
-
-    for ( ; ; )
-    {
-        /* v->processor may change when grabbing the lock; but
-         * per_cpu(v->processor) may also change, if changing
-         * cpu pool also changes the scheduler lock.  Retry
-         * until they match.
-         *
-         * It may also be the case that v->processor may change
-         * but the lock may be the same; this will succeed
-         * in that case.
-         */
-        lock=per_cpu(schedule_data, v->processor).schedule_lock;
-
-        spin_lock(lock);
-        if ( likely(lock == per_cpu(schedule_data, v->processor).schedule_lock) )
-            break;
-        spin_unlock(lock);
-    }
-}
-
-#define vcpu_schedule_lock_irq(v) \
-    do { local_irq_disable(); vcpu_schedule_lock(v); } while ( 0 )
-#define vcpu_schedule_lock_irqsave(v, flags) \
-    do { local_irq_save(flags); vcpu_schedule_lock(v); } while ( 0 )
+    spinlock_t *lock = per_cpu(schedule_data, cpu).schedule_lock;
 
-static inline void vcpu_schedule_unlock(struct vcpu *v)
-{
-    spin_unlock(per_cpu(schedule_data, v->processor).schedule_lock);
+    if ( !spin_trylock(lock) )
+        return NULL;
+    if ( lock == per_cpu(schedule_data, cpu).schedule_lock )
+        return lock;
+    spin_unlock(lock);
+    return NULL;
 }
 
-#define vcpu_schedule_unlock_irq(v) \
-    do { vcpu_schedule_unlock(v); local_irq_enable(); } while ( 0 )
-#define vcpu_schedule_unlock_irqrestore(v, flags) \
-    do { vcpu_schedule_unlock(v); local_irq_restore(flags); } while ( 0 )
-
 struct task_slice {
     struct vcpu *task;
     s_time_t     time;
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:11:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:11: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 1VWJOe-00087f-M7; Wed, 16 Oct 2013 05:11: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 1VWJOd-00087N-KY
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:47 +0000
Received: from [193.109.254.147:17590] by server-3.bemta-14.messagelabs.com id
	A3/F7-03605-2102E525; Wed, 16 Oct 2013 05:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1381900305!2368604!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1703 invoked from network); 16 Oct 2013 05:11:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:11:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOb-0006Qh-BH
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOb-0007H7-5W
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:45 +0000
Date: Wed, 16 Oct 2013 05:11:45 +0000
Message-Id: <E1VWJOb-0007H7-5W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: Correct function prototypes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7ab6af234f9c140418e6aae177928d00abbb628b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 14 09:07:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:07:44 2013 +0200

    sched: Correct function prototypes
    
    struct vcpu pointers are traditionally v rather than d.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/xen/sched.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 1765e18..2e83f08 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -567,9 +567,9 @@ void sched_set_node_affinity(struct domain *, nodemask_t *);
 int  sched_id(void);
 void sched_tick_suspend(void);
 void sched_tick_resume(void);
-void vcpu_wake(struct vcpu *d);
-void vcpu_sleep_nosync(struct vcpu *d);
-void vcpu_sleep_sync(struct vcpu *d);
+void vcpu_wake(struct vcpu *v);
+void vcpu_sleep_nosync(struct vcpu *v);
+void vcpu_sleep_sync(struct vcpu *v);
 
 /*
  * Force synchronisation of given VCPU's state. If it is currently descheduled,
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:11:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:11: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 1VWJOe-00087f-M7; Wed, 16 Oct 2013 05:11: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 1VWJOd-00087N-KY
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:47 +0000
Received: from [193.109.254.147:17590] by server-3.bemta-14.messagelabs.com id
	A3/F7-03605-2102E525; Wed, 16 Oct 2013 05:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1381900305!2368604!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1703 invoked from network); 16 Oct 2013 05:11:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:11:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOb-0006Qh-BH
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOb-0007H7-5W
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:45 +0000
Date: Wed, 16 Oct 2013 05:11:45 +0000
Message-Id: <E1VWJOb-0007H7-5W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: Correct function prototypes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7ab6af234f9c140418e6aae177928d00abbb628b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 14 09:07:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:07:44 2013 +0200

    sched: Correct function prototypes
    
    struct vcpu pointers are traditionally v rather than d.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/xen/sched.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 1765e18..2e83f08 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -567,9 +567,9 @@ void sched_set_node_affinity(struct domain *, nodemask_t *);
 int  sched_id(void);
 void sched_tick_suspend(void);
 void sched_tick_resume(void);
-void vcpu_wake(struct vcpu *d);
-void vcpu_sleep_nosync(struct vcpu *d);
-void vcpu_sleep_sync(struct vcpu *d);
+void vcpu_wake(struct vcpu *v);
+void vcpu_sleep_nosync(struct vcpu *v);
+void vcpu_sleep_sync(struct vcpu *v);
 
 /*
  * Force synchronisation of given VCPU's state. If it is currently descheduled,
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:12:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:12: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 1VWJOp-00089j-PX; Wed, 16 Oct 2013 05:11:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOo-00089N-7k
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:58 +0000
Received: from [85.158.143.35:27904] by server-2.bemta-4.messagelabs.com id
	7C/F6-06473-D102E525; Wed, 16 Oct 2013 05:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1381900315!2115925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10996 invoked from network); 16 Oct 2013 05:11:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:11:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOl-0006Qt-GY
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOl-0007Hc-EQ
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:55 +0000
Date: Wed, 16 Oct 2013 05:11:55 +0000
Message-Id: <E1VWJOl-0007Hc-EQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: properly handle backward
	string instruction emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f21399e148386ecf3826ab81159eca58cfab2147
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 09:50:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:50:16 2013 +0200

    x86/HVM: properly handle backward string instruction emulation
    
    Multiplying a signed 32-bit quantity with an unsigned 32-bit quantity
    produces an unsigned 32-bit result, yet for emulation of backward
    string instructions we need the result sign extended before getting
    added to the base address.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/intercept.c |   23 ++++++++---------------
 xen/arch/x86/hvm/io.c        |   10 ++++------
 xen/arch/x86/hvm/stdvga.c    |   34 +++++++++++-----------------------
 3 files changed, 23 insertions(+), 44 deletions(-)

diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c
index 5bb1c17..5ac0893 100644
--- a/xen/arch/x86/hvm/intercept.c
+++ b/xen/arch/x86/hvm/intercept.c
@@ -48,7 +48,7 @@ static int hvm_mmio_access(struct vcpu *v,
                            hvm_mmio_write_t write_handler)
 {
     unsigned long data;
-    int rc = X86EMUL_OKAY, i, sign = p->df ? -1 : 1;
+    int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
 
     if ( !p->data_is_ptr )
     {
@@ -68,13 +68,10 @@ static int hvm_mmio_access(struct vcpu *v,
         {
             int ret;
 
-            rc = read_handler(v, p->addr + (sign * i * p->size), p->size,
-                              &data);
+            rc = read_handler(v, p->addr + step * i, p->size, &data);
             if ( rc != X86EMUL_OKAY )
                 break;
-            ret = hvm_copy_to_guest_phys(p->data + (sign * i * p->size),
-                                         &data,
-                                         p->size);
+            ret = hvm_copy_to_guest_phys(p->data + step * i, &data, p->size);
             if ( (ret == HVMCOPY_gfn_paged_out) || 
                  (ret == HVMCOPY_gfn_shared) )
             {
@@ -87,8 +84,7 @@ static int hvm_mmio_access(struct vcpu *v,
     {
         for ( i = 0; i < p->count; i++ )
         {
-            switch ( hvm_copy_from_guest_phys(&data,
-                                              p->data + sign * i * p->size,
+            switch ( hvm_copy_from_guest_phys(&data, p->data + step * i,
                                               p->size) )
             {
             case HVMCOPY_okay:
@@ -109,8 +105,7 @@ static int hvm_mmio_access(struct vcpu *v,
             }
             if ( rc != X86EMUL_OKAY )
                 break;
-            rc = write_handler(v, p->addr + (sign * i * p->size), p->size,
-                               data);
+            rc = write_handler(v, p->addr + step * i, p->size, data);
             if ( rc != X86EMUL_OKAY )
                 break;
         }
@@ -142,7 +137,7 @@ int hvm_mmio_intercept(ioreq_t *p)
 
 static int process_portio_intercept(portio_action_t action, ioreq_t *p)
 {
-    int rc = X86EMUL_OKAY, i, sign = p->df ? -1 : 1;
+    int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
     uint32_t data;
 
     if ( !p->data_is_ptr )
@@ -167,8 +162,7 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
             rc = action(IOREQ_READ, p->addr, p->size, &data);
             if ( rc != X86EMUL_OKAY )
                 break;
-            (void)hvm_copy_to_guest_phys(p->data + sign*i*p->size,
-                                         &data, p->size);
+            (void)hvm_copy_to_guest_phys(p->data + step * i, &data, p->size);
         }
     }
     else /* p->dir == IOREQ_WRITE */
@@ -176,8 +170,7 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
         for ( i = 0; i < p->count; i++ )
         {
             data = 0;
-            switch ( hvm_copy_from_guest_phys(&data,
-                                              p->data + sign * i * p->size,
+            switch ( hvm_copy_from_guest_phys(&data, p->data + step * i,
                                               p->size) )
             {
             case HVMCOPY_okay:
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 5f5009a..77698c4 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -294,7 +294,7 @@ void hvm_io_assist(void)
 
 static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
 {
-    int i, sign = p->df ? -1 : 1;
+    int i, step = p->df ? -p->size : p->size;
     uint32_t data = 0;
 
     for ( i = 0; i < p->count; i++ )
@@ -317,8 +317,7 @@ static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
         if ( p->data_is_ptr )
         {
             int ret;
-            ret = hvm_copy_to_guest_phys(p->data + (sign * i * p->size), &data,
-                                         p->size);
+            ret = hvm_copy_to_guest_phys(p->data + step * i, &data, p->size);
             if ( (ret == HVMCOPY_gfn_paged_out) ||
                  (ret == HVMCOPY_gfn_shared) )
                 return X86EMUL_RETRY;
@@ -332,7 +331,7 @@ static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
 
 static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
 {
-    int i, sign = p->df ? -1 : 1;
+    int i, step = p->df ? -p->size : p->size;
     uint32_t data;
 
     for ( i = 0; i < p->count; i++ )
@@ -340,8 +339,7 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
         data = p->data;
         if ( p->data_is_ptr )
         {
-            switch ( hvm_copy_from_guest_phys(&data,
-                                              p->data + sign * i * p->size,
+            switch ( hvm_copy_from_guest_phys(&data, p->data + step * i,
                                               p->size) )
             {
             case HVMCOPY_okay:
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index 331fca0..19e80ed 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -467,15 +467,17 @@ static uint32_t read_data;
 static int mmio_move(struct hvm_hw_stdvga *s, ioreq_t *p)
 {
     int i;
-    int sign = p->df ? -1 : 1;
+    uint64_t addr = p->addr;
     p2m_type_t p2mt;
     struct domain *d = current->domain;
 
     if ( p->data_is_ptr )
     {
+        uint64_t data = p->data, tmp;
+        int step = p->df ? -p->size : p->size;
+
         if ( p->dir == IOREQ_READ )
         {
-            uint64_t addr = p->addr, data = p->data, tmp;
             for ( i = 0; i < p->count; i++ ) 
             {
                 tmp = stdvga_mem_read(addr, p->size);
@@ -498,13 +500,12 @@ static int mmio_move(struct hvm_hw_stdvga *s, ioreq_t *p)
                     ASSERT(!dp);
                     stdvga_mem_write(data, tmp, p->size);
                 }
-                data += sign * p->size;
-                addr += sign * p->size;
+                data += step;
+                addr += step;
             }
         }
         else
         {
-            uint32_t addr = p->addr, data = p->data, tmp;
             for ( i = 0; i < p->count; i++ )
             {
                 if ( hvm_copy_from_guest_phys(&tmp, data, p->size) !=
@@ -523,31 +524,18 @@ static int mmio_move(struct hvm_hw_stdvga *s, ioreq_t *p)
                     tmp = stdvga_mem_read(data, p->size);
                 }
                 stdvga_mem_write(addr, tmp, p->size);
-                data += sign * p->size;
-                addr += sign * p->size;
+                data += step;
+                addr += step;
             }
         }
     }
     else
     {
+        ASSERT(p->count == 1);
         if ( p->dir == IOREQ_READ )
-        {
-            uint32_t addr = p->addr;
-            for ( i = 0; i < p->count; i++ )
-            {
-                p->data = stdvga_mem_read(addr, p->size);
-                addr += sign * p->size;
-            }
-        }
+            p->data = stdvga_mem_read(addr, p->size);
         else
-        {
-            uint32_t addr = p->addr;
-            for ( i = 0; i < p->count; i++ )
-            {
-                stdvga_mem_write(addr, p->data, p->size);
-                addr += sign * p->size;
-            }
-        }
+            stdvga_mem_write(addr, p->data, p->size);
     }
 
     read_data = p->data;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Oct 16 05:12:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:12: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 1VWJOp-00089j-PX; Wed, 16 Oct 2013 05:11:59 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOo-00089N-7k
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:58 +0000
Received: from [85.158.143.35:27904] by server-2.bemta-4.messagelabs.com id
	7C/F6-06473-D102E525; Wed, 16 Oct 2013 05:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1381900315!2115925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10996 invoked from network); 16 Oct 2013 05:11:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:11:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOl-0006Qt-GY
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOl-0007Hc-EQ
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:11:55 +0000
Date: Wed, 16 Oct 2013 05:11:55 +0000
Message-Id: <E1VWJOl-0007Hc-EQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: properly handle backward
	string instruction emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f21399e148386ecf3826ab81159eca58cfab2147
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 09:50:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:50:16 2013 +0200

    x86/HVM: properly handle backward string instruction emulation
    
    Multiplying a signed 32-bit quantity with an unsigned 32-bit quantity
    produces an unsigned 32-bit result, yet for emulation of backward
    string instructions we need the result sign extended before getting
    added to the base address.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/intercept.c |   23 ++++++++---------------
 xen/arch/x86/hvm/io.c        |   10 ++++------
 xen/arch/x86/hvm/stdvga.c    |   34 +++++++++++-----------------------
 3 files changed, 23 insertions(+), 44 deletions(-)

diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c
index 5bb1c17..5ac0893 100644
--- a/xen/arch/x86/hvm/intercept.c
+++ b/xen/arch/x86/hvm/intercept.c
@@ -48,7 +48,7 @@ static int hvm_mmio_access(struct vcpu *v,
                            hvm_mmio_write_t write_handler)
 {
     unsigned long data;
-    int rc = X86EMUL_OKAY, i, sign = p->df ? -1 : 1;
+    int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
 
     if ( !p->data_is_ptr )
     {
@@ -68,13 +68,10 @@ static int hvm_mmio_access(struct vcpu *v,
         {
             int ret;
 
-            rc = read_handler(v, p->addr + (sign * i * p->size), p->size,
-                              &data);
+            rc = read_handler(v, p->addr + step * i, p->size, &data);
             if ( rc != X86EMUL_OKAY )
                 break;
-            ret = hvm_copy_to_guest_phys(p->data + (sign * i * p->size),
-                                         &data,
-                                         p->size);
+            ret = hvm_copy_to_guest_phys(p->data + step * i, &data, p->size);
             if ( (ret == HVMCOPY_gfn_paged_out) || 
                  (ret == HVMCOPY_gfn_shared) )
             {
@@ -87,8 +84,7 @@ static int hvm_mmio_access(struct vcpu *v,
     {
         for ( i = 0; i < p->count; i++ )
         {
-            switch ( hvm_copy_from_guest_phys(&data,
-                                              p->data + sign * i * p->size,
+            switch ( hvm_copy_from_guest_phys(&data, p->data + step * i,
                                               p->size) )
             {
             case HVMCOPY_okay:
@@ -109,8 +105,7 @@ static int hvm_mmio_access(struct vcpu *v,
             }
             if ( rc != X86EMUL_OKAY )
                 break;
-            rc = write_handler(v, p->addr + (sign * i * p->size), p->size,
-                               data);
+            rc = write_handler(v, p->addr + step * i, p->size, data);
             if ( rc != X86EMUL_OKAY )
                 break;
         }
@@ -142,7 +137,7 @@ int hvm_mmio_intercept(ioreq_t *p)
 
 static int process_portio_intercept(portio_action_t action, ioreq_t *p)
 {
-    int rc = X86EMUL_OKAY, i, sign = p->df ? -1 : 1;
+    int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
     uint32_t data;
 
     if ( !p->data_is_ptr )
@@ -167,8 +162,7 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
             rc = action(IOREQ_READ, p->addr, p->size, &data);
             if ( rc != X86EMUL_OKAY )
                 break;
-            (void)hvm_copy_to_guest_phys(p->data + sign*i*p->size,
-                                         &data, p->size);
+            (void)hvm_copy_to_guest_phys(p->data + step * i, &data, p->size);
         }
     }
     else /* p->dir == IOREQ_WRITE */
@@ -176,8 +170,7 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
         for ( i = 0; i < p->count; i++ )
         {
             data = 0;
-            switch ( hvm_copy_from_guest_phys(&data,
-                                              p->data + sign * i * p->size,
+            switch ( hvm_copy_from_guest_phys(&data, p->data + step * i,
                                               p->size) )
             {
             case HVMCOPY_okay:
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 5f5009a..77698c4 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -294,7 +294,7 @@ void hvm_io_assist(void)
 
 static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
 {
-    int i, sign = p->df ? -1 : 1;
+    int i, step = p->df ? -p->size : p->size;
     uint32_t data = 0;
 
     for ( i = 0; i < p->count; i++ )
@@ -317,8 +317,7 @@ static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
         if ( p->data_is_ptr )
         {
             int ret;
-            ret = hvm_copy_to_guest_phys(p->data + (sign * i * p->size), &data,
-                                         p->size);
+            ret = hvm_copy_to_guest_phys(p->data + step * i, &data, p->size);
             if ( (ret == HVMCOPY_gfn_paged_out) ||
                  (ret == HVMCOPY_gfn_shared) )
                 return X86EMUL_RETRY;
@@ -332,7 +331,7 @@ static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
 
 static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
 {
-    int i, sign = p->df ? -1 : 1;
+    int i, step = p->df ? -p->size : p->size;
     uint32_t data;
 
     for ( i = 0; i < p->count; i++ )
@@ -340,8 +339,7 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
         data = p->data;
         if ( p->data_is_ptr )
         {
-            switch ( hvm_copy_from_guest_phys(&data,
-                                              p->data + sign * i * p->size,
+            switch ( hvm_copy_from_guest_phys(&data, p->data + step * i,
                                               p->size) )
             {
             case HVMCOPY_okay:
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index 331fca0..19e80ed 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -467,15 +467,17 @@ static uint32_t read_data;
 static int mmio_move(struct hvm_hw_stdvga *s, ioreq_t *p)
 {
     int i;
-    int sign = p->df ? -1 : 1;
+    uint64_t addr = p->addr;
     p2m_type_t p2mt;
     struct domain *d = current->domain;
 
     if ( p->data_is_ptr )
     {
+        uint64_t data = p->data, tmp;
+        int step = p->df ? -p->size : p->size;
+
         if ( p->dir == IOREQ_READ )
         {
-            uint64_t addr = p->addr, data = p->data, tmp;
             for ( i = 0; i < p->count; i++ ) 
             {
                 tmp = stdvga_mem_read(addr, p->size);
@@ -498,13 +500,12 @@ static int mmio_move(struct hvm_hw_stdvga *s, ioreq_t *p)
                     ASSERT(!dp);
                     stdvga_mem_write(data, tmp, p->size);
                 }
-                data += sign * p->size;
-                addr += sign * p->size;
+                data += step;
+                addr += step;
             }
         }
         else
         {
-            uint32_t addr = p->addr, data = p->data, tmp;
             for ( i = 0; i < p->count; i++ )
             {
                 if ( hvm_copy_from_guest_phys(&tmp, data, p->size) !=
@@ -523,31 +524,18 @@ static int mmio_move(struct hvm_hw_stdvga *s, ioreq_t *p)
                     tmp = stdvga_mem_read(data, p->size);
                 }
                 stdvga_mem_write(addr, tmp, p->size);
-                data += sign * p->size;
-                addr += sign * p->size;
+                data += step;
+                addr += step;
             }
         }
     }
     else
     {
+        ASSERT(p->count == 1);
         if ( p->dir == IOREQ_READ )
-        {
-            uint32_t addr = p->addr;
-            for ( i = 0; i < p->count; i++ )
-            {
-                p->data = stdvga_mem_read(addr, p->size);
-                addr += sign * p->size;
-            }
-        }
+            p->data = stdvga_mem_read(addr, p->size);
         else
-        {
-            uint32_t addr = p->addr;
-            for ( i = 0; i < p->count; i++ )
-            {
-                stdvga_mem_write(addr, p->data, p->size);
-                addr += sign * p->size;
-            }
-        }
+            stdvga_mem_write(addr, p->data, p->size);
     }
 
     read_data = p->data;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Oct 16 05:12:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:12: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 1VWJP0-0008Bo-Sg; Wed, 16 Oct 2013 05:12: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 1VWJOz-0008BU-48
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:09 +0000
Received: from [85.158.137.68:49745] by server-6.bemta-3.messagelabs.com id
	C4/2E-23777-8202E525; Wed, 16 Oct 2013 05:12:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1381900325!1664618!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25252 invoked from network); 16 Oct 2013 05:12:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:12:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOv-0006RR-Ov
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOv-0007If-Kn
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:05 +0000
Date: Wed, 16 Oct 2013 05:12:05 +0000
Message-Id: <E1VWJOv-0007If-Kn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: fix direct PCI port I/O
	emulation retry and error handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 82ed8716b08ccf2f6239262ecc269c5cd60ef5dd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 09:51:40 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:51:40 2013 +0200

    x86/HVM: fix direct PCI port I/O emulation retry and error handling
    
    dpci_ioport_{read,write}() guest memory access failure handling should
    be modelled after process_portio_intercept()'s (and others): Upon
    encountering an error on other than the first iteration, the count
    successfully handled needs to be stored and X86EMUL_OKAY returned, in
    order for the generic instruction emulator to update register state
    correctly before reporting failure or retrying (both of which would
    only happen after re-invoking emulation).
    
    Further we leverage (and slightly extend, due to the above mentioned
    need to return X86EMUL_OKAY) the "large MMIO" retry model.
    
    Note that there is still a special case not explicitly taken care of
    here: While the first retry on the last iteration of a "rep ins"
    correctly recovers the already read data, an eventual subsequent retry
    is being handled by the pre-existing mmio-large logic (through
    hvmemul_do_io() storing the [recovered] data [again], also taking into
    consideration that the emulator converts a single iteration "ins" to
    ->read_io() plus ->write()).
    
    Also fix an off-by-one in the mmio-large-read logic, and slightly
    simplify the copying of the data.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/emulate.c     |   26 +++++++++++---
 xen/arch/x86/hvm/io.c          |   77 +++++++++++++++++++++++++++++++++-------
 xen/include/asm-x86/hvm/vcpu.h |    5 +++
 3 files changed, 90 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index b206997..15b2257 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -173,6 +173,13 @@ static int hvmemul_do_io(
         (p_data == NULL) ? HVMIO_dispatched : HVMIO_awaiting_completion;
     vio->io_size = size;
 
+    /*
+     * When retrying a repeated string instruction, force exit to guest after
+     * completion of the retried iteration to allow handling of interrupts.
+     */
+    if ( vio->mmio_retrying )
+        *reps = 1;
+
     p->dir = dir;
     p->data_is_ptr = value_is_ptr;
     p->type = is_mmio ? IOREQ_TYPE_COPY : IOREQ_TYPE_PIO;
@@ -202,8 +209,14 @@ static int hvmemul_do_io(
     case X86EMUL_RETRY:
         *reps = p->count;
         p->state = STATE_IORESP_READY;
-        hvm_io_assist();
-        vio->io_state = HVMIO_none;
+        if ( !vio->mmio_retry )
+        {
+            hvm_io_assist();
+            vio->io_state = HVMIO_none;
+        }
+        else
+            /* Defer hvm_io_assist() invocation to hvm_do_resume(). */
+            vio->io_state = HVMIO_handle_mmio_awaiting_completion;
         break;
     case X86EMUL_UNHANDLEABLE:
         rc = X86EMUL_RETRY;
@@ -249,10 +262,9 @@ static int hvmemul_do_io(
             if ( bytes == 0 )
                 pa = vio->mmio_large_read_pa = addr;
             if ( (addr == (pa + bytes)) &&
-                 ((bytes + size) <
-                  sizeof(vio->mmio_large_read)) )
+                 ((bytes + size) <= sizeof(vio->mmio_large_read)) )
             {
-                memcpy(&vio->mmio_large_read[addr - pa], p_data, size);
+                memcpy(&vio->mmio_large_read[bytes], p_data, size);
                 vio->mmio_large_read_bytes += size;
             }
         }
@@ -1151,9 +1163,13 @@ int hvm_emulate_one(
         ? sizeof(hvmemul_ctxt->insn_buf) : 0;
 
     hvmemul_ctxt->exn_pending = 0;
+    vio->mmio_retrying = vio->mmio_retry;
+    vio->mmio_retry = 0;
 
     rc = x86_emulate(&hvmemul_ctxt->ctxt, &hvm_emulate_ops);
 
+    if ( rc == X86EMUL_OKAY && vio->mmio_retry )
+        rc = X86EMUL_RETRY;
     if ( rc != X86EMUL_RETRY )
         vio->mmio_large_read_bytes = vio->mmio_large_write_bytes = 0;
 
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 77698c4..6e344e4 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -294,12 +294,21 @@ void hvm_io_assist(void)
 
 static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
 {
-    int i, step = p->df ? -p->size : p->size;
+    struct hvm_vcpu_io *vio = &current->arch.hvm_vcpu.hvm_io;
+    int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
     uint32_t data = 0;
 
     for ( i = 0; i < p->count; i++ )
     {
-        switch ( p->size )
+        if ( vio->mmio_retrying )
+        {
+            if ( vio->mmio_large_read_bytes != p->size )
+                return X86EMUL_UNHANDLEABLE;
+            memcpy(&data, vio->mmio_large_read, p->size);
+            vio->mmio_large_read_bytes = 0;
+            vio->mmio_retrying = 0;
+        }
+        else switch ( p->size )
         {
         case 1:
             data = inb(mport);
@@ -316,22 +325,51 @@ static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
 
         if ( p->data_is_ptr )
         {
-            int ret;
-            ret = hvm_copy_to_guest_phys(p->data + step * i, &data, p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) ||
-                 (ret == HVMCOPY_gfn_shared) )
-                return X86EMUL_RETRY;
+            switch ( hvm_copy_to_guest_phys(p->data + step * i,
+                                            &data, p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
+                rc = X86EMUL_RETRY;
+                break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                /* Drop the write as real hardware would. */
+                continue;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
+            }
+            if ( rc != X86EMUL_OKAY)
+                break;
         }
         else
             p->data = data;
     }
-    
-    return X86EMUL_OKAY;
+
+    if ( rc == X86EMUL_RETRY )
+    {
+        vio->mmio_retry = 1;
+        vio->mmio_large_read_bytes = p->size;
+        memcpy(vio->mmio_large_read, &data, p->size);
+    }
+
+    if ( i != 0 )
+    {
+        p->count = i;
+        rc = X86EMUL_OKAY;
+    }
+
+    return rc;
 }
 
 static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
 {
-    int i, step = p->df ? -p->size : p->size;
+    int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
     uint32_t data;
 
     for ( i = 0; i < p->count; i++ )
@@ -346,7 +384,8 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
                 break;
             case HVMCOPY_gfn_paged_out:
             case HVMCOPY_gfn_shared:
-                return X86EMUL_RETRY;
+                rc = X86EMUL_RETRY;
+                break;
             case HVMCOPY_bad_gfn_to_mfn:
                 data = ~0;
                 break;
@@ -354,8 +393,11 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
                 ASSERT(0);
                 /* fall through */
             default:
-                return X86EMUL_UNHANDLEABLE;
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
             }
+            if ( rc != X86EMUL_OKAY)
+                break;
         }
 
         switch ( p->size )
@@ -374,7 +416,16 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
         }
     }
 
-    return X86EMUL_OKAY;
+    if ( rc == X86EMUL_RETRY )
+        current->arch.hvm_vcpu.hvm_io.mmio_retry = 1;
+
+    if ( i != 0 )
+    {
+        p->count = i;
+        rc = X86EMUL_OKAY;
+    }
+
+    return rc;
 }
 
 int dpci_ioport_intercept(ioreq_t *p)
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index e8b8cd7..1abb364 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -66,6 +66,11 @@ struct hvm_vcpu_io {
     /* We may write up to m256 as a number of device-model transactions. */
     unsigned int mmio_large_write_bytes;
     paddr_t mmio_large_write_pa;
+    /*
+     * For string instruction emulation we need to be able to signal a
+     * necessary retry through other than function return codes.
+     */
+    bool_t mmio_retry, mmio_retrying;
 };
 
 #define VMCX_EADDR    (~0ULL)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:12:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:12: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 1VWJP0-0008Bo-Sg; Wed, 16 Oct 2013 05:12: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 1VWJOz-0008BU-48
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:09 +0000
Received: from [85.158.137.68:49745] by server-6.bemta-3.messagelabs.com id
	C4/2E-23777-8202E525; Wed, 16 Oct 2013 05:12:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1381900325!1664618!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25252 invoked from network); 16 Oct 2013 05:12:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:12:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOv-0006RR-Ov
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJOv-0007If-Kn
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:05 +0000
Date: Wed, 16 Oct 2013 05:12:05 +0000
Message-Id: <E1VWJOv-0007If-Kn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: fix direct PCI port I/O
	emulation retry and error handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 82ed8716b08ccf2f6239262ecc269c5cd60ef5dd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 09:51:40 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:51:40 2013 +0200

    x86/HVM: fix direct PCI port I/O emulation retry and error handling
    
    dpci_ioport_{read,write}() guest memory access failure handling should
    be modelled after process_portio_intercept()'s (and others): Upon
    encountering an error on other than the first iteration, the count
    successfully handled needs to be stored and X86EMUL_OKAY returned, in
    order for the generic instruction emulator to update register state
    correctly before reporting failure or retrying (both of which would
    only happen after re-invoking emulation).
    
    Further we leverage (and slightly extend, due to the above mentioned
    need to return X86EMUL_OKAY) the "large MMIO" retry model.
    
    Note that there is still a special case not explicitly taken care of
    here: While the first retry on the last iteration of a "rep ins"
    correctly recovers the already read data, an eventual subsequent retry
    is being handled by the pre-existing mmio-large logic (through
    hvmemul_do_io() storing the [recovered] data [again], also taking into
    consideration that the emulator converts a single iteration "ins" to
    ->read_io() plus ->write()).
    
    Also fix an off-by-one in the mmio-large-read logic, and slightly
    simplify the copying of the data.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/emulate.c     |   26 +++++++++++---
 xen/arch/x86/hvm/io.c          |   77 +++++++++++++++++++++++++++++++++-------
 xen/include/asm-x86/hvm/vcpu.h |    5 +++
 3 files changed, 90 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index b206997..15b2257 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -173,6 +173,13 @@ static int hvmemul_do_io(
         (p_data == NULL) ? HVMIO_dispatched : HVMIO_awaiting_completion;
     vio->io_size = size;
 
+    /*
+     * When retrying a repeated string instruction, force exit to guest after
+     * completion of the retried iteration to allow handling of interrupts.
+     */
+    if ( vio->mmio_retrying )
+        *reps = 1;
+
     p->dir = dir;
     p->data_is_ptr = value_is_ptr;
     p->type = is_mmio ? IOREQ_TYPE_COPY : IOREQ_TYPE_PIO;
@@ -202,8 +209,14 @@ static int hvmemul_do_io(
     case X86EMUL_RETRY:
         *reps = p->count;
         p->state = STATE_IORESP_READY;
-        hvm_io_assist();
-        vio->io_state = HVMIO_none;
+        if ( !vio->mmio_retry )
+        {
+            hvm_io_assist();
+            vio->io_state = HVMIO_none;
+        }
+        else
+            /* Defer hvm_io_assist() invocation to hvm_do_resume(). */
+            vio->io_state = HVMIO_handle_mmio_awaiting_completion;
         break;
     case X86EMUL_UNHANDLEABLE:
         rc = X86EMUL_RETRY;
@@ -249,10 +262,9 @@ static int hvmemul_do_io(
             if ( bytes == 0 )
                 pa = vio->mmio_large_read_pa = addr;
             if ( (addr == (pa + bytes)) &&
-                 ((bytes + size) <
-                  sizeof(vio->mmio_large_read)) )
+                 ((bytes + size) <= sizeof(vio->mmio_large_read)) )
             {
-                memcpy(&vio->mmio_large_read[addr - pa], p_data, size);
+                memcpy(&vio->mmio_large_read[bytes], p_data, size);
                 vio->mmio_large_read_bytes += size;
             }
         }
@@ -1151,9 +1163,13 @@ int hvm_emulate_one(
         ? sizeof(hvmemul_ctxt->insn_buf) : 0;
 
     hvmemul_ctxt->exn_pending = 0;
+    vio->mmio_retrying = vio->mmio_retry;
+    vio->mmio_retry = 0;
 
     rc = x86_emulate(&hvmemul_ctxt->ctxt, &hvm_emulate_ops);
 
+    if ( rc == X86EMUL_OKAY && vio->mmio_retry )
+        rc = X86EMUL_RETRY;
     if ( rc != X86EMUL_RETRY )
         vio->mmio_large_read_bytes = vio->mmio_large_write_bytes = 0;
 
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 77698c4..6e344e4 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -294,12 +294,21 @@ void hvm_io_assist(void)
 
 static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
 {
-    int i, step = p->df ? -p->size : p->size;
+    struct hvm_vcpu_io *vio = &current->arch.hvm_vcpu.hvm_io;
+    int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
     uint32_t data = 0;
 
     for ( i = 0; i < p->count; i++ )
     {
-        switch ( p->size )
+        if ( vio->mmio_retrying )
+        {
+            if ( vio->mmio_large_read_bytes != p->size )
+                return X86EMUL_UNHANDLEABLE;
+            memcpy(&data, vio->mmio_large_read, p->size);
+            vio->mmio_large_read_bytes = 0;
+            vio->mmio_retrying = 0;
+        }
+        else switch ( p->size )
         {
         case 1:
             data = inb(mport);
@@ -316,22 +325,51 @@ static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
 
         if ( p->data_is_ptr )
         {
-            int ret;
-            ret = hvm_copy_to_guest_phys(p->data + step * i, &data, p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) ||
-                 (ret == HVMCOPY_gfn_shared) )
-                return X86EMUL_RETRY;
+            switch ( hvm_copy_to_guest_phys(p->data + step * i,
+                                            &data, p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
+                rc = X86EMUL_RETRY;
+                break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                /* Drop the write as real hardware would. */
+                continue;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
+            }
+            if ( rc != X86EMUL_OKAY)
+                break;
         }
         else
             p->data = data;
     }
-    
-    return X86EMUL_OKAY;
+
+    if ( rc == X86EMUL_RETRY )
+    {
+        vio->mmio_retry = 1;
+        vio->mmio_large_read_bytes = p->size;
+        memcpy(vio->mmio_large_read, &data, p->size);
+    }
+
+    if ( i != 0 )
+    {
+        p->count = i;
+        rc = X86EMUL_OKAY;
+    }
+
+    return rc;
 }
 
 static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
 {
-    int i, step = p->df ? -p->size : p->size;
+    int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
     uint32_t data;
 
     for ( i = 0; i < p->count; i++ )
@@ -346,7 +384,8 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
                 break;
             case HVMCOPY_gfn_paged_out:
             case HVMCOPY_gfn_shared:
-                return X86EMUL_RETRY;
+                rc = X86EMUL_RETRY;
+                break;
             case HVMCOPY_bad_gfn_to_mfn:
                 data = ~0;
                 break;
@@ -354,8 +393,11 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
                 ASSERT(0);
                 /* fall through */
             default:
-                return X86EMUL_UNHANDLEABLE;
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
             }
+            if ( rc != X86EMUL_OKAY)
+                break;
         }
 
         switch ( p->size )
@@ -374,7 +416,16 @@ static int dpci_ioport_write(uint32_t mport, ioreq_t *p)
         }
     }
 
-    return X86EMUL_OKAY;
+    if ( rc == X86EMUL_RETRY )
+        current->arch.hvm_vcpu.hvm_io.mmio_retry = 1;
+
+    if ( i != 0 )
+    {
+        p->count = i;
+        rc = X86EMUL_OKAY;
+    }
+
+    return rc;
 }
 
 int dpci_ioport_intercept(ioreq_t *p)
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index e8b8cd7..1abb364 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -66,6 +66,11 @@ struct hvm_vcpu_io {
     /* We may write up to m256 as a number of device-model transactions. */
     unsigned int mmio_large_write_bytes;
     paddr_t mmio_large_write_pa;
+    /*
+     * For string instruction emulation we need to be able to signal a
+     * necessary retry through other than function return codes.
+     */
+    bool_t mmio_retry, mmio_retrying;
 };
 
 #define VMCX_EADDR    (~0ULL)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:12:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:12: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 1VWJP9-0008Dh-Vw; Wed, 16 Oct 2013 05:12: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 1VWJP8-0008DL-Qy
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:19 +0000
Received: from [193.109.254.147:24814] by server-8.bemta-14.messagelabs.com id
	C5/7F-18634-2302E525; Wed, 16 Oct 2013 05:12:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1381900336!2371303!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6891 invoked from network); 16 Oct 2013 05:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJP6-0006RY-0F
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJP5-0007J3-Sx
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:15 +0000
Date: Wed, 16 Oct 2013 05:12:15 +0000
Message-Id: <E1VWJP5-0007J3-Sx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: don't ignore
	hvm_copy_to_guest_phys() errors during I/O intercept
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e0c4efbe6dd6822c91b466c34bc6d8aaa935d90f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 09:52:33 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:52:33 2013 +0200

    x86/HVM: don't ignore hvm_copy_to_guest_phys() errors during I/O intercept
    
    Building upon the extended retry logic we can now also make sure to
    not ignore errors resulting from writing data back to guest memory.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/intercept.c |  120 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 107 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c
index 5ac0893..7cc13b5 100644
--- a/xen/arch/x86/hvm/intercept.c
+++ b/xen/arch/x86/hvm/intercept.c
@@ -47,6 +47,7 @@ static int hvm_mmio_access(struct vcpu *v,
                            hvm_mmio_read_t read_handler,
                            hvm_mmio_write_t write_handler)
 {
+    struct hvm_vcpu_io *vio = &v->arch.hvm_vcpu.hvm_io;
     unsigned long data;
     int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
 
@@ -54,7 +55,16 @@ static int hvm_mmio_access(struct vcpu *v,
     {
         if ( p->dir == IOREQ_READ )
         {
-            rc = read_handler(v, p->addr, p->size, &data);
+            if ( vio->mmio_retrying )
+            {
+                if ( vio->mmio_large_read_bytes != p->size )
+                    return X86EMUL_UNHANDLEABLE;
+                memcpy(&data, vio->mmio_large_read, p->size);
+                vio->mmio_large_read_bytes = 0;
+                vio->mmio_retrying = 0;
+            }
+            else
+                rc = read_handler(v, p->addr, p->size, &data);
             p->data = data;
         }
         else /* p->dir == IOREQ_WRITE */
@@ -66,18 +76,48 @@ static int hvm_mmio_access(struct vcpu *v,
     {
         for ( i = 0; i < p->count; i++ )
         {
-            int ret;
-
-            rc = read_handler(v, p->addr + step * i, p->size, &data);
-            if ( rc != X86EMUL_OKAY )
-                break;
-            ret = hvm_copy_to_guest_phys(p->data + step * i, &data, p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) || 
-                 (ret == HVMCOPY_gfn_shared) )
+            if ( vio->mmio_retrying )
+            {
+                if ( vio->mmio_large_read_bytes != p->size )
+                    return X86EMUL_UNHANDLEABLE;
+                memcpy(&data, vio->mmio_large_read, p->size);
+                vio->mmio_large_read_bytes = 0;
+                vio->mmio_retrying = 0;
+            }
+            else
             {
+                rc = read_handler(v, p->addr + step * i, p->size, &data);
+                if ( rc != X86EMUL_OKAY )
+                    break;
+            }
+            switch ( hvm_copy_to_guest_phys(p->data + step * i,
+                                            &data, p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 rc = X86EMUL_RETRY;
                 break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                /* Drop the write as real hardware would. */
+                continue;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
             }
+            if ( rc != X86EMUL_OKAY)
+                break;
+        }
+
+        if ( rc == X86EMUL_RETRY )
+        {
+            vio->mmio_retry = 1;
+            vio->mmio_large_read_bytes = p->size;
+            memcpy(vio->mmio_large_read, &data, p->size);
         }
     }
     else
@@ -109,6 +149,9 @@ static int hvm_mmio_access(struct vcpu *v,
             if ( rc != X86EMUL_OKAY )
                 break;
         }
+
+        if ( rc == X86EMUL_RETRY )
+            vio->mmio_retry = 1;
     }
 
     if ( i != 0 )
@@ -137,6 +180,7 @@ int hvm_mmio_intercept(ioreq_t *p)
 
 static int process_portio_intercept(portio_action_t action, ioreq_t *p)
 {
+    struct hvm_vcpu_io *vio = &current->arch.hvm_vcpu.hvm_io;
     int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
     uint32_t data;
 
@@ -144,7 +188,16 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
     {
         if ( p->dir == IOREQ_READ )
         {
-            rc = action(IOREQ_READ, p->addr, p->size, &data);
+            if ( vio->mmio_retrying )
+            {
+                if ( vio->mmio_large_read_bytes != p->size )
+                    return X86EMUL_UNHANDLEABLE;
+                memcpy(&data, vio->mmio_large_read, p->size);
+                vio->mmio_large_read_bytes = 0;
+                vio->mmio_retrying = 0;
+            }
+            else
+                rc = action(IOREQ_READ, p->addr, p->size, &data);
             p->data = data;
         }
         else
@@ -159,10 +212,48 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
     {
         for ( i = 0; i < p->count; i++ )
         {
-            rc = action(IOREQ_READ, p->addr, p->size, &data);
-            if ( rc != X86EMUL_OKAY )
+            if ( vio->mmio_retrying )
+            {
+                if ( vio->mmio_large_read_bytes != p->size )
+                    return X86EMUL_UNHANDLEABLE;
+                memcpy(&data, vio->mmio_large_read, p->size);
+                vio->mmio_large_read_bytes = 0;
+                vio->mmio_retrying = 0;
+            }
+            else
+            {
+                rc = action(IOREQ_READ, p->addr, p->size, &data);
+                if ( rc != X86EMUL_OKAY )
+                    break;
+            }
+            switch ( hvm_copy_to_guest_phys(p->data + step * i,
+                                            &data, p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
+                rc = X86EMUL_RETRY;
                 break;
-            (void)hvm_copy_to_guest_phys(p->data + step * i, &data, p->size);
+            case HVMCOPY_bad_gfn_to_mfn:
+                /* Drop the write as real hardware would. */
+                continue;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
+            }
+            if ( rc != X86EMUL_OKAY)
+                break;
+        }
+
+        if ( rc == X86EMUL_RETRY )
+        {
+            vio->mmio_retry = 1;
+            vio->mmio_large_read_bytes = p->size;
+            memcpy(vio->mmio_large_read, &data, p->size);
         }
     }
     else /* p->dir == IOREQ_WRITE */
@@ -195,6 +286,9 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
             if ( rc != X86EMUL_OKAY )
                 break;
         }
+
+        if ( rc == X86EMUL_RETRY )
+            vio->mmio_retry = 1;
     }
 
     if ( i != 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 Oct 16 05:12:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:12: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 1VWJP9-0008Dh-Vw; Wed, 16 Oct 2013 05:12: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 1VWJP8-0008DL-Qy
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:19 +0000
Received: from [193.109.254.147:24814] by server-8.bemta-14.messagelabs.com id
	C5/7F-18634-2302E525; Wed, 16 Oct 2013 05:12:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1381900336!2371303!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6891 invoked from network); 16 Oct 2013 05:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJP6-0006RY-0F
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJP5-0007J3-Sx
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:15 +0000
Date: Wed, 16 Oct 2013 05:12:15 +0000
Message-Id: <E1VWJP5-0007J3-Sx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: don't ignore
	hvm_copy_to_guest_phys() errors during I/O intercept
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e0c4efbe6dd6822c91b466c34bc6d8aaa935d90f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 09:52:33 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:52:33 2013 +0200

    x86/HVM: don't ignore hvm_copy_to_guest_phys() errors during I/O intercept
    
    Building upon the extended retry logic we can now also make sure to
    not ignore errors resulting from writing data back to guest memory.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/intercept.c |  120 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 107 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c
index 5ac0893..7cc13b5 100644
--- a/xen/arch/x86/hvm/intercept.c
+++ b/xen/arch/x86/hvm/intercept.c
@@ -47,6 +47,7 @@ static int hvm_mmio_access(struct vcpu *v,
                            hvm_mmio_read_t read_handler,
                            hvm_mmio_write_t write_handler)
 {
+    struct hvm_vcpu_io *vio = &v->arch.hvm_vcpu.hvm_io;
     unsigned long data;
     int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
 
@@ -54,7 +55,16 @@ static int hvm_mmio_access(struct vcpu *v,
     {
         if ( p->dir == IOREQ_READ )
         {
-            rc = read_handler(v, p->addr, p->size, &data);
+            if ( vio->mmio_retrying )
+            {
+                if ( vio->mmio_large_read_bytes != p->size )
+                    return X86EMUL_UNHANDLEABLE;
+                memcpy(&data, vio->mmio_large_read, p->size);
+                vio->mmio_large_read_bytes = 0;
+                vio->mmio_retrying = 0;
+            }
+            else
+                rc = read_handler(v, p->addr, p->size, &data);
             p->data = data;
         }
         else /* p->dir == IOREQ_WRITE */
@@ -66,18 +76,48 @@ static int hvm_mmio_access(struct vcpu *v,
     {
         for ( i = 0; i < p->count; i++ )
         {
-            int ret;
-
-            rc = read_handler(v, p->addr + step * i, p->size, &data);
-            if ( rc != X86EMUL_OKAY )
-                break;
-            ret = hvm_copy_to_guest_phys(p->data + step * i, &data, p->size);
-            if ( (ret == HVMCOPY_gfn_paged_out) || 
-                 (ret == HVMCOPY_gfn_shared) )
+            if ( vio->mmio_retrying )
+            {
+                if ( vio->mmio_large_read_bytes != p->size )
+                    return X86EMUL_UNHANDLEABLE;
+                memcpy(&data, vio->mmio_large_read, p->size);
+                vio->mmio_large_read_bytes = 0;
+                vio->mmio_retrying = 0;
+            }
+            else
             {
+                rc = read_handler(v, p->addr + step * i, p->size, &data);
+                if ( rc != X86EMUL_OKAY )
+                    break;
+            }
+            switch ( hvm_copy_to_guest_phys(p->data + step * i,
+                                            &data, p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
                 rc = X86EMUL_RETRY;
                 break;
+            case HVMCOPY_bad_gfn_to_mfn:
+                /* Drop the write as real hardware would. */
+                continue;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
             }
+            if ( rc != X86EMUL_OKAY)
+                break;
+        }
+
+        if ( rc == X86EMUL_RETRY )
+        {
+            vio->mmio_retry = 1;
+            vio->mmio_large_read_bytes = p->size;
+            memcpy(vio->mmio_large_read, &data, p->size);
         }
     }
     else
@@ -109,6 +149,9 @@ static int hvm_mmio_access(struct vcpu *v,
             if ( rc != X86EMUL_OKAY )
                 break;
         }
+
+        if ( rc == X86EMUL_RETRY )
+            vio->mmio_retry = 1;
     }
 
     if ( i != 0 )
@@ -137,6 +180,7 @@ int hvm_mmio_intercept(ioreq_t *p)
 
 static int process_portio_intercept(portio_action_t action, ioreq_t *p)
 {
+    struct hvm_vcpu_io *vio = &current->arch.hvm_vcpu.hvm_io;
     int rc = X86EMUL_OKAY, i, step = p->df ? -p->size : p->size;
     uint32_t data;
 
@@ -144,7 +188,16 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
     {
         if ( p->dir == IOREQ_READ )
         {
-            rc = action(IOREQ_READ, p->addr, p->size, &data);
+            if ( vio->mmio_retrying )
+            {
+                if ( vio->mmio_large_read_bytes != p->size )
+                    return X86EMUL_UNHANDLEABLE;
+                memcpy(&data, vio->mmio_large_read, p->size);
+                vio->mmio_large_read_bytes = 0;
+                vio->mmio_retrying = 0;
+            }
+            else
+                rc = action(IOREQ_READ, p->addr, p->size, &data);
             p->data = data;
         }
         else
@@ -159,10 +212,48 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
     {
         for ( i = 0; i < p->count; i++ )
         {
-            rc = action(IOREQ_READ, p->addr, p->size, &data);
-            if ( rc != X86EMUL_OKAY )
+            if ( vio->mmio_retrying )
+            {
+                if ( vio->mmio_large_read_bytes != p->size )
+                    return X86EMUL_UNHANDLEABLE;
+                memcpy(&data, vio->mmio_large_read, p->size);
+                vio->mmio_large_read_bytes = 0;
+                vio->mmio_retrying = 0;
+            }
+            else
+            {
+                rc = action(IOREQ_READ, p->addr, p->size, &data);
+                if ( rc != X86EMUL_OKAY )
+                    break;
+            }
+            switch ( hvm_copy_to_guest_phys(p->data + step * i,
+                                            &data, p->size) )
+            {
+            case HVMCOPY_okay:
+                break;
+            case HVMCOPY_gfn_paged_out:
+            case HVMCOPY_gfn_shared:
+                rc = X86EMUL_RETRY;
                 break;
-            (void)hvm_copy_to_guest_phys(p->data + step * i, &data, p->size);
+            case HVMCOPY_bad_gfn_to_mfn:
+                /* Drop the write as real hardware would. */
+                continue;
+            case HVMCOPY_bad_gva_to_gfn:
+                ASSERT(0);
+                /* fall through */
+            default:
+                rc = X86EMUL_UNHANDLEABLE;
+                break;
+            }
+            if ( rc != X86EMUL_OKAY)
+                break;
+        }
+
+        if ( rc == X86EMUL_RETRY )
+        {
+            vio->mmio_retry = 1;
+            vio->mmio_large_read_bytes = p->size;
+            memcpy(vio->mmio_large_read, &data, p->size);
         }
     }
     else /* p->dir == IOREQ_WRITE */
@@ -195,6 +286,9 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p)
             if ( rc != X86EMUL_OKAY )
                 break;
         }
+
+        if ( rc == X86EMUL_RETRY )
+            vio->mmio_retry = 1;
     }
 
     if ( i != 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 Oct 16 05:12:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:12: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 1VWJPK-0008Fo-53; Wed, 16 Oct 2013 05:12:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPI-0008FS-Un
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:29 +0000
Received: from [85.158.139.211:36056] by server-15.bemta-5.messagelabs.com id
	92/95-17574-C302E525; Wed, 16 Oct 2013 05:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1381900346!1610099!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30831 invoked from network); 16 Oct 2013 05:12:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:12:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPG-0006Re-95
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPG-0007JP-4f
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:26 +0000
Date: Wed, 16 Oct 2013 05:12:26 +0000
Message-Id: <E1VWJPG-0007JP-4f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: properly deal with
	hvm_copy_*_guest_phys() errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 63b02eff535b8798517b5a280cc2fff2f7d415c1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 09:53:31 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:53:31 2013 +0200

    x86/HVM: properly deal with hvm_copy_*_guest_phys() errors
    
    In memory read/write handling the default case should tell the caller
    that the operation cannot be handled rather than the operation having
    succeeded, so that when new HVMCOPY_* states get added not handling
    them explicitly will not result in errors being ignored.
    
    In task switch emulation code stop handling some errors, but not
    others.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/emulate.c |   14 ++++++--------
 xen/arch/x86/hvm/hvm.c     |   10 ++--------
 2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 15b2257..6cb6678 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -504,10 +504,10 @@ static int __hvmemul_read(
 
     switch ( rc )
     {
+    case HVMCOPY_okay:
+        break;
     case HVMCOPY_bad_gva_to_gfn:
         return X86EMUL_EXCEPTION;
-    case HVMCOPY_unhandleable:
-        return X86EMUL_UNHANDLEABLE;
     case HVMCOPY_bad_gfn_to_mfn:
         if ( access_type == hvm_access_insn_fetch )
             return X86EMUL_UNHANDLEABLE;
@@ -535,11 +535,10 @@ static int __hvmemul_read(
         }
         return rc;
     case HVMCOPY_gfn_paged_out:
-        return X86EMUL_RETRY;
     case HVMCOPY_gfn_shared:
         return X86EMUL_RETRY;
     default:
-        break;
+        return X86EMUL_UNHANDLEABLE;
     }
 
     return X86EMUL_OKAY;
@@ -634,10 +633,10 @@ static int hvmemul_write(
 
     switch ( rc )
     {
+    case HVMCOPY_okay:
+        break;
     case HVMCOPY_bad_gva_to_gfn:
         return X86EMUL_EXCEPTION;
-    case HVMCOPY_unhandleable:
-        return X86EMUL_UNHANDLEABLE;
     case HVMCOPY_bad_gfn_to_mfn:
         rc = hvmemul_linear_to_phys(addr, &gpa, chunk, &reps, pfec,
                                     hvmemul_ctxt);
@@ -663,11 +662,10 @@ static int hvmemul_write(
         }
         return rc;
     case HVMCOPY_gfn_paged_out:
-        return X86EMUL_RETRY;
     case HVMCOPY_gfn_shared:
         return X86EMUL_RETRY;
     default:
-        break;
+        return X86EMUL_UNHANDLEABLE;
     }
 
     return X86EMUL_OKAY;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6fcd95a..5f3a94a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2346,11 +2346,7 @@ void hvm_task_switch(
 
     rc = hvm_copy_to_guest_virt(
         prev_tr.base, &tss, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    if ( rc == HVMCOPY_gfn_shared )
+    if ( rc != HVMCOPY_okay )
         goto out;
 
     rc = hvm_copy_from_guest_virt(
@@ -2397,9 +2393,7 @@ void hvm_task_switch(
         tr.base, &tss, sizeof(tss), PFEC_page_present);
     if ( rc == HVMCOPY_bad_gva_to_gfn )
         exn_raised = 1;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    if ( rc == HVMCOPY_gfn_shared )
+    else if ( rc != HVMCOPY_okay )
         goto out;
 
     if ( (tss.trace & 1) && !exn_raised )
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:12:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:12: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 1VWJPK-0008Fo-53; Wed, 16 Oct 2013 05:12:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPI-0008FS-Un
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:29 +0000
Received: from [85.158.139.211:36056] by server-15.bemta-5.messagelabs.com id
	92/95-17574-C302E525; Wed, 16 Oct 2013 05:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1381900346!1610099!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30831 invoked from network); 16 Oct 2013 05:12:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:12:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPG-0006Re-95
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPG-0007JP-4f
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:26 +0000
Date: Wed, 16 Oct 2013 05:12:26 +0000
Message-Id: <E1VWJPG-0007JP-4f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: properly deal with
	hvm_copy_*_guest_phys() errors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 63b02eff535b8798517b5a280cc2fff2f7d415c1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 09:53:31 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:53:31 2013 +0200

    x86/HVM: properly deal with hvm_copy_*_guest_phys() errors
    
    In memory read/write handling the default case should tell the caller
    that the operation cannot be handled rather than the operation having
    succeeded, so that when new HVMCOPY_* states get added not handling
    them explicitly will not result in errors being ignored.
    
    In task switch emulation code stop handling some errors, but not
    others.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/emulate.c |   14 ++++++--------
 xen/arch/x86/hvm/hvm.c     |   10 ++--------
 2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 15b2257..6cb6678 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -504,10 +504,10 @@ static int __hvmemul_read(
 
     switch ( rc )
     {
+    case HVMCOPY_okay:
+        break;
     case HVMCOPY_bad_gva_to_gfn:
         return X86EMUL_EXCEPTION;
-    case HVMCOPY_unhandleable:
-        return X86EMUL_UNHANDLEABLE;
     case HVMCOPY_bad_gfn_to_mfn:
         if ( access_type == hvm_access_insn_fetch )
             return X86EMUL_UNHANDLEABLE;
@@ -535,11 +535,10 @@ static int __hvmemul_read(
         }
         return rc;
     case HVMCOPY_gfn_paged_out:
-        return X86EMUL_RETRY;
     case HVMCOPY_gfn_shared:
         return X86EMUL_RETRY;
     default:
-        break;
+        return X86EMUL_UNHANDLEABLE;
     }
 
     return X86EMUL_OKAY;
@@ -634,10 +633,10 @@ static int hvmemul_write(
 
     switch ( rc )
     {
+    case HVMCOPY_okay:
+        break;
     case HVMCOPY_bad_gva_to_gfn:
         return X86EMUL_EXCEPTION;
-    case HVMCOPY_unhandleable:
-        return X86EMUL_UNHANDLEABLE;
     case HVMCOPY_bad_gfn_to_mfn:
         rc = hvmemul_linear_to_phys(addr, &gpa, chunk, &reps, pfec,
                                     hvmemul_ctxt);
@@ -663,11 +662,10 @@ static int hvmemul_write(
         }
         return rc;
     case HVMCOPY_gfn_paged_out:
-        return X86EMUL_RETRY;
     case HVMCOPY_gfn_shared:
         return X86EMUL_RETRY;
     default:
-        break;
+        return X86EMUL_UNHANDLEABLE;
     }
 
     return X86EMUL_OKAY;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6fcd95a..5f3a94a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2346,11 +2346,7 @@ void hvm_task_switch(
 
     rc = hvm_copy_to_guest_virt(
         prev_tr.base, &tss, sizeof(tss), PFEC_page_present);
-    if ( rc == HVMCOPY_bad_gva_to_gfn )
-        goto out;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    if ( rc == HVMCOPY_gfn_shared )
+    if ( rc != HVMCOPY_okay )
         goto out;
 
     rc = hvm_copy_from_guest_virt(
@@ -2397,9 +2393,7 @@ void hvm_task_switch(
         tr.base, &tss, sizeof(tss), PFEC_page_present);
     if ( rc == HVMCOPY_bad_gva_to_gfn )
         exn_raised = 1;
-    if ( rc == HVMCOPY_gfn_paged_out )
-        goto out;
-    if ( rc == HVMCOPY_gfn_shared )
+    else if ( rc != HVMCOPY_okay )
         goto out;
 
     if ( (tss.trace & 1) && !exn_raised )
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:12:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:12: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 1VWJPV-0008Hs-8K; Wed, 16 Oct 2013 05:12: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 1VWJPT-0008HS-8q
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:39 +0000
Received: from [85.158.139.211:63535] by server-3.bemta-5.messagelabs.com id
	EF/FE-08905-6402E525; Wed, 16 Oct 2013 05:12:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1381900356!1597892!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18263 invoked from network); 16 Oct 2013 05:12:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPQ-0006Rm-FP
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPQ-0007Jq-Db
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:36 +0000
Date: Wed, 16 Oct 2013 05:12:36 +0000
Message-Id: <E1VWJPQ-0007Jq-Db@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: cache emulated instruction
	for retry processing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 699be3096ce62e2d6ef953b2a223c34330598ac8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 09:54:09 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:54:09 2013 +0200

    x86/HVM: cache emulated instruction for retry processing
    
    Rather than re-reading the instruction bytes upon retry processing,
    stash away and re-use what we already read. That way we can be certain
    that the retry won't do something different from what requested the
    retry, getting once again closer to real hardware behavior (where what
    we use retries for is simply a bus operation, not involving redundant
    decoding of instructions).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/emulate.c     |   57 ++++++++++++++++++++++++++++++----------
 xen/include/asm-x86/hvm/vcpu.h |    3 ++
 2 files changed, 46 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 6cb6678..f39c173 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -569,9 +569,19 @@ static int hvmemul_insn_fetch(
 
     /* Fall back if requested bytes are not in the prefetch cache. */
     if ( unlikely((insn_off + bytes) > hvmemul_ctxt->insn_buf_bytes) )
-        return __hvmemul_read(
-            seg, offset, p_data, bytes,
-            hvm_access_insn_fetch, hvmemul_ctxt);
+    {
+        int rc = __hvmemul_read(seg, offset, p_data, bytes,
+                                hvm_access_insn_fetch, hvmemul_ctxt);
+
+        if ( rc == X86EMUL_OKAY )
+        {
+            ASSERT(insn_off + bytes <= sizeof(hvmemul_ctxt->insn_buf));
+            memcpy(&hvmemul_ctxt->insn_buf[insn_off], p_data, bytes);
+            hvmemul_ctxt->insn_buf_bytes = insn_off + bytes;
+        }
+
+        return rc;
+    }
 
     /* Hit the cache. Simple memcpy. */
     memcpy(p_data, &hvmemul_ctxt->insn_buf[insn_off], bytes);
@@ -1148,17 +1158,27 @@ int hvm_emulate_one(
         pfec |= PFEC_user_mode;
 
     hvmemul_ctxt->insn_buf_eip = regs->eip;
-    hvmemul_ctxt->insn_buf_bytes =
-        hvm_get_insn_bytes(curr, hvmemul_ctxt->insn_buf)
-        ? :
-        (hvm_virtual_to_linear_addr(
-            x86_seg_cs, &hvmemul_ctxt->seg_reg[x86_seg_cs],
-            regs->eip, sizeof(hvmemul_ctxt->insn_buf),
-            hvm_access_insn_fetch, hvmemul_ctxt->ctxt.addr_size, &addr) &&
-         !hvm_fetch_from_guest_virt_nofault(
-             hvmemul_ctxt->insn_buf, addr,
-             sizeof(hvmemul_ctxt->insn_buf), pfec))
-        ? sizeof(hvmemul_ctxt->insn_buf) : 0;
+    if ( !vio->mmio_insn_bytes )
+    {
+        hvmemul_ctxt->insn_buf_bytes =
+            hvm_get_insn_bytes(curr, hvmemul_ctxt->insn_buf) ?:
+            (hvm_virtual_to_linear_addr(x86_seg_cs,
+                                        &hvmemul_ctxt->seg_reg[x86_seg_cs],
+                                        regs->eip,
+                                        sizeof(hvmemul_ctxt->insn_buf),
+                                        hvm_access_insn_fetch,
+                                        hvmemul_ctxt->ctxt.addr_size,
+                                        &addr) &&
+             hvm_fetch_from_guest_virt_nofault(hvmemul_ctxt->insn_buf, addr,
+                                               sizeof(hvmemul_ctxt->insn_buf),
+                                               pfec) == HVMCOPY_okay) ?
+            sizeof(hvmemul_ctxt->insn_buf) : 0;
+    }
+    else
+    {
+        hvmemul_ctxt->insn_buf_bytes = vio->mmio_insn_bytes;
+        memcpy(hvmemul_ctxt->insn_buf, vio->mmio_insn, vio->mmio_insn_bytes);
+    }
 
     hvmemul_ctxt->exn_pending = 0;
     vio->mmio_retrying = vio->mmio_retry;
@@ -1169,7 +1189,16 @@ int hvm_emulate_one(
     if ( rc == X86EMUL_OKAY && vio->mmio_retry )
         rc = X86EMUL_RETRY;
     if ( rc != X86EMUL_RETRY )
+    {
         vio->mmio_large_read_bytes = vio->mmio_large_write_bytes = 0;
+        vio->mmio_insn_bytes = 0;
+    }
+    else
+    {
+        BUILD_BUG_ON(sizeof(vio->mmio_insn) < sizeof(hvmemul_ctxt->insn_buf));
+        vio->mmio_insn_bytes = hvmemul_ctxt->insn_buf_bytes;
+        memcpy(vio->mmio_insn, hvmemul_ctxt->insn_buf, vio->mmio_insn_bytes);
+    }
 
     if ( rc != X86EMUL_OKAY )
         return rc;
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index 1abb364..8fa5452 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -66,6 +66,9 @@ struct hvm_vcpu_io {
     /* We may write up to m256 as a number of device-model transactions. */
     unsigned int mmio_large_write_bytes;
     paddr_t mmio_large_write_pa;
+    /* For retries we shouldn't re-fetch the instruction. */
+    unsigned int mmio_insn_bytes;
+    unsigned char mmio_insn[16];
     /*
      * For string instruction emulation we need to be able to signal a
      * necessary retry through other than function return codes.
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:12:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:12: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 1VWJPV-0008Hs-8K; Wed, 16 Oct 2013 05:12: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 1VWJPT-0008HS-8q
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:39 +0000
Received: from [85.158.139.211:63535] by server-3.bemta-5.messagelabs.com id
	EF/FE-08905-6402E525; Wed, 16 Oct 2013 05:12:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1381900356!1597892!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18263 invoked from network); 16 Oct 2013 05:12:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPQ-0006Rm-FP
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPQ-0007Jq-Db
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:36 +0000
Date: Wed, 16 Oct 2013 05:12:36 +0000
Message-Id: <E1VWJPQ-0007Jq-Db@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: cache emulated instruction
	for retry processing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 699be3096ce62e2d6ef953b2a223c34330598ac8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 14 09:54:09 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 09:54:09 2013 +0200

    x86/HVM: cache emulated instruction for retry processing
    
    Rather than re-reading the instruction bytes upon retry processing,
    stash away and re-use what we already read. That way we can be certain
    that the retry won't do something different from what requested the
    retry, getting once again closer to real hardware behavior (where what
    we use retries for is simply a bus operation, not involving redundant
    decoding of instructions).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/hvm/emulate.c     |   57 ++++++++++++++++++++++++++++++----------
 xen/include/asm-x86/hvm/vcpu.h |    3 ++
 2 files changed, 46 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 6cb6678..f39c173 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -569,9 +569,19 @@ static int hvmemul_insn_fetch(
 
     /* Fall back if requested bytes are not in the prefetch cache. */
     if ( unlikely((insn_off + bytes) > hvmemul_ctxt->insn_buf_bytes) )
-        return __hvmemul_read(
-            seg, offset, p_data, bytes,
-            hvm_access_insn_fetch, hvmemul_ctxt);
+    {
+        int rc = __hvmemul_read(seg, offset, p_data, bytes,
+                                hvm_access_insn_fetch, hvmemul_ctxt);
+
+        if ( rc == X86EMUL_OKAY )
+        {
+            ASSERT(insn_off + bytes <= sizeof(hvmemul_ctxt->insn_buf));
+            memcpy(&hvmemul_ctxt->insn_buf[insn_off], p_data, bytes);
+            hvmemul_ctxt->insn_buf_bytes = insn_off + bytes;
+        }
+
+        return rc;
+    }
 
     /* Hit the cache. Simple memcpy. */
     memcpy(p_data, &hvmemul_ctxt->insn_buf[insn_off], bytes);
@@ -1148,17 +1158,27 @@ int hvm_emulate_one(
         pfec |= PFEC_user_mode;
 
     hvmemul_ctxt->insn_buf_eip = regs->eip;
-    hvmemul_ctxt->insn_buf_bytes =
-        hvm_get_insn_bytes(curr, hvmemul_ctxt->insn_buf)
-        ? :
-        (hvm_virtual_to_linear_addr(
-            x86_seg_cs, &hvmemul_ctxt->seg_reg[x86_seg_cs],
-            regs->eip, sizeof(hvmemul_ctxt->insn_buf),
-            hvm_access_insn_fetch, hvmemul_ctxt->ctxt.addr_size, &addr) &&
-         !hvm_fetch_from_guest_virt_nofault(
-             hvmemul_ctxt->insn_buf, addr,
-             sizeof(hvmemul_ctxt->insn_buf), pfec))
-        ? sizeof(hvmemul_ctxt->insn_buf) : 0;
+    if ( !vio->mmio_insn_bytes )
+    {
+        hvmemul_ctxt->insn_buf_bytes =
+            hvm_get_insn_bytes(curr, hvmemul_ctxt->insn_buf) ?:
+            (hvm_virtual_to_linear_addr(x86_seg_cs,
+                                        &hvmemul_ctxt->seg_reg[x86_seg_cs],
+                                        regs->eip,
+                                        sizeof(hvmemul_ctxt->insn_buf),
+                                        hvm_access_insn_fetch,
+                                        hvmemul_ctxt->ctxt.addr_size,
+                                        &addr) &&
+             hvm_fetch_from_guest_virt_nofault(hvmemul_ctxt->insn_buf, addr,
+                                               sizeof(hvmemul_ctxt->insn_buf),
+                                               pfec) == HVMCOPY_okay) ?
+            sizeof(hvmemul_ctxt->insn_buf) : 0;
+    }
+    else
+    {
+        hvmemul_ctxt->insn_buf_bytes = vio->mmio_insn_bytes;
+        memcpy(hvmemul_ctxt->insn_buf, vio->mmio_insn, vio->mmio_insn_bytes);
+    }
 
     hvmemul_ctxt->exn_pending = 0;
     vio->mmio_retrying = vio->mmio_retry;
@@ -1169,7 +1189,16 @@ int hvm_emulate_one(
     if ( rc == X86EMUL_OKAY && vio->mmio_retry )
         rc = X86EMUL_RETRY;
     if ( rc != X86EMUL_RETRY )
+    {
         vio->mmio_large_read_bytes = vio->mmio_large_write_bytes = 0;
+        vio->mmio_insn_bytes = 0;
+    }
+    else
+    {
+        BUILD_BUG_ON(sizeof(vio->mmio_insn) < sizeof(hvmemul_ctxt->insn_buf));
+        vio->mmio_insn_bytes = hvmemul_ctxt->insn_buf_bytes;
+        memcpy(vio->mmio_insn, hvmemul_ctxt->insn_buf, vio->mmio_insn_bytes);
+    }
 
     if ( rc != X86EMUL_OKAY )
         return rc;
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index 1abb364..8fa5452 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -66,6 +66,9 @@ struct hvm_vcpu_io {
     /* We may write up to m256 as a number of device-model transactions. */
     unsigned int mmio_large_write_bytes;
     paddr_t mmio_large_write_pa;
+    /* For retries we shouldn't re-fetch the instruction. */
+    unsigned int mmio_insn_bytes;
+    unsigned char mmio_insn[16];
     /*
      * For string instruction emulation we need to be able to signal a
      * necessary retry through other than function return codes.
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:12:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:12: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 1VWJPf-0008JZ-BE; Wed, 16 Oct 2013 05:12:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPd-0008JF-9N
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:49 +0000
Received: from [193.109.254.147:31874] by server-14.bemta-14.messagelabs.com
	id E9/9F-20073-0502E525; Wed, 16 Oct 2013 05:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1381900366!1515713!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3731 invoked from network); 16 Oct 2013 05:12:47 -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;
	16 Oct 2013 05:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPa-0006Rs-Ko
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPa-0007KC-Iw
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:46 +0000
Date: Wed, 16 Oct 2013 05:12:46 +0000
Message-Id: <E1VWJPa-0007KC-Iw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] debug: remove some event channel info
	from the 'i' and 'q' debug keys
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 17ae93b12ddf22f2d794260a3dc2947858c625a0
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:14:38 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:14:38 2013 +0200

    debug: remove some event channel info from the 'i' and 'q' debug keys
    
    The 'i' key would always use VCPU0's selector word when printing the
    event channel state. Remove the incorrect output as a subsequent
    change will add the (correct) information to the 'e' key instead.
    
    When dumping domain information, printing the state of the VIRQ_DEBUG
    port is redundant -- this information is available via the 'e' key.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/irq.c      |    5 +----
 xen/common/keyhandler.c |   11 ++---------
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index c61cc46..7f547ff 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2262,14 +2262,11 @@ static void dump_irqs(unsigned char key)
                 d = action->guest[i];
                 pirq = domain_irq_to_pirq(d, irq);
                 info = pirq_info(d, pirq);
-                printk("%u:%3d(%c%c%c%c)",
+                printk("%u:%3d(%c%c%c)",
                        d->domain_id, pirq,
                        (test_bit(info->evtchn,
                                  &shared_info(d, evtchn_pending)) ?
                         'P' : '-'),
-                       (test_bit(info->evtchn / BITS_PER_EVTCHN_WORD(d),
-                                 &vcpu_info(d->vcpu[0], evtchn_pending_sel)) ?
-                        'S' : '-'),
                        (test_bit(info->evtchn, &shared_info(d, evtchn_mask)) ?
                         'M' : '-'),
                        (info->masked ? 'M' : '-'));
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index b9ad1b5..8e4b3f8 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -310,16 +310,9 @@ static void dump_domains(unsigned char key)
     {
         for_each_vcpu ( d, v )
         {
-            printk("Notifying guest %d:%d (virq %d, port %d, stat %d/%d/%d)\n",
+            printk("Notifying guest %d:%d (virq %d, port %d)\n",
                    d->domain_id, v->vcpu_id,
-                   VIRQ_DEBUG, v->virq_to_evtchn[VIRQ_DEBUG],
-                   test_bit(v->virq_to_evtchn[VIRQ_DEBUG], 
-                            &shared_info(d, evtchn_pending)),
-                   test_bit(v->virq_to_evtchn[VIRQ_DEBUG], 
-                            &shared_info(d, evtchn_mask)),
-                   test_bit(v->virq_to_evtchn[VIRQ_DEBUG] /
-                            BITS_PER_EVTCHN_WORD(d),
-                            &vcpu_info(v, evtchn_pending_sel)));
+                   VIRQ_DEBUG, v->virq_to_evtchn[VIRQ_DEBUG]);
             send_guest_vcpu_virq(v, VIRQ_DEBUG);
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:12:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:12: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 1VWJPf-0008JZ-BE; Wed, 16 Oct 2013 05:12:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPd-0008JF-9N
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:49 +0000
Received: from [193.109.254.147:31874] by server-14.bemta-14.messagelabs.com
	id E9/9F-20073-0502E525; Wed, 16 Oct 2013 05:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1381900366!1515713!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3731 invoked from network); 16 Oct 2013 05:12:47 -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;
	16 Oct 2013 05:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPa-0006Rs-Ko
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPa-0007KC-Iw
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:46 +0000
Date: Wed, 16 Oct 2013 05:12:46 +0000
Message-Id: <E1VWJPa-0007KC-Iw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] debug: remove some event channel info
	from the 'i' and 'q' debug keys
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 17ae93b12ddf22f2d794260a3dc2947858c625a0
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:14:38 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:14:38 2013 +0200

    debug: remove some event channel info from the 'i' and 'q' debug keys
    
    The 'i' key would always use VCPU0's selector word when printing the
    event channel state. Remove the incorrect output as a subsequent
    change will add the (correct) information to the 'e' key instead.
    
    When dumping domain information, printing the state of the VIRQ_DEBUG
    port is redundant -- this information is available via the 'e' key.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/irq.c      |    5 +----
 xen/common/keyhandler.c |   11 ++---------
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index c61cc46..7f547ff 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2262,14 +2262,11 @@ static void dump_irqs(unsigned char key)
                 d = action->guest[i];
                 pirq = domain_irq_to_pirq(d, irq);
                 info = pirq_info(d, pirq);
-                printk("%u:%3d(%c%c%c%c)",
+                printk("%u:%3d(%c%c%c)",
                        d->domain_id, pirq,
                        (test_bit(info->evtchn,
                                  &shared_info(d, evtchn_pending)) ?
                         'P' : '-'),
-                       (test_bit(info->evtchn / BITS_PER_EVTCHN_WORD(d),
-                                 &vcpu_info(d->vcpu[0], evtchn_pending_sel)) ?
-                        'S' : '-'),
                        (test_bit(info->evtchn, &shared_info(d, evtchn_mask)) ?
                         'M' : '-'),
                        (info->masked ? 'M' : '-'));
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index b9ad1b5..8e4b3f8 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -310,16 +310,9 @@ static void dump_domains(unsigned char key)
     {
         for_each_vcpu ( d, v )
         {
-            printk("Notifying guest %d:%d (virq %d, port %d, stat %d/%d/%d)\n",
+            printk("Notifying guest %d:%d (virq %d, port %d)\n",
                    d->domain_id, v->vcpu_id,
-                   VIRQ_DEBUG, v->virq_to_evtchn[VIRQ_DEBUG],
-                   test_bit(v->virq_to_evtchn[VIRQ_DEBUG], 
-                            &shared_info(d, evtchn_pending)),
-                   test_bit(v->virq_to_evtchn[VIRQ_DEBUG], 
-                            &shared_info(d, evtchn_mask)),
-                   test_bit(v->virq_to_evtchn[VIRQ_DEBUG] /
-                            BITS_PER_EVTCHN_WORD(d),
-                            &vcpu_info(v, evtchn_pending_sel)));
+                   VIRQ_DEBUG, v->virq_to_evtchn[VIRQ_DEBUG]);
             send_guest_vcpu_virq(v, VIRQ_DEBUG);
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:13:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:13: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 1VWJPq-0008Lj-FM; Wed, 16 Oct 2013 05:13:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPn-0008LO-Ve
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:00 +0000
Received: from [193.109.254.147:59121] by server-8.bemta-14.messagelabs.com id
	4D/DF-18634-B502E525; Wed, 16 Oct 2013 05:12:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1381900377!2369587!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18113 invoked from network); 16 Oct 2013 05:12:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:12:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPk-0006S1-Rh
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPk-0007KY-PE
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:56 +0000
Date: Wed, 16 Oct 2013 05:12:56 +0000
Message-Id: <E1VWJPk-0007KY-PE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: refactor low-level event
	channel port ops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fbbd5009e6ed1201731b1727762070c1a988e67d
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:15:49 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:15:49 2013 +0200

    evtchn: refactor low-level event channel port ops
    
    Use functions for the low-level event channel port operations
    (set/clear pending, unmask, is_pending and is_masked).
    
    Group these functions into a struct evtchn_port_op so they can be
    replaced by alternate implementations (for different ABIs) on a
    per-domain basis.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/irq.c         |   11 ++---
 xen/common/Makefile        |    1 +
 xen/common/event_2l.c      |   99 ++++++++++++++++++++++++++++++++++++++++++++
 xen/common/event_channel.c |   87 +++++++++++++++------------------------
 xen/common/schedule.c      |    3 +-
 xen/include/xen/event.h    |   45 ++++++++++++++++++++
 xen/include/xen/sched.h    |    4 ++
 7 files changed, 189 insertions(+), 61 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 7f547ff..53fe9e3 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1474,7 +1474,7 @@ int pirq_guest_unmask(struct domain *d)
         {
             pirq = pirqs[i]->pirq;
             if ( pirqs[i]->masked &&
-                 !test_bit(pirqs[i]->evtchn, &shared_info(d, evtchn_mask)) )
+                 !evtchn_port_is_masked(d, evtchn_from_port(d, pirqs[i]->evtchn)) )
                 pirq_guest_eoi(pirqs[i]);
         }
     } while ( ++pirq < d->nr_pirqs && n == ARRAY_SIZE(pirqs) );
@@ -2222,6 +2222,7 @@ static void dump_irqs(unsigned char key)
     int i, irq, pirq;
     struct irq_desc *desc;
     irq_guest_action_t *action;
+    struct evtchn *evtchn;
     struct domain *d;
     const struct pirq *info;
     unsigned long flags;
@@ -2262,13 +2263,11 @@ static void dump_irqs(unsigned char key)
                 d = action->guest[i];
                 pirq = domain_irq_to_pirq(d, irq);
                 info = pirq_info(d, pirq);
+                evtchn = evtchn_from_port(d, info->evtchn);
                 printk("%u:%3d(%c%c%c)",
                        d->domain_id, pirq,
-                       (test_bit(info->evtchn,
-                                 &shared_info(d, evtchn_pending)) ?
-                        'P' : '-'),
-                       (test_bit(info->evtchn, &shared_info(d, evtchn_mask)) ?
-                        'M' : '-'),
+                       (evtchn_port_is_pending(d, evtchn) ? 'P' : '-'),
+                       (evtchn_port_is_masked(d, evtchn) ? 'M' : '-'),
                        (info->masked ? 'M' : '-'));
                 if ( i != action->nr_guests )
                     printk(",");
diff --git a/xen/common/Makefile b/xen/common/Makefile
index fcb4a84..f6c473a 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -5,6 +5,7 @@ obj-y += cpupool.o
 obj-$(HAS_DEVICE_TREE) += device_tree.o
 obj-y += domctl.o
 obj-y += domain.o
+obj-y += event_2l.o
 obj-y += event_channel.o
 obj-y += grant_table.o
 obj-y += irq.o
diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
new file mode 100644
index 0000000..7b28942
--- /dev/null
+++ b/xen/common/event_2l.c
@@ -0,0 +1,99 @@
+/*
+ * Event channel port operations.
+ *
+ * Copyright (c) 2003-2006, K A Fraser.
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2 or later.  See the file COPYING for more details.
+ */
+
+#include <xen/config.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/errno.h>
+#include <xen/sched.h>
+#include <xen/event.h>
+
+static void evtchn_2l_set_pending(struct vcpu *v, struct evtchn *evtchn)
+{
+    struct domain *d = v->domain;
+    unsigned int port = evtchn->port;
+
+    /*
+     * The following bit operations must happen in strict order.
+     * NB. On x86, the atomic bit operations also act as memory barriers.
+     * There is therefore sufficiently strict ordering for this architecture --
+     * others may require explicit memory barriers.
+     */
+
+    if ( test_and_set_bit(port, &shared_info(d, evtchn_pending)) )
+        return;
+
+    if ( !test_bit        (port, &shared_info(d, evtchn_mask)) &&
+         !test_and_set_bit(port / BITS_PER_EVTCHN_WORD(d),
+                           &vcpu_info(v, evtchn_pending_sel)) )
+    {
+        vcpu_mark_events_pending(v);
+    }
+
+    evtchn_check_pollers(d, port);
+}
+
+static void evtchn_2l_clear_pending(struct domain *d, struct evtchn *evtchn)
+{
+    clear_bit(evtchn->port, &shared_info(d, evtchn_pending));
+}
+
+static void evtchn_2l_unmask(struct domain *d, struct evtchn *evtchn)
+{
+    struct vcpu *v = d->vcpu[evtchn->notify_vcpu_id];
+    unsigned int port = evtchn->port;
+
+    /*
+     * These operations must happen in strict order. Based on
+     * evtchn_2l_set_pending() above.
+     */
+    if ( test_and_clear_bit(port, &shared_info(d, evtchn_mask)) &&
+         test_bit          (port, &shared_info(d, evtchn_pending)) &&
+         !test_and_set_bit (port / BITS_PER_EVTCHN_WORD(d),
+                            &vcpu_info(v, evtchn_pending_sel)) )
+    {
+        vcpu_mark_events_pending(v);
+    }
+}
+
+static bool_t evtchn_2l_is_pending(struct domain *d,
+                                   const struct evtchn *evtchn)
+{
+    return test_bit(evtchn->port, &shared_info(d, evtchn_pending));
+}
+
+static bool_t evtchn_2l_is_masked(struct domain *d,
+                                  const struct evtchn *evtchn)
+{
+    return test_bit(evtchn->port, &shared_info(d, evtchn_mask));
+}
+
+static const struct evtchn_port_ops evtchn_port_ops_2l =
+{
+    .set_pending   = evtchn_2l_set_pending,
+    .clear_pending = evtchn_2l_clear_pending,
+    .unmask        = evtchn_2l_unmask,
+    .is_pending    = evtchn_2l_is_pending,
+    .is_masked     = evtchn_2l_is_masked,
+};
+
+void evtchn_2l_init(struct domain *d)
+{
+    d->evtchn_port_ops = &evtchn_port_ops_2l;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 64c976b..7290a21 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -150,6 +150,7 @@ static int get_free_port(struct domain *d)
             xfree(chn);
             return -ENOMEM;
         }
+        chn[i].port = port + i;
     }
 
     bucket_from_port(d, port) = chn;
@@ -530,7 +531,7 @@ static long __evtchn_close(struct domain *d1, int port1)
     }
 
     /* Clear pending event to avoid unexpected behavior on re-bind. */
-    clear_bit(port1, &shared_info(d1, evtchn_pending));
+    evtchn_port_clear_pending(d1, chn1);
 
     /* Reset binding to vcpu0 when the channel is freed. */
     chn1->state          = ECS_FREE;
@@ -615,43 +616,7 @@ out:
 
 static void evtchn_set_pending(struct vcpu *v, int port)
 {
-    struct domain *d = v->domain;
-    int vcpuid;
-
-    /*
-     * The following bit operations must happen in strict order.
-     * NB. On x86, the atomic bit operations also act as memory barriers.
-     * There is therefore sufficiently strict ordering for this architecture --
-     * others may require explicit memory barriers.
-     */
-
-    if ( test_and_set_bit(port, &shared_info(d, evtchn_pending)) )
-        return;
-
-    if ( !test_bit        (port, &shared_info(d, evtchn_mask)) &&
-         !test_and_set_bit(port / BITS_PER_EVTCHN_WORD(d),
-                           &vcpu_info(v, evtchn_pending_sel)) )
-    {
-        vcpu_mark_events_pending(v);
-    }
-    
-    /* Check if some VCPU might be polling for this event. */
-    if ( likely(bitmap_empty(d->poll_mask, d->max_vcpus)) )
-        return;
-
-    /* Wake any interested (or potentially interested) pollers. */
-    for ( vcpuid = find_first_bit(d->poll_mask, d->max_vcpus);
-          vcpuid < d->max_vcpus;
-          vcpuid = find_next_bit(d->poll_mask, d->max_vcpus, vcpuid+1) )
-    {
-        v = d->vcpu[vcpuid];
-        if ( ((v->poll_evtchn <= 0) || (v->poll_evtchn == port)) &&
-             test_and_clear_bit(vcpuid, d->poll_mask) )
-        {
-            v->poll_evtchn = 0;
-            vcpu_unblock(v);
-        }
-    }
+    evtchn_port_set_pending(v, evtchn_from_port(v->domain, port));
 }
 
 int guest_enabled_event(struct vcpu *v, uint32_t virq)
@@ -920,26 +885,15 @@ long evtchn_bind_vcpu(unsigned int port, unsigned int vcpu_id)
 int evtchn_unmask(unsigned int port)
 {
     struct domain *d = current->domain;
-    struct vcpu   *v;
+    struct evtchn *evtchn;
 
     ASSERT(spin_is_locked(&d->event_lock));
 
     if ( unlikely(!port_is_valid(d, port)) )
         return -EINVAL;
 
-    v = d->vcpu[evtchn_from_port(d, port)->notify_vcpu_id];
-
-    /*
-     * These operations must happen in strict order. Based on
-     * include/xen/event.h:evtchn_set_pending(). 
-     */
-    if ( test_and_clear_bit(port, &shared_info(d, evtchn_mask)) &&
-         test_bit          (port, &shared_info(d, evtchn_pending)) &&
-         !test_and_set_bit (port / BITS_PER_EVTCHN_WORD(d),
-                            &vcpu_info(v, evtchn_pending_sel)) )
-    {
-        vcpu_mark_events_pending(v);
-    }
+    evtchn = evtchn_from_port(d, port);
+    evtchn_port_unmask(d, evtchn);
 
     return 0;
 }
@@ -1170,9 +1124,34 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
     spin_unlock(&ld->event_lock);
 }
 
+void evtchn_check_pollers(struct domain *d, unsigned int port)
+{
+    struct vcpu *v;
+    unsigned int vcpuid;
+
+    /* Check if some VCPU might be polling for this event. */
+    if ( likely(bitmap_empty(d->poll_mask, d->max_vcpus)) )
+        return;
+
+    /* Wake any interested (or potentially interested) pollers. */
+    for ( vcpuid = find_first_bit(d->poll_mask, d->max_vcpus);
+          vcpuid < d->max_vcpus;
+          vcpuid = find_next_bit(d->poll_mask, d->max_vcpus, vcpuid+1) )
+    {
+        v = d->vcpu[vcpuid];
+        if ( ((v->poll_evtchn <= 0) || (v->poll_evtchn == port)) &&
+             test_and_clear_bit(vcpuid, d->poll_mask) )
+        {
+            v->poll_evtchn = 0;
+            vcpu_unblock(v);
+        }
+    }
+}
 
 int evtchn_init(struct domain *d)
 {
+    evtchn_2l_init(d);
+
     spin_lock_init(&d->event_lock);
     if ( get_free_port(d) != 0 )
         return -EINVAL;
@@ -1270,8 +1249,8 @@ static void domain_dump_evtchn_info(struct domain *d)
 
         printk("    %4u [%d/%d]: s=%d n=%d x=%d",
                port,
-               !!test_bit(port, &shared_info(d, evtchn_pending)),
-               !!test_bit(port, &shared_info(d, evtchn_mask)),
+               !!evtchn_port_is_pending(d, chn),
+               !!evtchn_port_is_masked(d, chn),
                chn->state, chn->notify_vcpu_id, chn->xen_consumer);
 
         switch ( chn->state )
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index af3abc2..b8e4cb4 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -34,6 +34,7 @@
 #include <xen/multicall.h>
 #include <xen/cpu.h>
 #include <xen/preempt.h>
+#include <xen/event.h>
 #include <public/sched.h>
 #include <xsm/xsm.h>
 
@@ -759,7 +760,7 @@ static long do_poll(struct sched_poll *sched_poll)
             goto out;
 
         rc = 0;
-        if ( test_bit(port, &shared_info(d, evtchn_pending)) )
+        if ( evtchn_port_is_pending(d, evtchn_from_port(d, port)) )
             goto out;
     }
 
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 6f60162..30c59c9 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -102,4 +102,49 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
         smp_mb(); /* set blocked status /then/ caller does his work */  \
     } while ( 0 )
 
+void evtchn_check_pollers(struct domain *d, unsigned int port);
+
+void evtchn_2l_init(struct domain *d);
+
+/*
+ * Low-level event channel port ops.
+ */
+struct evtchn_port_ops {
+    void (*set_pending)(struct vcpu *v, struct evtchn *evtchn);
+    void (*clear_pending)(struct domain *d, struct evtchn *evtchn);
+    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);
+};
+
+static inline void evtchn_port_set_pending(struct vcpu *v,
+                                           struct evtchn *evtchn)
+{
+    v->domain->evtchn_port_ops->set_pending(v, evtchn);
+}
+
+static inline void evtchn_port_clear_pending(struct domain *d,
+                                             struct evtchn *evtchn)
+{
+    d->evtchn_port_ops->clear_pending(d, evtchn);
+}
+
+static inline void evtchn_port_unmask(struct domain *d,
+                                      struct evtchn *evtchn)
+{
+    d->evtchn_port_ops->unmask(d, evtchn);
+}
+
+static inline bool_t evtchn_port_is_pending(struct domain *d,
+                                            const struct evtchn *evtchn)
+{
+    return d->evtchn_port_ops->is_pending(d, evtchn);
+}
+
+static inline bool_t evtchn_port_is_masked(struct domain *d,
+                                           const struct evtchn *evtchn)
+{
+    return d->evtchn_port_ops->is_masked(d, evtchn);
+}
+
 #endif /* __XEN_EVENT_H__ */
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 2e83f08..7c9eca3 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -66,6 +66,7 @@ struct evtchn
     u8  state;             /* ECS_* */
     u8  xen_consumer;      /* Consumer in Xen, if any? (0 = send to guest) */
     u16 notify_vcpu_id;    /* VCPU for local delivery notification */
+    u32 port;
     union {
         struct {
             domid_t remote_domid;
@@ -238,6 +239,8 @@ struct mem_event_per_domain
     struct mem_event_domain access;
 };
 
+struct evtchn_port_ops;
+
 struct domain
 {
     domid_t          domain_id;
@@ -271,6 +274,7 @@ struct domain
     /* Event channel information. */
     struct evtchn   *evtchn[NR_EVTCHN_BUCKETS];
     spinlock_t       event_lock;
+    const struct evtchn_port_ops *evtchn_port_ops;
 
     struct grant_table *grant_table;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:13:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:13: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 1VWJPq-0008Lj-FM; Wed, 16 Oct 2013 05:13:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPn-0008LO-Ve
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:00 +0000
Received: from [193.109.254.147:59121] by server-8.bemta-14.messagelabs.com id
	4D/DF-18634-B502E525; Wed, 16 Oct 2013 05:12:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1381900377!2369587!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18113 invoked from network); 16 Oct 2013 05:12:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:12:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPk-0006S1-Rh
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPk-0007KY-PE
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:12:56 +0000
Date: Wed, 16 Oct 2013 05:12:56 +0000
Message-Id: <E1VWJPk-0007KY-PE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: refactor low-level event
	channel port ops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fbbd5009e6ed1201731b1727762070c1a988e67d
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:15:49 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:15:49 2013 +0200

    evtchn: refactor low-level event channel port ops
    
    Use functions for the low-level event channel port operations
    (set/clear pending, unmask, is_pending and is_masked).
    
    Group these functions into a struct evtchn_port_op so they can be
    replaced by alternate implementations (for different ABIs) on a
    per-domain basis.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/irq.c         |   11 ++---
 xen/common/Makefile        |    1 +
 xen/common/event_2l.c      |   99 ++++++++++++++++++++++++++++++++++++++++++++
 xen/common/event_channel.c |   87 +++++++++++++++------------------------
 xen/common/schedule.c      |    3 +-
 xen/include/xen/event.h    |   45 ++++++++++++++++++++
 xen/include/xen/sched.h    |    4 ++
 7 files changed, 189 insertions(+), 61 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 7f547ff..53fe9e3 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1474,7 +1474,7 @@ int pirq_guest_unmask(struct domain *d)
         {
             pirq = pirqs[i]->pirq;
             if ( pirqs[i]->masked &&
-                 !test_bit(pirqs[i]->evtchn, &shared_info(d, evtchn_mask)) )
+                 !evtchn_port_is_masked(d, evtchn_from_port(d, pirqs[i]->evtchn)) )
                 pirq_guest_eoi(pirqs[i]);
         }
     } while ( ++pirq < d->nr_pirqs && n == ARRAY_SIZE(pirqs) );
@@ -2222,6 +2222,7 @@ static void dump_irqs(unsigned char key)
     int i, irq, pirq;
     struct irq_desc *desc;
     irq_guest_action_t *action;
+    struct evtchn *evtchn;
     struct domain *d;
     const struct pirq *info;
     unsigned long flags;
@@ -2262,13 +2263,11 @@ static void dump_irqs(unsigned char key)
                 d = action->guest[i];
                 pirq = domain_irq_to_pirq(d, irq);
                 info = pirq_info(d, pirq);
+                evtchn = evtchn_from_port(d, info->evtchn);
                 printk("%u:%3d(%c%c%c)",
                        d->domain_id, pirq,
-                       (test_bit(info->evtchn,
-                                 &shared_info(d, evtchn_pending)) ?
-                        'P' : '-'),
-                       (test_bit(info->evtchn, &shared_info(d, evtchn_mask)) ?
-                        'M' : '-'),
+                       (evtchn_port_is_pending(d, evtchn) ? 'P' : '-'),
+                       (evtchn_port_is_masked(d, evtchn) ? 'M' : '-'),
                        (info->masked ? 'M' : '-'));
                 if ( i != action->nr_guests )
                     printk(",");
diff --git a/xen/common/Makefile b/xen/common/Makefile
index fcb4a84..f6c473a 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -5,6 +5,7 @@ obj-y += cpupool.o
 obj-$(HAS_DEVICE_TREE) += device_tree.o
 obj-y += domctl.o
 obj-y += domain.o
+obj-y += event_2l.o
 obj-y += event_channel.o
 obj-y += grant_table.o
 obj-y += irq.o
diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
new file mode 100644
index 0000000..7b28942
--- /dev/null
+++ b/xen/common/event_2l.c
@@ -0,0 +1,99 @@
+/*
+ * Event channel port operations.
+ *
+ * Copyright (c) 2003-2006, K A Fraser.
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2 or later.  See the file COPYING for more details.
+ */
+
+#include <xen/config.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/errno.h>
+#include <xen/sched.h>
+#include <xen/event.h>
+
+static void evtchn_2l_set_pending(struct vcpu *v, struct evtchn *evtchn)
+{
+    struct domain *d = v->domain;
+    unsigned int port = evtchn->port;
+
+    /*
+     * The following bit operations must happen in strict order.
+     * NB. On x86, the atomic bit operations also act as memory barriers.
+     * There is therefore sufficiently strict ordering for this architecture --
+     * others may require explicit memory barriers.
+     */
+
+    if ( test_and_set_bit(port, &shared_info(d, evtchn_pending)) )
+        return;
+
+    if ( !test_bit        (port, &shared_info(d, evtchn_mask)) &&
+         !test_and_set_bit(port / BITS_PER_EVTCHN_WORD(d),
+                           &vcpu_info(v, evtchn_pending_sel)) )
+    {
+        vcpu_mark_events_pending(v);
+    }
+
+    evtchn_check_pollers(d, port);
+}
+
+static void evtchn_2l_clear_pending(struct domain *d, struct evtchn *evtchn)
+{
+    clear_bit(evtchn->port, &shared_info(d, evtchn_pending));
+}
+
+static void evtchn_2l_unmask(struct domain *d, struct evtchn *evtchn)
+{
+    struct vcpu *v = d->vcpu[evtchn->notify_vcpu_id];
+    unsigned int port = evtchn->port;
+
+    /*
+     * These operations must happen in strict order. Based on
+     * evtchn_2l_set_pending() above.
+     */
+    if ( test_and_clear_bit(port, &shared_info(d, evtchn_mask)) &&
+         test_bit          (port, &shared_info(d, evtchn_pending)) &&
+         !test_and_set_bit (port / BITS_PER_EVTCHN_WORD(d),
+                            &vcpu_info(v, evtchn_pending_sel)) )
+    {
+        vcpu_mark_events_pending(v);
+    }
+}
+
+static bool_t evtchn_2l_is_pending(struct domain *d,
+                                   const struct evtchn *evtchn)
+{
+    return test_bit(evtchn->port, &shared_info(d, evtchn_pending));
+}
+
+static bool_t evtchn_2l_is_masked(struct domain *d,
+                                  const struct evtchn *evtchn)
+{
+    return test_bit(evtchn->port, &shared_info(d, evtchn_mask));
+}
+
+static const struct evtchn_port_ops evtchn_port_ops_2l =
+{
+    .set_pending   = evtchn_2l_set_pending,
+    .clear_pending = evtchn_2l_clear_pending,
+    .unmask        = evtchn_2l_unmask,
+    .is_pending    = evtchn_2l_is_pending,
+    .is_masked     = evtchn_2l_is_masked,
+};
+
+void evtchn_2l_init(struct domain *d)
+{
+    d->evtchn_port_ops = &evtchn_port_ops_2l;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 64c976b..7290a21 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -150,6 +150,7 @@ static int get_free_port(struct domain *d)
             xfree(chn);
             return -ENOMEM;
         }
+        chn[i].port = port + i;
     }
 
     bucket_from_port(d, port) = chn;
@@ -530,7 +531,7 @@ static long __evtchn_close(struct domain *d1, int port1)
     }
 
     /* Clear pending event to avoid unexpected behavior on re-bind. */
-    clear_bit(port1, &shared_info(d1, evtchn_pending));
+    evtchn_port_clear_pending(d1, chn1);
 
     /* Reset binding to vcpu0 when the channel is freed. */
     chn1->state          = ECS_FREE;
@@ -615,43 +616,7 @@ out:
 
 static void evtchn_set_pending(struct vcpu *v, int port)
 {
-    struct domain *d = v->domain;
-    int vcpuid;
-
-    /*
-     * The following bit operations must happen in strict order.
-     * NB. On x86, the atomic bit operations also act as memory barriers.
-     * There is therefore sufficiently strict ordering for this architecture --
-     * others may require explicit memory barriers.
-     */
-
-    if ( test_and_set_bit(port, &shared_info(d, evtchn_pending)) )
-        return;
-
-    if ( !test_bit        (port, &shared_info(d, evtchn_mask)) &&
-         !test_and_set_bit(port / BITS_PER_EVTCHN_WORD(d),
-                           &vcpu_info(v, evtchn_pending_sel)) )
-    {
-        vcpu_mark_events_pending(v);
-    }
-    
-    /* Check if some VCPU might be polling for this event. */
-    if ( likely(bitmap_empty(d->poll_mask, d->max_vcpus)) )
-        return;
-
-    /* Wake any interested (or potentially interested) pollers. */
-    for ( vcpuid = find_first_bit(d->poll_mask, d->max_vcpus);
-          vcpuid < d->max_vcpus;
-          vcpuid = find_next_bit(d->poll_mask, d->max_vcpus, vcpuid+1) )
-    {
-        v = d->vcpu[vcpuid];
-        if ( ((v->poll_evtchn <= 0) || (v->poll_evtchn == port)) &&
-             test_and_clear_bit(vcpuid, d->poll_mask) )
-        {
-            v->poll_evtchn = 0;
-            vcpu_unblock(v);
-        }
-    }
+    evtchn_port_set_pending(v, evtchn_from_port(v->domain, port));
 }
 
 int guest_enabled_event(struct vcpu *v, uint32_t virq)
@@ -920,26 +885,15 @@ long evtchn_bind_vcpu(unsigned int port, unsigned int vcpu_id)
 int evtchn_unmask(unsigned int port)
 {
     struct domain *d = current->domain;
-    struct vcpu   *v;
+    struct evtchn *evtchn;
 
     ASSERT(spin_is_locked(&d->event_lock));
 
     if ( unlikely(!port_is_valid(d, port)) )
         return -EINVAL;
 
-    v = d->vcpu[evtchn_from_port(d, port)->notify_vcpu_id];
-
-    /*
-     * These operations must happen in strict order. Based on
-     * include/xen/event.h:evtchn_set_pending(). 
-     */
-    if ( test_and_clear_bit(port, &shared_info(d, evtchn_mask)) &&
-         test_bit          (port, &shared_info(d, evtchn_pending)) &&
-         !test_and_set_bit (port / BITS_PER_EVTCHN_WORD(d),
-                            &vcpu_info(v, evtchn_pending_sel)) )
-    {
-        vcpu_mark_events_pending(v);
-    }
+    evtchn = evtchn_from_port(d, port);
+    evtchn_port_unmask(d, evtchn);
 
     return 0;
 }
@@ -1170,9 +1124,34 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
     spin_unlock(&ld->event_lock);
 }
 
+void evtchn_check_pollers(struct domain *d, unsigned int port)
+{
+    struct vcpu *v;
+    unsigned int vcpuid;
+
+    /* Check if some VCPU might be polling for this event. */
+    if ( likely(bitmap_empty(d->poll_mask, d->max_vcpus)) )
+        return;
+
+    /* Wake any interested (or potentially interested) pollers. */
+    for ( vcpuid = find_first_bit(d->poll_mask, d->max_vcpus);
+          vcpuid < d->max_vcpus;
+          vcpuid = find_next_bit(d->poll_mask, d->max_vcpus, vcpuid+1) )
+    {
+        v = d->vcpu[vcpuid];
+        if ( ((v->poll_evtchn <= 0) || (v->poll_evtchn == port)) &&
+             test_and_clear_bit(vcpuid, d->poll_mask) )
+        {
+            v->poll_evtchn = 0;
+            vcpu_unblock(v);
+        }
+    }
+}
 
 int evtchn_init(struct domain *d)
 {
+    evtchn_2l_init(d);
+
     spin_lock_init(&d->event_lock);
     if ( get_free_port(d) != 0 )
         return -EINVAL;
@@ -1270,8 +1249,8 @@ static void domain_dump_evtchn_info(struct domain *d)
 
         printk("    %4u [%d/%d]: s=%d n=%d x=%d",
                port,
-               !!test_bit(port, &shared_info(d, evtchn_pending)),
-               !!test_bit(port, &shared_info(d, evtchn_mask)),
+               !!evtchn_port_is_pending(d, chn),
+               !!evtchn_port_is_masked(d, chn),
                chn->state, chn->notify_vcpu_id, chn->xen_consumer);
 
         switch ( chn->state )
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index af3abc2..b8e4cb4 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -34,6 +34,7 @@
 #include <xen/multicall.h>
 #include <xen/cpu.h>
 #include <xen/preempt.h>
+#include <xen/event.h>
 #include <public/sched.h>
 #include <xsm/xsm.h>
 
@@ -759,7 +760,7 @@ static long do_poll(struct sched_poll *sched_poll)
             goto out;
 
         rc = 0;
-        if ( test_bit(port, &shared_info(d, evtchn_pending)) )
+        if ( evtchn_port_is_pending(d, evtchn_from_port(d, port)) )
             goto out;
     }
 
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 6f60162..30c59c9 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -102,4 +102,49 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
         smp_mb(); /* set blocked status /then/ caller does his work */  \
     } while ( 0 )
 
+void evtchn_check_pollers(struct domain *d, unsigned int port);
+
+void evtchn_2l_init(struct domain *d);
+
+/*
+ * Low-level event channel port ops.
+ */
+struct evtchn_port_ops {
+    void (*set_pending)(struct vcpu *v, struct evtchn *evtchn);
+    void (*clear_pending)(struct domain *d, struct evtchn *evtchn);
+    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);
+};
+
+static inline void evtchn_port_set_pending(struct vcpu *v,
+                                           struct evtchn *evtchn)
+{
+    v->domain->evtchn_port_ops->set_pending(v, evtchn);
+}
+
+static inline void evtchn_port_clear_pending(struct domain *d,
+                                             struct evtchn *evtchn)
+{
+    d->evtchn_port_ops->clear_pending(d, evtchn);
+}
+
+static inline void evtchn_port_unmask(struct domain *d,
+                                      struct evtchn *evtchn)
+{
+    d->evtchn_port_ops->unmask(d, evtchn);
+}
+
+static inline bool_t evtchn_port_is_pending(struct domain *d,
+                                            const struct evtchn *evtchn)
+{
+    return d->evtchn_port_ops->is_pending(d, evtchn);
+}
+
+static inline bool_t evtchn_port_is_masked(struct domain *d,
+                                           const struct evtchn *evtchn)
+{
+    return d->evtchn_port_ops->is_masked(d, evtchn);
+}
+
 #endif /* __XEN_EVENT_H__ */
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 2e83f08..7c9eca3 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -66,6 +66,7 @@ struct evtchn
     u8  state;             /* ECS_* */
     u8  xen_consumer;      /* Consumer in Xen, if any? (0 = send to guest) */
     u16 notify_vcpu_id;    /* VCPU for local delivery notification */
+    u32 port;
     union {
         struct {
             domid_t remote_domid;
@@ -238,6 +239,8 @@ struct mem_event_per_domain
     struct mem_event_domain access;
 };
 
+struct evtchn_port_ops;
+
 struct domain
 {
     domid_t          domain_id;
@@ -271,6 +274,7 @@ struct domain
     /* Event channel information. */
     struct evtchn   *evtchn[NR_EVTCHN_BUCKETS];
     spinlock_t       event_lock;
+    const struct evtchn_port_ops *evtchn_port_ops;
 
     struct grant_table *grant_table;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:13:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:13:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWJPy-0008Nb-MJ; Wed, 16 Oct 2013 05:13: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 1VWJPx-0008N6-Fv
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:09 +0000
Received: from [85.158.137.68:57673] by server-11.bemta-3.messagelabs.com id
	7D/AD-05386-5602E525; Wed, 16 Oct 2013 05:13:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1381900387!1676744!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 785 invoked from network); 16 Oct 2013 05:13:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:13:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPv-0006SY-12
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPu-0007Lr-VO
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:06 +0000
Date: Wed, 16 Oct 2013 05:13:06 +0000
Message-Id: <E1VWJPu-0007Lr-VO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: print ABI specific state with
	the 'e' debug key
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 611d0ecc81bf948f6f9c592afdd6c2aebcfaaadb
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:17:14 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:17:14 2013 +0200

    evtchn: print ABI specific state with the 'e' debug key
    
    In the output of the 'e' debug key, print some ABI specific state in
    addition to the (p)ending and (m)asked bits.
    
    For the 2-level ABI, print the state of that event's selector
    bit. e.g.,
    
    (XEN)     port [p/m/s]
    (XEN)        1 [0/0/1]: s=3 n=0 x=0 d=0 p=74
    (XEN)        2 [0/0/1]: s=3 n=0 x=0 d=0 p=75
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/event_2l.c      |   10 ++++++++++
 xen/common/event_channel.c |    8 +++++---
 xen/include/xen/event.h    |    7 +++++++
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index 7b28942..a9d99d3 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -74,6 +74,15 @@ static bool_t evtchn_2l_is_masked(struct domain *d,
     return test_bit(evtchn->port, &shared_info(d, evtchn_mask));
 }
 
+static void evtchn_2l_print_state(struct domain *d,
+                                  const struct evtchn *evtchn)
+{
+    struct vcpu *v = d->vcpu[evtchn->notify_vcpu_id];
+
+    printk("%d", !!test_bit(evtchn->port / BITS_PER_EVTCHN_WORD(d),
+                            &vcpu_info(v, evtchn_pending_sel)));
+}
+
 static const struct evtchn_port_ops evtchn_port_ops_2l =
 {
     .set_pending   = evtchn_2l_set_pending,
@@ -81,6 +90,7 @@ static const struct evtchn_port_ops evtchn_port_ops_2l =
     .unmask        = evtchn_2l_unmask,
     .is_pending    = evtchn_2l_is_pending,
     .is_masked     = evtchn_2l_is_masked,
+    .print_state   = evtchn_2l_print_state,
 };
 
 void evtchn_2l_init(struct domain *d)
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 7290a21..f73c7a9 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1232,7 +1232,7 @@ static void domain_dump_evtchn_info(struct domain *d)
                          d->poll_mask, d->max_vcpus);
     printk("Event channel information for domain %d:\n"
            "Polling vCPUs: {%s}\n"
-           "    port [p/m]\n", d->domain_id, keyhandler_scratch);
+           "    port [p/m/s]\n", d->domain_id, keyhandler_scratch);
 
     spin_lock(&d->event_lock);
 
@@ -1247,10 +1247,12 @@ static void domain_dump_evtchn_info(struct domain *d)
         if ( chn->state == ECS_FREE )
             continue;
 
-        printk("    %4u [%d/%d]: s=%d n=%d x=%d",
+        printk("    %4u [%d/%d/",
                port,
                !!evtchn_port_is_pending(d, chn),
-               !!evtchn_port_is_masked(d, chn),
+               !!evtchn_port_is_masked(d, chn));
+        evtchn_port_print_state(d, chn);
+        printk("]: s=%d n=%d x=%d",
                chn->state, chn->notify_vcpu_id, chn->xen_consumer);
 
         switch ( chn->state )
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 30c59c9..2445562 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -115,6 +115,7 @@ 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);
+    void (*print_state)(struct domain *d, const struct evtchn *evtchn);
 };
 
 static inline void evtchn_port_set_pending(struct vcpu *v,
@@ -147,4 +148,10 @@ static inline bool_t evtchn_port_is_masked(struct domain *d,
     return d->evtchn_port_ops->is_masked(d, evtchn);
 }
 
+static inline void evtchn_port_print_state(struct domain *d,
+                                           const struct evtchn *evtchn)
+{
+    d->evtchn_port_ops->print_state(d, evtchn);
+}
+
 #endif /* __XEN_EVENT_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 Oct 16 05:13:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:13:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWJPy-0008Nb-MJ; Wed, 16 Oct 2013 05:13: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 1VWJPx-0008N6-Fv
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:09 +0000
Received: from [85.158.137.68:57673] by server-11.bemta-3.messagelabs.com id
	7D/AD-05386-5602E525; Wed, 16 Oct 2013 05:13:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1381900387!1676744!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 785 invoked from network); 16 Oct 2013 05:13:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:13:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPv-0006SY-12
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJPu-0007Lr-VO
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:06 +0000
Date: Wed, 16 Oct 2013 05:13:06 +0000
Message-Id: <E1VWJPu-0007Lr-VO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: print ABI specific state with
	the 'e' debug key
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 611d0ecc81bf948f6f9c592afdd6c2aebcfaaadb
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:17:14 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:17:14 2013 +0200

    evtchn: print ABI specific state with the 'e' debug key
    
    In the output of the 'e' debug key, print some ABI specific state in
    addition to the (p)ending and (m)asked bits.
    
    For the 2-level ABI, print the state of that event's selector
    bit. e.g.,
    
    (XEN)     port [p/m/s]
    (XEN)        1 [0/0/1]: s=3 n=0 x=0 d=0 p=74
    (XEN)        2 [0/0/1]: s=3 n=0 x=0 d=0 p=75
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/event_2l.c      |   10 ++++++++++
 xen/common/event_channel.c |    8 +++++---
 xen/include/xen/event.h    |    7 +++++++
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index 7b28942..a9d99d3 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -74,6 +74,15 @@ static bool_t evtchn_2l_is_masked(struct domain *d,
     return test_bit(evtchn->port, &shared_info(d, evtchn_mask));
 }
 
+static void evtchn_2l_print_state(struct domain *d,
+                                  const struct evtchn *evtchn)
+{
+    struct vcpu *v = d->vcpu[evtchn->notify_vcpu_id];
+
+    printk("%d", !!test_bit(evtchn->port / BITS_PER_EVTCHN_WORD(d),
+                            &vcpu_info(v, evtchn_pending_sel)));
+}
+
 static const struct evtchn_port_ops evtchn_port_ops_2l =
 {
     .set_pending   = evtchn_2l_set_pending,
@@ -81,6 +90,7 @@ static const struct evtchn_port_ops evtchn_port_ops_2l =
     .unmask        = evtchn_2l_unmask,
     .is_pending    = evtchn_2l_is_pending,
     .is_masked     = evtchn_2l_is_masked,
+    .print_state   = evtchn_2l_print_state,
 };
 
 void evtchn_2l_init(struct domain *d)
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 7290a21..f73c7a9 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1232,7 +1232,7 @@ static void domain_dump_evtchn_info(struct domain *d)
                          d->poll_mask, d->max_vcpus);
     printk("Event channel information for domain %d:\n"
            "Polling vCPUs: {%s}\n"
-           "    port [p/m]\n", d->domain_id, keyhandler_scratch);
+           "    port [p/m/s]\n", d->domain_id, keyhandler_scratch);
 
     spin_lock(&d->event_lock);
 
@@ -1247,10 +1247,12 @@ static void domain_dump_evtchn_info(struct domain *d)
         if ( chn->state == ECS_FREE )
             continue;
 
-        printk("    %4u [%d/%d]: s=%d n=%d x=%d",
+        printk("    %4u [%d/%d/",
                port,
                !!evtchn_port_is_pending(d, chn),
-               !!evtchn_port_is_masked(d, chn),
+               !!evtchn_port_is_masked(d, chn));
+        evtchn_port_print_state(d, chn);
+        printk("]: s=%d n=%d x=%d",
                chn->state, chn->notify_vcpu_id, chn->xen_consumer);
 
         switch ( chn->state )
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 30c59c9..2445562 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -115,6 +115,7 @@ 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);
+    void (*print_state)(struct domain *d, const struct evtchn *evtchn);
 };
 
 static inline void evtchn_port_set_pending(struct vcpu *v,
@@ -147,4 +148,10 @@ static inline bool_t evtchn_port_is_masked(struct domain *d,
     return d->evtchn_port_ops->is_masked(d, evtchn);
 }
 
+static inline void evtchn_port_print_state(struct domain *d,
+                                           const struct evtchn *evtchn)
+{
+    d->evtchn_port_ops->print_state(d, evtchn);
+}
+
 #endif /* __XEN_EVENT_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 Oct 16 05:13:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:13: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 1VWJQ9-0008PZ-PD; Wed, 16 Oct 2013 05:13:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQ8-0008PE-NV
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:20 +0000
Received: from [193.109.254.147:14992] by server-13.bemta-14.messagelabs.com
	id 59/59-25247-F602E525; Wed, 16 Oct 2013 05:13:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1381900397!2360352!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5889 invoked from network); 16 Oct 2013 05:13:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:13:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQ5-0006Sg-7Y
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQ5-0007MF-4j
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:17 +0000
Date: Wed, 16 Oct 2013 05:13:17 +0000
Message-Id: <E1VWJQ5-0007MF-4j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: use a per-domain variable for
	the max number of event channels
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 48974e6ce52ee21e08d0e621611371dc05624bbc
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:18:24 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:18:24 2013 +0200

    evtchn: use a per-domain variable for the max number of event channels
    
    Instead of the MAX_EVTCHNS(d) macro, use d->max_evtchns instead.  This
    avoids having to repeatedly check the ABI type.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/event_2l.c      |    1 +
 xen/common/event_channel.c |    4 ++--
 xen/common/schedule.c      |    2 +-
 xen/include/xen/event.h    |    2 +-
 xen/include/xen/sched.h    |    2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index a9d99d3..5837ae8 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -96,6 +96,7 @@ static const struct evtchn_port_ops evtchn_port_ops_2l =
 void evtchn_2l_init(struct domain *d)
 {
     d->evtchn_port_ops = &evtchn_port_ops_2l;
+    d->max_evtchns = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 }
 
 /*
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index f73c7a9..539a198 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -134,7 +134,7 @@ static int get_free_port(struct domain *d)
         if ( evtchn_from_port(d, port)->state == ECS_FREE )
             return port;
 
-    if ( port == MAX_EVTCHNS(d) )
+    if ( port == d->max_evtchns )
         return -ENOSPC;
 
     chn = xzalloc_array(struct evtchn, EVTCHNS_PER_BUCKET);
@@ -1236,7 +1236,7 @@ static void domain_dump_evtchn_info(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    for ( port = 1; port < MAX_EVTCHNS(d); ++port )
+    for ( port = 1; port < d->max_evtchns; ++port )
     {
         const struct evtchn *chn;
         char *ssid;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index b8e4cb4..bfa6bee 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -756,7 +756,7 @@ static long do_poll(struct sched_poll *sched_poll)
             goto out;
 
         rc = -EINVAL;
-        if ( port >= MAX_EVTCHNS(d) )
+        if ( port >= d->max_evtchns )
             goto out;
 
         rc = 0;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 2445562..6933f02 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -73,7 +73,7 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 #define bucket_from_port(d,p) \
     ((d)->evtchn[(p)/EVTCHNS_PER_BUCKET])
 #define port_is_valid(d,p)    \
-    (((p) >= 0) && ((p) < MAX_EVTCHNS(d)) && \
+    (((p) >= 0) && ((p) < (d)->max_evtchns) &&  \
      (bucket_from_port(d,p) != NULL))
 #define evtchn_from_port(d,p) \
     (&(bucket_from_port(d,p))[(p)&(EVTCHNS_PER_BUCKET-1)])
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 7c9eca3..f8fc7c2 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -50,7 +50,6 @@ extern struct domain *dom0;
 #else
 #define BITS_PER_EVTCHN_WORD(d) (has_32bit_shinfo(d) ? 32 : BITS_PER_XEN_ULONG)
 #endif
-#define MAX_EVTCHNS(d) (BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d))
 #define EVTCHNS_PER_BUCKET 128
 #define NR_EVTCHN_BUCKETS  (NR_EVENT_CHANNELS / EVTCHNS_PER_BUCKET)
 
@@ -273,6 +272,7 @@ struct domain
 
     /* Event channel information. */
     struct evtchn   *evtchn[NR_EVTCHN_BUCKETS];
+    unsigned int     max_evtchns;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_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 Oct 16 05:13:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:13: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 1VWJQ9-0008PZ-PD; Wed, 16 Oct 2013 05:13:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQ8-0008PE-NV
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:20 +0000
Received: from [193.109.254.147:14992] by server-13.bemta-14.messagelabs.com
	id 59/59-25247-F602E525; Wed, 16 Oct 2013 05:13:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1381900397!2360352!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5889 invoked from network); 16 Oct 2013 05:13:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:13:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQ5-0006Sg-7Y
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQ5-0007MF-4j
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:17 +0000
Date: Wed, 16 Oct 2013 05:13:17 +0000
Message-Id: <E1VWJQ5-0007MF-4j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: use a per-domain variable for
	the max number of event channels
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 48974e6ce52ee21e08d0e621611371dc05624bbc
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:18:24 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:18:24 2013 +0200

    evtchn: use a per-domain variable for the max number of event channels
    
    Instead of the MAX_EVTCHNS(d) macro, use d->max_evtchns instead.  This
    avoids having to repeatedly check the ABI type.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/event_2l.c      |    1 +
 xen/common/event_channel.c |    4 ++--
 xen/common/schedule.c      |    2 +-
 xen/include/xen/event.h    |    2 +-
 xen/include/xen/sched.h    |    2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index a9d99d3..5837ae8 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -96,6 +96,7 @@ static const struct evtchn_port_ops evtchn_port_ops_2l =
 void evtchn_2l_init(struct domain *d)
 {
     d->evtchn_port_ops = &evtchn_port_ops_2l;
+    d->max_evtchns = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 }
 
 /*
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index f73c7a9..539a198 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -134,7 +134,7 @@ static int get_free_port(struct domain *d)
         if ( evtchn_from_port(d, port)->state == ECS_FREE )
             return port;
 
-    if ( port == MAX_EVTCHNS(d) )
+    if ( port == d->max_evtchns )
         return -ENOSPC;
 
     chn = xzalloc_array(struct evtchn, EVTCHNS_PER_BUCKET);
@@ -1236,7 +1236,7 @@ static void domain_dump_evtchn_info(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    for ( port = 1; port < MAX_EVTCHNS(d); ++port )
+    for ( port = 1; port < d->max_evtchns; ++port )
     {
         const struct evtchn *chn;
         char *ssid;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index b8e4cb4..bfa6bee 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -756,7 +756,7 @@ static long do_poll(struct sched_poll *sched_poll)
             goto out;
 
         rc = -EINVAL;
-        if ( port >= MAX_EVTCHNS(d) )
+        if ( port >= d->max_evtchns )
             goto out;
 
         rc = 0;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 2445562..6933f02 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -73,7 +73,7 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 #define bucket_from_port(d,p) \
     ((d)->evtchn[(p)/EVTCHNS_PER_BUCKET])
 #define port_is_valid(d,p)    \
-    (((p) >= 0) && ((p) < MAX_EVTCHNS(d)) && \
+    (((p) >= 0) && ((p) < (d)->max_evtchns) &&  \
      (bucket_from_port(d,p) != NULL))
 #define evtchn_from_port(d,p) \
     (&(bucket_from_port(d,p))[(p)&(EVTCHNS_PER_BUCKET-1)])
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 7c9eca3..f8fc7c2 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -50,7 +50,6 @@ extern struct domain *dom0;
 #else
 #define BITS_PER_EVTCHN_WORD(d) (has_32bit_shinfo(d) ? 32 : BITS_PER_XEN_ULONG)
 #endif
-#define MAX_EVTCHNS(d) (BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d))
 #define EVTCHNS_PER_BUCKET 128
 #define NR_EVTCHN_BUCKETS  (NR_EVENT_CHANNELS / EVTCHNS_PER_BUCKET)
 
@@ -273,6 +272,7 @@ struct domain
 
     /* Event channel information. */
     struct evtchn   *evtchn[NR_EVTCHN_BUCKETS];
+    unsigned int     max_evtchns;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_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 Oct 16 05:13:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:13: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 1VWJQI-0008RE-SF; Wed, 16 Oct 2013 05:13:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQI-0008R1-4U
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:30 +0000
Received: from [85.158.143.35:34263] by server-3.bemta-4.messagelabs.com id
	B0/98-21600-9702E525; Wed, 16 Oct 2013 05:13:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1381900407!2110538!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3644 invoked from network); 16 Oct 2013 05:13:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:13:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQF-0006Sm-E9
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQF-0007Mb-Bu
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:27 +0000
Date: Wed, 16 Oct 2013 05:13:27 +0000
Message-Id: <E1VWJQF-0007Mb-Bu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: allow many more evtchn objects
	to be allocated per 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 ea963e094a01cbbac203f0252c28808cfdc7f8ed
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:19:21 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:19:21 2013 +0200

    evtchn: allow many more evtchn objects to be allocated per domain
    
    Expand the number of event channels that can be supported internally
    by altering now struct evtchn's are allocated.
    
    The objects are indexed using a two level scheme of groups and buckets
    (instead of only buckets).  Each group is a page of bucket pointers.
    Each bucket is a page-sized array of struct evtchn's.
    
    The optimal number of evtchns per bucket is calculated at compile
    time.
    
    If XSM is not enabled, struct evtchn is 16 bytes and each bucket
    contains 256, requiring only 1 group of 512 pointers for 2^17
    (131,072) event channels.  With XSM enabled, struct evtchn is 24
    bytes, each bucket contains 128 and 2 groups are required.
    
    For the common case of a domain with only a few event channels,
    instead of requiring an additional allocation for the group page, the
    first bucket is indexed directly.
    
    As a consequence of this, struct domain shrinks by at least 232 bytes
    as 32 bucket pointers are replaced with 1 bucket pointer and (at most)
    2 group pointers.
    
    [ Based on a patch from Wei Liu with improvements from Malcolm
    Crossley. ]
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/event_channel.c |   82 ++++++++++++++++++++++++++++++++++----------
 xen/include/xen/event.h    |   40 ++++++++++++++++-----
 xen/include/xen/sched.h    |   21 ++++++++++--
 3 files changed, 113 insertions(+), 30 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 539a198..87bca94 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -121,11 +121,47 @@ static int virq_is_global(uint32_t virq)
 }
 
 
+static struct evtchn *alloc_evtchn_bucket(struct domain *d, unsigned int port)
+{
+    struct evtchn *chn;
+    unsigned int i;
+
+    chn = xzalloc_array(struct evtchn, EVTCHNS_PER_BUCKET);
+    if ( !chn )
+        return NULL;
+
+    for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
+    {
+        if ( xsm_alloc_security_evtchn(&chn[i]) )
+        {
+            while ( i-- )
+                xsm_free_security_evtchn(&chn[i]);
+            xfree(chn);
+            return NULL;
+        }
+        chn[i].port = port + i;
+    }
+    return chn;
+}
+
+static void free_evtchn_bucket(struct domain *d, struct evtchn *bucket)
+{
+    unsigned int i;
+
+    if ( !bucket )
+        return;
+
+    for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
+        xsm_free_security_evtchn(bucket + i);
+
+    xfree(bucket);
+}
+
 static int get_free_port(struct domain *d)
 {
     struct evtchn *chn;
+    struct evtchn **grp;
     int            port;
-    int            i, j;
 
     if ( d->is_dying )
         return -EINVAL;
@@ -137,22 +173,17 @@ static int get_free_port(struct domain *d)
     if ( port == d->max_evtchns )
         return -ENOSPC;
 
-    chn = xzalloc_array(struct evtchn, EVTCHNS_PER_BUCKET);
-    if ( unlikely(chn == NULL) )
-        return -ENOMEM;
-
-    for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
+    if ( !group_from_port(d, port) )
     {
-        if ( xsm_alloc_security_evtchn(&chn[i]) )
-        {
-            for ( j = 0; j < i; j++ )
-                xsm_free_security_evtchn(&chn[j]);
-            xfree(chn);
+        grp = xzalloc_array(struct evtchn *, BUCKETS_PER_GROUP);
+        if ( !grp )
             return -ENOMEM;
-        }
-        chn[i].port = port + i;
+        group_from_port(d, port) = grp;
     }
 
+    chn = alloc_evtchn_bucket(d, port);
+    if ( !chn )
+        return -ENOMEM;
     bucket_from_port(d, port) = chn;
 
     return port;
@@ -1152,15 +1183,25 @@ int evtchn_init(struct domain *d)
 {
     evtchn_2l_init(d);
 
+    d->evtchn = alloc_evtchn_bucket(d, 0);
+    if ( !d->evtchn )
+        return -ENOMEM;
+
     spin_lock_init(&d->event_lock);
     if ( get_free_port(d) != 0 )
+    {
+        free_evtchn_bucket(d, d->evtchn);
         return -EINVAL;
+    }
     evtchn_from_port(d, 0)->state = ECS_RESERVED;
 
 #if MAX_VIRT_CPUS > BITS_PER_LONG
     d->poll_mask = xmalloc_array(unsigned long, BITS_TO_LONGS(MAX_VIRT_CPUS));
     if ( !d->poll_mask )
+    {
+        free_evtchn_bucket(d, d->evtchn);
         return -ENOMEM;
+    }
     bitmap_zero(d->poll_mask, MAX_VIRT_CPUS);
 #endif
 
@@ -1170,7 +1211,7 @@ int evtchn_init(struct domain *d)
 
 void evtchn_destroy(struct domain *d)
 {
-    int i;
+    unsigned int i, j;
 
     /* After this barrier no new event-channel allocations can occur. */
     BUG_ON(!d->is_dying);
@@ -1185,12 +1226,17 @@ void evtchn_destroy(struct domain *d)
 
     /* Free all event-channel buckets. */
     spin_lock(&d->event_lock);
-    for ( i = 0; i < NR_EVTCHN_BUCKETS; i++ )
+    for ( i = 0; i < NR_EVTCHN_GROUPS; i++ )
     {
-        xsm_free_security_evtchn(d->evtchn[i]);
-        xfree(d->evtchn[i]);
-        d->evtchn[i] = NULL;
+        if ( !d->evtchn_group[i] )
+            continue;
+        for ( j = 0; j < BUCKETS_PER_GROUP; j++ )
+            free_evtchn_bucket(d, d->evtchn_group[i][j]);
+        xfree(d->evtchn_group[i]);
+        d->evtchn_group[i] = NULL;
     }
+    free_evtchn_bucket(d, d->evtchn);
+    d->evtchn = NULL;
     spin_unlock(&d->event_lock);
 
     clear_global_virq_handlers(d);
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 6933f02..cba09e7 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -69,15 +69,37 @@ int guest_enabled_event(struct vcpu *v, uint32_t virq);
 /* Notify remote end of a Xen-attached event channel.*/
 void notify_via_xen_event_channel(struct domain *ld, int lport);
 
-/* Internal event channel object accessors */
-#define bucket_from_port(d,p) \
-    ((d)->evtchn[(p)/EVTCHNS_PER_BUCKET])
-#define port_is_valid(d,p)    \
-    (((p) >= 0) && ((p) < (d)->max_evtchns) &&  \
-     (bucket_from_port(d,p) != NULL))
-#define evtchn_from_port(d,p) \
-    (&(bucket_from_port(d,p))[(p)&(EVTCHNS_PER_BUCKET-1)])
+/*
+ * Internal event channel object storage.
+ *
+ * The objects (struct evtchn) are indexed using a two level scheme of
+ * groups and buckets.  Each group is a page of bucket pointers.  Each
+ * bucket is a page-sized array of struct evtchn's.
+ *
+ * The first bucket is directly accessed via d->evtchn.
+ */
+#define group_from_port(d, p) \
+    ((d)->evtchn_group[(p) / EVTCHNS_PER_GROUP])
+#define bucket_from_port(d, p) \
+    ((group_from_port(d, p))[((p) % EVTCHNS_PER_GROUP) / EVTCHNS_PER_BUCKET])
 
+static inline bool_t port_is_valid(struct domain *d, unsigned int p)
+{
+    if ( p >= d->max_evtchns )
+        return 0;
+    if ( !d->evtchn )
+        return 0;
+    if ( p < EVTCHNS_PER_BUCKET )
+        return 1;
+    return group_from_port(d, p) != NULL && bucket_from_port(d, p) != NULL;
+}
+
+static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
+{
+    if ( p < EVTCHNS_PER_BUCKET )
+        return &d->evtchn[p];
+    return bucket_from_port(d, p) + (p % EVTCHNS_PER_BUCKET);
+}
 
 /* Wait on a Xen-attached event channel. */
 #define wait_on_xen_event_channel(port, condition)                      \
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index f8fc7c2..2090a41 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -50,8 +50,22 @@ extern struct domain *dom0;
 #else
 #define BITS_PER_EVTCHN_WORD(d) (has_32bit_shinfo(d) ? 32 : BITS_PER_XEN_ULONG)
 #endif
-#define EVTCHNS_PER_BUCKET 128
-#define NR_EVTCHN_BUCKETS  (NR_EVENT_CHANNELS / EVTCHNS_PER_BUCKET)
+
+#define BUCKETS_PER_GROUP  (PAGE_SIZE/sizeof(struct evtchn *))
+/* Round size of struct evtchn up to power of 2 size */
+#define __RDU2(x)   (       (x) | (   (x) >> 1))
+#define __RDU4(x)   ( __RDU2(x) | ( __RDU2(x) >> 2))
+#define __RDU8(x)   ( __RDU4(x) | ( __RDU4(x) >> 4))
+#define __RDU16(x)  ( __RDU8(x) | ( __RDU8(x) >> 8))
+#define __RDU32(x)  (__RDU16(x) | (__RDU16(x) >>16))
+#define next_power_of_2(x)      (__RDU32((x)-1) + 1)
+
+/* Maximum number of event channels for any ABI. */
+#define MAX_NR_EVTCHNS NR_EVENT_CHANNELS
+
+#define EVTCHNS_PER_BUCKET (PAGE_SIZE / next_power_of_2(sizeof(struct evtchn)))
+#define EVTCHNS_PER_GROUP  (BUCKETS_PER_GROUP * EVTCHNS_PER_BUCKET)
+#define NR_EVTCHN_GROUPS   DIV_ROUND_UP(MAX_NR_EVTCHNS, EVTCHNS_PER_GROUP)
 
 struct evtchn
 {
@@ -271,7 +285,8 @@ struct domain
     spinlock_t       rangesets_lock;
 
     /* Event channel information. */
-    struct evtchn   *evtchn[NR_EVTCHN_BUCKETS];
+    struct evtchn   *evtchn;                         /* first bucket only */
+    struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
     unsigned int     max_evtchns;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_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 Oct 16 05:13:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:13: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 1VWJQI-0008RE-SF; Wed, 16 Oct 2013 05:13:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQI-0008R1-4U
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:30 +0000
Received: from [85.158.143.35:34263] by server-3.bemta-4.messagelabs.com id
	B0/98-21600-9702E525; Wed, 16 Oct 2013 05:13:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1381900407!2110538!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3644 invoked from network); 16 Oct 2013 05:13:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:13:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQF-0006Sm-E9
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQF-0007Mb-Bu
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:27 +0000
Date: Wed, 16 Oct 2013 05:13:27 +0000
Message-Id: <E1VWJQF-0007Mb-Bu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: allow many more evtchn objects
	to be allocated per 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 ea963e094a01cbbac203f0252c28808cfdc7f8ed
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:19:21 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:19:21 2013 +0200

    evtchn: allow many more evtchn objects to be allocated per domain
    
    Expand the number of event channels that can be supported internally
    by altering now struct evtchn's are allocated.
    
    The objects are indexed using a two level scheme of groups and buckets
    (instead of only buckets).  Each group is a page of bucket pointers.
    Each bucket is a page-sized array of struct evtchn's.
    
    The optimal number of evtchns per bucket is calculated at compile
    time.
    
    If XSM is not enabled, struct evtchn is 16 bytes and each bucket
    contains 256, requiring only 1 group of 512 pointers for 2^17
    (131,072) event channels.  With XSM enabled, struct evtchn is 24
    bytes, each bucket contains 128 and 2 groups are required.
    
    For the common case of a domain with only a few event channels,
    instead of requiring an additional allocation for the group page, the
    first bucket is indexed directly.
    
    As a consequence of this, struct domain shrinks by at least 232 bytes
    as 32 bucket pointers are replaced with 1 bucket pointer and (at most)
    2 group pointers.
    
    [ Based on a patch from Wei Liu with improvements from Malcolm
    Crossley. ]
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/event_channel.c |   82 ++++++++++++++++++++++++++++++++++----------
 xen/include/xen/event.h    |   40 ++++++++++++++++-----
 xen/include/xen/sched.h    |   21 ++++++++++--
 3 files changed, 113 insertions(+), 30 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 539a198..87bca94 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -121,11 +121,47 @@ static int virq_is_global(uint32_t virq)
 }
 
 
+static struct evtchn *alloc_evtchn_bucket(struct domain *d, unsigned int port)
+{
+    struct evtchn *chn;
+    unsigned int i;
+
+    chn = xzalloc_array(struct evtchn, EVTCHNS_PER_BUCKET);
+    if ( !chn )
+        return NULL;
+
+    for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
+    {
+        if ( xsm_alloc_security_evtchn(&chn[i]) )
+        {
+            while ( i-- )
+                xsm_free_security_evtchn(&chn[i]);
+            xfree(chn);
+            return NULL;
+        }
+        chn[i].port = port + i;
+    }
+    return chn;
+}
+
+static void free_evtchn_bucket(struct domain *d, struct evtchn *bucket)
+{
+    unsigned int i;
+
+    if ( !bucket )
+        return;
+
+    for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
+        xsm_free_security_evtchn(bucket + i);
+
+    xfree(bucket);
+}
+
 static int get_free_port(struct domain *d)
 {
     struct evtchn *chn;
+    struct evtchn **grp;
     int            port;
-    int            i, j;
 
     if ( d->is_dying )
         return -EINVAL;
@@ -137,22 +173,17 @@ static int get_free_port(struct domain *d)
     if ( port == d->max_evtchns )
         return -ENOSPC;
 
-    chn = xzalloc_array(struct evtchn, EVTCHNS_PER_BUCKET);
-    if ( unlikely(chn == NULL) )
-        return -ENOMEM;
-
-    for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
+    if ( !group_from_port(d, port) )
     {
-        if ( xsm_alloc_security_evtchn(&chn[i]) )
-        {
-            for ( j = 0; j < i; j++ )
-                xsm_free_security_evtchn(&chn[j]);
-            xfree(chn);
+        grp = xzalloc_array(struct evtchn *, BUCKETS_PER_GROUP);
+        if ( !grp )
             return -ENOMEM;
-        }
-        chn[i].port = port + i;
+        group_from_port(d, port) = grp;
     }
 
+    chn = alloc_evtchn_bucket(d, port);
+    if ( !chn )
+        return -ENOMEM;
     bucket_from_port(d, port) = chn;
 
     return port;
@@ -1152,15 +1183,25 @@ int evtchn_init(struct domain *d)
 {
     evtchn_2l_init(d);
 
+    d->evtchn = alloc_evtchn_bucket(d, 0);
+    if ( !d->evtchn )
+        return -ENOMEM;
+
     spin_lock_init(&d->event_lock);
     if ( get_free_port(d) != 0 )
+    {
+        free_evtchn_bucket(d, d->evtchn);
         return -EINVAL;
+    }
     evtchn_from_port(d, 0)->state = ECS_RESERVED;
 
 #if MAX_VIRT_CPUS > BITS_PER_LONG
     d->poll_mask = xmalloc_array(unsigned long, BITS_TO_LONGS(MAX_VIRT_CPUS));
     if ( !d->poll_mask )
+    {
+        free_evtchn_bucket(d, d->evtchn);
         return -ENOMEM;
+    }
     bitmap_zero(d->poll_mask, MAX_VIRT_CPUS);
 #endif
 
@@ -1170,7 +1211,7 @@ int evtchn_init(struct domain *d)
 
 void evtchn_destroy(struct domain *d)
 {
-    int i;
+    unsigned int i, j;
 
     /* After this barrier no new event-channel allocations can occur. */
     BUG_ON(!d->is_dying);
@@ -1185,12 +1226,17 @@ void evtchn_destroy(struct domain *d)
 
     /* Free all event-channel buckets. */
     spin_lock(&d->event_lock);
-    for ( i = 0; i < NR_EVTCHN_BUCKETS; i++ )
+    for ( i = 0; i < NR_EVTCHN_GROUPS; i++ )
     {
-        xsm_free_security_evtchn(d->evtchn[i]);
-        xfree(d->evtchn[i]);
-        d->evtchn[i] = NULL;
+        if ( !d->evtchn_group[i] )
+            continue;
+        for ( j = 0; j < BUCKETS_PER_GROUP; j++ )
+            free_evtchn_bucket(d, d->evtchn_group[i][j]);
+        xfree(d->evtchn_group[i]);
+        d->evtchn_group[i] = NULL;
     }
+    free_evtchn_bucket(d, d->evtchn);
+    d->evtchn = NULL;
     spin_unlock(&d->event_lock);
 
     clear_global_virq_handlers(d);
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 6933f02..cba09e7 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -69,15 +69,37 @@ int guest_enabled_event(struct vcpu *v, uint32_t virq);
 /* Notify remote end of a Xen-attached event channel.*/
 void notify_via_xen_event_channel(struct domain *ld, int lport);
 
-/* Internal event channel object accessors */
-#define bucket_from_port(d,p) \
-    ((d)->evtchn[(p)/EVTCHNS_PER_BUCKET])
-#define port_is_valid(d,p)    \
-    (((p) >= 0) && ((p) < (d)->max_evtchns) &&  \
-     (bucket_from_port(d,p) != NULL))
-#define evtchn_from_port(d,p) \
-    (&(bucket_from_port(d,p))[(p)&(EVTCHNS_PER_BUCKET-1)])
+/*
+ * Internal event channel object storage.
+ *
+ * The objects (struct evtchn) are indexed using a two level scheme of
+ * groups and buckets.  Each group is a page of bucket pointers.  Each
+ * bucket is a page-sized array of struct evtchn's.
+ *
+ * The first bucket is directly accessed via d->evtchn.
+ */
+#define group_from_port(d, p) \
+    ((d)->evtchn_group[(p) / EVTCHNS_PER_GROUP])
+#define bucket_from_port(d, p) \
+    ((group_from_port(d, p))[((p) % EVTCHNS_PER_GROUP) / EVTCHNS_PER_BUCKET])
 
+static inline bool_t port_is_valid(struct domain *d, unsigned int p)
+{
+    if ( p >= d->max_evtchns )
+        return 0;
+    if ( !d->evtchn )
+        return 0;
+    if ( p < EVTCHNS_PER_BUCKET )
+        return 1;
+    return group_from_port(d, p) != NULL && bucket_from_port(d, p) != NULL;
+}
+
+static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
+{
+    if ( p < EVTCHNS_PER_BUCKET )
+        return &d->evtchn[p];
+    return bucket_from_port(d, p) + (p % EVTCHNS_PER_BUCKET);
+}
 
 /* Wait on a Xen-attached event channel. */
 #define wait_on_xen_event_channel(port, condition)                      \
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index f8fc7c2..2090a41 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -50,8 +50,22 @@ extern struct domain *dom0;
 #else
 #define BITS_PER_EVTCHN_WORD(d) (has_32bit_shinfo(d) ? 32 : BITS_PER_XEN_ULONG)
 #endif
-#define EVTCHNS_PER_BUCKET 128
-#define NR_EVTCHN_BUCKETS  (NR_EVENT_CHANNELS / EVTCHNS_PER_BUCKET)
+
+#define BUCKETS_PER_GROUP  (PAGE_SIZE/sizeof(struct evtchn *))
+/* Round size of struct evtchn up to power of 2 size */
+#define __RDU2(x)   (       (x) | (   (x) >> 1))
+#define __RDU4(x)   ( __RDU2(x) | ( __RDU2(x) >> 2))
+#define __RDU8(x)   ( __RDU4(x) | ( __RDU4(x) >> 4))
+#define __RDU16(x)  ( __RDU8(x) | ( __RDU8(x) >> 8))
+#define __RDU32(x)  (__RDU16(x) | (__RDU16(x) >>16))
+#define next_power_of_2(x)      (__RDU32((x)-1) + 1)
+
+/* Maximum number of event channels for any ABI. */
+#define MAX_NR_EVTCHNS NR_EVENT_CHANNELS
+
+#define EVTCHNS_PER_BUCKET (PAGE_SIZE / next_power_of_2(sizeof(struct evtchn)))
+#define EVTCHNS_PER_GROUP  (BUCKETS_PER_GROUP * EVTCHNS_PER_BUCKET)
+#define NR_EVTCHN_GROUPS   DIV_ROUND_UP(MAX_NR_EVTCHNS, EVTCHNS_PER_GROUP)
 
 struct evtchn
 {
@@ -271,7 +285,8 @@ struct domain
     spinlock_t       rangesets_lock;
 
     /* Event channel information. */
-    struct evtchn   *evtchn[NR_EVTCHN_BUCKETS];
+    struct evtchn   *evtchn;                         /* first bucket only */
+    struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
     unsigned int     max_evtchns;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_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 Oct 16 05:13:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:13: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 1VWJQT-0008T7-W3; Wed, 16 Oct 2013 05:13: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 1VWJQS-0008Ss-D7
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:40 +0000
Received: from [85.158.139.211:8230] by server-14.bemta-5.messagelabs.com id
	1D/F6-29404-3802E525; Wed, 16 Oct 2013 05:13:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1381900417!1413141!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5849 invoked from network); 16 Oct 2013 05:13:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:13:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQP-0006Su-Iv
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQP-0007N1-Hp
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:37 +0000
Date: Wed, 16 Oct 2013 05:13:37 +0000
Message-Id: <E1VWJQP-0007N1-Hp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: add FIFO-based event channel
	ABI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d2d50c2f308f8b5a9e30cb4a4bebf23aa81211f5
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:20:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:20:02 2013 +0200

    evtchn: add FIFO-based event channel ABI
    
    Add the event channel hypercall sub-ops and the definitions for the
    shared data structures for the FIFO-based event channel ABI.
    
    The design document for this new ABI is available here:
    
    http://xenbits.xen.org/people/dvrabel/event-channels-F.pdf
    
    In summary, events are reported using a per-domain shared event array
    of event words.  Each event word has PENDING, LINKED and MASKED bits
    and a LINK field for pointing to the next event in the event queue.
    
    There are 16 event queues (with different priorities) per-VCPU.
    
    Key advantages of this new ABI include:
    
    - Support for over 100,000 events (2^17).
    - 16 different event priorities.
    - Improved fairness in event latency through the use of FIFOs.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/public/event_channel.h |   75 ++++++++++++++++++++++++++++++++++++
 xen/include/public/xen.h           |    6 ++-
 xen/include/xen/sched.h            |    2 +-
 3 files changed, 80 insertions(+), 3 deletions(-)

diff --git a/xen/include/public/event_channel.h b/xen/include/public/event_channel.h
index 472efdb..4a53484 100644
--- a/xen/include/public/event_channel.h
+++ b/xen/include/public/event_channel.h
@@ -71,6 +71,9 @@
 #define EVTCHNOP_bind_vcpu        8
 #define EVTCHNOP_unmask           9
 #define EVTCHNOP_reset           10
+#define EVTCHNOP_init_control    11
+#define EVTCHNOP_expand_array    12
+#define EVTCHNOP_set_priority    13
 /* ` } */
 
 typedef uint32_t evtchn_port_t;
@@ -258,6 +261,43 @@ struct evtchn_reset {
 typedef struct evtchn_reset evtchn_reset_t;
 
 /*
+ * EVTCHNOP_init_control: initialize the control block for the FIFO ABI.
+ *
+ * Note: any events that are currently pending will not be resent and
+ * will be lost.  Guests should call this before binding any event to
+ * avoid losing any events.
+ */
+struct evtchn_init_control {
+    /* IN parameters. */
+    uint64_t control_gfn;
+    uint32_t offset;
+    uint32_t vcpu;
+    /* OUT parameters. */
+    uint8_t link_bits;
+    uint8_t _pad[7];
+};
+typedef struct evtchn_init_control evtchn_init_control_t;
+
+/*
+ * EVTCHNOP_expand_array: add an additional page to the event array.
+ */
+struct evtchn_expand_array {
+    /* IN parameters. */
+    uint64_t array_gfn;
+};
+typedef struct evtchn_expand_array evtchn_expand_array_t;
+
+/*
+ * EVTCHNOP_set_priority: set the priority for an event channel.
+ */
+struct evtchn_set_priority {
+    /* IN parameters. */
+    uint32_t port;
+    uint32_t priority;
+};
+typedef struct evtchn_set_priority evtchn_set_priority_t;
+
+/*
  * ` enum neg_errnoval
  * ` HYPERVISOR_event_channel_op_compat(struct evtchn_op *op)
  * `
@@ -281,6 +321,41 @@ struct evtchn_op {
 typedef struct evtchn_op evtchn_op_t;
 DEFINE_XEN_GUEST_HANDLE(evtchn_op_t);
 
+/*
+ * 2-level ABI
+ */
+
+#define EVTCHN_2L_NR_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
+
+/*
+ * FIFO ABI
+ */
+
+/* Events may have priorities from 0 (highest) to 15 (lowest). */
+#define EVTCHN_FIFO_PRIORITY_MAX     0
+#define EVTCHN_FIFO_PRIORITY_DEFAULT 7
+#define EVTCHN_FIFO_PRIORITY_MIN     15
+
+#define EVTCHN_FIFO_MAX_QUEUES (EVTCHN_FIFO_PRIORITY_MIN + 1)
+
+typedef uint32_t event_word_t;
+
+#define EVTCHN_FIFO_PENDING 31
+#define EVTCHN_FIFO_MASKED  30
+#define EVTCHN_FIFO_LINKED  29
+
+#define EVTCHN_FIFO_LINK_BITS 17
+#define EVTCHN_FIFO_LINK_MASK ((1 << EVTCHN_FIFO_LINK_BITS) - 1)
+
+#define EVTCHN_FIFO_NR_CHANNELS (1 << EVTCHN_FIFO_LINK_BITS)
+
+struct evtchn_fifo_control_block {
+    uint32_t ready;
+    uint32_t _rsvd;
+    uint32_t head[EVTCHN_FIFO_MAX_QUEUES];
+};
+typedef struct evtchn_fifo_control_block evtchn_fifo_control_block_t;
+
 #endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
 
 /*
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index b50bd05..8c5697e 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -552,11 +552,13 @@ struct multicall_entry {
 typedef struct multicall_entry multicall_entry_t;
 DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);
 
+#if __XEN_INTERFACE_VERSION__ < 0x00040400
 /*
- * Event channel endpoints per domain:
+ * Event channel endpoints per domain (when using the 2-level ABI):
  *  1024 if a long is 32 bits; 4096 if a long is 64 bits.
  */
-#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
+#define NR_EVENT_CHANNELS EVTCHN_2L_NR_CHANNELS
+#endif
 
 struct vcpu_time_info {
     /*
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 2090a41..1bc6475 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -61,7 +61,7 @@ extern struct domain *dom0;
 #define next_power_of_2(x)      (__RDU32((x)-1) + 1)
 
 /* Maximum number of event channels for any ABI. */
-#define MAX_NR_EVTCHNS NR_EVENT_CHANNELS
+#define MAX_NR_EVTCHNS EVTCHN_2L_NR_CHANNELS
 
 #define EVTCHNS_PER_BUCKET (PAGE_SIZE / next_power_of_2(sizeof(struct evtchn)))
 #define EVTCHNS_PER_GROUP  (BUCKETS_PER_GROUP * EVTCHNS_PER_BUCKET)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:13:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:13: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 1VWJQT-0008T7-W3; Wed, 16 Oct 2013 05:13: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 1VWJQS-0008Ss-D7
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:40 +0000
Received: from [85.158.139.211:8230] by server-14.bemta-5.messagelabs.com id
	1D/F6-29404-3802E525; Wed, 16 Oct 2013 05:13:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1381900417!1413141!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5849 invoked from network); 16 Oct 2013 05:13:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:13:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQP-0006Su-Iv
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQP-0007N1-Hp
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:37 +0000
Date: Wed, 16 Oct 2013 05:13:37 +0000
Message-Id: <E1VWJQP-0007N1-Hp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: add FIFO-based event channel
	ABI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d2d50c2f308f8b5a9e30cb4a4bebf23aa81211f5
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:20:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:20:02 2013 +0200

    evtchn: add FIFO-based event channel ABI
    
    Add the event channel hypercall sub-ops and the definitions for the
    shared data structures for the FIFO-based event channel ABI.
    
    The design document for this new ABI is available here:
    
    http://xenbits.xen.org/people/dvrabel/event-channels-F.pdf
    
    In summary, events are reported using a per-domain shared event array
    of event words.  Each event word has PENDING, LINKED and MASKED bits
    and a LINK field for pointing to the next event in the event queue.
    
    There are 16 event queues (with different priorities) per-VCPU.
    
    Key advantages of this new ABI include:
    
    - Support for over 100,000 events (2^17).
    - 16 different event priorities.
    - Improved fairness in event latency through the use of FIFOs.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/public/event_channel.h |   75 ++++++++++++++++++++++++++++++++++++
 xen/include/public/xen.h           |    6 ++-
 xen/include/xen/sched.h            |    2 +-
 3 files changed, 80 insertions(+), 3 deletions(-)

diff --git a/xen/include/public/event_channel.h b/xen/include/public/event_channel.h
index 472efdb..4a53484 100644
--- a/xen/include/public/event_channel.h
+++ b/xen/include/public/event_channel.h
@@ -71,6 +71,9 @@
 #define EVTCHNOP_bind_vcpu        8
 #define EVTCHNOP_unmask           9
 #define EVTCHNOP_reset           10
+#define EVTCHNOP_init_control    11
+#define EVTCHNOP_expand_array    12
+#define EVTCHNOP_set_priority    13
 /* ` } */
 
 typedef uint32_t evtchn_port_t;
@@ -258,6 +261,43 @@ struct evtchn_reset {
 typedef struct evtchn_reset evtchn_reset_t;
 
 /*
+ * EVTCHNOP_init_control: initialize the control block for the FIFO ABI.
+ *
+ * Note: any events that are currently pending will not be resent and
+ * will be lost.  Guests should call this before binding any event to
+ * avoid losing any events.
+ */
+struct evtchn_init_control {
+    /* IN parameters. */
+    uint64_t control_gfn;
+    uint32_t offset;
+    uint32_t vcpu;
+    /* OUT parameters. */
+    uint8_t link_bits;
+    uint8_t _pad[7];
+};
+typedef struct evtchn_init_control evtchn_init_control_t;
+
+/*
+ * EVTCHNOP_expand_array: add an additional page to the event array.
+ */
+struct evtchn_expand_array {
+    /* IN parameters. */
+    uint64_t array_gfn;
+};
+typedef struct evtchn_expand_array evtchn_expand_array_t;
+
+/*
+ * EVTCHNOP_set_priority: set the priority for an event channel.
+ */
+struct evtchn_set_priority {
+    /* IN parameters. */
+    uint32_t port;
+    uint32_t priority;
+};
+typedef struct evtchn_set_priority evtchn_set_priority_t;
+
+/*
  * ` enum neg_errnoval
  * ` HYPERVISOR_event_channel_op_compat(struct evtchn_op *op)
  * `
@@ -281,6 +321,41 @@ struct evtchn_op {
 typedef struct evtchn_op evtchn_op_t;
 DEFINE_XEN_GUEST_HANDLE(evtchn_op_t);
 
+/*
+ * 2-level ABI
+ */
+
+#define EVTCHN_2L_NR_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
+
+/*
+ * FIFO ABI
+ */
+
+/* Events may have priorities from 0 (highest) to 15 (lowest). */
+#define EVTCHN_FIFO_PRIORITY_MAX     0
+#define EVTCHN_FIFO_PRIORITY_DEFAULT 7
+#define EVTCHN_FIFO_PRIORITY_MIN     15
+
+#define EVTCHN_FIFO_MAX_QUEUES (EVTCHN_FIFO_PRIORITY_MIN + 1)
+
+typedef uint32_t event_word_t;
+
+#define EVTCHN_FIFO_PENDING 31
+#define EVTCHN_FIFO_MASKED  30
+#define EVTCHN_FIFO_LINKED  29
+
+#define EVTCHN_FIFO_LINK_BITS 17
+#define EVTCHN_FIFO_LINK_MASK ((1 << EVTCHN_FIFO_LINK_BITS) - 1)
+
+#define EVTCHN_FIFO_NR_CHANNELS (1 << EVTCHN_FIFO_LINK_BITS)
+
+struct evtchn_fifo_control_block {
+    uint32_t ready;
+    uint32_t _rsvd;
+    uint32_t head[EVTCHN_FIFO_MAX_QUEUES];
+};
+typedef struct evtchn_fifo_control_block evtchn_fifo_control_block_t;
+
 #endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
 
 /*
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index b50bd05..8c5697e 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -552,11 +552,13 @@ struct multicall_entry {
 typedef struct multicall_entry multicall_entry_t;
 DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);
 
+#if __XEN_INTERFACE_VERSION__ < 0x00040400
 /*
- * Event channel endpoints per domain:
+ * Event channel endpoints per domain (when using the 2-level ABI):
  *  1024 if a long is 32 bits; 4096 if a long is 64 bits.
  */
-#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
+#define NR_EVENT_CHANNELS EVTCHN_2L_NR_CHANNELS
+#endif
 
 struct vcpu_time_info {
     /*
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 2090a41..1bc6475 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -61,7 +61,7 @@ extern struct domain *dom0;
 #define next_power_of_2(x)      (__RDU32((x)-1) + 1)
 
 /* Maximum number of event channels for any ABI. */
-#define MAX_NR_EVTCHNS NR_EVENT_CHANNELS
+#define MAX_NR_EVTCHNS EVTCHN_2L_NR_CHANNELS
 
 #define EVTCHNS_PER_BUCKET (PAGE_SIZE / next_power_of_2(sizeof(struct evtchn)))
 #define EVTCHNS_PER_GROUP  (BUCKETS_PER_GROUP * EVTCHNS_PER_BUCKET)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:13:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:13: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 1VWJQe-0008VK-5M; Wed, 16 Oct 2013 05:13:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQc-0008Uw-H4
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:50 +0000
Received: from [85.158.139.211:18321] by server-12.bemta-5.messagelabs.com id
	3A/4B-15833-D802E525; Wed, 16 Oct 2013 05:13:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1381900427!1611740!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11932 invoked from network); 16 Oct 2013 05:13:48 -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;
	16 Oct 2013 05:13:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQZ-0006T0-OC
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQZ-0007NN-N8
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:47 +0000
Date: Wed, 16 Oct 2013 05:13:47 +0000
Message-Id: <E1VWJQZ-0007NN-N8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: implement
	EVTCHNOP_set_priority and add the set_priority hook
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit edc8872aeb4a6e6a50775d6088aab97324ee3e15
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:21:06 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:21:06 2013 +0200

    evtchn: implement EVTCHNOP_set_priority and add the set_priority hook
    
    Implement EVTCHNOP_set_priority.  A new set_priority hook added to
    struct evtchn_port_ops will do the ABI specific validation and setup.
    
    If an ABI does not provide a set_priority hook (as is the case of the
    2-level ABI), the sub-op will return -ENOSYS.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/event_channel.c |   29 +++++++++++++++++++++++++++++
 xen/include/xen/event.h    |   11 +++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 87bca94..340bf32 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -955,6 +955,27 @@ out:
     return rc;
 }
 
+static long evtchn_set_priority(const struct evtchn_set_priority *set_priority)
+{
+    struct domain *d = current->domain;
+    unsigned int port = set_priority->port;
+    long ret;
+
+    spin_lock(&d->event_lock);
+
+    if ( !port_is_valid(d, port) )
+    {
+        spin_unlock(&d->event_lock);
+        return -EINVAL;
+    }
+
+    ret = evtchn_port_set_priority(d, evtchn_from_port(d, port),
+                                   set_priority->priority);
+
+    spin_unlock(&d->event_lock);
+
+    return ret;
+}
 
 long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
@@ -1064,6 +1085,14 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
+    case EVTCHNOP_set_priority: {
+        struct evtchn_set_priority set_priority;
+        if ( copy_from_guest(&set_priority, arg, 1) != 0 )
+            return -EFAULT;
+        rc = evtchn_set_priority(&set_priority);
+        break;
+    }
+
     default:
         rc = -ENOSYS;
         break;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index cba09e7..70fc271 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -137,6 +137,8 @@ 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);
+    int (*set_priority)(struct domain *d, struct evtchn *evtchn,
+                        unsigned int priority);
     void (*print_state)(struct domain *d, const struct evtchn *evtchn);
 };
 
@@ -170,6 +172,15 @@ static inline bool_t evtchn_port_is_masked(struct domain *d,
     return d->evtchn_port_ops->is_masked(d, evtchn);
 }
 
+static inline int evtchn_port_set_priority(struct domain *d,
+                                           struct evtchn *evtchn,
+                                           unsigned int priority)
+{
+    if ( !d->evtchn_port_ops->set_priority )
+        return -ENOSYS;
+    return d->evtchn_port_ops->set_priority(d, evtchn, priority);
+}
+
 static inline void evtchn_port_print_state(struct domain *d,
                                            const struct evtchn *evtchn)
 {
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:13:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:13: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 1VWJQe-0008VK-5M; Wed, 16 Oct 2013 05:13:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQc-0008Uw-H4
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:50 +0000
Received: from [85.158.139.211:18321] by server-12.bemta-5.messagelabs.com id
	3A/4B-15833-D802E525; Wed, 16 Oct 2013 05:13:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1381900427!1611740!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11932 invoked from network); 16 Oct 2013 05:13:48 -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;
	16 Oct 2013 05:13:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQZ-0006T0-OC
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQZ-0007NN-N8
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:47 +0000
Date: Wed, 16 Oct 2013 05:13:47 +0000
Message-Id: <E1VWJQZ-0007NN-N8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: implement
	EVTCHNOP_set_priority and add the set_priority hook
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit edc8872aeb4a6e6a50775d6088aab97324ee3e15
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:21:06 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:21:06 2013 +0200

    evtchn: implement EVTCHNOP_set_priority and add the set_priority hook
    
    Implement EVTCHNOP_set_priority.  A new set_priority hook added to
    struct evtchn_port_ops will do the ABI specific validation and setup.
    
    If an ABI does not provide a set_priority hook (as is the case of the
    2-level ABI), the sub-op will return -ENOSYS.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/event_channel.c |   29 +++++++++++++++++++++++++++++
 xen/include/xen/event.h    |   11 +++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 87bca94..340bf32 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -955,6 +955,27 @@ out:
     return rc;
 }
 
+static long evtchn_set_priority(const struct evtchn_set_priority *set_priority)
+{
+    struct domain *d = current->domain;
+    unsigned int port = set_priority->port;
+    long ret;
+
+    spin_lock(&d->event_lock);
+
+    if ( !port_is_valid(d, port) )
+    {
+        spin_unlock(&d->event_lock);
+        return -EINVAL;
+    }
+
+    ret = evtchn_port_set_priority(d, evtchn_from_port(d, port),
+                                   set_priority->priority);
+
+    spin_unlock(&d->event_lock);
+
+    return ret;
+}
 
 long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
@@ -1064,6 +1085,14 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
+    case EVTCHNOP_set_priority: {
+        struct evtchn_set_priority set_priority;
+        if ( copy_from_guest(&set_priority, arg, 1) != 0 )
+            return -EFAULT;
+        rc = evtchn_set_priority(&set_priority);
+        break;
+    }
+
     default:
         rc = -ENOSYS;
         break;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index cba09e7..70fc271 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -137,6 +137,8 @@ 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);
+    int (*set_priority)(struct domain *d, struct evtchn *evtchn,
+                        unsigned int priority);
     void (*print_state)(struct domain *d, const struct evtchn *evtchn);
 };
 
@@ -170,6 +172,15 @@ static inline bool_t evtchn_port_is_masked(struct domain *d,
     return d->evtchn_port_ops->is_masked(d, evtchn);
 }
 
+static inline int evtchn_port_set_priority(struct domain *d,
+                                           struct evtchn *evtchn,
+                                           unsigned int priority)
+{
+    if ( !d->evtchn_port_ops->set_priority )
+        return -ENOSYS;
+    return d->evtchn_port_ops->set_priority(d, evtchn, priority);
+}
+
 static inline void evtchn_port_print_state(struct domain *d,
                                            const struct evtchn *evtchn)
 {
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:14:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:14:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWJQq-00005s-8z; Wed, 16 Oct 2013 05:14:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQn-00005Q-Kw
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:02 +0000
Received: from [85.158.137.68:54482] by server-8.bemta-3.messagelabs.com id
	76/2F-06638-8902E525; Wed, 16 Oct 2013 05:14:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1381900438!1685602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4472 invoked from network); 16 Oct 2013 05:13:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:13:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQj-0006T9-Uc
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQj-0007Nj-Ry
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:57 +0000
Date: Wed, 16 Oct 2013 05:13:57 +0000
Message-Id: <E1VWJQj-0007Nj-Ry@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: add FIFO-based event channel
	hypercalls and port ops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 88910061ec615b2d05e721a82c37139e05df0712
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:22:07 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:22:07 2013 +0200

    evtchn: add FIFO-based event channel hypercalls and port ops
    
    Add the implementation for the FIFO-based event channel ABI.  The new
    hypercall sub-ops (EVTCHNOP_init_control, EVTCHNOP_expand_array) and
    the required evtchn_ops (set_pending, unmask, etc.).
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/Makefile          |    1 +
 xen/common/event_channel.c   |   21 ++
 xen/common/event_fifo.c      |  445 ++++++++++++++++++++++++++++++++++++++++++
 xen/include/xen/event_fifo.h |   47 +++++
 xen/include/xen/sched.h      |    6 +-
 5 files changed, 519 insertions(+), 1 deletions(-)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index f6c473a..686f7a1 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -7,6 +7,7 @@ obj-y += domctl.o
 obj-y += domain.o
 obj-y += event_2l.o
 obj-y += event_channel.o
+obj-y += event_fifo.o
 obj-y += grant_table.o
 obj-y += irq.o
 obj-y += kernel.o
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 340bf32..0c0bbe4 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -26,6 +26,7 @@
 #include <xen/compat.h>
 #include <xen/guest_access.h>
 #include <xen/keyhandler.h>
+#include <xen/event_fifo.h>
 #include <asm/current.h>
 
 #include <public/xen.h>
@@ -1085,6 +1086,24 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
+    case EVTCHNOP_init_control: {
+        struct evtchn_init_control init_control;
+        if ( copy_from_guest(&init_control, arg, 1) != 0 )
+            return -EFAULT;
+        rc = evtchn_fifo_init_control(&init_control);
+        if ( !rc && __copy_to_guest(arg, &init_control, 1) )
+            rc = -EFAULT;
+        break;
+    }
+
+    case EVTCHNOP_expand_array: {
+        struct evtchn_expand_array expand_array;
+        if ( copy_from_guest(&expand_array, arg, 1) != 0 )
+            return -EFAULT;
+        rc = evtchn_fifo_expand_array(&expand_array);
+        break;
+    }
+
     case EVTCHNOP_set_priority: {
         struct evtchn_set_priority set_priority;
         if ( copy_from_guest(&set_priority, arg, 1) != 0 )
@@ -1269,6 +1288,8 @@ void evtchn_destroy(struct domain *d)
     spin_unlock(&d->event_lock);
 
     clear_global_virq_handlers(d);
+
+    evtchn_fifo_destroy(d);
 }
 
 
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
new file mode 100644
index 0000000..eb0b97c
--- /dev/null
+++ b/xen/common/event_fifo.c
@@ -0,0 +1,445 @@
+/*
+ * FIFO event channel management.
+ *
+ * Copyright (C) 2013 Citrix Systems R&D Ltd.
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2 or later.  See the file COPYING for more details.
+ */
+
+#include <xen/config.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/errno.h>
+#include <xen/sched.h>
+#include <xen/event.h>
+#include <xen/event_fifo.h>
+#include <xen/paging.h>
+#include <xen/mm.h>
+
+#include <public/event_channel.h>
+
+static inline event_word_t *evtchn_fifo_word_from_port(struct domain *d,
+                                                       unsigned int port)
+{
+    unsigned int p, w;
+
+    if ( unlikely(port >= d->evtchn_fifo->num_evtchns) )
+        return NULL;
+
+    p = port / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
+    w = port % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
+
+    return d->evtchn_fifo->event_array[p] + w;
+}
+
+static bool_t evtchn_fifo_set_link(event_word_t *word, uint32_t link)
+{
+    event_word_t n, o, w;
+
+    w = *word;
+
+    do {
+        if ( !(w & (1 << EVTCHN_FIFO_LINKED)) )
+            return 0;
+        o = w;
+        n = (w & ~EVTCHN_FIFO_LINK_MASK) | link;
+    } while ( (w = cmpxchg(word, o, n)) != o );
+
+    return 1;
+}
+
+static void evtchn_fifo_set_pending(struct vcpu *v, struct evtchn *evtchn)
+{
+    struct domain *d = v->domain;
+    unsigned int port;
+    event_word_t *word;
+    struct evtchn_fifo_queue *q;
+    unsigned long flags;
+    bool_t was_pending;
+
+    port = evtchn->port;
+    word = evtchn_fifo_word_from_port(d, port);
+    if ( unlikely(!word) )
+        return;
+
+    /*
+     * No locking around getting the queue. This may race with
+     * changing the priority but we are allowed to signal the event
+     * once on the old priority.
+     */
+    q = &v->evtchn_fifo->queue[evtchn->priority];
+
+    was_pending = test_and_set_bit(EVTCHN_FIFO_PENDING, word);
+
+    /*
+     * Link the event if it unmasked and not already linked.
+     */
+    if ( !test_bit(EVTCHN_FIFO_MASKED, word)
+         && !test_and_set_bit(EVTCHN_FIFO_LINKED, word) )
+    {
+        event_word_t *tail_word;
+        bool_t linked = 0;
+
+        spin_lock_irqsave(&q->lock, flags);
+
+        /*
+         * Atomically link the tail to port iff the tail is linked.
+         * If the tail is unlinked the queue is empty.
+         *
+         * If port is the same as tail, the queue is empty but q->tail
+         * will appear linked as we just set LINKED above.
+         *
+         * If the queue is empty (i.e., we haven't linked to the new
+         * event), head must be updated.
+         */
+        if ( port != q->tail )
+        {
+            tail_word = evtchn_fifo_word_from_port(d, q->tail);
+            linked = evtchn_fifo_set_link(tail_word, port);
+        }
+        if ( !linked )
+            write_atomic(q->head, port);
+        q->tail = port;
+
+        spin_unlock_irqrestore(&q->lock, flags);
+
+        if ( !test_and_set_bit(q->priority,
+                               &v->evtchn_fifo->control_block->ready) )
+            vcpu_mark_events_pending(v);
+    }
+
+    if ( !was_pending )
+        evtchn_check_pollers(d, port);
+}
+
+static void evtchn_fifo_clear_pending(struct domain *d, struct evtchn *evtchn)
+{
+    event_word_t *word;
+
+    word = evtchn_fifo_word_from_port(d, evtchn->port);
+    if ( unlikely(!word) )
+        return;
+
+    /*
+     * Just clear the P bit.
+     *
+     * No need to unlink as the guest will unlink and ignore
+     * non-pending events.
+     */
+    clear_bit(EVTCHN_FIFO_PENDING, word);
+}
+
+static void evtchn_fifo_unmask(struct domain *d, struct evtchn *evtchn)
+{
+    struct vcpu *v = d->vcpu[evtchn->notify_vcpu_id];
+    event_word_t *word;
+
+    word = evtchn_fifo_word_from_port(d, evtchn->port);
+    if ( unlikely(!word) )
+        return;
+
+    clear_bit(EVTCHN_FIFO_MASKED, word);
+
+    /* Relink if pending. */
+    if ( test_bit(EVTCHN_FIFO_PENDING, word) )
+        evtchn_fifo_set_pending(v, evtchn);
+}
+
+static bool_t evtchn_fifo_is_pending(struct domain *d,
+                                     const struct evtchn *evtchn)
+{
+    event_word_t *word;
+
+    word = evtchn_fifo_word_from_port(d, evtchn->port);
+    if ( unlikely(!word) )
+        return 0;
+
+    return test_bit(EVTCHN_FIFO_PENDING, word);
+}
+
+static bool_t evtchn_fifo_is_masked(struct domain *d,
+                                    const struct evtchn *evtchn)
+{
+    event_word_t *word;
+
+    word = evtchn_fifo_word_from_port(d, evtchn->port);
+    if ( unlikely(!word) )
+        return 1;
+
+    return test_bit(EVTCHN_FIFO_MASKED, word);
+}
+
+static int evtchn_fifo_set_priority(struct domain *d, struct evtchn *evtchn,
+                                    unsigned int priority)
+{
+    if ( priority > EVTCHN_FIFO_PRIORITY_MIN )
+        return -EINVAL;
+
+    /*
+     * Only need to switch to the new queue for future events. If the
+     * event is already pending or in the process of being linked it
+     * will be on the old queue -- this is fine.
+     */
+    evtchn->priority = priority;
+
+    return 0;
+}
+
+static void evtchn_fifo_print_state(struct domain *d,
+                                    const struct evtchn *evtchn)
+{
+    event_word_t *word;
+
+    word = evtchn_fifo_word_from_port(d, evtchn->port);
+    if ( !word )
+        printk("?   ");
+    else if ( test_bit(EVTCHN_FIFO_LINKED, word) )
+        printk("%-4u", *word & EVTCHN_FIFO_LINK_MASK);
+    else
+        printk("-   ");
+}
+
+static const struct evtchn_port_ops evtchn_port_ops_fifo =
+{
+    .set_pending   = evtchn_fifo_set_pending,
+    .clear_pending = evtchn_fifo_clear_pending,
+    .unmask        = evtchn_fifo_unmask,
+    .is_pending    = evtchn_fifo_is_pending,
+    .is_masked     = evtchn_fifo_is_masked,
+    .set_priority  = evtchn_fifo_set_priority,
+    .print_state   = evtchn_fifo_print_state,
+};
+
+static int map_guest_page(struct domain *d, uint64_t gfn, void **virt)
+{
+    struct page_info *p;
+
+    p = get_page_from_gfn(d, gfn, NULL, P2M_ALLOC);
+    if ( !p )
+        return -EINVAL;
+
+    if ( !get_page_type(p, PGT_writable_page) )
+    {
+        put_page(p);
+        return -EINVAL;
+    }
+
+    *virt = map_domain_page_global(gfn);
+    if ( !*virt )
+    {
+        put_page_and_type(p);
+        return -ENOMEM;
+    }
+    return 0;
+}
+
+static void unmap_guest_page(void *virt)
+{
+    struct page_info *page;
+
+    if ( !virt )
+        return;
+
+    virt = (void *)((unsigned long)virt & PAGE_MASK);
+    page = mfn_to_page(domain_page_map_to_mfn(virt));
+
+    unmap_domain_page_global(virt);
+    put_page_and_type(page);
+}
+
+static void init_queue(struct vcpu *v, struct evtchn_fifo_queue *q,
+                       unsigned int i)
+{
+    spin_lock_init(&q->lock);
+    q->priority = i;
+    q->head = &v->evtchn_fifo->control_block->head[i];
+}
+
+static int setup_control_block(struct vcpu *v, uint64_t gfn, uint32_t offset)
+{
+    struct domain *d = v->domain;
+    struct evtchn_fifo_vcpu *efv;
+    void *virt;
+    unsigned int i;
+    int rc;
+
+    if ( v->evtchn_fifo )
+        return -EINVAL;
+
+    efv = xzalloc(struct evtchn_fifo_vcpu);
+    if ( !efv )
+        return -ENOMEM;
+
+    rc = map_guest_page(d, gfn, &virt);
+    if ( rc < 0 )
+    {
+        xfree(efv);
+        return rc;
+    }
+
+    v->evtchn_fifo = efv;
+    v->evtchn_fifo->control_block = virt + offset;
+
+    for ( i = 0; i <= EVTCHN_FIFO_PRIORITY_MIN; i++ )
+        init_queue(v, &v->evtchn_fifo->queue[i], i);
+
+    return 0;
+}
+
+static void cleanup_control_block(struct vcpu *v)
+{
+    if ( !v->evtchn_fifo )
+        return;
+
+    unmap_guest_page(v->evtchn_fifo->control_block);
+    xfree(v->evtchn_fifo);
+    v->evtchn_fifo = NULL;
+}
+
+/*
+ * Setup an event array with no pages.
+ */
+static int setup_event_array(struct domain *d)
+{
+    d->evtchn_fifo = xzalloc(struct evtchn_fifo_domain);
+    if ( !d->evtchn_fifo )
+        return -ENOMEM;
+
+    return 0;
+}
+
+static void cleanup_event_array(struct domain *d)
+{
+    unsigned int i;
+
+    if ( !d->evtchn_fifo )
+        return;
+
+    for ( i = 0; i < EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES; i++ )
+        unmap_guest_page(d->evtchn_fifo->event_array[i]);
+    xfree(d->evtchn_fifo);
+}
+
+static void set_priority_all(struct domain *d, unsigned int priority)
+{
+    unsigned int port;
+
+    for ( port = 1; port < d->max_evtchns; port++ )
+    {
+        if ( !port_is_valid(d, port) )
+            break;
+
+        evtchn_port_set_priority(d, evtchn_from_port(d, port), priority);
+    }
+}
+
+int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
+{
+    struct domain *d = current->domain;
+    uint32_t vcpu_id;
+    uint64_t gfn;
+    uint32_t offset;
+    struct vcpu *v;
+    int rc;
+
+    init_control->link_bits = EVTCHN_FIFO_LINK_BITS;
+
+    vcpu_id = init_control->vcpu;
+    gfn     = init_control->control_gfn;
+    offset  = init_control->offset;
+
+    if ( vcpu_id >= d->max_vcpus || !d->vcpu[vcpu_id] )
+        return -ENOENT;
+    v = d->vcpu[vcpu_id];
+
+    /* Must not cross page boundary. */
+    if ( offset > (PAGE_SIZE - sizeof(evtchn_fifo_control_block_t)) )
+        return -EINVAL;
+
+    /* Must be 8-bytes aligned. */
+    if ( offset & (8 - 1) )
+        return -EINVAL;
+
+    spin_lock(&d->event_lock);
+
+    rc = setup_control_block(v, gfn, offset);
+
+    /*
+     * If this is the first control block, setup an empty event array
+     * and switch to the fifo port ops.
+     *
+     * Any ports currently bound will have their priority set to the
+     * default.
+     */
+    if ( rc == 0 && !d->evtchn_fifo )
+    {
+        rc = setup_event_array(d);
+        if ( rc < 0 )
+            cleanup_control_block(v);
+        else
+        {
+            d->evtchn_port_ops = &evtchn_port_ops_fifo;
+            d->max_evtchns = EVTCHN_FIFO_NR_CHANNELS;
+            set_priority_all(d, EVTCHN_FIFO_PRIORITY_DEFAULT);
+        }
+    }
+
+    spin_unlock(&d->event_lock);
+
+    return rc;
+}
+
+static int add_page_to_event_array(struct domain *d, unsigned long gfn)
+{
+    void *virt;
+    unsigned int slot;
+    int rc;
+
+    slot = d->evtchn_fifo->num_evtchns / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
+    if ( slot >= EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES )
+        return -ENOSPC;
+
+    rc = map_guest_page(d, gfn, &virt);
+    if ( rc < 0 )
+        return rc;
+
+    d->evtchn_fifo->event_array[slot] = virt;
+    d->evtchn_fifo->num_evtchns += EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
+
+    return 0;
+}
+
+int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array)
+{
+    struct domain *d = current->domain;
+    int rc;
+
+    if ( !d->evtchn_fifo )
+        return -ENOSYS;
+
+    spin_lock(&d->event_lock);
+    rc = add_page_to_event_array(d, expand_array->array_gfn);
+    spin_unlock(&d->event_lock);
+
+    return rc;
+}
+
+void evtchn_fifo_destroy(struct domain *d)
+{
+    struct vcpu *v;
+
+    for_each_vcpu( d, v )
+        cleanup_control_block(v);
+    cleanup_event_array(d);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/event_fifo.h b/xen/include/xen/event_fifo.h
new file mode 100644
index 0000000..4115f6f
--- /dev/null
+++ b/xen/include/xen/event_fifo.h
@@ -0,0 +1,47 @@
+/*
+ * FIFO-based event channel ABI.
+ *
+ * Copyright (C) 2013 Citrix Systems R&D Ltd.
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2 or later.  See the file COPYING for more details.
+ */
+#ifndef __XEN_EVENT_FIFO_H__
+#define __XEN_EVENT_FIFO_H__
+
+struct evtchn_fifo_queue {
+    uint32_t *head; /* points into control block */
+    uint32_t tail;
+    uint8_t priority;
+    spinlock_t lock;
+};
+
+struct evtchn_fifo_vcpu {
+    struct evtchn_fifo_control_block *control_block;
+    struct evtchn_fifo_queue queue[EVTCHN_FIFO_MAX_QUEUES];
+};
+
+#define EVTCHN_FIFO_EVENT_WORDS_PER_PAGE (PAGE_SIZE / sizeof(event_word_t))
+#define EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES \
+    (EVTCHN_FIFO_NR_CHANNELS / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE)
+
+struct evtchn_fifo_domain {
+    event_word_t *event_array[EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES];
+    unsigned int num_evtchns;
+};
+
+int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
+int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
+void evtchn_fifo_destroy(struct domain *domain);
+
+#endif /* __XEN_EVENT_FIFO_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 1bc6475..ca7e417 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -61,7 +61,7 @@ extern struct domain *dom0;
 #define next_power_of_2(x)      (__RDU32((x)-1) + 1)
 
 /* Maximum number of event channels for any ABI. */
-#define MAX_NR_EVTCHNS EVTCHN_2L_NR_CHANNELS
+#define MAX_NR_EVTCHNS MAX(EVTCHN_2L_NR_CHANNELS, EVTCHN_FIFO_NR_CHANNELS)
 
 #define EVTCHNS_PER_BUCKET (PAGE_SIZE / next_power_of_2(sizeof(struct evtchn)))
 #define EVTCHNS_PER_GROUP  (BUCKETS_PER_GROUP * EVTCHNS_PER_BUCKET)
@@ -95,6 +95,7 @@ struct evtchn
         } pirq;        /* state == ECS_PIRQ */
         u16 virq;      /* state == ECS_VIRQ */
     } u;
+    u8 priority;
 #ifdef FLASK_ENABLE
     void *ssid;
 #endif
@@ -209,6 +210,8 @@ struct vcpu
     /* Guest-specified relocation of vcpu_info. */
     unsigned long vcpu_info_mfn;
 
+    struct evtchn_fifo_vcpu *evtchn_fifo;
+
     struct arch_vcpu arch;
 };
 
@@ -290,6 +293,7 @@ struct domain
     unsigned int     max_evtchns;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
+    struct evtchn_fifo_domain *evtchn_fifo;
 
     struct grant_table *grant_table;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:14:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:14:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWJQq-00005s-8z; Wed, 16 Oct 2013 05:14:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQn-00005Q-Kw
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:02 +0000
Received: from [85.158.137.68:54482] by server-8.bemta-3.messagelabs.com id
	76/2F-06638-8902E525; Wed, 16 Oct 2013 05:14:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1381900438!1685602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4472 invoked from network); 16 Oct 2013 05:13:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:13:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQj-0006T9-Uc
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQj-0007Nj-Ry
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:13:57 +0000
Date: Wed, 16 Oct 2013 05:13:57 +0000
Message-Id: <E1VWJQj-0007Nj-Ry@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn: add FIFO-based event channel
	hypercalls and port ops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 88910061ec615b2d05e721a82c37139e05df0712
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:22:07 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:22:07 2013 +0200

    evtchn: add FIFO-based event channel hypercalls and port ops
    
    Add the implementation for the FIFO-based event channel ABI.  The new
    hypercall sub-ops (EVTCHNOP_init_control, EVTCHNOP_expand_array) and
    the required evtchn_ops (set_pending, unmask, etc.).
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/Makefile          |    1 +
 xen/common/event_channel.c   |   21 ++
 xen/common/event_fifo.c      |  445 ++++++++++++++++++++++++++++++++++++++++++
 xen/include/xen/event_fifo.h |   47 +++++
 xen/include/xen/sched.h      |    6 +-
 5 files changed, 519 insertions(+), 1 deletions(-)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index f6c473a..686f7a1 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -7,6 +7,7 @@ obj-y += domctl.o
 obj-y += domain.o
 obj-y += event_2l.o
 obj-y += event_channel.o
+obj-y += event_fifo.o
 obj-y += grant_table.o
 obj-y += irq.o
 obj-y += kernel.o
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 340bf32..0c0bbe4 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -26,6 +26,7 @@
 #include <xen/compat.h>
 #include <xen/guest_access.h>
 #include <xen/keyhandler.h>
+#include <xen/event_fifo.h>
 #include <asm/current.h>
 
 #include <public/xen.h>
@@ -1085,6 +1086,24 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
+    case EVTCHNOP_init_control: {
+        struct evtchn_init_control init_control;
+        if ( copy_from_guest(&init_control, arg, 1) != 0 )
+            return -EFAULT;
+        rc = evtchn_fifo_init_control(&init_control);
+        if ( !rc && __copy_to_guest(arg, &init_control, 1) )
+            rc = -EFAULT;
+        break;
+    }
+
+    case EVTCHNOP_expand_array: {
+        struct evtchn_expand_array expand_array;
+        if ( copy_from_guest(&expand_array, arg, 1) != 0 )
+            return -EFAULT;
+        rc = evtchn_fifo_expand_array(&expand_array);
+        break;
+    }
+
     case EVTCHNOP_set_priority: {
         struct evtchn_set_priority set_priority;
         if ( copy_from_guest(&set_priority, arg, 1) != 0 )
@@ -1269,6 +1288,8 @@ void evtchn_destroy(struct domain *d)
     spin_unlock(&d->event_lock);
 
     clear_global_virq_handlers(d);
+
+    evtchn_fifo_destroy(d);
 }
 
 
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
new file mode 100644
index 0000000..eb0b97c
--- /dev/null
+++ b/xen/common/event_fifo.c
@@ -0,0 +1,445 @@
+/*
+ * FIFO event channel management.
+ *
+ * Copyright (C) 2013 Citrix Systems R&D Ltd.
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2 or later.  See the file COPYING for more details.
+ */
+
+#include <xen/config.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/errno.h>
+#include <xen/sched.h>
+#include <xen/event.h>
+#include <xen/event_fifo.h>
+#include <xen/paging.h>
+#include <xen/mm.h>
+
+#include <public/event_channel.h>
+
+static inline event_word_t *evtchn_fifo_word_from_port(struct domain *d,
+                                                       unsigned int port)
+{
+    unsigned int p, w;
+
+    if ( unlikely(port >= d->evtchn_fifo->num_evtchns) )
+        return NULL;
+
+    p = port / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
+    w = port % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
+
+    return d->evtchn_fifo->event_array[p] + w;
+}
+
+static bool_t evtchn_fifo_set_link(event_word_t *word, uint32_t link)
+{
+    event_word_t n, o, w;
+
+    w = *word;
+
+    do {
+        if ( !(w & (1 << EVTCHN_FIFO_LINKED)) )
+            return 0;
+        o = w;
+        n = (w & ~EVTCHN_FIFO_LINK_MASK) | link;
+    } while ( (w = cmpxchg(word, o, n)) != o );
+
+    return 1;
+}
+
+static void evtchn_fifo_set_pending(struct vcpu *v, struct evtchn *evtchn)
+{
+    struct domain *d = v->domain;
+    unsigned int port;
+    event_word_t *word;
+    struct evtchn_fifo_queue *q;
+    unsigned long flags;
+    bool_t was_pending;
+
+    port = evtchn->port;
+    word = evtchn_fifo_word_from_port(d, port);
+    if ( unlikely(!word) )
+        return;
+
+    /*
+     * No locking around getting the queue. This may race with
+     * changing the priority but we are allowed to signal the event
+     * once on the old priority.
+     */
+    q = &v->evtchn_fifo->queue[evtchn->priority];
+
+    was_pending = test_and_set_bit(EVTCHN_FIFO_PENDING, word);
+
+    /*
+     * Link the event if it unmasked and not already linked.
+     */
+    if ( !test_bit(EVTCHN_FIFO_MASKED, word)
+         && !test_and_set_bit(EVTCHN_FIFO_LINKED, word) )
+    {
+        event_word_t *tail_word;
+        bool_t linked = 0;
+
+        spin_lock_irqsave(&q->lock, flags);
+
+        /*
+         * Atomically link the tail to port iff the tail is linked.
+         * If the tail is unlinked the queue is empty.
+         *
+         * If port is the same as tail, the queue is empty but q->tail
+         * will appear linked as we just set LINKED above.
+         *
+         * If the queue is empty (i.e., we haven't linked to the new
+         * event), head must be updated.
+         */
+        if ( port != q->tail )
+        {
+            tail_word = evtchn_fifo_word_from_port(d, q->tail);
+            linked = evtchn_fifo_set_link(tail_word, port);
+        }
+        if ( !linked )
+            write_atomic(q->head, port);
+        q->tail = port;
+
+        spin_unlock_irqrestore(&q->lock, flags);
+
+        if ( !test_and_set_bit(q->priority,
+                               &v->evtchn_fifo->control_block->ready) )
+            vcpu_mark_events_pending(v);
+    }
+
+    if ( !was_pending )
+        evtchn_check_pollers(d, port);
+}
+
+static void evtchn_fifo_clear_pending(struct domain *d, struct evtchn *evtchn)
+{
+    event_word_t *word;
+
+    word = evtchn_fifo_word_from_port(d, evtchn->port);
+    if ( unlikely(!word) )
+        return;
+
+    /*
+     * Just clear the P bit.
+     *
+     * No need to unlink as the guest will unlink and ignore
+     * non-pending events.
+     */
+    clear_bit(EVTCHN_FIFO_PENDING, word);
+}
+
+static void evtchn_fifo_unmask(struct domain *d, struct evtchn *evtchn)
+{
+    struct vcpu *v = d->vcpu[evtchn->notify_vcpu_id];
+    event_word_t *word;
+
+    word = evtchn_fifo_word_from_port(d, evtchn->port);
+    if ( unlikely(!word) )
+        return;
+
+    clear_bit(EVTCHN_FIFO_MASKED, word);
+
+    /* Relink if pending. */
+    if ( test_bit(EVTCHN_FIFO_PENDING, word) )
+        evtchn_fifo_set_pending(v, evtchn);
+}
+
+static bool_t evtchn_fifo_is_pending(struct domain *d,
+                                     const struct evtchn *evtchn)
+{
+    event_word_t *word;
+
+    word = evtchn_fifo_word_from_port(d, evtchn->port);
+    if ( unlikely(!word) )
+        return 0;
+
+    return test_bit(EVTCHN_FIFO_PENDING, word);
+}
+
+static bool_t evtchn_fifo_is_masked(struct domain *d,
+                                    const struct evtchn *evtchn)
+{
+    event_word_t *word;
+
+    word = evtchn_fifo_word_from_port(d, evtchn->port);
+    if ( unlikely(!word) )
+        return 1;
+
+    return test_bit(EVTCHN_FIFO_MASKED, word);
+}
+
+static int evtchn_fifo_set_priority(struct domain *d, struct evtchn *evtchn,
+                                    unsigned int priority)
+{
+    if ( priority > EVTCHN_FIFO_PRIORITY_MIN )
+        return -EINVAL;
+
+    /*
+     * Only need to switch to the new queue for future events. If the
+     * event is already pending or in the process of being linked it
+     * will be on the old queue -- this is fine.
+     */
+    evtchn->priority = priority;
+
+    return 0;
+}
+
+static void evtchn_fifo_print_state(struct domain *d,
+                                    const struct evtchn *evtchn)
+{
+    event_word_t *word;
+
+    word = evtchn_fifo_word_from_port(d, evtchn->port);
+    if ( !word )
+        printk("?   ");
+    else if ( test_bit(EVTCHN_FIFO_LINKED, word) )
+        printk("%-4u", *word & EVTCHN_FIFO_LINK_MASK);
+    else
+        printk("-   ");
+}
+
+static const struct evtchn_port_ops evtchn_port_ops_fifo =
+{
+    .set_pending   = evtchn_fifo_set_pending,
+    .clear_pending = evtchn_fifo_clear_pending,
+    .unmask        = evtchn_fifo_unmask,
+    .is_pending    = evtchn_fifo_is_pending,
+    .is_masked     = evtchn_fifo_is_masked,
+    .set_priority  = evtchn_fifo_set_priority,
+    .print_state   = evtchn_fifo_print_state,
+};
+
+static int map_guest_page(struct domain *d, uint64_t gfn, void **virt)
+{
+    struct page_info *p;
+
+    p = get_page_from_gfn(d, gfn, NULL, P2M_ALLOC);
+    if ( !p )
+        return -EINVAL;
+
+    if ( !get_page_type(p, PGT_writable_page) )
+    {
+        put_page(p);
+        return -EINVAL;
+    }
+
+    *virt = map_domain_page_global(gfn);
+    if ( !*virt )
+    {
+        put_page_and_type(p);
+        return -ENOMEM;
+    }
+    return 0;
+}
+
+static void unmap_guest_page(void *virt)
+{
+    struct page_info *page;
+
+    if ( !virt )
+        return;
+
+    virt = (void *)((unsigned long)virt & PAGE_MASK);
+    page = mfn_to_page(domain_page_map_to_mfn(virt));
+
+    unmap_domain_page_global(virt);
+    put_page_and_type(page);
+}
+
+static void init_queue(struct vcpu *v, struct evtchn_fifo_queue *q,
+                       unsigned int i)
+{
+    spin_lock_init(&q->lock);
+    q->priority = i;
+    q->head = &v->evtchn_fifo->control_block->head[i];
+}
+
+static int setup_control_block(struct vcpu *v, uint64_t gfn, uint32_t offset)
+{
+    struct domain *d = v->domain;
+    struct evtchn_fifo_vcpu *efv;
+    void *virt;
+    unsigned int i;
+    int rc;
+
+    if ( v->evtchn_fifo )
+        return -EINVAL;
+
+    efv = xzalloc(struct evtchn_fifo_vcpu);
+    if ( !efv )
+        return -ENOMEM;
+
+    rc = map_guest_page(d, gfn, &virt);
+    if ( rc < 0 )
+    {
+        xfree(efv);
+        return rc;
+    }
+
+    v->evtchn_fifo = efv;
+    v->evtchn_fifo->control_block = virt + offset;
+
+    for ( i = 0; i <= EVTCHN_FIFO_PRIORITY_MIN; i++ )
+        init_queue(v, &v->evtchn_fifo->queue[i], i);
+
+    return 0;
+}
+
+static void cleanup_control_block(struct vcpu *v)
+{
+    if ( !v->evtchn_fifo )
+        return;
+
+    unmap_guest_page(v->evtchn_fifo->control_block);
+    xfree(v->evtchn_fifo);
+    v->evtchn_fifo = NULL;
+}
+
+/*
+ * Setup an event array with no pages.
+ */
+static int setup_event_array(struct domain *d)
+{
+    d->evtchn_fifo = xzalloc(struct evtchn_fifo_domain);
+    if ( !d->evtchn_fifo )
+        return -ENOMEM;
+
+    return 0;
+}
+
+static void cleanup_event_array(struct domain *d)
+{
+    unsigned int i;
+
+    if ( !d->evtchn_fifo )
+        return;
+
+    for ( i = 0; i < EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES; i++ )
+        unmap_guest_page(d->evtchn_fifo->event_array[i]);
+    xfree(d->evtchn_fifo);
+}
+
+static void set_priority_all(struct domain *d, unsigned int priority)
+{
+    unsigned int port;
+
+    for ( port = 1; port < d->max_evtchns; port++ )
+    {
+        if ( !port_is_valid(d, port) )
+            break;
+
+        evtchn_port_set_priority(d, evtchn_from_port(d, port), priority);
+    }
+}
+
+int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
+{
+    struct domain *d = current->domain;
+    uint32_t vcpu_id;
+    uint64_t gfn;
+    uint32_t offset;
+    struct vcpu *v;
+    int rc;
+
+    init_control->link_bits = EVTCHN_FIFO_LINK_BITS;
+
+    vcpu_id = init_control->vcpu;
+    gfn     = init_control->control_gfn;
+    offset  = init_control->offset;
+
+    if ( vcpu_id >= d->max_vcpus || !d->vcpu[vcpu_id] )
+        return -ENOENT;
+    v = d->vcpu[vcpu_id];
+
+    /* Must not cross page boundary. */
+    if ( offset > (PAGE_SIZE - sizeof(evtchn_fifo_control_block_t)) )
+        return -EINVAL;
+
+    /* Must be 8-bytes aligned. */
+    if ( offset & (8 - 1) )
+        return -EINVAL;
+
+    spin_lock(&d->event_lock);
+
+    rc = setup_control_block(v, gfn, offset);
+
+    /*
+     * If this is the first control block, setup an empty event array
+     * and switch to the fifo port ops.
+     *
+     * Any ports currently bound will have their priority set to the
+     * default.
+     */
+    if ( rc == 0 && !d->evtchn_fifo )
+    {
+        rc = setup_event_array(d);
+        if ( rc < 0 )
+            cleanup_control_block(v);
+        else
+        {
+            d->evtchn_port_ops = &evtchn_port_ops_fifo;
+            d->max_evtchns = EVTCHN_FIFO_NR_CHANNELS;
+            set_priority_all(d, EVTCHN_FIFO_PRIORITY_DEFAULT);
+        }
+    }
+
+    spin_unlock(&d->event_lock);
+
+    return rc;
+}
+
+static int add_page_to_event_array(struct domain *d, unsigned long gfn)
+{
+    void *virt;
+    unsigned int slot;
+    int rc;
+
+    slot = d->evtchn_fifo->num_evtchns / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
+    if ( slot >= EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES )
+        return -ENOSPC;
+
+    rc = map_guest_page(d, gfn, &virt);
+    if ( rc < 0 )
+        return rc;
+
+    d->evtchn_fifo->event_array[slot] = virt;
+    d->evtchn_fifo->num_evtchns += EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
+
+    return 0;
+}
+
+int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array)
+{
+    struct domain *d = current->domain;
+    int rc;
+
+    if ( !d->evtchn_fifo )
+        return -ENOSYS;
+
+    spin_lock(&d->event_lock);
+    rc = add_page_to_event_array(d, expand_array->array_gfn);
+    spin_unlock(&d->event_lock);
+
+    return rc;
+}
+
+void evtchn_fifo_destroy(struct domain *d)
+{
+    struct vcpu *v;
+
+    for_each_vcpu( d, v )
+        cleanup_control_block(v);
+    cleanup_event_array(d);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/event_fifo.h b/xen/include/xen/event_fifo.h
new file mode 100644
index 0000000..4115f6f
--- /dev/null
+++ b/xen/include/xen/event_fifo.h
@@ -0,0 +1,47 @@
+/*
+ * FIFO-based event channel ABI.
+ *
+ * Copyright (C) 2013 Citrix Systems R&D Ltd.
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2 or later.  See the file COPYING for more details.
+ */
+#ifndef __XEN_EVENT_FIFO_H__
+#define __XEN_EVENT_FIFO_H__
+
+struct evtchn_fifo_queue {
+    uint32_t *head; /* points into control block */
+    uint32_t tail;
+    uint8_t priority;
+    spinlock_t lock;
+};
+
+struct evtchn_fifo_vcpu {
+    struct evtchn_fifo_control_block *control_block;
+    struct evtchn_fifo_queue queue[EVTCHN_FIFO_MAX_QUEUES];
+};
+
+#define EVTCHN_FIFO_EVENT_WORDS_PER_PAGE (PAGE_SIZE / sizeof(event_word_t))
+#define EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES \
+    (EVTCHN_FIFO_NR_CHANNELS / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE)
+
+struct evtchn_fifo_domain {
+    event_word_t *event_array[EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES];
+    unsigned int num_evtchns;
+};
+
+int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
+int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
+void evtchn_fifo_destroy(struct domain *domain);
+
+#endif /* __XEN_EVENT_FIFO_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 1bc6475..ca7e417 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -61,7 +61,7 @@ extern struct domain *dom0;
 #define next_power_of_2(x)      (__RDU32((x)-1) + 1)
 
 /* Maximum number of event channels for any ABI. */
-#define MAX_NR_EVTCHNS EVTCHN_2L_NR_CHANNELS
+#define MAX_NR_EVTCHNS MAX(EVTCHN_2L_NR_CHANNELS, EVTCHN_FIFO_NR_CHANNELS)
 
 #define EVTCHNS_PER_BUCKET (PAGE_SIZE / next_power_of_2(sizeof(struct evtchn)))
 #define EVTCHNS_PER_GROUP  (BUCKETS_PER_GROUP * EVTCHNS_PER_BUCKET)
@@ -95,6 +95,7 @@ struct evtchn
         } pirq;        /* state == ECS_PIRQ */
         u16 virq;      /* state == ECS_VIRQ */
     } u;
+    u8 priority;
 #ifdef FLASK_ENABLE
     void *ssid;
 #endif
@@ -209,6 +210,8 @@ struct vcpu
     /* Guest-specified relocation of vcpu_info. */
     unsigned long vcpu_info_mfn;
 
+    struct evtchn_fifo_vcpu *evtchn_fifo;
+
     struct arch_vcpu arch;
 };
 
@@ -290,6 +293,7 @@ struct domain
     unsigned int     max_evtchns;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
+    struct evtchn_fifo_domain *evtchn_fifo;
 
     struct grant_table *grant_table;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:14:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:14: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 1VWJQy-00007d-CX; Wed, 16 Oct 2013 05:14: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 1VWJQx-00007G-4V
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:11 +0000
Received: from [85.158.139.211:18945] by server-11.bemta-5.messagelabs.com id
	19/71-03454-2A02E525; Wed, 16 Oct 2013 05:14:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1381900448!1605341!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=2.5 required=7.0 tests=BODY_RANDOM_LONG,LONGWORDS
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18660 invoked from network); 16 Oct 2013 05:14:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:14:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQu-0006Ti-46
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQu-0007Ol-2a
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:08 +0000
Date: Wed, 16 Oct 2013 05:14:08 +0000
Message-Id: <E1VWJQu-0007Ol-2a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Add DOMCTL to limit the number of
	event channels a domain may use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ec7763c807f252e930c9647a0631253db2844a7
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:23:10 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:23:10 2013 +0200

    Add DOMCTL to limit the number of event channels a domain may use
    
    Add XEN_DOMCTL_set_max_evtchn which may be used during domain creation to
    set the maximum event channel port a domain may use.  This may be used to
    limit the amount of Xen resources (global mapping space and xenheap) that
    a domain may use for event channels.
    
    A domain that does not have a limit set may use all the event channels
    supported by the event channel ABI in use.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/modules/xen/xen.if |    2 +-
 tools/flask/policy/policy/modules/xen/xen.te |    2 +-
 xen/common/domctl.c                          |    8 ++++++++
 xen/common/event_channel.c                   |    7 ++++++-
 xen/include/public/domctl.h                  |   13 +++++++++++++
 xen/include/xen/sched.h                      |    1 +
 xen/xsm/flask/hooks.c                        |    3 +++
 xen/xsm/flask/policy/access_vectors          |    2 ++
 8 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 97af0a8..dedc035 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -49,7 +49,7 @@ define(`create_domain_common', `
 			getdomaininfo hypercall setvcpucontext setextvcpucontext
 			getscheduler getvcpuinfo getvcpuextstate getaddrsize
 			getaffinity setaffinity };
-	allow $1 $2:domain2 { set_cpuid settsc setscheduler setclaim };
+	allow $1 $2:domain2 { set_cpuid settsc setscheduler setclaim  set_max_evtchn };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op };
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index c89ce28..bb59fe8 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -76,7 +76,7 @@ allow dom0_t dom0_t:domain {
 	getpodtarget setpodtarget set_misc_info set_virq_handler
 };
 allow dom0_t dom0_t:domain2 {
-	set_cpuid gettsc settsc setscheduler
+	set_cpuid gettsc settsc setscheduler set_max_evtchn
 };
 allow dom0_t dom0_t:resource { add remove };
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 9760d50..870eef1 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -863,6 +863,14 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
     break;
 
+    case XEN_DOMCTL_set_max_evtchn:
+    {
+        d->max_evtchn_port = min_t(unsigned int,
+                                   op->u.set_max_evtchn.max_port,
+                                   INT_MAX);
+    }
+    break;
+
     default:
         ret = arch_do_domctl(op, d, u_domctl);
         break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 0c0bbe4..34efd24 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -168,10 +168,14 @@ static int get_free_port(struct domain *d)
         return -EINVAL;
 
     for ( port = 0; port_is_valid(d, port); port++ )
+    {
+        if ( port > d->max_evtchn_port )
+            return -ENOSPC;
         if ( evtchn_from_port(d, port)->state == ECS_FREE )
             return port;
+    }
 
-    if ( port == d->max_evtchns )
+    if ( port == d->max_evtchns || port > d->max_evtchn_port )
         return -ENOSPC;
 
     if ( !group_from_port(d, port) )
@@ -1230,6 +1234,7 @@ void evtchn_check_pollers(struct domain *d, unsigned int port)
 int evtchn_init(struct domain *d)
 {
     evtchn_2l_init(d);
+    d->max_evtchn_port = INT_MAX;
 
     d->evtchn = alloc_evtchn_bucket(d, 0);
     if ( !d->evtchn )
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 4c5b2bb..d4e479f 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -852,6 +852,17 @@ struct xen_domctl_set_broken_page_p2m {
 typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
 
+/*
+ * XEN_DOMCTL_set_max_evtchn: sets the maximum event channel port
+ * number the guest may use.  Use this limit the amount of resources
+ * (global mapping space, xenheap) a guest may use for event channels.
+ */
+struct xen_domctl_set_max_evtchn {
+    uint32_t max_port;
+};
+typedef struct xen_domctl_set_max_evtchn xen_domctl_set_max_evtchn_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_max_evtchn_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -920,6 +931,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_setnodeaffinity               68
 #define XEN_DOMCTL_getnodeaffinity               69
+#define XEN_DOMCTL_set_max_evtchn                70
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -975,6 +987,7 @@ struct xen_domctl {
         struct xen_domctl_set_access_required access_required;
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
+        struct xen_domctl_set_max_evtchn    set_max_evtchn;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
         struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index ca7e417..c2588a5 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -291,6 +291,7 @@ struct domain
     struct evtchn   *evtchn;                         /* first bucket only */
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
     unsigned int     max_evtchns;
+    unsigned int     max_evtchn_port;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index fa0589a..b1e2593 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -727,6 +727,9 @@ static int flask_domctl(struct domain *d, int cmd)
     case XEN_DOMCTL_audit_p2m:
         return current_has_perm(d, SECCLASS_HVM, HVM__AUDIT_P2M);
 
+    case XEN_DOMCTL_set_max_evtchn:
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SET_MAX_EVTCHN);
+
     default:
         printk("flask_domctl: Unknown op %d\n", cmd);
         return -EPERM;
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index 5dfe13b..1fbe241 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -194,6 +194,8 @@ class domain2
     setscheduler
 # XENMEM_claim_pages
     setclaim
+# XEN_DOMCTL_set_max_evtchn
+    set_max_evtchn
 }
 
 # Similar to class domain, but primarily contains domctls related to HVM 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 Wed Oct 16 05:14:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:14: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 1VWJQy-00007d-CX; Wed, 16 Oct 2013 05:14: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 1VWJQx-00007G-4V
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:11 +0000
Received: from [85.158.139.211:18945] by server-11.bemta-5.messagelabs.com id
	19/71-03454-2A02E525; Wed, 16 Oct 2013 05:14:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1381900448!1605341!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=2.5 required=7.0 tests=BODY_RANDOM_LONG,LONGWORDS
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18660 invoked from network); 16 Oct 2013 05:14:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:14:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQu-0006Ti-46
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJQu-0007Ol-2a
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:08 +0000
Date: Wed, 16 Oct 2013 05:14:08 +0000
Message-Id: <E1VWJQu-0007Ol-2a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Add DOMCTL to limit the number of
	event channels a domain may use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ec7763c807f252e930c9647a0631253db2844a7
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:23:10 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:23:10 2013 +0200

    Add DOMCTL to limit the number of event channels a domain may use
    
    Add XEN_DOMCTL_set_max_evtchn which may be used during domain creation to
    set the maximum event channel port a domain may use.  This may be used to
    limit the amount of Xen resources (global mapping space and xenheap) that
    a domain may use for event channels.
    
    A domain that does not have a limit set may use all the event channels
    supported by the event channel ABI in use.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/modules/xen/xen.if |    2 +-
 tools/flask/policy/policy/modules/xen/xen.te |    2 +-
 xen/common/domctl.c                          |    8 ++++++++
 xen/common/event_channel.c                   |    7 ++++++-
 xen/include/public/domctl.h                  |   13 +++++++++++++
 xen/include/xen/sched.h                      |    1 +
 xen/xsm/flask/hooks.c                        |    3 +++
 xen/xsm/flask/policy/access_vectors          |    2 ++
 8 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 97af0a8..dedc035 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -49,7 +49,7 @@ define(`create_domain_common', `
 			getdomaininfo hypercall setvcpucontext setextvcpucontext
 			getscheduler getvcpuinfo getvcpuextstate getaddrsize
 			getaffinity setaffinity };
-	allow $1 $2:domain2 { set_cpuid settsc setscheduler setclaim };
+	allow $1 $2:domain2 { set_cpuid settsc setscheduler setclaim  set_max_evtchn };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op };
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index c89ce28..bb59fe8 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -76,7 +76,7 @@ allow dom0_t dom0_t:domain {
 	getpodtarget setpodtarget set_misc_info set_virq_handler
 };
 allow dom0_t dom0_t:domain2 {
-	set_cpuid gettsc settsc setscheduler
+	set_cpuid gettsc settsc setscheduler set_max_evtchn
 };
 allow dom0_t dom0_t:resource { add remove };
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 9760d50..870eef1 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -863,6 +863,14 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
     break;
 
+    case XEN_DOMCTL_set_max_evtchn:
+    {
+        d->max_evtchn_port = min_t(unsigned int,
+                                   op->u.set_max_evtchn.max_port,
+                                   INT_MAX);
+    }
+    break;
+
     default:
         ret = arch_do_domctl(op, d, u_domctl);
         break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 0c0bbe4..34efd24 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -168,10 +168,14 @@ static int get_free_port(struct domain *d)
         return -EINVAL;
 
     for ( port = 0; port_is_valid(d, port); port++ )
+    {
+        if ( port > d->max_evtchn_port )
+            return -ENOSPC;
         if ( evtchn_from_port(d, port)->state == ECS_FREE )
             return port;
+    }
 
-    if ( port == d->max_evtchns )
+    if ( port == d->max_evtchns || port > d->max_evtchn_port )
         return -ENOSPC;
 
     if ( !group_from_port(d, port) )
@@ -1230,6 +1234,7 @@ void evtchn_check_pollers(struct domain *d, unsigned int port)
 int evtchn_init(struct domain *d)
 {
     evtchn_2l_init(d);
+    d->max_evtchn_port = INT_MAX;
 
     d->evtchn = alloc_evtchn_bucket(d, 0);
     if ( !d->evtchn )
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 4c5b2bb..d4e479f 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -852,6 +852,17 @@ struct xen_domctl_set_broken_page_p2m {
 typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
 
+/*
+ * XEN_DOMCTL_set_max_evtchn: sets the maximum event channel port
+ * number the guest may use.  Use this limit the amount of resources
+ * (global mapping space, xenheap) a guest may use for event channels.
+ */
+struct xen_domctl_set_max_evtchn {
+    uint32_t max_port;
+};
+typedef struct xen_domctl_set_max_evtchn xen_domctl_set_max_evtchn_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_max_evtchn_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -920,6 +931,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_setnodeaffinity               68
 #define XEN_DOMCTL_getnodeaffinity               69
+#define XEN_DOMCTL_set_max_evtchn                70
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -975,6 +987,7 @@ struct xen_domctl {
         struct xen_domctl_set_access_required access_required;
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
+        struct xen_domctl_set_max_evtchn    set_max_evtchn;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
         struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index ca7e417..c2588a5 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -291,6 +291,7 @@ struct domain
     struct evtchn   *evtchn;                         /* first bucket only */
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
     unsigned int     max_evtchns;
+    unsigned int     max_evtchn_port;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index fa0589a..b1e2593 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -727,6 +727,9 @@ static int flask_domctl(struct domain *d, int cmd)
     case XEN_DOMCTL_audit_p2m:
         return current_has_perm(d, SECCLASS_HVM, HVM__AUDIT_P2M);
 
+    case XEN_DOMCTL_set_max_evtchn:
+        return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__SET_MAX_EVTCHN);
+
     default:
         printk("flask_domctl: Unknown op %d\n", cmd);
         return -EPERM;
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index 5dfe13b..1fbe241 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -194,6 +194,8 @@ class domain2
     setscheduler
 # XENMEM_claim_pages
     setclaim
+# XEN_DOMCTL_set_max_evtchn
+    set_max_evtchn
 }
 
 # Similar to class domain, but primarily contains domctls related to HVM 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 Wed Oct 16 05:14:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:14: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 1VWJR8-00009f-IK; Wed, 16 Oct 2013 05:14:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJR6-00009L-Tv
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:21 +0000
Received: from [85.158.143.35:36421] by server-2.bemta-4.messagelabs.com id
	FA/D8-06473-CA02E525; Wed, 16 Oct 2013 05:14:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1381900458!2118515!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22102 invoked from network); 16 Oct 2013 05:14:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:14:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJR4-0006To-Bc
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJR4-0007Pc-8b
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:18 +0000
Date: Wed, 16 Oct 2013 05:14:18 +0000
Message-Id: <E1VWJR4-0007Pc-8b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: add xc_domain_set_max_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 783b9e67f963bbb068b68fea4426131858145b0f
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:24:03 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:24:03 2013 +0200

    libxc: add xc_domain_set_max_evtchn()
    
    Add xc_domain_set_max_evtchn(), a wrapper around the
    DOMCTL_set_max_evtchn hypercall.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 tools/libxc/xc_domain.c |   11 +++++++++++
 tools/libxc/xenctrl.h   |   12 ++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 81316d3..2cea6e3 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1766,6 +1766,17 @@ int xc_domain_set_virq_handler(xc_interface *xch, uint32_t domid, int virq)
     return do_domctl(xch, &domctl);
 }
 
+int xc_domain_set_max_evtchn(xc_interface *xch, uint32_t domid,
+                             uint32_t max_port)
+{
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_max_evtchn;
+    domctl.domain = domid;
+    domctl.u.set_max_evtchn.max_port = max_port;
+    return do_domctl(xch, &domctl);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 58d51f3..8cf3f3b 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -847,6 +847,18 @@ int xc_domain_set_access_required(xc_interface *xch,
  */
 int xc_domain_set_virq_handler(xc_interface *xch, uint32_t domid, int virq);
 
+/**
+ * Set the maximum event channel port a domain may bind.
+ *
+ * This does not affect ports that are already bound.
+ *
+ * @param xch a handle to an open hypervisor interface
+ * @param domid the domain id
+ * @param max_port maximum port number
+ */
+int xc_domain_set_max_evtchn(xc_interface *xch, uint32_t domid,
+                             uint32_t max_port);
+
 /*
  * CPUPOOL MANAGEMENT FUNCTIONS
  */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:14:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:14: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 1VWJR8-00009f-IK; Wed, 16 Oct 2013 05:14:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJR6-00009L-Tv
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:21 +0000
Received: from [85.158.143.35:36421] by server-2.bemta-4.messagelabs.com id
	FA/D8-06473-CA02E525; Wed, 16 Oct 2013 05:14:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1381900458!2118515!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22102 invoked from network); 16 Oct 2013 05:14:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:14:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJR4-0006To-Bc
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJR4-0007Pc-8b
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:18 +0000
Date: Wed, 16 Oct 2013 05:14:18 +0000
Message-Id: <E1VWJR4-0007Pc-8b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: add xc_domain_set_max_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 783b9e67f963bbb068b68fea4426131858145b0f
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:24:03 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:24:03 2013 +0200

    libxc: add xc_domain_set_max_evtchn()
    
    Add xc_domain_set_max_evtchn(), a wrapper around the
    DOMCTL_set_max_evtchn hypercall.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 tools/libxc/xc_domain.c |   11 +++++++++++
 tools/libxc/xenctrl.h   |   12 ++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 81316d3..2cea6e3 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1766,6 +1766,17 @@ int xc_domain_set_virq_handler(xc_interface *xch, uint32_t domid, int virq)
     return do_domctl(xch, &domctl);
 }
 
+int xc_domain_set_max_evtchn(xc_interface *xch, uint32_t domid,
+                             uint32_t max_port)
+{
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_max_evtchn;
+    domctl.domain = domid;
+    domctl.u.set_max_evtchn.max_port = max_port;
+    return do_domctl(xch, &domctl);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 58d51f3..8cf3f3b 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -847,6 +847,18 @@ int xc_domain_set_access_required(xc_interface *xch,
  */
 int xc_domain_set_virq_handler(xc_interface *xch, uint32_t domid, int virq);
 
+/**
+ * Set the maximum event channel port a domain may bind.
+ *
+ * This does not affect ports that are already bound.
+ *
+ * @param xch a handle to an open hypervisor interface
+ * @param domid the domain id
+ * @param max_port maximum port number
+ */
+int xc_domain_set_max_evtchn(xc_interface *xch, uint32_t domid,
+                             uint32_t max_port);
+
 /*
  * CPUPOOL MANAGEMENT FUNCTIONS
  */
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:14:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:14: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 1VWJRI-0000BT-LZ; Wed, 16 Oct 2013 05:14:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRH-0000B9-7E
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:31 +0000
Received: from [85.158.137.68:28063] by server-14.bemta-3.messagelabs.com id
	82/C8-20312-6B02E525; Wed, 16 Oct 2013 05:14:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1381900468!1677243!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17716 invoked from network); 16 Oct 2013 05:14:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:14:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRE-0006Tw-IE
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRE-0007Py-Fp
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:28 +0000
Date: Wed, 16 Oct 2013 05:14:28 +0000
Message-Id: <E1VWJRE-0007Py-Fp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl,
	xl: add max_event_channels option to xl configuration 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 a77eb86f44e52c5aea7f0ba7023600c043a9cdcd
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:25:39 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:25:39 2013 +0200

    libxl,xl: add max_event_channels option to xl configuration file
    
    Add the 'max_event_channels' option to the xl configuration file to
    limit the number of event channels that domain may use.
    
    Plumb this option through to libxl via a new libxl_build_info field
    and call xc_domain_set_max_evtchn() in the post build stage of domain
    creation.
    
    A new LIBXL_HAVE_BUILDINFO_EVENT_CHANNELS #define indicates that this
    new field is available.
    
    The default value of 1023 limits the domain to using the minimum
    amount of global mapping pages and at most 5 xenheap pages.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 docs/man/xl.cfg.pod.5       |   11 +++++++++++
 tools/libxl/libxl.h         |    5 +++++
 tools/libxl/libxl_create.c  |    3 +++
 tools/libxl/libxl_dom.c     |    7 +++++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    3 +++
 6 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index cd96969..278dba1 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -580,6 +580,17 @@ Allow a guest to access specific physical IRQs.
 It is recommended to use this option only for trusted VMs under
 administrator control.
 
+=item B<max_event_channels=N>
+
+Limit the guest to using at most N event channels (PV interrupts).
+Guests use hypervisor resources for each event channel they use.
+
+The default of 1023 should be sufficient for typical guests.  The
+maximum value depends what the guest supports.  Guests supporting the
+FIFO-based event channel ABI support up to 131,071 event channels.
+Other guests are limited to 4095 (64-bit x86 and ARM) or 1023 (32-bit
+x86).
+
 =back
 
 =head2 Paravirtualised (PV) Guest Specific Options
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index c9d9535..1c6675d 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -90,6 +90,11 @@
 #define LIBXL_HAVE_BUILDINFO_HVM_VENDOR_DEVICE 1
 
 /*
+ * The libxl_domain_build_info has the event_channels field.
+ */
+#define LIBXL_HAVE_BUILDINFO_EVENT_CHANNELS 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index c5ec577..1b320d3 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -208,6 +208,9 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
 
     libxl_defbool_setdefault(&b_info->disable_migrate, false);
 
+    if (!b_info->event_channels)
+        b_info->event_channels = 1023;
+
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 6e2252a..356f920 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -268,6 +268,13 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     if (rc)
         return rc;
 
+    rc = xc_domain_set_max_evtchn(ctx->xch, domid, info->event_channels);
+    if (rc) {
+        LOG(ERROR, "Failed to set event channel limit to %d (%d)",
+            info->event_channels, rc);
+        return ERROR_FAIL;
+    }
+
     libxl_cpuid_apply_policy(ctx, domid);
     if (info->cpuid != NULL)
         libxl_cpuid_set(ctx, domid, info->cpuid);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index b5d0b70..d2cea8a 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -312,6 +312,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("irqs",             Array(uint32, "num_irqs")),
     ("iomem",            Array(libxl_iomem_range, "num_iomem")),
     ("claim_mode",	     libxl_defbool),
+    ("event_channels",   uint32),
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware",         string),
                                        ("bios",             libxl_bios_type),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 14bb385..a8261be 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -845,6 +845,9 @@ static void parse_config_data(const char *config_source,
     if (!xlu_cfg_get_long (config, "videoram", &l, 0))
         b_info->video_memkb = l * 1024;
 
+    if (!xlu_cfg_get_long(config, "max_event_channels", &l, 0))
+        b_info->event_channels = l;
+
     switch(b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         if (!xlu_cfg_get_string (config, "kernel", &buf, 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 Oct 16 05:14:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:14: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 1VWJRI-0000BT-LZ; Wed, 16 Oct 2013 05:14:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRH-0000B9-7E
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:31 +0000
Received: from [85.158.137.68:28063] by server-14.bemta-3.messagelabs.com id
	82/C8-20312-6B02E525; Wed, 16 Oct 2013 05:14:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1381900468!1677243!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17716 invoked from network); 16 Oct 2013 05:14:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:14:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRE-0006Tw-IE
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRE-0007Py-Fp
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:28 +0000
Date: Wed, 16 Oct 2013 05:14:28 +0000
Message-Id: <E1VWJRE-0007Py-Fp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl,
	xl: add max_event_channels option to xl configuration 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 a77eb86f44e52c5aea7f0ba7023600c043a9cdcd
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Oct 14 10:25:39 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 14 10:25:39 2013 +0200

    libxl,xl: add max_event_channels option to xl configuration file
    
    Add the 'max_event_channels' option to the xl configuration file to
    limit the number of event channels that domain may use.
    
    Plumb this option through to libxl via a new libxl_build_info field
    and call xc_domain_set_max_evtchn() in the post build stage of domain
    creation.
    
    A new LIBXL_HAVE_BUILDINFO_EVENT_CHANNELS #define indicates that this
    new field is available.
    
    The default value of 1023 limits the domain to using the minimum
    amount of global mapping pages and at most 5 xenheap pages.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 docs/man/xl.cfg.pod.5       |   11 +++++++++++
 tools/libxl/libxl.h         |    5 +++++
 tools/libxl/libxl_create.c  |    3 +++
 tools/libxl/libxl_dom.c     |    7 +++++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    3 +++
 6 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index cd96969..278dba1 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -580,6 +580,17 @@ Allow a guest to access specific physical IRQs.
 It is recommended to use this option only for trusted VMs under
 administrator control.
 
+=item B<max_event_channels=N>
+
+Limit the guest to using at most N event channels (PV interrupts).
+Guests use hypervisor resources for each event channel they use.
+
+The default of 1023 should be sufficient for typical guests.  The
+maximum value depends what the guest supports.  Guests supporting the
+FIFO-based event channel ABI support up to 131,071 event channels.
+Other guests are limited to 4095 (64-bit x86 and ARM) or 1023 (32-bit
+x86).
+
 =back
 
 =head2 Paravirtualised (PV) Guest Specific Options
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index c9d9535..1c6675d 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -90,6 +90,11 @@
 #define LIBXL_HAVE_BUILDINFO_HVM_VENDOR_DEVICE 1
 
 /*
+ * The libxl_domain_build_info has the event_channels field.
+ */
+#define LIBXL_HAVE_BUILDINFO_EVENT_CHANNELS 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index c5ec577..1b320d3 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -208,6 +208,9 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
 
     libxl_defbool_setdefault(&b_info->disable_migrate, false);
 
+    if (!b_info->event_channels)
+        b_info->event_channels = 1023;
+
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 6e2252a..356f920 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -268,6 +268,13 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     if (rc)
         return rc;
 
+    rc = xc_domain_set_max_evtchn(ctx->xch, domid, info->event_channels);
+    if (rc) {
+        LOG(ERROR, "Failed to set event channel limit to %d (%d)",
+            info->event_channels, rc);
+        return ERROR_FAIL;
+    }
+
     libxl_cpuid_apply_policy(ctx, domid);
     if (info->cpuid != NULL)
         libxl_cpuid_set(ctx, domid, info->cpuid);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index b5d0b70..d2cea8a 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -312,6 +312,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("irqs",             Array(uint32, "num_irqs")),
     ("iomem",            Array(libxl_iomem_range, "num_iomem")),
     ("claim_mode",	     libxl_defbool),
+    ("event_channels",   uint32),
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware",         string),
                                        ("bios",             libxl_bios_type),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 14bb385..a8261be 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -845,6 +845,9 @@ static void parse_config_data(const char *config_source,
     if (!xlu_cfg_get_long (config, "videoram", &l, 0))
         b_info->video_memkb = l * 1024;
 
+    if (!xlu_cfg_get_long(config, "max_event_channels", &l, 0))
+        b_info->event_channels = l;
+
     switch(b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         if (!xlu_cfg_get_string (config, "kernel", &buf, 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 Oct 16 05:14:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:14: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 1VWJRT-0000DS-P0; Wed, 16 Oct 2013 05:14: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 1VWJRR-0000D9-Kq
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:41 +0000
Received: from [85.158.137.68:28315] by server-9.bemta-3.messagelabs.com id
	95/D7-21272-0C02E525; Wed, 16 Oct 2013 05:14:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1381900478!1678922!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28012 invoked from network); 16 Oct 2013 05:14:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:14:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRO-0006U2-Mz
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRO-0007QU-Lv
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:38 +0000
Date: Wed, 16 Oct 2013 05:14:38 +0000
Message-Id: <E1VWJRO-0007QU-Lv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] pygrub: Support (/dev/xvda) style disk
	specifications
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b2e55da3cd6f5911b833edb9e1fd9a22110c2a74
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 10:37:37 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 14 17:40:36 2013 +0100

    pygrub: Support (/dev/xvda) style disk specifications
    
    You get these if you install Debian Wheezy as HVM and then try to convert to
    PV.
    
    This is Debian bug #603391.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Tested-by: Tril <tril@metapipe.net>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/pygrub/examples/debian-wheezy-hvm.grub2 |  104 +++++++++++++++++++++++++
 tools/pygrub/src/GrubConf.py                  |    6 +-
 2 files changed, 109 insertions(+), 1 deletions(-)

diff --git a/tools/pygrub/examples/debian-wheezy-hvm.grub2 b/tools/pygrub/examples/debian-wheezy-hvm.grub2
new file mode 100644
index 0000000..b5ee9e2
--- /dev/null
+++ b/tools/pygrub/examples/debian-wheezy-hvm.grub2
@@ -0,0 +1,104 @@
+
+#
+# DO NOT EDIT THIS FILE
+#
+# It is automatically generated by grub-mkconfig using templates
+# from /etc/grub.d and settings from /etc/default/grub
+#
+
+### BEGIN /etc/grub.d/00_header ###
+if [ -s $prefix/grubenv ]; then
+  load_env
+fi
+set default="0"
+if [ "${prev_saved_entry}" ]; then
+  set saved_entry="${prev_saved_entry}"
+  save_env saved_entry
+  set prev_saved_entry=
+  save_env prev_saved_entry
+  set boot_once=true
+fi
+
+function savedefault {
+  if [ -z "${boot_once}" ]; then
+    saved_entry="${chosen}"
+    save_env saved_entry
+  fi
+}
+
+function load_video {
+  insmod vbe
+  insmod vga
+  insmod video_bochs
+  insmod video_cirrus
+}
+
+insmod part_msdos
+insmod ext2
+set root='(/dev/xvda,msdos1)'
+search --no-floppy --fs-uuid --set=root f395d5a0-4612-4872-806c-33cd37c152f0
+if loadfont /usr/share/grub/unicode.pf2 ; then
+  set gfxmode=640x480
+  load_video
+  insmod gfxterm
+  insmod part_msdos
+  insmod ext2
+  set root='(/dev/xvda,msdos1)'
+  search --no-floppy --fs-uuid --set=root f395d5a0-4612-4872-806c-33cd37c152f0
+  set locale_dir=($root)/boot/grub/locale
+  set lang=en_US
+  insmod gettext
+fi
+terminal_output gfxterm
+set timeout=5
+### END /etc/grub.d/00_header ###
+
+### BEGIN /etc/grub.d/05_debian_theme ###
+set menu_color_normal=cyan/blue
+set menu_color_highlight=white/blue
+### END /etc/grub.d/05_debian_theme ###
+
+### BEGIN /etc/grub.d/10_linux ###
+menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-amd64' --class debian --class gnu-linux --class gnu --class os {
+        load_video
+        insmod gzio
+        insmod part_msdos
+        insmod ext2
+        set root='(/dev/xvda,msdos1)'
+        search --no-floppy --fs-uuid --set=root f395d5a0-4612-4872-806c-33cd37c152f0
+        echo    'Loading Linux 3.2.0-4-amd64 ...'
+        linux   /boot/vmlinuz-3.2.0-4-amd64 root=UUID=f395d5a0-4612-4872-806c-33cd37c152f0 ro  
+        echo    'Loading initial ramdisk ...'
+        initrd  /boot/initrd.img-3.2.0-4-amd64
+}
+menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
+        load_video
+        insmod gzio
+        insmod part_msdos
+        insmod ext2
+        set root='(/dev/xvda,msdos1)'
+        search --no-floppy --fs-uuid --set=root f395d5a0-4612-4872-806c-33cd37c152f0
+        echo    'Loading Linux 3.2.0-4-amd64 ...'
+        linux   /boot/vmlinuz-3.2.0-4-amd64 root=UUID=f395d5a0-4612-4872-806c-33cd37c152f0 ro single 
+        echo    'Loading initial ramdisk ...'
+        initrd  /boot/initrd.img-3.2.0-4-amd64
+}
+### END /etc/grub.d/10_linux ###
+
+### BEGIN /etc/grub.d/20_linux_xen ###
+### END /etc/grub.d/20_linux_xen ###
+
+### BEGIN /etc/grub.d/30_os-prober ###
+### END /etc/grub.d/30_os-prober ###
+
+### BEGIN /etc/grub.d/40_custom ###
+# This file provides an easy way to add custom menu entries.  Simply type the
+# menu entries you want to add after this comment.  Be careful not to change
+# the 'exec tail' line above.
+### END /etc/grub.d/40_custom ###
+
+### BEGIN /etc/grub.d/41_custom ###
+if [ -f  $prefix/custom.cfg ]; then
+  source $prefix/custom.cfg;
+fi
+### END /etc/grub.d/41_custom ###
diff --git a/tools/pygrub/src/GrubConf.py b/tools/pygrub/src/GrubConf.py
index 6324c62..cb853c9 100644
--- a/tools/pygrub/src/GrubConf.py
+++ b/tools/pygrub/src/GrubConf.py
@@ -67,7 +67,11 @@ class GrubDiskPart(object):
         return self._disk
     def set_disk(self, val):
         val = val.replace("(", "").replace(")", "")
-        self._disk = int(val[2:])
+        if val.startswith("/dev/xvd"):
+            disk = val[len("/dev/xvd")]
+            self._disk = ord(disk)-ord('a')
+        else:
+            self._disk = int(val[2:])
     disk = property(get_disk, set_disk)
 
     def get_part(self):
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:14:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:14: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 1VWJRT-0000DS-P0; Wed, 16 Oct 2013 05:14: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 1VWJRR-0000D9-Kq
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:41 +0000
Received: from [85.158.137.68:28315] by server-9.bemta-3.messagelabs.com id
	95/D7-21272-0C02E525; Wed, 16 Oct 2013 05:14:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1381900478!1678922!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28012 invoked from network); 16 Oct 2013 05:14:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:14:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRO-0006U2-Mz
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRO-0007QU-Lv
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:38 +0000
Date: Wed, 16 Oct 2013 05:14:38 +0000
Message-Id: <E1VWJRO-0007QU-Lv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] pygrub: Support (/dev/xvda) style disk
	specifications
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b2e55da3cd6f5911b833edb9e1fd9a22110c2a74
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 10:37:37 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 14 17:40:36 2013 +0100

    pygrub: Support (/dev/xvda) style disk specifications
    
    You get these if you install Debian Wheezy as HVM and then try to convert to
    PV.
    
    This is Debian bug #603391.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Tested-by: Tril <tril@metapipe.net>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/pygrub/examples/debian-wheezy-hvm.grub2 |  104 +++++++++++++++++++++++++
 tools/pygrub/src/GrubConf.py                  |    6 +-
 2 files changed, 109 insertions(+), 1 deletions(-)

diff --git a/tools/pygrub/examples/debian-wheezy-hvm.grub2 b/tools/pygrub/examples/debian-wheezy-hvm.grub2
new file mode 100644
index 0000000..b5ee9e2
--- /dev/null
+++ b/tools/pygrub/examples/debian-wheezy-hvm.grub2
@@ -0,0 +1,104 @@
+
+#
+# DO NOT EDIT THIS FILE
+#
+# It is automatically generated by grub-mkconfig using templates
+# from /etc/grub.d and settings from /etc/default/grub
+#
+
+### BEGIN /etc/grub.d/00_header ###
+if [ -s $prefix/grubenv ]; then
+  load_env
+fi
+set default="0"
+if [ "${prev_saved_entry}" ]; then
+  set saved_entry="${prev_saved_entry}"
+  save_env saved_entry
+  set prev_saved_entry=
+  save_env prev_saved_entry
+  set boot_once=true
+fi
+
+function savedefault {
+  if [ -z "${boot_once}" ]; then
+    saved_entry="${chosen}"
+    save_env saved_entry
+  fi
+}
+
+function load_video {
+  insmod vbe
+  insmod vga
+  insmod video_bochs
+  insmod video_cirrus
+}
+
+insmod part_msdos
+insmod ext2
+set root='(/dev/xvda,msdos1)'
+search --no-floppy --fs-uuid --set=root f395d5a0-4612-4872-806c-33cd37c152f0
+if loadfont /usr/share/grub/unicode.pf2 ; then
+  set gfxmode=640x480
+  load_video
+  insmod gfxterm
+  insmod part_msdos
+  insmod ext2
+  set root='(/dev/xvda,msdos1)'
+  search --no-floppy --fs-uuid --set=root f395d5a0-4612-4872-806c-33cd37c152f0
+  set locale_dir=($root)/boot/grub/locale
+  set lang=en_US
+  insmod gettext
+fi
+terminal_output gfxterm
+set timeout=5
+### END /etc/grub.d/00_header ###
+
+### BEGIN /etc/grub.d/05_debian_theme ###
+set menu_color_normal=cyan/blue
+set menu_color_highlight=white/blue
+### END /etc/grub.d/05_debian_theme ###
+
+### BEGIN /etc/grub.d/10_linux ###
+menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-amd64' --class debian --class gnu-linux --class gnu --class os {
+        load_video
+        insmod gzio
+        insmod part_msdos
+        insmod ext2
+        set root='(/dev/xvda,msdos1)'
+        search --no-floppy --fs-uuid --set=root f395d5a0-4612-4872-806c-33cd37c152f0
+        echo    'Loading Linux 3.2.0-4-amd64 ...'
+        linux   /boot/vmlinuz-3.2.0-4-amd64 root=UUID=f395d5a0-4612-4872-806c-33cd37c152f0 ro  
+        echo    'Loading initial ramdisk ...'
+        initrd  /boot/initrd.img-3.2.0-4-amd64
+}
+menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
+        load_video
+        insmod gzio
+        insmod part_msdos
+        insmod ext2
+        set root='(/dev/xvda,msdos1)'
+        search --no-floppy --fs-uuid --set=root f395d5a0-4612-4872-806c-33cd37c152f0
+        echo    'Loading Linux 3.2.0-4-amd64 ...'
+        linux   /boot/vmlinuz-3.2.0-4-amd64 root=UUID=f395d5a0-4612-4872-806c-33cd37c152f0 ro single 
+        echo    'Loading initial ramdisk ...'
+        initrd  /boot/initrd.img-3.2.0-4-amd64
+}
+### END /etc/grub.d/10_linux ###
+
+### BEGIN /etc/grub.d/20_linux_xen ###
+### END /etc/grub.d/20_linux_xen ###
+
+### BEGIN /etc/grub.d/30_os-prober ###
+### END /etc/grub.d/30_os-prober ###
+
+### BEGIN /etc/grub.d/40_custom ###
+# This file provides an easy way to add custom menu entries.  Simply type the
+# menu entries you want to add after this comment.  Be careful not to change
+# the 'exec tail' line above.
+### END /etc/grub.d/40_custom ###
+
+### BEGIN /etc/grub.d/41_custom ###
+if [ -f  $prefix/custom.cfg ]; then
+  source $prefix/custom.cfg;
+fi
+### END /etc/grub.d/41_custom ###
diff --git a/tools/pygrub/src/GrubConf.py b/tools/pygrub/src/GrubConf.py
index 6324c62..cb853c9 100644
--- a/tools/pygrub/src/GrubConf.py
+++ b/tools/pygrub/src/GrubConf.py
@@ -67,7 +67,11 @@ class GrubDiskPart(object):
         return self._disk
     def set_disk(self, val):
         val = val.replace("(", "").replace(")", "")
-        self._disk = int(val[2:])
+        if val.startswith("/dev/xvd"):
+            disk = val[len("/dev/xvd")]
+            self._disk = ord(disk)-ord('a')
+        else:
+            self._disk = int(val[2:])
     disk = property(get_disk, set_disk)
 
     def get_part(self):
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 16 05:14:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:14: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 1VWJRc-0000FA-S0; Wed, 16 Oct 2013 05:14: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 1VWJRb-0000Ev-IL
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:51 +0000
Received: from [193.109.254.147:40327] by server-15.bemta-14.messagelabs.com
	id 91/B6-02681-AC02E525; Wed, 16 Oct 2013 05:14:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1381900489!2378898!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=2.2 required=7.0 tests=BIZ_TLD,BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5753 invoked from network); 16 Oct 2013 05:14:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:14:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRY-0006U8-Rv
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRY-0007Qq-QN
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:48 +0000
Date: Wed, 16 Oct 2013 05:14:48 +0000
Message-Id: <E1VWJRY-0007Qq-QN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: remove qemu default devices for
	upstream qemu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6ef823fdfa701b3659e4161520f43b5835338fb5
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Mon Sep 30 13:53:08 2013 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 14 17:46:18 2013 +0100

    libxl: remove qemu default devices for upstream qemu
    
    Remove default devices created by qemu. Qemu will create only devices
    defined by xen, since the devices not defined by xen are not usable.
    Remove deleting of empty floppy no more needed with nodefault.
    
    (Removed a whitespace error. -iwj)
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_dm.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 43c3bec..ef29d0b 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -392,6 +392,13 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
     flexarray_append(dm_args, "-mon");
     flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
 
+    /*
+     * Remove default devices created by qemu. Qemu will create only devices
+     * defined by xen, since the devices not defined by xen are not usable.
+     * Remove deleting of empty floppy no more needed with nodefault.
+     */
+    flexarray_append(dm_args, "-nodefaults");
+
     if (b_info->type == LIBXL_DOMAIN_TYPE_PV) {
         flexarray_append(dm_args, "-xen-attach");
     }
@@ -457,9 +464,6 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
     if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         int ioemu_nics = 0;
 
-        /* Disable useless empty floppy drive */
-        flexarray_vappend(dm_args, "-global", "isa-fdc.driveA=", NULL);
-
         if (b_info->u.hvm.serial) {
             flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, 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 Wed Oct 16 05:14:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:14: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 1VWJRc-0000FA-S0; Wed, 16 Oct 2013 05:14: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 1VWJRb-0000Ev-IL
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:51 +0000
Received: from [193.109.254.147:40327] by server-15.bemta-14.messagelabs.com
	id 91/B6-02681-AC02E525; Wed, 16 Oct 2013 05:14:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1381900489!2378898!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=2.2 required=7.0 tests=BIZ_TLD,BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5753 invoked from network); 16 Oct 2013 05:14:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:14:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRY-0006U8-Rv
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRY-0007Qq-QN
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:48 +0000
Date: Wed, 16 Oct 2013 05:14:48 +0000
Message-Id: <E1VWJRY-0007Qq-QN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: remove qemu default devices for
	upstream qemu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6ef823fdfa701b3659e4161520f43b5835338fb5
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Mon Sep 30 13:53:08 2013 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 14 17:46:18 2013 +0100

    libxl: remove qemu default devices for upstream qemu
    
    Remove default devices created by qemu. Qemu will create only devices
    defined by xen, since the devices not defined by xen are not usable.
    Remove deleting of empty floppy no more needed with nodefault.
    
    (Removed a whitespace error. -iwj)
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_dm.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 43c3bec..ef29d0b 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -392,6 +392,13 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
     flexarray_append(dm_args, "-mon");
     flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
 
+    /*
+     * Remove default devices created by qemu. Qemu will create only devices
+     * defined by xen, since the devices not defined by xen are not usable.
+     * Remove deleting of empty floppy no more needed with nodefault.
+     */
+    flexarray_append(dm_args, "-nodefaults");
+
     if (b_info->type == LIBXL_DOMAIN_TYPE_PV) {
         flexarray_append(dm_args, "-xen-attach");
     }
@@ -457,9 +464,6 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
     if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         int ioemu_nics = 0;
 
-        /* Disable useless empty floppy drive */
-        flexarray_vappend(dm_args, "-global", "isa-fdc.driveA=", NULL);
-
         if (b_info->u.hvm.serial) {
             flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, 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 Wed Oct 16 05:15:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:15: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 1VWJRn-0000H0-3D; Wed, 16 Oct 2013 05:15:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRl-0000Gh-Ef
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:15:01 +0000
Received: from [85.158.143.35:40146] by server-2.bemta-4.messagelabs.com id
	65/39-06473-4D02E525; Wed, 16 Oct 2013 05:15:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1381900499!2114964!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29517 invoked from network); 16 Oct 2013 05:15:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:15:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRj-0006UH-1d
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRi-0007RE-Vx
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:59 +0000
Date: Wed, 16 Oct 2013 05:14:58 +0000
Message-Id: <E1VWJRi-0007RE-Vx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/evtchn: Fix build on ARM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 720f45ad01b6a3af2d77fb8fe122d934bbadba47
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Oct 14 23:19:37 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 15 10:24:29 2013 +0100

    xen/evtchn: Fix build on ARM
    
    The recent event channel changes introduced by commit a77eb86 and before...
    break the compilation on Xen ARM. This commit adds missing includes in
    common/event_fifo.c and include/xen/sched.h.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/event_fifo.c |    1 +
 xen/include/xen/sched.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index eb0b97c..bec8d87 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -16,6 +16,7 @@
 #include <xen/event_fifo.h>
 #include <xen/paging.h>
 #include <xen/mm.h>
+#include <xen/domain_page.h>
 
 #include <public/event_channel.h>
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index c2588a5..25bf637 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -24,6 +24,7 @@
 #include <public/sysctl.h>
 #include <public/vcpu.h>
 #include <public/mem_event.h>
+#include <public/event_channel.h>
 
 #ifdef CONFIG_COMPAT
 #include <compat/vcpu.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 Oct 16 05:15:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 05:15: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 1VWJRn-0000H0-3D; Wed, 16 Oct 2013 05:15:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRl-0000Gh-Ef
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:15:01 +0000
Received: from [85.158.143.35:40146] by server-2.bemta-4.messagelabs.com id
	65/39-06473-4D02E525; Wed, 16 Oct 2013 05:15:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1381900499!2114964!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29517 invoked from network); 16 Oct 2013 05:15:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 05:15:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRj-0006UH-1d
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWJRi-0007RE-Vx
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 05:14:59 +0000
Date: Wed, 16 Oct 2013 05:14:58 +0000
Message-Id: <E1VWJRi-0007RE-Vx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/evtchn: Fix build on ARM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 720f45ad01b6a3af2d77fb8fe122d934bbadba47
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Oct 14 23:19:37 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Oct 15 10:24:29 2013 +0100

    xen/evtchn: Fix build on ARM
    
    The recent event channel changes introduced by commit a77eb86 and before...
    break the compilation on Xen ARM. This commit adds missing includes in
    common/event_fifo.c and include/xen/sched.h.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/event_fifo.c |    1 +
 xen/include/xen/sched.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index eb0b97c..bec8d87 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -16,6 +16,7 @@
 #include <xen/event_fifo.h>
 #include <xen/paging.h>
 #include <xen/mm.h>
+#include <xen/domain_page.h>
 
 #include <public/event_channel.h>
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index c2588a5..25bf637 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -24,6 +24,7 @@
 #include <public/sysctl.h>
 #include <public/vcpu.h>
 #include <public/mem_event.h>
+#include <public/event_channel.h>
 
 #ifdef CONFIG_COMPAT
 #include <compat/vcpu.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 Oct 16 13:33:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 13:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWRDo-0004bf-Mg; Wed, 16 Oct 2013 13:33:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDm-0004bE-QQ
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:07 +0000
Received: from [85.158.137.68:43225] by server-9.bemta-3.messagelabs.com id
	E1/FA-21272-2959E525; Wed, 16 Oct 2013 13:33:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-31.messagelabs.com!1381930384!1802736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8639 invoked from network); 16 Oct 2013 13:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 13:33:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDk-0003mW-32
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDk-0005Lk-1I
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:04 +0000
Message-Id: <E1VWRDk-0005Lk-1I@xenbits.xen.org>
Date: Wed, 16 Oct 2013 13:33:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86/time: remove dead code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1381928848 -7200
# Node ID 3ae180dda3a99b5208e13083a3767c041632363b
# Parent  80784d88c2e7c6798f87a36a815a94b076719c32
x86/time: remove dead code

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


diff -r 80784d88c2e7 -r 3ae180dda3a9 arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c	Wed Oct 16 15:05:18 2013 +0200
+++ b/arch/i386/kernel/time-xen.c	Wed Oct 16 15:07:28 2013 +0200
@@ -45,7 +45,6 @@
 #include <linux/sysdev.h>
 #include <linux/bcd.h>
 #include <linux/efi.h>
-#include <linux/mca.h>
 #include <linux/sysctl.h>
 #include <linux/percpu.h>
 #include <linux/kernel_stat.h>
@@ -97,10 +96,6 @@ extern unsigned long wall_jiffies;
 DEFINE_SPINLOCK(rtc_lock);
 EXPORT_SYMBOL(rtc_lock);
 
-extern struct init_timer_opts timer_tsc_init;
-extern struct timer_opts timer_tsc;
-#define timer_none timer_tsc
-
 /* These are peridically updated in shared_info, and then copied here. */
 struct shadow_time_info {
 	u64 tsc_timestamp;     /* TSC at last update of time vals.  */
@@ -172,24 +167,6 @@ static int __init __permitted_clock_jitt
 }
 __setup("permitted_clock_jitter=", __permitted_clock_jitter);
 
-#if 0
-static void delay_tsc(unsigned long loops)
-{
-	unsigned long bclock, now;
-
-	rdtscl(bclock);
-	do {
-		rep_nop();
-		rdtscl(now);
-	} while ((now - bclock) < loops);
-}
-
-struct timer_opts timer_tsc = {
-	.name = "tsc",
-	.delay = delay_tsc,
-};
-#endif
-
 /*
  * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
  * yielding a 64-bit result.
@@ -226,14 +203,6 @@ static inline u64 scale_delta(u64 delta,
 	return product;
 }
 
-#if 0 /* defined (__i386__) */
-int read_current_timer(unsigned long *timer_val)
-{
-	rdtscl(*timer_val);
-	return 0;
-}
-#endif
-
 void init_cpu_khz(void)
 {
 	u64 __cpu_khz = 1000000ULL << 32;

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

From xen-changelog-bounces@lists.xen.org Wed Oct 16 13:33:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 13:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWRDo-0004bf-Mg; Wed, 16 Oct 2013 13:33:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDm-0004bE-QQ
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:07 +0000
Received: from [85.158.137.68:43225] by server-9.bemta-3.messagelabs.com id
	E1/FA-21272-2959E525; Wed, 16 Oct 2013 13:33:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-31.messagelabs.com!1381930384!1802736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8639 invoked from network); 16 Oct 2013 13:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 13:33:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDk-0003mW-32
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDk-0005Lk-1I
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:04 +0000
Message-Id: <E1VWRDk-0005Lk-1I@xenbits.xen.org>
Date: Wed, 16 Oct 2013 13:33:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86/time: remove dead code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1381928848 -7200
# Node ID 3ae180dda3a99b5208e13083a3767c041632363b
# Parent  80784d88c2e7c6798f87a36a815a94b076719c32
x86/time: remove dead code

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


diff -r 80784d88c2e7 -r 3ae180dda3a9 arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c	Wed Oct 16 15:05:18 2013 +0200
+++ b/arch/i386/kernel/time-xen.c	Wed Oct 16 15:07:28 2013 +0200
@@ -45,7 +45,6 @@
 #include <linux/sysdev.h>
 #include <linux/bcd.h>
 #include <linux/efi.h>
-#include <linux/mca.h>
 #include <linux/sysctl.h>
 #include <linux/percpu.h>
 #include <linux/kernel_stat.h>
@@ -97,10 +96,6 @@ extern unsigned long wall_jiffies;
 DEFINE_SPINLOCK(rtc_lock);
 EXPORT_SYMBOL(rtc_lock);
 
-extern struct init_timer_opts timer_tsc_init;
-extern struct timer_opts timer_tsc;
-#define timer_none timer_tsc
-
 /* These are peridically updated in shared_info, and then copied here. */
 struct shadow_time_info {
 	u64 tsc_timestamp;     /* TSC at last update of time vals.  */
@@ -172,24 +167,6 @@ static int __init __permitted_clock_jitt
 }
 __setup("permitted_clock_jitter=", __permitted_clock_jitter);
 
-#if 0
-static void delay_tsc(unsigned long loops)
-{
-	unsigned long bclock, now;
-
-	rdtscl(bclock);
-	do {
-		rep_nop();
-		rdtscl(now);
-	} while ((now - bclock) < loops);
-}
-
-struct timer_opts timer_tsc = {
-	.name = "tsc",
-	.delay = delay_tsc,
-};
-#endif
-
 /*
  * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
  * yielding a 64-bit result.
@@ -226,14 +203,6 @@ static inline u64 scale_delta(u64 delta,
 	return product;
 }
 
-#if 0 /* defined (__i386__) */
-int read_current_timer(unsigned long *timer_val)
-{
-	rdtscl(*timer_val);
-	return 0;
-}
-#endif
-
 void init_cpu_khz(void)
 {
 	u64 __cpu_khz = 1000000ULL << 32;

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

From xen-changelog-bounces@lists.xen.org Wed Oct 16 13:33:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 13:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWRDn-0004bR-Hd; Wed, 16 Oct 2013 13:33:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDm-0004b8-0v
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:06 +0000
Received: from [85.158.139.211:8271] by server-16.bemta-5.messagelabs.com id
	C4/E0-17144-1959E525; Wed, 16 Oct 2013 13:33:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1381930383!1728347!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27758 invoked from network); 16 Oct 2013 13:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 13:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDj-0003mQ-Aa
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDj-0005LG-65
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:03 +0000
Message-Id: <E1VWRDj-0005LG-65@xenbits.xen.org>
Date: Wed, 16 Oct 2013 13:33:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] net{back,front}: minor cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1381928543 -7200
# Node ID aea020fc95cbb50dbb4063897d88d7898d7f77b2
# Parent  b94250095e987b539baa08c82d0f2861fa3c85fe
net{back,front}: minor cleanup

- use PFN_UP() instead of open coding it
- make xennet_get_extras() static
- tighten packing of struct netbk_rx_meta
- guard GNTTABOP_unmap_and_replace by CONFIG_XEN_COMPAT check (mostly
  for documentation purposes)

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


diff -r b94250095e98 -r aea020fc95cb drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c	Tue Sep 10 12:06:11 2013 +0200
+++ b/drivers/xen/netback/netback.c	Wed Oct 16 15:02:23 2013 +0200
@@ -46,7 +46,7 @@
 
 struct netbk_rx_meta {
 	skb_frag_t frag;
-	int id;
+	u16 id;
 	u8 copy:1;
 };
 
@@ -1726,10 +1726,12 @@ static int __init netback_init(void)
 
 	netbk_copy_skb_mode = NETBK_DONT_COPY_SKB;
 	if (MODPARM_copy_skb) {
+#if CONFIG_XEN_COMPAT < 0x030200
 		if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_and_replace,
 					      NULL, 0))
 			netbk_copy_skb_mode = NETBK_ALWAYS_COPY_SKB;
 		else
+#endif
 			netbk_copy_skb_mode = NETBK_DELAYED_COPY_SKB;
 	}
 
diff -r b94250095e98 -r aea020fc95cb drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Tue Sep 10 12:06:11 2013 +0200
+++ b/drivers/xen/netfront/netfront.c	Wed Oct 16 15:02:23 2013 +0200
@@ -33,6 +33,7 @@
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/kernel.h>
+#include <linux/pfn.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/string.h>
@@ -971,7 +972,7 @@ static int network_start_xmit(struct sk_
 		goto drop;
 	}
 
-	frags += (offset + len + PAGE_SIZE - 1) / PAGE_SIZE;
+	frags += PFN_UP(offset + len);
 	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
 		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
 		       frags);
@@ -1102,9 +1103,8 @@ static void xennet_move_rx_slot(struct n
 	np->rx.req_prod_pvt++;
 }
 
-int xennet_get_extras(struct netfront_info *np,
-		      struct netif_extra_info *extras, RING_IDX rp)
-
+static int xennet_get_extras(struct netfront_info *np,
+			     struct netif_extra_info *extras, RING_IDX rp)
 {
 	struct netif_extra_info *extra;
 	RING_IDX cons = np->rx.rsp_cons;

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

From xen-changelog-bounces@lists.xen.org Wed Oct 16 13:33:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 13:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWRDn-0004bR-Hd; Wed, 16 Oct 2013 13:33:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDm-0004b8-0v
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:06 +0000
Received: from [85.158.139.211:8271] by server-16.bemta-5.messagelabs.com id
	C4/E0-17144-1959E525; Wed, 16 Oct 2013 13:33:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-206.messagelabs.com!1381930383!1728347!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27758 invoked from network); 16 Oct 2013 13:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 13:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDj-0003mQ-Aa
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDj-0005LG-65
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:03 +0000
Message-Id: <E1VWRDj-0005LG-65@xenbits.xen.org>
Date: Wed, 16 Oct 2013 13:33:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] net{back,front}: minor cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1381928543 -7200
# Node ID aea020fc95cbb50dbb4063897d88d7898d7f77b2
# Parent  b94250095e987b539baa08c82d0f2861fa3c85fe
net{back,front}: minor cleanup

- use PFN_UP() instead of open coding it
- make xennet_get_extras() static
- tighten packing of struct netbk_rx_meta
- guard GNTTABOP_unmap_and_replace by CONFIG_XEN_COMPAT check (mostly
  for documentation purposes)

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


diff -r b94250095e98 -r aea020fc95cb drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c	Tue Sep 10 12:06:11 2013 +0200
+++ b/drivers/xen/netback/netback.c	Wed Oct 16 15:02:23 2013 +0200
@@ -46,7 +46,7 @@
 
 struct netbk_rx_meta {
 	skb_frag_t frag;
-	int id;
+	u16 id;
 	u8 copy:1;
 };
 
@@ -1726,10 +1726,12 @@ static int __init netback_init(void)
 
 	netbk_copy_skb_mode = NETBK_DONT_COPY_SKB;
 	if (MODPARM_copy_skb) {
+#if CONFIG_XEN_COMPAT < 0x030200
 		if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_and_replace,
 					      NULL, 0))
 			netbk_copy_skb_mode = NETBK_ALWAYS_COPY_SKB;
 		else
+#endif
 			netbk_copy_skb_mode = NETBK_DELAYED_COPY_SKB;
 	}
 
diff -r b94250095e98 -r aea020fc95cb drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Tue Sep 10 12:06:11 2013 +0200
+++ b/drivers/xen/netfront/netfront.c	Wed Oct 16 15:02:23 2013 +0200
@@ -33,6 +33,7 @@
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/kernel.h>
+#include <linux/pfn.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/string.h>
@@ -971,7 +972,7 @@ static int network_start_xmit(struct sk_
 		goto drop;
 	}
 
-	frags += (offset + len + PAGE_SIZE - 1) / PAGE_SIZE;
+	frags += PFN_UP(offset + len);
 	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
 		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
 		       frags);
@@ -1102,9 +1103,8 @@ static void xennet_move_rx_slot(struct n
 	np->rx.req_prod_pvt++;
 }
 
-int xennet_get_extras(struct netfront_info *np,
-		      struct netif_extra_info *extras, RING_IDX rp)
-
+static int xennet_get_extras(struct netfront_info *np,
+			     struct netif_extra_info *extras, RING_IDX rp)
 {
 	struct netif_extra_info *extra;
 	RING_IDX cons = np->rx.rsp_cons;

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

From xen-changelog-bounces@lists.xen.org Wed Oct 16 13:33:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 13:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWRDo-0004ba-KQ; Wed, 16 Oct 2013 13:33:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDm-0004bF-QW
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:06 +0000
Received: from [85.158.137.68:39186] by server-6.bemta-3.messagelabs.com id
	56/6C-23777-1959E525; Wed, 16 Oct 2013 13:33:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-31.messagelabs.com!1381930383!1809311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27004 invoked from network); 16 Oct 2013 13:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 13:33:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDj-0003mT-M2
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDj-0005LV-KM
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:03 +0000
Message-Id: <E1VWRDj-0005LV-KM@xenbits.xen.org>
Date: Wed, 16 Oct 2013 13:33:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86/time: replace deprecated
	SA_INTERRUPT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1381928718 -7200
# Node ID 80784d88c2e7c6798f87a36a815a94b076719c32
# Parent  aea020fc95cbb50dbb4063897d88d7898d7f77b2
x86/time: replace deprecated SA_INTERRUPT

... and add IRQF_TIMER at the same time.

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


diff -r aea020fc95cb -r 80784d88c2e7 arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c	Wed Oct 16 15:02:23 2013 +0200
+++ b/arch/i386/kernel/time-xen.c	Wed Oct 16 15:05:18 2013 +0200
@@ -926,7 +926,7 @@ static void setup_cpu0_timer_irq(void)
 			VIRQ_TIMER,
 			0,
 			timer_interrupt,
-			SA_INTERRUPT,
+			IRQF_DISABLED|IRQF_TIMER,
 			"timer0",
 			NULL);
 	BUG_ON(per_cpu(timer_irq, 0) < 0);
@@ -1147,7 +1147,7 @@ int __cpuinit local_setup_timer(unsigned
 	irq = bind_virq_to_irqhandler(VIRQ_TIMER,
 				      cpu,
 				      timer_interrupt,
-				      SA_INTERRUPT,
+				      IRQF_DISABLED|IRQF_TIMER,
 				      timer_name[cpu],
 				      NULL);
 	if (irq < 0)

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

From xen-changelog-bounces@lists.xen.org Wed Oct 16 13:33:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 16 Oct 2013 13:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWRDo-0004ba-KQ; Wed, 16 Oct 2013 13:33:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDm-0004bF-QW
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:06 +0000
Received: from [85.158.137.68:39186] by server-6.bemta-3.messagelabs.com id
	56/6C-23777-1959E525; Wed, 16 Oct 2013 13:33:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-31.messagelabs.com!1381930383!1809311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27004 invoked from network); 16 Oct 2013 13:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Oct 2013 13:33:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDj-0003mT-M2
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VWRDj-0005LV-KM
	for xen-changelog@lists.xensource.com; Wed, 16 Oct 2013 13:33:03 +0000
Message-Id: <E1VWRDj-0005LV-KM@xenbits.xen.org>
Date: Wed, 16 Oct 2013 13:33:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86/time: replace deprecated
	SA_INTERRUPT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1381928718 -7200
# Node ID 80784d88c2e7c6798f87a36a815a94b076719c32
# Parent  aea020fc95cbb50dbb4063897d88d7898d7f77b2
x86/time: replace deprecated SA_INTERRUPT

... and add IRQF_TIMER at the same time.

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


diff -r aea020fc95cb -r 80784d88c2e7 arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c	Wed Oct 16 15:02:23 2013 +0200
+++ b/arch/i386/kernel/time-xen.c	Wed Oct 16 15:05:18 2013 +0200
@@ -926,7 +926,7 @@ static void setup_cpu0_timer_irq(void)
 			VIRQ_TIMER,
 			0,
 			timer_interrupt,
-			SA_INTERRUPT,
+			IRQF_DISABLED|IRQF_TIMER,
 			"timer0",
 			NULL);
 	BUG_ON(per_cpu(timer_irq, 0) < 0);
@@ -1147,7 +1147,7 @@ int __cpuinit local_setup_timer(unsigned
 	irq = bind_virq_to_irqhandler(VIRQ_TIMER,
 				      cpu,
 				      timer_interrupt,
-				      SA_INTERRUPT,
+				      IRQF_DISABLED|IRQF_TIMER,
 				      timer_name[cpu],
 				      NULL);
 	if (irq < 0)

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

From xen-changelog-bounces@lists.xen.org Thu Oct 17 06:11:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 06: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 1VWgna-0003lG-EI; Thu, 17 Oct 2013 06:11:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWgnZ-0003lB-BD
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 06:11:05 +0000
Received: from [85.158.143.35:55301] by server-2.bemta-4.messagelabs.com id
	BA/90-06473-87F7F525; Thu, 17 Oct 2013 06:11:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1381990263!2265323!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17210 invoked from network); 17 Oct 2013 06:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 06:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWgnX-0005Rf-0E
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 06:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWgnW-0000Ib-RW
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 06:11:02 +0000
Date: Thu, 17 Oct 2013 06:11:02 +0000
Message-Id: <E1VWgnW-0000Ib-RW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] fix DOMID_IO mapping permission
	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 9119a3fda323be347e13ffbc8221f8fcc8c09f06
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Wed Oct 16 12:31:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 16 12:31:25 2013 +0200

    fix DOMID_IO mapping permission checks
    
    When the permission checks for memory mapping were moved from
    get_pg_owner to xsm_mmu_update in aaba7a677, the exception for DOMID_IO
    was not taken into account. This will cause IO memory mappings by PV
    domains (mini-os in particular) to fail when XSM/FLASK is not being
    used. This patch reintroduces the exception for DOMID_IO; the actual
    restrictions on IO memory mappings have always been checked separately
    using iomem_access_permitted, so this change should not break existing
    access control.
    
    Reported-by: Eduardo Peixoto Macedo <epm@cin.ufpe.br>
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 07344c0f33be13bf9232a113681ef9087557f706
    master date: 2013-09-26 10:15:47 +0200
---
 xen/include/xsm/dummy.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index ecf262b..52c651c 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -567,9 +567,10 @@ static XSM_INLINE int xsm_domain_memory_map(XSM_DEFAULT_ARG struct domain *d)
 static XSM_INLINE int xsm_mmu_update(XSM_DEFAULT_ARG struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
-    int rc;
+    int rc = 0;
     XSM_ASSERT_ACTION(XSM_TARGET);
-    rc = xsm_default_action(action, d, f);
+    if ( f != dom_io )
+        rc = xsm_default_action(action, d, f);
     if ( t && !rc )
         rc = xsm_default_action(action, d, t);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Oct 17 06:11:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 06: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 1VWgna-0003lG-EI; Thu, 17 Oct 2013 06:11:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWgnZ-0003lB-BD
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 06:11:05 +0000
Received: from [85.158.143.35:55301] by server-2.bemta-4.messagelabs.com id
	BA/90-06473-87F7F525; Thu, 17 Oct 2013 06:11:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1381990263!2265323!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17210 invoked from network); 17 Oct 2013 06:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 06:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWgnX-0005Rf-0E
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 06:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWgnW-0000Ib-RW
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 06:11:02 +0000
Date: Thu, 17 Oct 2013 06:11:02 +0000
Message-Id: <E1VWgnW-0000Ib-RW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] fix DOMID_IO mapping permission
	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 9119a3fda323be347e13ffbc8221f8fcc8c09f06
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Wed Oct 16 12:31:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 16 12:31:25 2013 +0200

    fix DOMID_IO mapping permission checks
    
    When the permission checks for memory mapping were moved from
    get_pg_owner to xsm_mmu_update in aaba7a677, the exception for DOMID_IO
    was not taken into account. This will cause IO memory mappings by PV
    domains (mini-os in particular) to fail when XSM/FLASK is not being
    used. This patch reintroduces the exception for DOMID_IO; the actual
    restrictions on IO memory mappings have always been checked separately
    using iomem_access_permitted, so this change should not break existing
    access control.
    
    Reported-by: Eduardo Peixoto Macedo <epm@cin.ufpe.br>
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 07344c0f33be13bf9232a113681ef9087557f706
    master date: 2013-09-26 10:15:47 +0200
---
 xen/include/xsm/dummy.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index ecf262b..52c651c 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -567,9 +567,10 @@ static XSM_INLINE int xsm_domain_memory_map(XSM_DEFAULT_ARG struct domain *d)
 static XSM_INLINE int xsm_mmu_update(XSM_DEFAULT_ARG struct domain *d, struct domain *t,
                                      struct domain *f, uint32_t flags)
 {
-    int rc;
+    int rc = 0;
     XSM_ASSERT_ACTION(XSM_TARGET);
-    rc = xsm_default_action(action, d, f);
+    if ( f != dom_io )
+        rc = xsm_default_action(action, d, f);
     if ( t && !rc )
         rc = xsm_default_action(action, d, t);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Oct 17 15:44:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 15:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWpk7-00017o-Tp; Thu, 17 Oct 2013 15:44:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpk6-00017Z-6X
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:06 +0000
Received: from [85.158.139.211:60072] by server-14.bemta-5.messagelabs.com id
	73/2C-29404-5C500625; Thu, 17 Oct 2013 15:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1382024643!1999722!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26867 invoked from network); 17 Oct 2013 15:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 15:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpk3-0003Tx-Kg
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpk3-0007ym-7x
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:03 +0000
Date: Thu, 17 Oct 2013 15:44:03 +0000
Message-Id: <E1VWpk3-0007ym-7x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] credit: unpause parked vcpu before
	destroying it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d38a668b6ef8c84d1d3fda9947ffb0056d01fe3a
Author:     Juergen Gross <juergen.gross@ts.fujitsu.com>
AuthorDate: Wed Oct 16 12:26:48 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 16 12:26:48 2013 +0200

    credit: unpause parked vcpu before destroying it
    
    A capped out vcpu must be unpaused in case of moving it to another cpupool,
    otherwise it will be paused forever.
    
    Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/common/sched_credit.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 192c653..e69d794 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -929,6 +929,12 @@ csched_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
 
     SCHED_STAT_CRANK(vcpu_destroy);
 
+    if ( test_and_clear_bit(CSCHED_FLAG_VCPU_PARKED, &svc->flags) )
+    {
+        SCHED_STAT_CRANK(vcpu_unpark);
+        vcpu_unpause(svc->vcpu);
+    }
+
     if ( __vcpu_on_runq(svc) )
         __runq_remove(svc);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 17 15:44:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 15:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWpk7-00017o-Tp; Thu, 17 Oct 2013 15:44:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpk6-00017Z-6X
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:06 +0000
Received: from [85.158.139.211:60072] by server-14.bemta-5.messagelabs.com id
	73/2C-29404-5C500625; Thu, 17 Oct 2013 15:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1382024643!1999722!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26867 invoked from network); 17 Oct 2013 15:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 15:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpk3-0003Tx-Kg
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpk3-0007ym-7x
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:03 +0000
Date: Thu, 17 Oct 2013 15:44:03 +0000
Message-Id: <E1VWpk3-0007ym-7x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] credit: unpause parked vcpu before
	destroying it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d38a668b6ef8c84d1d3fda9947ffb0056d01fe3a
Author:     Juergen Gross <juergen.gross@ts.fujitsu.com>
AuthorDate: Wed Oct 16 12:26:48 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 16 12:26:48 2013 +0200

    credit: unpause parked vcpu before destroying it
    
    A capped out vcpu must be unpaused in case of moving it to another cpupool,
    otherwise it will be paused forever.
    
    Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/common/sched_credit.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 192c653..e69d794 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -929,6 +929,12 @@ csched_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
 
     SCHED_STAT_CRANK(vcpu_destroy);
 
+    if ( test_and_clear_bit(CSCHED_FLAG_VCPU_PARKED, &svc->flags) )
+    {
+        SCHED_STAT_CRANK(vcpu_unpark);
+        vcpu_unpause(svc->vcpu);
+    }
+
     if ( __vcpu_on_runq(svc) )
         __runq_remove(svc);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 17 15:44:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 15:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWpkI-00018l-0v; Thu, 17 Oct 2013 15:44: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 1VWpkG-00018a-BH
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:16 +0000
Received: from [85.158.143.35:48274] by server-1.bemta-4.messagelabs.com id
	95/E3-17304-FC500625; Thu, 17 Oct 2013 15:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1382024654!2433614!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10702 invoked from network); 17 Oct 2013 15:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 15:44:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpkD-0003U0-T9
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpkD-0007zA-R4
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:13 +0000
Date: Thu, 17 Oct 2013 15:44:13 +0000
Message-Id: <E1VWpkD-0007zA-R4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] add cap value to credit scheduler
	debug 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 b4fdb6da1e030d5f13929d88c607dc3d9c5b6b23
Author:     Juergen Gross <juergen.gross@ts.fujitsu.com>
AuthorDate: Wed Oct 16 12:28:04 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 16 12:28:04 2013 +0200

    add cap value to credit scheduler debug info
    
    Currently only the weight is the only scheduling parameter printed for
    domains in the credit scheduler key handler. Add the cap value to be
    printed as well.
    
    Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/common/sched_credit.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index e69d794..28dafcf 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1750,7 +1750,8 @@ csched_dump_vcpu(struct csched_vcpu *svc)
 
     if ( sdom )
     {
-        printk(" credit=%i [w=%u]", atomic_read(&svc->credit), sdom->weight);
+        printk(" credit=%i [w=%u,cap=%u]", atomic_read(&svc->credit),
+                sdom->weight, sdom->cap);
 #ifdef CSCHED_STATS
         printk(" (%d+%u) {a/i=%u/%u m=%u+%u (k=%u)}",
                 svc->stats.credit_last,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 17 15:44:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 15:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWpkI-00018l-0v; Thu, 17 Oct 2013 15:44: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 1VWpkG-00018a-BH
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:16 +0000
Received: from [85.158.143.35:48274] by server-1.bemta-4.messagelabs.com id
	95/E3-17304-FC500625; Thu, 17 Oct 2013 15:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1382024654!2433614!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10702 invoked from network); 17 Oct 2013 15:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 15:44:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpkD-0003U0-T9
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpkD-0007zA-R4
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:13 +0000
Date: Thu, 17 Oct 2013 15:44:13 +0000
Message-Id: <E1VWpkD-0007zA-R4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] add cap value to credit scheduler
	debug 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 b4fdb6da1e030d5f13929d88c607dc3d9c5b6b23
Author:     Juergen Gross <juergen.gross@ts.fujitsu.com>
AuthorDate: Wed Oct 16 12:28:04 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 16 12:28:04 2013 +0200

    add cap value to credit scheduler debug info
    
    Currently only the weight is the only scheduling parameter printed for
    domains in the credit scheduler key handler. Add the cap value to be
    printed as well.
    
    Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/common/sched_credit.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index e69d794..28dafcf 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1750,7 +1750,8 @@ csched_dump_vcpu(struct csched_vcpu *svc)
 
     if ( sdom )
     {
-        printk(" credit=%i [w=%u]", atomic_read(&svc->credit), sdom->weight);
+        printk(" credit=%i [w=%u,cap=%u]", atomic_read(&svc->credit),
+                sdom->weight, sdom->cap);
 #ifdef CSCHED_STATS
         printk(" (%d+%u) {a/i=%u/%u m=%u+%u (k=%u)}",
                 svc->stats.credit_last,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 17 15:44:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 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 1VWpkS-00019q-4I; Thu, 17 Oct 2013 15:44: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 1VWpkQ-00019f-Pa
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:26 +0000
Received: from [193.109.254.147:45559] by server-7.bemta-14.messagelabs.com id
	E0/32-26234-AD500625; Thu, 17 Oct 2013 15:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1382024664!2781914!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25595 invoked from network); 17 Oct 2013 15:44:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 15:44:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpkO-0003U6-3u
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpkO-0007zW-1h
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:24 +0000
Date: Thu, 17 Oct 2013 15:44:24 +0000
Message-Id: <E1VWpkO-0007zW-1h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Emacs style fix
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2a3bb93c5c8740624cbfeeeb314408d07a64ff79
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 11 16:31:57 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 16 11:46:07 2013 +0100

    xen: arm: Emacs style fix
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/sysregs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/sysregs.h b/xen/include/asm-arm/sysregs.h
index 9c64777..48ad07e 100644
--- a/xen/include/asm-arm/sysregs.h
+++ b/xen/include/asm-arm/sysregs.h
@@ -49,7 +49,7 @@
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * 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 Oct 17 15:44:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 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 1VWpkS-00019q-4I; Thu, 17 Oct 2013 15:44: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 1VWpkQ-00019f-Pa
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:26 +0000
Received: from [193.109.254.147:45559] by server-7.bemta-14.messagelabs.com id
	E0/32-26234-AD500625; Thu, 17 Oct 2013 15:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1382024664!2781914!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25595 invoked from network); 17 Oct 2013 15:44:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 15:44:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpkO-0003U6-3u
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpkO-0007zW-1h
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:24 +0000
Date: Thu, 17 Oct 2013 15:44:24 +0000
Message-Id: <E1VWpkO-0007zW-1h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Emacs style fix
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2a3bb93c5c8740624cbfeeeb314408d07a64ff79
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Oct 11 16:31:57 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 16 11:46:07 2013 +0100

    xen: arm: Emacs style fix
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/sysregs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/sysregs.h b/xen/include/asm-arm/sysregs.h
index 9c64777..48ad07e 100644
--- a/xen/include/asm-arm/sysregs.h
+++ b/xen/include/asm-arm/sysregs.h
@@ -49,7 +49,7 @@
 /*
  * Local variables:
  * mode: C
- * c-set-style: "BSD"
+ * 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 Oct 17 15:44:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 15:44:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWpkc-0001BN-IE; Thu, 17 Oct 2013 15:44:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpka-0001B2-Kl
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:36 +0000
Received: from [85.158.143.35:51936] by server-3.bemta-4.messagelabs.com id
	5D/F1-21600-4E500625; Thu, 17 Oct 2013 15:44:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1382024674!2540496!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9940 invoked from network); 17 Oct 2013 15:44:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 15:44:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpkY-0003UF-B8
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpkY-0007zt-7z
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:34 +0000
Date: Thu, 17 Oct 2013 15:44:34 +0000
Message-Id: <E1VWpkY-0007zt-7z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xend: Drop long deprecation warning in
	/var/run not /tmp
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d335119f7ab03c1221386749e0b539d67bdc7831
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 11 12:49:05 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 16 11:49:09 2013 +0100

    xend: Drop long deprecation warning in /var/run not /tmp
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/python/xen/xm/xm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/python/xen/xm/xm b/tools/python/xen/xm/xm
index 6a3f545..fef4272 100755
--- a/tools/python/xen/xm/xm
+++ b/tools/python/xen/xm/xm
@@ -6,7 +6,7 @@ from xen.xm import main
 
 print >>sys.stderr, ("WARNING: xend/xm is deprecated.")
 
-if not os.path.exists("/tmp/xm-deprecation-long-warning"):
+if not os.path.exists("/var/run/xm-deprecation-long-warning"):
     print >>sys.stderr, ("""
 xend is deprecated and scheduled for removal. Please migrate to another
 toolstack ASAP.
@@ -15,6 +15,6 @@ See http://wiki.xen.org/wiki/Choice_of_Toolstacks for information on
 other alternatives, including xl which is designed to be a drop in
 replacement for xm (http://wiki.xen.org/wiki/XL).
 """)
-    open("/tmp/xm-deprecation-long-warning", "w").close()
+    open("/var/run/xm-deprecation-long-warning", "w").close()
 
 main.main(sys.argv)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 17 15:44:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 15:44:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWpkc-0001BN-IE; Thu, 17 Oct 2013 15:44:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpka-0001B2-Kl
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:36 +0000
Received: from [85.158.143.35:51936] by server-3.bemta-4.messagelabs.com id
	5D/F1-21600-4E500625; Thu, 17 Oct 2013 15:44:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1382024674!2540496!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9940 invoked from network); 17 Oct 2013 15:44:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 15:44:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpkY-0003UF-B8
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpkY-0007zt-7z
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:34 +0000
Date: Thu, 17 Oct 2013 15:44:34 +0000
Message-Id: <E1VWpkY-0007zt-7z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xend: Drop long deprecation warning in
	/var/run not /tmp
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d335119f7ab03c1221386749e0b539d67bdc7831
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 11 12:49:05 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Oct 16 11:49:09 2013 +0100

    xend: Drop long deprecation warning in /var/run not /tmp
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/python/xen/xm/xm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/python/xen/xm/xm b/tools/python/xen/xm/xm
index 6a3f545..fef4272 100755
--- a/tools/python/xen/xm/xm
+++ b/tools/python/xen/xm/xm
@@ -6,7 +6,7 @@ from xen.xm import main
 
 print >>sys.stderr, ("WARNING: xend/xm is deprecated.")
 
-if not os.path.exists("/tmp/xm-deprecation-long-warning"):
+if not os.path.exists("/var/run/xm-deprecation-long-warning"):
     print >>sys.stderr, ("""
 xend is deprecated and scheduled for removal. Please migrate to another
 toolstack ASAP.
@@ -15,6 +15,6 @@ See http://wiki.xen.org/wiki/Choice_of_Toolstacks for information on
 other alternatives, including xl which is designed to be a drop in
 replacement for xm (http://wiki.xen.org/wiki/XL).
 """)
-    open("/tmp/xm-deprecation-long-warning", "w").close()
+    open("/var/run/xm-deprecation-long-warning", "w").close()
 
 main.main(sys.argv)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 17 15:44:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 15:44:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWpkl-0001Cv-LR; Thu, 17 Oct 2013 15:44: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 1VWpkk-0001Cg-Vo
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:47 +0000
Received: from [193.109.254.147:57294] by server-12.bemta-14.messagelabs.com
	id C4/14-01752-EE500625; Thu, 17 Oct 2013 15:44:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1382024684!2767010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28663 invoked from network); 17 Oct 2013 15:44:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 15:44:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpki-0003UN-Gy
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpki-00080I-Fn
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:44 +0000
Date: Thu, 17 Oct 2013 15:44:44 +0000
Message-Id: <E1VWpki-00080I-Fn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: update to SeaBIOS 1.7.3.1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a65299c87b057dff6bc4c8490e15827a854d9d28
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Sep 23 13:19:16 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 16 14:51:02 2013 +0100

    tools: update to SeaBIOS 1.7.3.1
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk                     |    6 +++---
 tools/firmware/seabios-config |    9 ++++++++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/Config.mk b/Config.mk
index a26c7c0..1879454 100644
--- a/Config.mk
+++ b/Config.mk
@@ -234,9 +234,9 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
 QEMU_UPSTREAM_REVISION ?= 1c514a7734b7f98625a0d18d5e8ee7581f26e50c
-SEABIOS_UPSTREAM_TAG ?= 3a28511b46f0c2af5fae1b6ed2b0c19d7913cee3
-# Wed Jun 26 16:30:45 2013 +0100
-# xen: Don't perform SMP setup.
+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.
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
diff --git a/tools/firmware/seabios-config b/tools/firmware/seabios-config
index 3a36fd1..a497162 100644
--- a/tools/firmware/seabios-config
+++ b/tools/firmware/seabios-config
@@ -1,13 +1,16 @@
 #
 # Automatically generated make config: don't edit
 # SeaBIOS Configuration
-# Thu Jan  3 17:25:45 2013
+# Mon Sep 23 12:59:01 2013
 #
 
 #
 # General Features
 #
 # CONFIG_COREBOOT is not set
+CONFIG_QEMU=y
+# CONFIG_CSM is not set
+CONFIG_QEMU_HARDWARE=y
 CONFIG_XEN=y
 CONFIG_THREADS=y
 # CONFIG_THREAD_OPTIONROMS is not set
@@ -15,6 +18,7 @@ CONFIG_RELOCATE_INIT=y
 CONFIG_BOOTMENU=y
 # CONFIG_BOOTSPLASH is not set
 CONFIG_BOOTORDER=y
+CONFIG_ENTRY_EXTRASTACK=y
 
 #
 # Hardware support
@@ -27,6 +31,7 @@ CONFIG_VIRTIO_BLK=y
 CONFIG_VIRTIO_SCSI=y
 CONFIG_ESP_SCSI=y
 CONFIG_LSI_SCSI=y
+CONFIG_MEGASAS=y
 CONFIG_FLOPPY=y
 CONFIG_PS2PORT=y
 CONFIG_USB=y
@@ -42,6 +47,7 @@ CONFIG_SERIAL=y
 CONFIG_LPT=y
 CONFIG_USE_SMM=y
 CONFIG_MTRR_INIT=y
+CONFIG_PMTIMER=y
 
 #
 # BIOS interfaces
@@ -70,6 +76,7 @@ CONFIG_PIRTABLE=y
 CONFIG_MPTABLE=y
 CONFIG_SMBIOS=y
 CONFIG_ACPI=y
+CONFIG_ACPI_DSDT=y
 
 #
 # VGA ROM
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 17 15:44:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 15:44:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWpkl-0001Cv-LR; Thu, 17 Oct 2013 15:44: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 1VWpkk-0001Cg-Vo
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:47 +0000
Received: from [193.109.254.147:57294] by server-12.bemta-14.messagelabs.com
	id C4/14-01752-EE500625; Thu, 17 Oct 2013 15:44:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1382024684!2767010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28663 invoked from network); 17 Oct 2013 15:44:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 15:44:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpki-0003UN-Gy
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWpki-00080I-Fn
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 15:44:44 +0000
Date: Thu, 17 Oct 2013 15:44:44 +0000
Message-Id: <E1VWpki-00080I-Fn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: update to SeaBIOS 1.7.3.1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a65299c87b057dff6bc4c8490e15827a854d9d28
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Sep 23 13:19:16 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Oct 16 14:51:02 2013 +0100

    tools: update to SeaBIOS 1.7.3.1
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk                     |    6 +++---
 tools/firmware/seabios-config |    9 ++++++++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/Config.mk b/Config.mk
index a26c7c0..1879454 100644
--- a/Config.mk
+++ b/Config.mk
@@ -234,9 +234,9 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
 QEMU_UPSTREAM_REVISION ?= 1c514a7734b7f98625a0d18d5e8ee7581f26e50c
-SEABIOS_UPSTREAM_TAG ?= 3a28511b46f0c2af5fae1b6ed2b0c19d7913cee3
-# Wed Jun 26 16:30:45 2013 +0100
-# xen: Don't perform SMP setup.
+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.
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
diff --git a/tools/firmware/seabios-config b/tools/firmware/seabios-config
index 3a36fd1..a497162 100644
--- a/tools/firmware/seabios-config
+++ b/tools/firmware/seabios-config
@@ -1,13 +1,16 @@
 #
 # Automatically generated make config: don't edit
 # SeaBIOS Configuration
-# Thu Jan  3 17:25:45 2013
+# Mon Sep 23 12:59:01 2013
 #
 
 #
 # General Features
 #
 # CONFIG_COREBOOT is not set
+CONFIG_QEMU=y
+# CONFIG_CSM is not set
+CONFIG_QEMU_HARDWARE=y
 CONFIG_XEN=y
 CONFIG_THREADS=y
 # CONFIG_THREAD_OPTIONROMS is not set
@@ -15,6 +18,7 @@ CONFIG_RELOCATE_INIT=y
 CONFIG_BOOTMENU=y
 # CONFIG_BOOTSPLASH is not set
 CONFIG_BOOTORDER=y
+CONFIG_ENTRY_EXTRASTACK=y
 
 #
 # Hardware support
@@ -27,6 +31,7 @@ CONFIG_VIRTIO_BLK=y
 CONFIG_VIRTIO_SCSI=y
 CONFIG_ESP_SCSI=y
 CONFIG_LSI_SCSI=y
+CONFIG_MEGASAS=y
 CONFIG_FLOPPY=y
 CONFIG_PS2PORT=y
 CONFIG_USB=y
@@ -42,6 +47,7 @@ CONFIG_SERIAL=y
 CONFIG_LPT=y
 CONFIG_USE_SMM=y
 CONFIG_MTRR_INIT=y
+CONFIG_PMTIMER=y
 
 #
 # BIOS interfaces
@@ -70,6 +76,7 @@ CONFIG_PIRTABLE=y
 CONFIG_MPTABLE=y
 CONFIG_SMBIOS=y
 CONFIG_ACPI=y
+CONFIG_ACPI_DSDT=y
 
 #
 # VGA ROM
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 17 22:55:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 22:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWwTE-0001ri-JX; Thu, 17 Oct 2013 22: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 1VWwTD-0001ra-Kk
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 22:55:07 +0000
Received: from [85.158.137.68:31998] by server-17.bemta-3.messagelabs.com id
	A1/05-12030-ACA60625; Thu, 17 Oct 2013 22:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1382050504!2144010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8729 invoked from network); 17 Oct 2013 22:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 22:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWwTA-0000CV-8Q
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 22:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWwT9-0003Uw-PW
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 22:55:03 +0000
Date: Thu, 17 Oct 2013 22:55:03 +0000
Message-Id: <E1VWwT9-0003Uw-PW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: print relevant (tail) part of
	filename for warnings and crashes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f72cb6bbc10348f4f7671428e5db509731e9e6a5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 17 11:35:26 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 17 11:35:26 2013 +0200

    x86: print relevant (tail) part of filename for warnings and crashes
    
    In particular when the origin construct is in a header file (and
    hence the file name is an absolute path instead of just the file name
    portion) the information can otherwise become rather useless when the
    build tree isn't sitting relatively close to the file system root.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/traps.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 8dcb70a..77c200b 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -945,7 +945,7 @@ void do_invalid_op(struct cpu_user_regs *regs)
 {
     const struct bug_frame *bug;
     u8 bug_insn[2];
-    const char *filename, *predicate, *eip = (char *)regs->eip;
+    const char *prefix = "", *filename, *predicate, *eip = (char *)regs->eip;
     unsigned long fixup;
     int id, lineno;
     static const struct bug_frame *const stop_frames[] = {
@@ -996,21 +996,27 @@ void do_invalid_op(struct cpu_user_regs *regs)
     filename = bug_ptr(bug);
     if ( !is_kernel(filename) )
         goto die;
+    fixup = strlen(filename);
+    if ( fixup > 50 )
+    {
+        filename += fixup - 47;
+        prefix = "...";
+    }
     lineno = bug_line(bug);
 
     switch ( id )
     {
     case BUGFRAME_warn:
-        printk("Xen WARN at %.50s:%d\n", filename, lineno);
+        printk("Xen WARN at %s%s:%d\n", prefix, filename, lineno);
         show_execution_state(regs);
         regs->eip = (unsigned long)eip;
         return;
 
     case BUGFRAME_bug:
-        printk("Xen BUG at %.50s:%d\n", filename, lineno);
+        printk("Xen BUG at %s%s:%d\n", prefix, filename, lineno);
         DEBUGGER_trap_fatal(TRAP_invalid_op, regs);
         show_execution_state(regs);
-        panic("Xen BUG at %.50s:%d\n", filename, lineno);
+        panic("Xen BUG at %s%s:%d\n", prefix, filename, lineno);
 
     case BUGFRAME_assert:
         /* ASSERT: decode the predicate string pointer. */
@@ -1018,12 +1024,12 @@ void do_invalid_op(struct cpu_user_regs *regs)
         if ( !is_kernel(predicate) )
             predicate = "<unknown>";
 
-        printk("Assertion '%s' failed at %.50s:%d\n",
-               predicate, filename, lineno);
+        printk("Assertion '%s' failed at %s%s:%d\n",
+               predicate, prefix, filename, lineno);
         DEBUGGER_trap_fatal(TRAP_invalid_op, regs);
         show_execution_state(regs);
-        panic("Assertion '%s' failed at %.50s:%d\n",
-              predicate, filename, lineno);
+        panic("Assertion '%s' failed at %s%s:%d\n",
+              predicate, prefix, filename, lineno);
     }
 
  die:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 17 22:55:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 17 Oct 2013 22:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWwTE-0001ri-JX; Thu, 17 Oct 2013 22: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 1VWwTD-0001ra-Kk
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 22:55:07 +0000
Received: from [85.158.137.68:31998] by server-17.bemta-3.messagelabs.com id
	A1/05-12030-ACA60625; Thu, 17 Oct 2013 22:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1382050504!2144010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8729 invoked from network); 17 Oct 2013 22:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Oct 2013 22:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWwTA-0000CV-8Q
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 22:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWwT9-0003Uw-PW
	for xen-changelog@lists.xensource.com; Thu, 17 Oct 2013 22:55:03 +0000
Date: Thu, 17 Oct 2013 22:55:03 +0000
Message-Id: <E1VWwT9-0003Uw-PW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: print relevant (tail) part of
	filename for warnings and crashes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f72cb6bbc10348f4f7671428e5db509731e9e6a5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 17 11:35:26 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 17 11:35:26 2013 +0200

    x86: print relevant (tail) part of filename for warnings and crashes
    
    In particular when the origin construct is in a header file (and
    hence the file name is an absolute path instead of just the file name
    portion) the information can otherwise become rather useless when the
    build tree isn't sitting relatively close to the file system root.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/traps.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 8dcb70a..77c200b 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -945,7 +945,7 @@ void do_invalid_op(struct cpu_user_regs *regs)
 {
     const struct bug_frame *bug;
     u8 bug_insn[2];
-    const char *filename, *predicate, *eip = (char *)regs->eip;
+    const char *prefix = "", *filename, *predicate, *eip = (char *)regs->eip;
     unsigned long fixup;
     int id, lineno;
     static const struct bug_frame *const stop_frames[] = {
@@ -996,21 +996,27 @@ void do_invalid_op(struct cpu_user_regs *regs)
     filename = bug_ptr(bug);
     if ( !is_kernel(filename) )
         goto die;
+    fixup = strlen(filename);
+    if ( fixup > 50 )
+    {
+        filename += fixup - 47;
+        prefix = "...";
+    }
     lineno = bug_line(bug);
 
     switch ( id )
     {
     case BUGFRAME_warn:
-        printk("Xen WARN at %.50s:%d\n", filename, lineno);
+        printk("Xen WARN at %s%s:%d\n", prefix, filename, lineno);
         show_execution_state(regs);
         regs->eip = (unsigned long)eip;
         return;
 
     case BUGFRAME_bug:
-        printk("Xen BUG at %.50s:%d\n", filename, lineno);
+        printk("Xen BUG at %s%s:%d\n", prefix, filename, lineno);
         DEBUGGER_trap_fatal(TRAP_invalid_op, regs);
         show_execution_state(regs);
-        panic("Xen BUG at %.50s:%d\n", filename, lineno);
+        panic("Xen BUG at %s%s:%d\n", prefix, filename, lineno);
 
     case BUGFRAME_assert:
         /* ASSERT: decode the predicate string pointer. */
@@ -1018,12 +1024,12 @@ void do_invalid_op(struct cpu_user_regs *regs)
         if ( !is_kernel(predicate) )
             predicate = "<unknown>";
 
-        printk("Assertion '%s' failed at %.50s:%d\n",
-               predicate, filename, lineno);
+        printk("Assertion '%s' failed at %s%s:%d\n",
+               predicate, prefix, filename, lineno);
         DEBUGGER_trap_fatal(TRAP_invalid_op, regs);
         show_execution_state(regs);
-        panic("Assertion '%s' failed at %.50s:%d\n",
-              predicate, filename, lineno);
+        panic("Assertion '%s' failed at %s%s:%d\n",
+              predicate, prefix, filename, lineno);
     }
 
  die:
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 18 02:11:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Oct 2013 02:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWzWs-00088z-Hq; Fri, 18 Oct 2013 02:11: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 1VWzWr-00088t-6A
	for xen-changelog@lists.xensource.com; Fri, 18 Oct 2013 02:11:05 +0000
Received: from [193.109.254.147:27137] by server-15.bemta-14.messagelabs.com
	id 69/39-02681-8B890625; Fri, 18 Oct 2013 02:11:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1382062262!2852529!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20722 invoked from network); 18 Oct 2013 02:11:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Oct 2013 02:11:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWzWo-00011m-B3
	for xen-changelog@lists.xensource.com; Fri, 18 Oct 2013 02:11:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWzWo-0000yB-2w
	for xen-changelog@lists.xensource.com; Fri, 18 Oct 2013 02:11:02 +0000
Date: Fri, 18 Oct 2013 02:11:02 +0000
Message-Id: <E1VWzWo-0000yB-2w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] update Xen version to 4.3.1-rc2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a4f69699e3b5730fad2f10053c5daa2b2dce044
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 17 16:13:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 17 16:13:05 2013 +0200

    update Xen version to 4.3.1-rc2
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 474e24f..1ca446e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -212,7 +212,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.3-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.0
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.1-rc2
 SEABIOS_UPSTREAM_TAG ?= 3a28511b46f0c2af5fae1b6ed2b0c19d7913cee3
 # Wed Jun 26 16:30:45 2013 +0100
 # xen: Don't perform SMP setup.
@@ -224,7 +224,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 0bd3d991be73031b8d9c07ccf43e5785ca26ca71
+QEMU_TAG ?= xen-4.3.1-rc2
 # Thu Jul 25 08:11:55 2013 +0000
 # passthrough: Correctly expose PCH ISA bridge for IGD passthrough
 
diff --git a/xen/Makefile b/xen/Makefile
index 7b18779..5f698c8 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 3
-export XEN_EXTRAVERSION ?= .1-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-rc2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 18 02:11:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Oct 2013 02:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VWzWs-00088z-Hq; Fri, 18 Oct 2013 02:11: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 1VWzWr-00088t-6A
	for xen-changelog@lists.xensource.com; Fri, 18 Oct 2013 02:11:05 +0000
Received: from [193.109.254.147:27137] by server-15.bemta-14.messagelabs.com
	id 69/39-02681-8B890625; Fri, 18 Oct 2013 02:11:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1382062262!2852529!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20722 invoked from network); 18 Oct 2013 02:11:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Oct 2013 02:11:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWzWo-00011m-B3
	for xen-changelog@lists.xensource.com; Fri, 18 Oct 2013 02:11:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VWzWo-0000yB-2w
	for xen-changelog@lists.xensource.com; Fri, 18 Oct 2013 02:11:02 +0000
Date: Fri, 18 Oct 2013 02:11:02 +0000
Message-Id: <E1VWzWo-0000yB-2w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] update Xen version to 4.3.1-rc2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a4f69699e3b5730fad2f10053c5daa2b2dce044
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 17 16:13:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 17 16:13:05 2013 +0200

    update Xen version to 4.3.1-rc2
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 474e24f..1ca446e 100644
--- a/Config.mk
+++ b/Config.mk
@@ -212,7 +212,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.3-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.0
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.1-rc2
 SEABIOS_UPSTREAM_TAG ?= 3a28511b46f0c2af5fae1b6ed2b0c19d7913cee3
 # Wed Jun 26 16:30:45 2013 +0100
 # xen: Don't perform SMP setup.
@@ -224,7 +224,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 0bd3d991be73031b8d9c07ccf43e5785ca26ca71
+QEMU_TAG ?= xen-4.3.1-rc2
 # Thu Jul 25 08:11:55 2013 +0000
 # passthrough: Correctly expose PCH ISA bridge for IGD passthrough
 
diff --git a/xen/Makefile b/xen/Makefile
index 7b18779..5f698c8 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 3
-export XEN_EXTRAVERSION ?= .1-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-rc2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Oct 18 23:22:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Oct 2013 23: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 1VXJMv-0007Vf-Gv; Fri, 18 Oct 2013 23:22: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 1VXJMu-0007Va-DE
	for xen-changelog@lists.xensource.com; Fri, 18 Oct 2013 23:22:08 +0000
Received: from [85.158.137.68:22664] by server-4.bemta-3.messagelabs.com id
	58/E2-08123-F92C1625; Fri, 18 Oct 2013 23:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1382138523!2376263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11873 invoked from network); 18 Oct 2013 23:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Oct 2013 23:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VXJMp-0007GA-2M
	for xen-changelog@lists.xensource.com; Fri, 18 Oct 2013 23:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VXJMo-0003FP-PX
	for xen-changelog@lists.xensource.com; Fri, 18 Oct 2013 23:22:02 +0000
Date: Fri, 18 Oct 2013 23:22:02 +0000
Message-Id: <E1VXJMo-0003FP-PX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add CPU ID for Broadcom
	Brahma-B15
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 06afffeffd7a7da83b17ff7f49979d56bbdf6710
Author:     Marc Carino <marc.ceeeee@gmail.com>
AuthorDate: Wed Oct 16 15:57:06 2013 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 18 09:42:16 2013 +0100

    xen/arm: Add CPU ID for Broadcom Brahma-B15
    
    Let Xen recognize the Broadcom Brahma-B15 CPU by adding the appropriate
    MIDR mask to the initialization phase. Further, ensure that the console
    output properly reports the CPU manufacturer as "Broadcom Corporation".
    
    Signed-off-by: Marc Carino <marc.ceeeee@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/proc-v7.S |    8 ++++++++
 xen/arch/arm/setup.c         |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/arm32/proc-v7.S b/xen/arch/arm/arm32/proc-v7.S
index 6577a89..2c8cb9c 100644
--- a/xen/arch/arm/arm32/proc-v7.S
+++ b/xen/arch/arm/arm32/proc-v7.S
@@ -43,6 +43,14 @@ __v7_ca7mp_proc_info:
         .long v7_init
         .size __v7_ca7mp_proc_info, . - __v7_ca7mp_proc_info
 
+        .section ".init.proc.info", #alloc, #execinstr
+        .type __v7_brahma15mp_proc_info, #object
+__v7_brahma15mp_proc_info:
+        .long 0x420F00F2             /* Broadcom Brahma-B15 */
+        .long 0xFF0FFFFF             /* Mask */
+        .long v7_init
+        .size __v7_brahma15mp_proc_info, . - __v7_brahma15mp_proc_info
+
 /*
  * Local variables:
  * mode: ASM
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 49f344c..7d6e596 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -61,6 +61,7 @@ static void __init init_idle_domain(void)
 
 static const char * __initdata processor_implementers[] = {
     ['A'] = "ARM Limited",
+    ['B'] = "Broadcom Corporation",
     ['D'] = "Digital Equipment Corp",
     ['M'] = "Motorola, Freescale Semiconductor Inc.",
     ['Q'] = "Qualcomm Inc.",
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 18 23:22:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 18 Oct 2013 23: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 1VXJMv-0007Vf-Gv; Fri, 18 Oct 2013 23:22: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 1VXJMu-0007Va-DE
	for xen-changelog@lists.xensource.com; Fri, 18 Oct 2013 23:22:08 +0000
Received: from [85.158.137.68:22664] by server-4.bemta-3.messagelabs.com id
	58/E2-08123-F92C1625; Fri, 18 Oct 2013 23:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1382138523!2376263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11873 invoked from network); 18 Oct 2013 23:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Oct 2013 23:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VXJMp-0007GA-2M
	for xen-changelog@lists.xensource.com; Fri, 18 Oct 2013 23:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VXJMo-0003FP-PX
	for xen-changelog@lists.xensource.com; Fri, 18 Oct 2013 23:22:02 +0000
Date: Fri, 18 Oct 2013 23:22:02 +0000
Message-Id: <E1VXJMo-0003FP-PX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add CPU ID for Broadcom
	Brahma-B15
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 06afffeffd7a7da83b17ff7f49979d56bbdf6710
Author:     Marc Carino <marc.ceeeee@gmail.com>
AuthorDate: Wed Oct 16 15:57:06 2013 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Oct 18 09:42:16 2013 +0100

    xen/arm: Add CPU ID for Broadcom Brahma-B15
    
    Let Xen recognize the Broadcom Brahma-B15 CPU by adding the appropriate
    MIDR mask to the initialization phase. Further, ensure that the console
    output properly reports the CPU manufacturer as "Broadcom Corporation".
    
    Signed-off-by: Marc Carino <marc.ceeeee@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/proc-v7.S |    8 ++++++++
 xen/arch/arm/setup.c         |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/arm32/proc-v7.S b/xen/arch/arm/arm32/proc-v7.S
index 6577a89..2c8cb9c 100644
--- a/xen/arch/arm/arm32/proc-v7.S
+++ b/xen/arch/arm/arm32/proc-v7.S
@@ -43,6 +43,14 @@ __v7_ca7mp_proc_info:
         .long v7_init
         .size __v7_ca7mp_proc_info, . - __v7_ca7mp_proc_info
 
+        .section ".init.proc.info", #alloc, #execinstr
+        .type __v7_brahma15mp_proc_info, #object
+__v7_brahma15mp_proc_info:
+        .long 0x420F00F2             /* Broadcom Brahma-B15 */
+        .long 0xFF0FFFFF             /* Mask */
+        .long v7_init
+        .size __v7_brahma15mp_proc_info, . - __v7_brahma15mp_proc_info
+
 /*
  * Local variables:
  * mode: ASM
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 49f344c..7d6e596 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -61,6 +61,7 @@ static void __init init_idle_domain(void)
 
 static const char * __initdata processor_implementers[] = {
     ['A'] = "ARM Limited",
+    ['B'] = "Broadcom Corporation",
     ['D'] = "Digital Equipment Corp",
     ['M'] = "Motorola, Freescale Semiconductor Inc.",
     ['Q'] = "Qualcomm Inc.",
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 21 09:55:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 21 Oct 2013 09:55: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 1VYCCa-00013a-JB; Mon, 21 Oct 2013 09:55:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VYCCZ-00013S-Mh
	for xen-changelog@lists.xensource.com; Mon, 21 Oct 2013 09:55:07 +0000
Received: from [85.158.137.68:49945] by server-8.bemta-3.messagelabs.com id
	F1/48-06638-AF9F4625; Mon, 21 Oct 2013 09:55:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-31.messagelabs.com!1382349304!2673445!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14026 invoked from network); 21 Oct 2013 09:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Oct 2013 09:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VYCCV-0001Ks-Ul
	for xen-changelog@lists.xensource.com; Mon, 21 Oct 2013 09:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VYCCV-0000rD-R3
	for xen-changelog@lists.xensource.com; Mon, 21 Oct 2013 09:55:03 +0000
Message-Id: <E1VYCCV-0000rD-R3@xenbits.xen.org>
Date: Mon, 21 Oct 2013 09:55:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] pcifront: Deal with toolstack
	missing 'XenbusStateClosing' 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

# HG changeset patch
# User Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
# Date 1382348852 -7200
# Node ID 2427f3a0bac88b02829e4c3d75a349c596fa0dd7
# Parent  3ae180dda3a99b5208e13083a3767c041632363b
pcifront: Deal with toolstack missing 'XenbusStateClosing' state.

There are two tool-stack that can instruct the Xen PCI frontend
and backend to change states: 'xm' (Python code with a daemon),
and 'xl' (C library - does not keep state changes).

With the 'xm', the path to disconnect a single PCI device (xm pci-detach
<guest> <BDF>) is:

4(Connected)->7(Reconfiguring*)-> 8(Reconfigured)-> 4(Connected)->5(Closing*).

The * is for states that the tool-stack sets. For 'xl', it is similar:

4(Connected)->7(Reconfiguring*)-> 8(Reconfigured)-> 4(Connected)

Both of them also tear down the XenBus structure, so the backend
state ends up going in the 3(Initialised) and calls pcifront_xenbus_remove.

When a PCI device is plugged back in (xm pci-attach <guest> <BDF>)
both of them follow the same pattern:

2(InitWait*), 3(Initialized*), 4(Connected*)->4(Connected).

[xen-pcifront ignores the 2,3 state changes and only acts when
4 (Connected) has been reached]

Note that this is for a _single_ PCI device. If there were two
PCI devices and only one was disconnected 'xm' would show the same
state changes.

The problem is that git commit 3d925320e9e2de162bd138bf97816bda8c3f71be
("xen/pcifront: Use Xen-SWIOTLB when initting if required") introduced
a mechanism to initialize the SWIOTLB when the Xen PCI front moves to
Connected state. It also had some aggressive seatbelt code check that
would warn the user if one tried to change to Connected state without
hitting first the Closing state:

 pcifront pci-0: PCI frontend already installed!

However, that code can be relaxed and we can continue on working
even if the frontend is instructed to be the 'Connected' state with
no devices and then gets tickled to be in 'Connected' state again.

In other words, this 4(Connected)->5(Closing)->4(Connected) state
was expected, while 4(Connected)->.... anything but 5(Closing)->4(Connected)
was not. This patch removes that aggressive check and allows
Xen pcifront to work with the 'xl' toolstack (for one or more
PCI devices) and with 'xm' toolstack (for more than two PCI
devices).

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

While I continue to think this ought to be fixed in xl, consensus seems
to be that the frontend should be able to cope with this.

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


diff -r 3ae180dda3a9 -r 2427f3a0bac8 drivers/xen/pcifront/pci.c
--- a/drivers/xen/pcifront/pci.c	Wed Oct 16 15:07:28 2013 +0200
+++ b/drivers/xen/pcifront/pci.c	Mon Oct 21 11:47:32 2013 +0200
@@ -22,10 +22,8 @@ int pcifront_connect(struct pcifront_dev
 		dev_info(&pdev->xdev->dev, "Installing PCI frontend\n");
 		pcifront_dev = pdev;
 	}
-	else {
-		dev_err(&pdev->xdev->dev, "PCI frontend already installed!\n");
-		err = -EEXIST;
-	}
+	else
+		dev_info(&pdev->xdev->dev, "PCI frontend already installed\n");
 
 	spin_unlock(&pcifront_dev_lock);
 

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

From xen-changelog-bounces@lists.xen.org Mon Oct 21 09:55:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 21 Oct 2013 09:55: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 1VYCCa-00013a-JB; Mon, 21 Oct 2013 09:55:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VYCCZ-00013S-Mh
	for xen-changelog@lists.xensource.com; Mon, 21 Oct 2013 09:55:07 +0000
Received: from [85.158.137.68:49945] by server-8.bemta-3.messagelabs.com id
	F1/48-06638-AF9F4625; Mon, 21 Oct 2013 09:55:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-31.messagelabs.com!1382349304!2673445!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14026 invoked from network); 21 Oct 2013 09:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Oct 2013 09:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VYCCV-0001Ks-Ul
	for xen-changelog@lists.xensource.com; Mon, 21 Oct 2013 09:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VYCCV-0000rD-R3
	for xen-changelog@lists.xensource.com; Mon, 21 Oct 2013 09:55:03 +0000
Message-Id: <E1VYCCV-0000rD-R3@xenbits.xen.org>
Date: Mon, 21 Oct 2013 09:55:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] pcifront: Deal with toolstack
	missing 'XenbusStateClosing' 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

# HG changeset patch
# User Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
# Date 1382348852 -7200
# Node ID 2427f3a0bac88b02829e4c3d75a349c596fa0dd7
# Parent  3ae180dda3a99b5208e13083a3767c041632363b
pcifront: Deal with toolstack missing 'XenbusStateClosing' state.

There are two tool-stack that can instruct the Xen PCI frontend
and backend to change states: 'xm' (Python code with a daemon),
and 'xl' (C library - does not keep state changes).

With the 'xm', the path to disconnect a single PCI device (xm pci-detach
<guest> <BDF>) is:

4(Connected)->7(Reconfiguring*)-> 8(Reconfigured)-> 4(Connected)->5(Closing*).

The * is for states that the tool-stack sets. For 'xl', it is similar:

4(Connected)->7(Reconfiguring*)-> 8(Reconfigured)-> 4(Connected)

Both of them also tear down the XenBus structure, so the backend
state ends up going in the 3(Initialised) and calls pcifront_xenbus_remove.

When a PCI device is plugged back in (xm pci-attach <guest> <BDF>)
both of them follow the same pattern:

2(InitWait*), 3(Initialized*), 4(Connected*)->4(Connected).

[xen-pcifront ignores the 2,3 state changes and only acts when
4 (Connected) has been reached]

Note that this is for a _single_ PCI device. If there were two
PCI devices and only one was disconnected 'xm' would show the same
state changes.

The problem is that git commit 3d925320e9e2de162bd138bf97816bda8c3f71be
("xen/pcifront: Use Xen-SWIOTLB when initting if required") introduced
a mechanism to initialize the SWIOTLB when the Xen PCI front moves to
Connected state. It also had some aggressive seatbelt code check that
would warn the user if one tried to change to Connected state without
hitting first the Closing state:

 pcifront pci-0: PCI frontend already installed!

However, that code can be relaxed and we can continue on working
even if the frontend is instructed to be the 'Connected' state with
no devices and then gets tickled to be in 'Connected' state again.

In other words, this 4(Connected)->5(Closing)->4(Connected) state
was expected, while 4(Connected)->.... anything but 5(Closing)->4(Connected)
was not. This patch removes that aggressive check and allows
Xen pcifront to work with the 'xl' toolstack (for one or more
PCI devices) and with 'xm' toolstack (for more than two PCI
devices).

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

While I continue to think this ought to be fixed in xl, consensus seems
to be that the frontend should be able to cope with this.

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


diff -r 3ae180dda3a9 -r 2427f3a0bac8 drivers/xen/pcifront/pci.c
--- a/drivers/xen/pcifront/pci.c	Wed Oct 16 15:07:28 2013 +0200
+++ b/drivers/xen/pcifront/pci.c	Mon Oct 21 11:47:32 2013 +0200
@@ -22,10 +22,8 @@ int pcifront_connect(struct pcifront_dev
 		dev_info(&pdev->xdev->dev, "Installing PCI frontend\n");
 		pcifront_dev = pdev;
 	}
-	else {
-		dev_err(&pdev->xdev->dev, "PCI frontend already installed!\n");
-		err = -EEXIST;
-	}
+	else
+		dev_info(&pdev->xdev->dev, "PCI frontend already installed\n");
 
 	spin_unlock(&pcifront_dev_lock);
 

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

From xen-changelog-bounces@lists.xen.org Tue Oct 22 03:22:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Oct 2013 03: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 1VYSXo-0000Dd-8J; Tue, 22 Oct 2013 03: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 1VYSXm-0000DX-H3
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 03:22:06 +0000
Received: from [85.158.137.68:46494] by server-6.bemta-3.messagelabs.com id
	DB/CD-23777-D5FE5625; Tue, 22 Oct 2013 03:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1382412123!2833935!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 433 invoked from network); 22 Oct 2013 03:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2013 03:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYSXj-0003R8-EJ
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 03:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYSXj-0005XQ-4J
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 03:22:03 +0000
Date: Tue, 22 Oct 2013 03:22:03 +0000
Message-Id: <E1VYSXj-0005XQ-4J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsave: also save/restore XCR0
	across suspend (ACPI S3)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e47a90e6dca491c0ceea6ffa18055e7e32565e8e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 21 17:26:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 21 17:26:16 2013 +0200

    x86/xsave: also save/restore XCR0 across suspend (ACPI S3)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/acpi/suspend.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/acpi/suspend.c b/xen/arch/x86/acpi/suspend.c
index 9c3cf38..6fdd876 100644
--- a/xen/arch/x86/acpi/suspend.c
+++ b/xen/arch/x86/acpi/suspend.c
@@ -13,12 +13,14 @@
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/support.h>
 #include <asm/i387.h>
+#include <asm/xstate.h>
 #include <xen/hypercall.h>
 
 static unsigned long saved_lstar, saved_cstar;
 static unsigned long saved_sysenter_esp, saved_sysenter_eip;
 static unsigned long saved_fs_base, saved_gs_base, saved_kernel_gs_base;
 static uint16_t saved_segs[4];
+static uint64_t saved_xcr0;
 
 void save_rest_processor_state(void)
 {
@@ -38,6 +40,8 @@ void save_rest_processor_state(void)
         rdmsrl(MSR_IA32_SYSENTER_ESP, saved_sysenter_esp);
         rdmsrl(MSR_IA32_SYSENTER_EIP, saved_sysenter_eip);
     }
+    if ( cpu_has_xsave )
+        saved_xcr0 = get_xcr0();
 }
 
 
@@ -77,6 +81,9 @@ void restore_rest_processor_state(void)
         do_set_segment_base(SEGBASE_GS_USER_SEL, saved_segs[3]);
     }
 
+    if ( cpu_has_xsave && !set_xcr0(saved_xcr0) )
+        BUG();
+
     /* Maybe load the debug registers. */
     BUG_ON(is_hvm_vcpu(curr));
     if ( !is_idle_vcpu(curr) && curr->arch.debugreg[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 Tue Oct 22 03:22:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Oct 2013 03: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 1VYSXo-0000Dd-8J; Tue, 22 Oct 2013 03: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 1VYSXm-0000DX-H3
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 03:22:06 +0000
Received: from [85.158.137.68:46494] by server-6.bemta-3.messagelabs.com id
	DB/CD-23777-D5FE5625; Tue, 22 Oct 2013 03:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1382412123!2833935!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 433 invoked from network); 22 Oct 2013 03:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2013 03:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYSXj-0003R8-EJ
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 03:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYSXj-0005XQ-4J
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 03:22:03 +0000
Date: Tue, 22 Oct 2013 03:22:03 +0000
Message-Id: <E1VYSXj-0005XQ-4J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsave: also save/restore XCR0
	across suspend (ACPI S3)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e47a90e6dca491c0ceea6ffa18055e7e32565e8e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 21 17:26:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 21 17:26:16 2013 +0200

    x86/xsave: also save/restore XCR0 across suspend (ACPI S3)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/acpi/suspend.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/acpi/suspend.c b/xen/arch/x86/acpi/suspend.c
index 9c3cf38..6fdd876 100644
--- a/xen/arch/x86/acpi/suspend.c
+++ b/xen/arch/x86/acpi/suspend.c
@@ -13,12 +13,14 @@
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/support.h>
 #include <asm/i387.h>
+#include <asm/xstate.h>
 #include <xen/hypercall.h>
 
 static unsigned long saved_lstar, saved_cstar;
 static unsigned long saved_sysenter_esp, saved_sysenter_eip;
 static unsigned long saved_fs_base, saved_gs_base, saved_kernel_gs_base;
 static uint16_t saved_segs[4];
+static uint64_t saved_xcr0;
 
 void save_rest_processor_state(void)
 {
@@ -38,6 +40,8 @@ void save_rest_processor_state(void)
         rdmsrl(MSR_IA32_SYSENTER_ESP, saved_sysenter_esp);
         rdmsrl(MSR_IA32_SYSENTER_EIP, saved_sysenter_eip);
     }
+    if ( cpu_has_xsave )
+        saved_xcr0 = get_xcr0();
 }
 
 
@@ -77,6 +81,9 @@ void restore_rest_processor_state(void)
         do_set_segment_base(SEGBASE_GS_USER_SEL, saved_segs[3]);
     }
 
+    if ( cpu_has_xsave && !set_xcr0(saved_xcr0) )
+        BUG();
+
     /* Maybe load the debug registers. */
     BUG_ON(is_hvm_vcpu(curr));
     if ( !is_idle_vcpu(curr) && curr->arch.debugreg[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 Tue Oct 22 23:55:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Oct 2013 23:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VYln7-00076x-Jd; Tue, 22 Oct 2013 23:55: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 1VYln5-00076h-QD
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:12 +0000
Received: from [85.158.139.211:59453] by server-14.bemta-5.messagelabs.com id
	CB/7C-29404-F5017625; Tue, 22 Oct 2013 23:55:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1382486108!2974177!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6029 invoked from network); 22 Oct 2013 23:55:10 -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;
	22 Oct 2013 23:55:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYln2-0000n4-Mz
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYln2-00083c-G3
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:08 +0000
Date: Tue, 22 Oct 2013 23:55:08 +0000
Message-Id: <E1VYln2-00083c-G3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/irq: local_irq_restore() should
	not blindly popf
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e5fc6434d710894b5fc5a676d7f4c41608ab3ae6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 22 17:11:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 17:11:16 2013 +0200

    x86/irq: local_irq_restore() should not blindly popf
    
    local_irq_restore() should only be concerned with possibly changing the
    interrupt flag.  A blind popf could corrupt other system flags.
    
    While playing in this area, fixup an opencoded use of X86_EFLAGS_IF.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/asm-x86/system.h |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 6ab7d56..e9602aa 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -3,6 +3,7 @@
 
 #include <xen/lib.h>
 #include <xen/bitops.h>
+#include <asm/processor.h>
 
 #define read_segment_register(name)                             \
 ({  u16 __sel;                                                  \
@@ -159,15 +160,19 @@ static always_inline unsigned long __cmpxchg(
 #define local_irq_restore(x)                                     \
 ({                                                               \
     BUILD_BUG_ON(sizeof(x) != sizeof(long));                     \
-    asm volatile ( "push" __OS " %0 ; popf" __OS                 \
-                   : : "g" (x) : "memory", "cc" );               \
+    asm volatile ( "pushfq\n\t"                                  \
+                   "andq %0, (%%rsp)\n\t"                        \
+                   "orq  %1, (%%rsp)\n\t"                        \
+                   "popfq"                                       \
+                   : : "i?r" ( ~X86_EFLAGS_IF ),                 \
+                       "ri" ( (x) & X86_EFLAGS_IF ) );           \
 })
 
 static inline int local_irq_is_enabled(void)
 {
     unsigned long flags;
     local_save_flags(flags);
-    return !!(flags & (1<<9)); /* EFLAGS_IF */
+    return !!(flags & X86_EFLAGS_IF);
 }
 
 #define BROKEN_ACPI_Sx          0x0001
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 22 23:55:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Oct 2013 23:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VYln7-00076x-Jd; Tue, 22 Oct 2013 23:55: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 1VYln5-00076h-QD
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:12 +0000
Received: from [85.158.139.211:59453] by server-14.bemta-5.messagelabs.com id
	CB/7C-29404-F5017625; Tue, 22 Oct 2013 23:55:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1382486108!2974177!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6029 invoked from network); 22 Oct 2013 23:55:10 -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;
	22 Oct 2013 23:55:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYln2-0000n4-Mz
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYln2-00083c-G3
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:08 +0000
Date: Tue, 22 Oct 2013 23:55:08 +0000
Message-Id: <E1VYln2-00083c-G3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/irq: local_irq_restore() should
	not blindly popf
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e5fc6434d710894b5fc5a676d7f4c41608ab3ae6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 22 17:11:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 17:11:16 2013 +0200

    x86/irq: local_irq_restore() should not blindly popf
    
    local_irq_restore() should only be concerned with possibly changing the
    interrupt flag.  A blind popf could corrupt other system flags.
    
    While playing in this area, fixup an opencoded use of X86_EFLAGS_IF.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/asm-x86/system.h |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 6ab7d56..e9602aa 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -3,6 +3,7 @@
 
 #include <xen/lib.h>
 #include <xen/bitops.h>
+#include <asm/processor.h>
 
 #define read_segment_register(name)                             \
 ({  u16 __sel;                                                  \
@@ -159,15 +160,19 @@ static always_inline unsigned long __cmpxchg(
 #define local_irq_restore(x)                                     \
 ({                                                               \
     BUILD_BUG_ON(sizeof(x) != sizeof(long));                     \
-    asm volatile ( "push" __OS " %0 ; popf" __OS                 \
-                   : : "g" (x) : "memory", "cc" );               \
+    asm volatile ( "pushfq\n\t"                                  \
+                   "andq %0, (%%rsp)\n\t"                        \
+                   "orq  %1, (%%rsp)\n\t"                        \
+                   "popfq"                                       \
+                   : : "i?r" ( ~X86_EFLAGS_IF ),                 \
+                       "ri" ( (x) & X86_EFLAGS_IF ) );           \
 })
 
 static inline int local_irq_is_enabled(void)
 {
     unsigned long flags;
     local_save_flags(flags);
-    return !!(flags & (1<<9)); /* EFLAGS_IF */
+    return !!(flags & X86_EFLAGS_IF);
 }
 
 #define BROKEN_ACPI_Sx          0x0001
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 22 23:55:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Oct 2013 23:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VYlnH-00077l-NM; Tue, 22 Oct 2013 23:55: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 1VYlnG-00077P-30
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:22 +0000
Received: from [85.158.143.35:48838] by server-1.bemta-4.messagelabs.com id
	F2/DC-17304-96017625; Tue, 22 Oct 2013 23:55:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1382486119!3642238!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13421 invoked from network); 22 Oct 2013 23:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2013 23:55:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYlnD-0000n7-7J
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYlnC-000844-SB
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:18 +0000
Date: Tue, 22 Oct 2013 23:55:18 +0000
Message-Id: <E1VYlnC-000844-SB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] widen flags parameter for
	spinlock_irqsave() and friends
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 782dcf5c502ce089d13eaa92e1c6c324f751df16
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 22 17:15:58 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 17:15:58 2013 +0200

    widen flags parameter for spinlock_irqsave() and friends
    
    These issues were detected using the subsequent patch which forces a
    compilation error if the result from local_irq_save() would be truncated.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/sched_credit2.c |    7 ++++---
 xen/common/trace.c         |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 84e547b..4e68375 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -1480,7 +1480,7 @@ static void *
 csched_alloc_domdata(const struct scheduler *ops, struct domain *dom)
 {
     struct csched_dom *sdom;
-    int flags;
+    unsigned long flags;
 
     sdom = xzalloc(struct csched_dom);
     if ( sdom == NULL )
@@ -1524,7 +1524,7 @@ csched_dom_init(const struct scheduler *ops, struct domain *dom)
 static void
 csched_free_domdata(const struct scheduler *ops, void *data)
 {
-    int flags;
+    unsigned long flags;
     struct csched_dom *sdom = data;
 
     spin_lock_irqsave(&CSCHED_PRIV(ops)->lock, flags);
@@ -1944,7 +1944,8 @@ static void deactivate_runqueue(struct csched_private *prv, int rqi)
 
 static void init_pcpu(const struct scheduler *ops, int cpu)
 {
-    int rqi, flags;
+    int rqi;
+    unsigned long flags;
     struct csched_private *prv = CSCHED_PRIV(ops);
     struct csched_runqueue_data *rqd;
     spinlock_t *old_lock;
diff --git a/xen/common/trace.c b/xen/common/trace.c
index 63ea0b7..41ddc33 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -420,7 +420,7 @@ int tb_control(xen_sysctl_tbuf_op_t *tbc)
          * hypercall returns, no more records should be placed into the buffers. */
         for_each_online_cpu(i)
         {
-            int flags;
+            unsigned long flags;
             spin_lock_irqsave(&per_cpu(t_lock, i), flags);
             per_cpu(lost_records, i)=0;
             spin_unlock_irqrestore(&per_cpu(t_lock, i), 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 Tue Oct 22 23:55:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Oct 2013 23:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VYlnH-00077l-NM; Tue, 22 Oct 2013 23:55: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 1VYlnG-00077P-30
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:22 +0000
Received: from [85.158.143.35:48838] by server-1.bemta-4.messagelabs.com id
	F2/DC-17304-96017625; Tue, 22 Oct 2013 23:55:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1382486119!3642238!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13421 invoked from network); 22 Oct 2013 23:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2013 23:55:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYlnD-0000n7-7J
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYlnC-000844-SB
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:18 +0000
Date: Tue, 22 Oct 2013 23:55:18 +0000
Message-Id: <E1VYlnC-000844-SB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] widen flags parameter for
	spinlock_irqsave() and friends
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 782dcf5c502ce089d13eaa92e1c6c324f751df16
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 22 17:15:58 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 17:15:58 2013 +0200

    widen flags parameter for spinlock_irqsave() and friends
    
    These issues were detected using the subsequent patch which forces a
    compilation error if the result from local_irq_save() would be truncated.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/sched_credit2.c |    7 ++++---
 xen/common/trace.c         |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 84e547b..4e68375 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -1480,7 +1480,7 @@ static void *
 csched_alloc_domdata(const struct scheduler *ops, struct domain *dom)
 {
     struct csched_dom *sdom;
-    int flags;
+    unsigned long flags;
 
     sdom = xzalloc(struct csched_dom);
     if ( sdom == NULL )
@@ -1524,7 +1524,7 @@ csched_dom_init(const struct scheduler *ops, struct domain *dom)
 static void
 csched_free_domdata(const struct scheduler *ops, void *data)
 {
-    int flags;
+    unsigned long flags;
     struct csched_dom *sdom = data;
 
     spin_lock_irqsave(&CSCHED_PRIV(ops)->lock, flags);
@@ -1944,7 +1944,8 @@ static void deactivate_runqueue(struct csched_private *prv, int rqi)
 
 static void init_pcpu(const struct scheduler *ops, int cpu)
 {
-    int rqi, flags;
+    int rqi;
+    unsigned long flags;
     struct csched_private *prv = CSCHED_PRIV(ops);
     struct csched_runqueue_data *rqd;
     spinlock_t *old_lock;
diff --git a/xen/common/trace.c b/xen/common/trace.c
index 63ea0b7..41ddc33 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -420,7 +420,7 @@ int tb_control(xen_sysctl_tbuf_op_t *tbc)
          * hypercall returns, no more records should be placed into the buffers. */
         for_each_online_cpu(i)
         {
-            int flags;
+            unsigned long flags;
             spin_lock_irqsave(&per_cpu(t_lock, i), flags);
             per_cpu(lost_records, i)=0;
             spin_unlock_irqrestore(&per_cpu(t_lock, i), 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 Tue Oct 22 23:55:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Oct 2013 23:55:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VYlnR-000797-QL; Tue, 22 Oct 2013 23:55:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYlnQ-00078m-3B
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:32 +0000
Received: from [85.158.143.35:15760] by server-2.bemta-4.messagelabs.com id
	8C/2F-06473-37017625; Tue, 22 Oct 2013 23:55:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1382486129!2962887!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17484 invoked from network); 22 Oct 2013 23:55:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2013 23:55:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYlnN-0000nF-H2
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYlnN-00084T-Bj
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:29 +0000
Date: Tue, 22 Oct 2013 23:55:29 +0000
Message-Id: <E1VYlnN-00084T-Bj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] spinlock: ensure the flags parameter
	is wide enough
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 170fa9967176c8627fe2e75dbe1dc5212019afde
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 22 17:16:29 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 17:16:29 2013 +0200

    spinlock: ensure the flags parameter is wide enough
    
    Because of the construction of spin_lock_irq() (and varients), the flags
    parameter could be trucated.  Use a BUILD_BUG_ON() to verify the width of the
    parameter.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/xen/spinlock.h |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 76581c5..12b0a89 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -188,7 +188,11 @@ int _rw_is_write_locked(rwlock_t *lock);
 
 #define spin_lock(l)                  _spin_lock(l)
 #define spin_lock_irq(l)              _spin_lock_irq(l)
-#define spin_lock_irqsave(l, f)       ((f) = _spin_lock_irqsave(l))
+#define spin_lock_irqsave(l, f)                                 \
+    ({                                                          \
+        BUILD_BUG_ON(sizeof(f) != sizeof(unsigned long));       \
+        ((f) = _spin_lock_irqsave(l));                          \
+    })
 
 #define spin_unlock(l)                _spin_unlock(l)
 #define spin_unlock_irq(l)            _spin_unlock_irq(l)
@@ -220,7 +224,11 @@ int _rw_is_write_locked(rwlock_t *lock);
 
 #define read_lock(l)                  _read_lock(l)
 #define read_lock_irq(l)              _read_lock_irq(l)
-#define read_lock_irqsave(l, f)       ((f) = _read_lock_irqsave(l))
+#define read_lock_irqsave(l, f)                                 \
+    ({                                                          \
+        BUILD_BUG_ON(sizeof(f) != sizeof(unsigned long));       \
+        ((f) = _read_lock_irqsave(l));                          \
+    })
 
 #define read_unlock(l)                _read_unlock(l)
 #define read_unlock_irq(l)            _read_unlock_irq(l)
@@ -229,7 +237,11 @@ int _rw_is_write_locked(rwlock_t *lock);
 
 #define write_lock(l)                 _write_lock(l)
 #define write_lock_irq(l)             _write_lock_irq(l)
-#define write_lock_irqsave(l, f)      ((f) = _write_lock_irqsave(l))
+#define write_lock_irqsave(l, f)                                \
+    ({                                                          \
+        BUILD_BUG_ON(sizeof(f) != sizeof(unsigned long));       \
+        ((f) = _write_lock_irqsave(l));                         \
+    })
 #define write_trylock(l)              _write_trylock(l)
 
 #define write_unlock(l)               _write_unlock(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 Tue Oct 22 23:55:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 22 Oct 2013 23:55:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VYlnR-000797-QL; Tue, 22 Oct 2013 23:55:33 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYlnQ-00078m-3B
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:32 +0000
Received: from [85.158.143.35:15760] by server-2.bemta-4.messagelabs.com id
	8C/2F-06473-37017625; Tue, 22 Oct 2013 23:55:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1382486129!2962887!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17484 invoked from network); 22 Oct 2013 23:55:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Oct 2013 23:55:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYlnN-0000nF-H2
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VYlnN-00084T-Bj
	for xen-changelog@lists.xensource.com; Tue, 22 Oct 2013 23:55:29 +0000
Date: Tue, 22 Oct 2013 23:55:29 +0000
Message-Id: <E1VYlnN-00084T-Bj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] spinlock: ensure the flags parameter
	is wide enough
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 170fa9967176c8627fe2e75dbe1dc5212019afde
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 22 17:16:29 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 17:16:29 2013 +0200

    spinlock: ensure the flags parameter is wide enough
    
    Because of the construction of spin_lock_irq() (and varients), the flags
    parameter could be trucated.  Use a BUILD_BUG_ON() to verify the width of the
    parameter.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/xen/spinlock.h |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 76581c5..12b0a89 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -188,7 +188,11 @@ int _rw_is_write_locked(rwlock_t *lock);
 
 #define spin_lock(l)                  _spin_lock(l)
 #define spin_lock_irq(l)              _spin_lock_irq(l)
-#define spin_lock_irqsave(l, f)       ((f) = _spin_lock_irqsave(l))
+#define spin_lock_irqsave(l, f)                                 \
+    ({                                                          \
+        BUILD_BUG_ON(sizeof(f) != sizeof(unsigned long));       \
+        ((f) = _spin_lock_irqsave(l));                          \
+    })
 
 #define spin_unlock(l)                _spin_unlock(l)
 #define spin_unlock_irq(l)            _spin_unlock_irq(l)
@@ -220,7 +224,11 @@ int _rw_is_write_locked(rwlock_t *lock);
 
 #define read_lock(l)                  _read_lock(l)
 #define read_lock_irq(l)              _read_lock_irq(l)
-#define read_lock_irqsave(l, f)       ((f) = _read_lock_irqsave(l))
+#define read_lock_irqsave(l, f)                                 \
+    ({                                                          \
+        BUILD_BUG_ON(sizeof(f) != sizeof(unsigned long));       \
+        ((f) = _read_lock_irqsave(l));                          \
+    })
 
 #define read_unlock(l)                _read_unlock(l)
 #define read_unlock_irq(l)            _read_unlock_irq(l)
@@ -229,7 +237,11 @@ int _rw_is_write_locked(rwlock_t *lock);
 
 #define write_lock(l)                 _write_lock(l)
 #define write_lock_irq(l)             _write_lock_irq(l)
-#define write_lock_irqsave(l, f)      ((f) = _write_lock_irqsave(l))
+#define write_lock_irqsave(l, f)                                \
+    ({                                                          \
+        BUILD_BUG_ON(sizeof(f) != sizeof(unsigned long));       \
+        ((f) = _write_lock_irqsave(l));                         \
+    })
 #define write_trylock(l)              _write_trylock(l)
 
 #define write_unlock(l)               _write_unlock(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 Oct 25 08:55:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:55: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 1VZdAl-00069c-7l; Fri, 25 Oct 2013 08:55: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 1VZdAj-00069V-Em
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:09 +0000
Received: from [85.158.137.68:59013] by server-17.bemta-3.messagelabs.com id
	1B/D3-12030-CE13A625; Fri, 25 Oct 2013 08:55:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1382691306!3693305!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25779 invoked from network); 25 Oct 2013 08:55:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:55:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdAg-0002Ls-5a
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdAf-0007DJ-Mb
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:05 +0000
Date: Fri, 25 Oct 2013 08:55:05 +0000
Message-Id: <E1VZdAf-0007DJ-Mb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: add_to_physmap_one: Avoid to
	map mfn 0 if an error occurs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 55021ff9ab691f8c79c1f881aa8ac40ae1cd4ab9
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Oct 23 17:28:47 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:02:02 2013 +0100

    xen/arm: add_to_physmap_one: Avoid to map mfn 0 if an error occurs
    
    By default, the function add_to_physmap_one set mfn to 0. Some code paths that
    result to an error, continue and the map the mfn 0 (valid on ARM) to the
    slot given by the guest.
    
    To fix the problem, return directly an error if sanity check has failed.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/mm.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 474dfef..eaeb0c3 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -981,6 +981,8 @@ static int xenmem_add_to_physmap_one(
             idx &= ~XENMAPIDX_grant_table_status;
             if ( idx < nr_status_frames(d->grant_table) )
                 mfn = virt_to_mfn(d->grant_table->status[idx]);
+            else
+                return -EINVAL;
         }
         else
         {
@@ -990,6 +992,8 @@ static int xenmem_add_to_physmap_one(
 
             if ( idx < nr_grant_frames(d->grant_table) )
                 mfn = virt_to_mfn(d->grant_table->shared_raw[idx]);
+            else
+                return -EINVAL;
         }
         
         d->arch.grant_table_gpfn[idx] = gpfn;
@@ -999,6 +1003,8 @@ static int xenmem_add_to_physmap_one(
     case XENMAPSPACE_shared_info:
         if ( idx == 0 )
             mfn = virt_to_mfn(d->shared_info);
+        else
+            return -EINVAL;
         break;
     case XENMAPSPACE_gmfn_foreign:
     {
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 25 08:55:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:55: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 1VZdAl-00069c-7l; Fri, 25 Oct 2013 08:55: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 1VZdAj-00069V-Em
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:09 +0000
Received: from [85.158.137.68:59013] by server-17.bemta-3.messagelabs.com id
	1B/D3-12030-CE13A625; Fri, 25 Oct 2013 08:55:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1382691306!3693305!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25779 invoked from network); 25 Oct 2013 08:55:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:55:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdAg-0002Ls-5a
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdAf-0007DJ-Mb
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:05 +0000
Date: Fri, 25 Oct 2013 08:55:05 +0000
Message-Id: <E1VZdAf-0007DJ-Mb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: add_to_physmap_one: Avoid to
	map mfn 0 if an error occurs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 55021ff9ab691f8c79c1f881aa8ac40ae1cd4ab9
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Oct 23 17:28:47 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:02:02 2013 +0100

    xen/arm: add_to_physmap_one: Avoid to map mfn 0 if an error occurs
    
    By default, the function add_to_physmap_one set mfn to 0. Some code paths that
    result to an error, continue and the map the mfn 0 (valid on ARM) to the
    slot given by the guest.
    
    To fix the problem, return directly an error if sanity check has failed.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/mm.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 474dfef..eaeb0c3 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -981,6 +981,8 @@ static int xenmem_add_to_physmap_one(
             idx &= ~XENMAPIDX_grant_table_status;
             if ( idx < nr_status_frames(d->grant_table) )
                 mfn = virt_to_mfn(d->grant_table->status[idx]);
+            else
+                return -EINVAL;
         }
         else
         {
@@ -990,6 +992,8 @@ static int xenmem_add_to_physmap_one(
 
             if ( idx < nr_grant_frames(d->grant_table) )
                 mfn = virt_to_mfn(d->grant_table->shared_raw[idx]);
+            else
+                return -EINVAL;
         }
         
         d->arch.grant_table_gpfn[idx] = gpfn;
@@ -999,6 +1003,8 @@ static int xenmem_add_to_physmap_one(
     case XENMAPSPACE_shared_info:
         if ( idx == 0 )
             mfn = virt_to_mfn(d->shared_info);
+        else
+            return -EINVAL;
         break;
     case XENMAPSPACE_gmfn_foreign:
     {
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 25 08:55:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VZdAx-0006AN-At; Fri, 25 Oct 2013 08:55: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 1VZdAv-0006AF-Vh
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:22 +0000
Received: from [85.158.139.211:4759] by server-9.bemta-5.messagelabs.com id
	E3/57-12926-9F13A625; Fri, 25 Oct 2013 08:55:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1382691316!3339748!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 316 invoked from network); 25 Oct 2013 08:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:55:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdAq-0002Lv-E0
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdAq-0007ED-9u
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:16 +0000
Date: Fri, 25 Oct 2013 08:55:16 +0000
Message-Id: <E1VZdAq-0007ED-9u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] netif.h: Add IPv6 related 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 d319a371decf9f851e4b9c18c4e123b9d2e16a57
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Thu Oct 24 09:47:50 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:02:02 2013 +0100

    netif.h: Add IPv6 related changes
    
    My recent patch series to Linux netback added IPv6 checksum
    offload and GSO support. This involved making some changes to the
    copy of netif.h in Linux.
    This patch adds those changes to the canonical copy of netif.h.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/io/netif.h |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index 3aa2dec..d7fb771 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -69,6 +69,20 @@
  */
 
 /*
+ * "feature-no-csum-offload" should be used to turn IPv4 TCP/UDP checksum
+ * offload off or on. If it is missing then the feature is assumed to be on.
+ * "feature-ipv6-csum-offload" should be used to turn IPv6 TCP/UDP checksum
+ * offload on or off. If it is missing then the feature is assumed to be off.
+ */
+
+/*
+ * "feature-gso-tcpv4" and "feature-gso-tcpv6" advertise the capability to
+ * handle large TCP packets (in IPv4 or IPv6 form respectively). Neither
+ * frontends nor backends are assumed to be capable unless the flags are
+ * present.
+ */
+
+/*
  * This is the 'wire' format for packets:
  *  Request 1: netif_tx_request -- NETTXF_* (any flags)
  * [Request 2: netif_tx_extra]  (only if request 1 has NETTXF_extra_info)
@@ -116,8 +130,10 @@ typedef struct netif_tx_request netif_tx_request_t;
 #define _XEN_NETIF_EXTRA_FLAG_MORE (0)
 #define XEN_NETIF_EXTRA_FLAG_MORE  (1U<<_XEN_NETIF_EXTRA_FLAG_MORE)
 
-/* GSO types - only TCPv4 currently supported. */
+/* GSO types */
+#define XEN_NETIF_GSO_TYPE_NONE         (0)
 #define XEN_NETIF_GSO_TYPE_TCPV4        (1)
+#define XEN_NETIF_GSO_TYPE_TCPV6        (2)
 
 /*
  * This structure needs to fit within both netif_tx_request and
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 25 08:55:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VZdAx-0006AN-At; Fri, 25 Oct 2013 08:55: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 1VZdAv-0006AF-Vh
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:22 +0000
Received: from [85.158.139.211:4759] by server-9.bemta-5.messagelabs.com id
	E3/57-12926-9F13A625; Fri, 25 Oct 2013 08:55:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1382691316!3339748!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 316 invoked from network); 25 Oct 2013 08:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:55:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdAq-0002Lv-E0
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdAq-0007ED-9u
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:16 +0000
Date: Fri, 25 Oct 2013 08:55:16 +0000
Message-Id: <E1VZdAq-0007ED-9u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] netif.h: Add IPv6 related 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 d319a371decf9f851e4b9c18c4e123b9d2e16a57
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Thu Oct 24 09:47:50 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:02:02 2013 +0100

    netif.h: Add IPv6 related changes
    
    My recent patch series to Linux netback added IPv6 checksum
    offload and GSO support. This involved making some changes to the
    copy of netif.h in Linux.
    This patch adds those changes to the canonical copy of netif.h.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/io/netif.h |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index 3aa2dec..d7fb771 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -69,6 +69,20 @@
  */
 
 /*
+ * "feature-no-csum-offload" should be used to turn IPv4 TCP/UDP checksum
+ * offload off or on. If it is missing then the feature is assumed to be on.
+ * "feature-ipv6-csum-offload" should be used to turn IPv6 TCP/UDP checksum
+ * offload on or off. If it is missing then the feature is assumed to be off.
+ */
+
+/*
+ * "feature-gso-tcpv4" and "feature-gso-tcpv6" advertise the capability to
+ * handle large TCP packets (in IPv4 or IPv6 form respectively). Neither
+ * frontends nor backends are assumed to be capable unless the flags are
+ * present.
+ */
+
+/*
  * This is the 'wire' format for packets:
  *  Request 1: netif_tx_request -- NETTXF_* (any flags)
  * [Request 2: netif_tx_extra]  (only if request 1 has NETTXF_extra_info)
@@ -116,8 +130,10 @@ typedef struct netif_tx_request netif_tx_request_t;
 #define _XEN_NETIF_EXTRA_FLAG_MORE (0)
 #define XEN_NETIF_EXTRA_FLAG_MORE  (1U<<_XEN_NETIF_EXTRA_FLAG_MORE)
 
-/* GSO types - only TCPv4 currently supported. */
+/* GSO types */
+#define XEN_NETIF_GSO_TYPE_NONE         (0)
 #define XEN_NETIF_GSO_TYPE_TCPV4        (1)
+#define XEN_NETIF_GSO_TYPE_TCPV6        (2)
 
 /*
  * This structure needs to fit within both netif_tx_request and
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 25 08:55:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:55:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VZdB5-0006B5-Do; Fri, 25 Oct 2013 08:55: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 1VZdB3-0006Ar-HY
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:29 +0000
Received: from [193.109.254.147:39386] by server-15.bemta-14.messagelabs.com
	id E7/67-02681-0023A625; Fri, 25 Oct 2013 08:55:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1382691327!581995!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8306 invoked from network); 25 Oct 2013 08:55:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:55:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdB1-0002M1-3i
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdB0-0007EZ-I6
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:27 +0000
Date: Fri, 25 Oct 2013 08:55:26 +0000
Message-Id: <E1VZdB0-0007EZ-I6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: fix a typo in comment of
	PLATFORM_QUIRK_DOM0_MAPPING_11
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 96dfb26efab1de0d1a1bdb84987f13ab1be3498d
Author:     Chen Baozi <baozich@gmail.com>
AuthorDate: Tue Oct 15 16:45:29 2013 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:02:02 2013 +0100

    xen/arm: fix a typo in comment of PLATFORM_QUIRK_DOM0_MAPPING_11
    
    Signed-off-by: Chen Baozi <baozich@gmail.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/include/asm-arm/platform.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index dbd2a15..43afebb 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -41,7 +41,7 @@ struct platform_desc {
 
 /*
  * Quirk to map dom0 memory in 1:1
- * Usefull on platform where System MMU is not yet implemented
+ * Useful on platform where System MMU is not yet implemented
  */
 #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 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 Fri Oct 25 08:55:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:55:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VZdB5-0006B5-Do; Fri, 25 Oct 2013 08:55: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 1VZdB3-0006Ar-HY
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:29 +0000
Received: from [193.109.254.147:39386] by server-15.bemta-14.messagelabs.com
	id E7/67-02681-0023A625; Fri, 25 Oct 2013 08:55:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1382691327!581995!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8306 invoked from network); 25 Oct 2013 08:55:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:55:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdB1-0002M1-3i
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdB0-0007EZ-I6
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:27 +0000
Date: Fri, 25 Oct 2013 08:55:26 +0000
Message-Id: <E1VZdB0-0007EZ-I6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: fix a typo in comment of
	PLATFORM_QUIRK_DOM0_MAPPING_11
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 96dfb26efab1de0d1a1bdb84987f13ab1be3498d
Author:     Chen Baozi <baozich@gmail.com>
AuthorDate: Tue Oct 15 16:45:29 2013 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:02:02 2013 +0100

    xen/arm: fix a typo in comment of PLATFORM_QUIRK_DOM0_MAPPING_11
    
    Signed-off-by: Chen Baozi <baozich@gmail.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/include/asm-arm/platform.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index dbd2a15..43afebb 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -41,7 +41,7 @@ struct platform_desc {
 
 /*
  * Quirk to map dom0 memory in 1:1
- * Usefull on platform where System MMU is not yet implemented
+ * Useful on platform where System MMU is not yet implemented
  */
 #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 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 Fri Oct 25 08:55:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:55:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VZdBF-0006C8-H2; Fri, 25 Oct 2013 08:55: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 1VZdBD-0006Bv-RK
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:40 +0000
Received: from [85.158.143.35:13267] by server-3.bemta-4.messagelabs.com id
	9D/52-21600-B023A625; Fri, 25 Oct 2013 08:55:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1382691337!327117!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7191 invoked from network); 25 Oct 2013 08:55:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:55:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBB-0002M9-Bi
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBB-0007F0-8y
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:37 +0000
Date: Fri, 25 Oct 2013 08:55:37 +0000
Message-Id: <E1VZdBB-0007F0-8y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: implement smp initialization
	callbacks for omap5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 466abd6b3866cda0866c03a9d7673f299d6f6754
Author:     Chen Baozi <baozich@gmail.com>
AuthorDate: Tue Oct 15 16:45:31 2013 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:03:30 2013 +0100

    xen/arm: implement smp initialization callbacks for omap5
    
    Signed-off-by: Chen Baozi <baozich@gmail.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/platforms/omap5.c        |   34 +++++++++++++++++++++++++++++++++
 xen/include/asm-arm/platforms/omap5.h |    3 ++
 2 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index a40d016..bd9db74 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -121,6 +121,38 @@ static int omap5_specific_mapping(struct domain *d)
     return 0;
 }
 
+static int __init omap5_smp_init(void)
+{
+    void __iomem *wugen_base;
+
+    wugen_base = ioremap_nocache(OMAP5_WKUPGEN_BASE, PAGE_SIZE);
+    if ( !wugen_base )
+    {
+        dprintk(XENLOG_ERR, "Unable to map omap5 MMIO\n");
+        return -EFAULT;
+    }
+
+    printk("Set AuxCoreBoot1 to %"PRIpaddr" (%p)\n",
+           __pa(init_secondary), init_secondary);
+    writel(__pa(init_secondary), wugen_base + OMAP_AUX_CORE_BOOT_1_OFFSET);
+
+    printk("Set AuxCoreBoot0 to 0x20\n");
+    writel(0x20, wugen_base + OMAP_AUX_CORE_BOOT_0_OFFSET);
+
+    iounmap(wugen_base);
+
+    return 0;
+}
+
+static int __init omap5_cpu_up(int cpu)
+{
+    /* Nothing to do here, the generic sev() will suffice to kick CPUs
+     * out of either the firmware or our own smp_up_cpu gate,
+     * depending on where they have ended up. */
+
+    return 0;
+}
+
 static uint32_t omap5_quirks(void)
 {
     return PLATFORM_QUIRK_DOM0_MAPPING_11;
@@ -136,6 +168,8 @@ PLATFORM_START(omap5, "TI OMAP5")
     .compatible = omap5_dt_compat,
     .init_time = omap5_init_time,
     .specific_mapping = omap5_specific_mapping,
+    .smp_init = omap5_smp_init,
+    .cpu_up = omap5_cpu_up,
     .quirks = omap5_quirks,
 PLATFORM_END
 
diff --git a/xen/include/asm-arm/platforms/omap5.h b/xen/include/asm-arm/platforms/omap5.h
index dd8c6ca..c559c84 100644
--- a/xen/include/asm-arm/platforms/omap5.h
+++ b/xen/include/asm-arm/platforms/omap5.h
@@ -17,6 +17,9 @@
 #define OMAP5_WKUPGEN_BASE                      0x48281000
 #define OMAP5_SRAM_PA                           0x40300000
 
+#define OMAP_AUX_CORE_BOOT_0_OFFSET             0x800
+#define OMAP_AUX_CORE_BOOT_1_OFFSET             0x804
+
 #endif /* __ASM_ARM_PLATFORMS_OMAP5_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 Fri Oct 25 08:55:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:55:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VZdBF-0006C8-H2; Fri, 25 Oct 2013 08:55: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 1VZdBD-0006Bv-RK
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:40 +0000
Received: from [85.158.143.35:13267] by server-3.bemta-4.messagelabs.com id
	9D/52-21600-B023A625; Fri, 25 Oct 2013 08:55:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1382691337!327117!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7191 invoked from network); 25 Oct 2013 08:55:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:55:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBB-0002M9-Bi
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBB-0007F0-8y
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:37 +0000
Date: Fri, 25 Oct 2013 08:55:37 +0000
Message-Id: <E1VZdBB-0007F0-8y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: implement smp initialization
	callbacks for omap5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 466abd6b3866cda0866c03a9d7673f299d6f6754
Author:     Chen Baozi <baozich@gmail.com>
AuthorDate: Tue Oct 15 16:45:31 2013 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:03:30 2013 +0100

    xen/arm: implement smp initialization callbacks for omap5
    
    Signed-off-by: Chen Baozi <baozich@gmail.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/platforms/omap5.c        |   34 +++++++++++++++++++++++++++++++++
 xen/include/asm-arm/platforms/omap5.h |    3 ++
 2 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index a40d016..bd9db74 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -121,6 +121,38 @@ static int omap5_specific_mapping(struct domain *d)
     return 0;
 }
 
+static int __init omap5_smp_init(void)
+{
+    void __iomem *wugen_base;
+
+    wugen_base = ioremap_nocache(OMAP5_WKUPGEN_BASE, PAGE_SIZE);
+    if ( !wugen_base )
+    {
+        dprintk(XENLOG_ERR, "Unable to map omap5 MMIO\n");
+        return -EFAULT;
+    }
+
+    printk("Set AuxCoreBoot1 to %"PRIpaddr" (%p)\n",
+           __pa(init_secondary), init_secondary);
+    writel(__pa(init_secondary), wugen_base + OMAP_AUX_CORE_BOOT_1_OFFSET);
+
+    printk("Set AuxCoreBoot0 to 0x20\n");
+    writel(0x20, wugen_base + OMAP_AUX_CORE_BOOT_0_OFFSET);
+
+    iounmap(wugen_base);
+
+    return 0;
+}
+
+static int __init omap5_cpu_up(int cpu)
+{
+    /* Nothing to do here, the generic sev() will suffice to kick CPUs
+     * out of either the firmware or our own smp_up_cpu gate,
+     * depending on where they have ended up. */
+
+    return 0;
+}
+
 static uint32_t omap5_quirks(void)
 {
     return PLATFORM_QUIRK_DOM0_MAPPING_11;
@@ -136,6 +168,8 @@ PLATFORM_START(omap5, "TI OMAP5")
     .compatible = omap5_dt_compat,
     .init_time = omap5_init_time,
     .specific_mapping = omap5_specific_mapping,
+    .smp_init = omap5_smp_init,
+    .cpu_up = omap5_cpu_up,
     .quirks = omap5_quirks,
 PLATFORM_END
 
diff --git a/xen/include/asm-arm/platforms/omap5.h b/xen/include/asm-arm/platforms/omap5.h
index dd8c6ca..c559c84 100644
--- a/xen/include/asm-arm/platforms/omap5.h
+++ b/xen/include/asm-arm/platforms/omap5.h
@@ -17,6 +17,9 @@
 #define OMAP5_WKUPGEN_BASE                      0x48281000
 #define OMAP5_SRAM_PA                           0x40300000
 
+#define OMAP_AUX_CORE_BOOT_0_OFFSET             0x800
+#define OMAP_AUX_CORE_BOOT_1_OFFSET             0x804
+
 #endif /* __ASM_ARM_PLATFORMS_OMAP5_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 Fri Oct 25 08:55:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08: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 1VZdBP-0006DY-K9; Fri, 25 Oct 2013 08:55:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBO-0006DJ-8i
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:50 +0000
Received: from [85.158.139.211:62050] by server-10.bemta-5.messagelabs.com id
	07/95-28640-5123A625; Fri, 25 Oct 2013 08:55:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1382691347!3545787!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11666 invoked from network); 25 Oct 2013 08:55:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:55:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBL-0002MI-Gv
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBL-0007FM-FN
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:47 +0000
Date: Fri, 25 Oct 2013 08:55:47 +0000
Message-Id: <E1VZdBL-0007FM-FN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Allocate memory for dom0 from
	the bottom with the 1:1 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 6c21cb36e263de2db8716b477157a5b6cd531e1e
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Oct 22 11:51:48 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:04:42 2013 +0100

    xen/arm: Allocate memory for dom0 from the bottom with the 1:1 Workaround
    
    On Linux, the option CONFIG_ARM_PATCH_PHYS_VIRT (by default enabled) allows
    the Kernel to be loaded anywhere (or nearly) by patching the translation
    pv<->virt at boot time.
    
    The current solution in Linux assuming that the delta physical address -
    virtual address is always negative. A positive delta will destroy all the
    optimisation to modify only a part of the translation instruction (add/sub).
    
    By default, Xen is allocating memory from the top of memory and then
    goes down. To avoid booting issue with Linux, we must allocate memory
    from the bottom (ie starting from 0).
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 4f91327..4e1badf 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -70,12 +70,19 @@ static int set_memory_reg_11(struct domain *d, struct kernel_info *kinfo,
     int reg_size = dt_cells_to_size(dt_n_addr_cells(np) + dt_n_size_cells(np));
     paddr_t start;
     paddr_t size;
-    struct page_info *pg;
+    struct page_info *pg = NULL;
     unsigned int order = get_order_from_bytes(dom0_mem);
     int res;
     paddr_t spfn;
+    unsigned int bits;
+
+    for ( bits = PAGE_SHIFT + 1; bits < PADDR_BITS; bits++ )
+    {
+        pg = alloc_domheap_pages(d, order, MEMF_bits(bits));
+        if ( pg != NULL )
+            break;
+    }
 
-    pg = alloc_domheap_pages(d, order, 0);
     if ( !pg )
         panic("Failed to allocate contiguous memory for dom0\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 Fri Oct 25 08:55:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08: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 1VZdBP-0006DY-K9; Fri, 25 Oct 2013 08:55:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBO-0006DJ-8i
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:50 +0000
Received: from [85.158.139.211:62050] by server-10.bemta-5.messagelabs.com id
	07/95-28640-5123A625; Fri, 25 Oct 2013 08:55:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1382691347!3545787!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11666 invoked from network); 25 Oct 2013 08:55:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:55:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBL-0002MI-Gv
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBL-0007FM-FN
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:47 +0000
Date: Fri, 25 Oct 2013 08:55:47 +0000
Message-Id: <E1VZdBL-0007FM-FN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Allocate memory for dom0 from
	the bottom with the 1:1 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 6c21cb36e263de2db8716b477157a5b6cd531e1e
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Oct 22 11:51:48 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:04:42 2013 +0100

    xen/arm: Allocate memory for dom0 from the bottom with the 1:1 Workaround
    
    On Linux, the option CONFIG_ARM_PATCH_PHYS_VIRT (by default enabled) allows
    the Kernel to be loaded anywhere (or nearly) by patching the translation
    pv<->virt at boot time.
    
    The current solution in Linux assuming that the delta physical address -
    virtual address is always negative. A positive delta will destroy all the
    optimisation to modify only a part of the translation instruction (add/sub).
    
    By default, Xen is allocating memory from the top of memory and then
    goes down. To avoid booting issue with Linux, we must allocate memory
    from the bottom (ie starting from 0).
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 4f91327..4e1badf 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -70,12 +70,19 @@ static int set_memory_reg_11(struct domain *d, struct kernel_info *kinfo,
     int reg_size = dt_cells_to_size(dt_n_addr_cells(np) + dt_n_size_cells(np));
     paddr_t start;
     paddr_t size;
-    struct page_info *pg;
+    struct page_info *pg = NULL;
     unsigned int order = get_order_from_bytes(dom0_mem);
     int res;
     paddr_t spfn;
+    unsigned int bits;
+
+    for ( bits = PAGE_SHIFT + 1; bits < PADDR_BITS; bits++ )
+    {
+        pg = alloc_domheap_pages(d, order, MEMF_bits(bits));
+        if ( pg != NULL )
+            break;
+    }
 
-    pg = alloc_domheap_pages(d, order, 0);
     if ( !pg )
         panic("Failed to allocate contiguous memory for dom0\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 Fri Oct 25 08:56:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:56: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 1VZdBa-0006FP-IN; Fri, 25 Oct 2013 08:56: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 1VZdBY-0006Ex-2o
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:00 +0000
Received: from [85.158.143.35:17596] by server-1.bemta-4.messagelabs.com id
	A3/A9-17304-F123A625; Fri, 25 Oct 2013 08:55:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1382691357!325882!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31652 invoked from network); 25 Oct 2013 08:55:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:55:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBV-0002MR-NY
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBV-0007Fj-KV
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:57 +0000
Date: Fri, 25 Oct 2013 08:55:57 +0000
Message-Id: <E1VZdBV-0007Fj-KV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: correct XEN_COMPILE_ARCH
	autodetection for arm64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit badd47de999561ac31b7b6b7b2c3b34ef0476dad
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 22 17:12:14 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:16:49 2013 +0100

    xen: arm: correct XEN_COMPILE_ARCH autodetection for arm64
    
    At least on aarch64 openSUSE running with qemu-user-aarch64 "uname -m" reports
    "aarch64" and not "armv8" so include that in the seddery. There's no harm
    leaving the existing armv8 rune too so do so.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 Config.mk |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1879454..7f3d8c7 100644
--- a/Config.mk
+++ b/Config.mk
@@ -24,7 +24,8 @@ coverage ?= n
 
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
                          -e s/i86pc/x86_32/ -e s/amd64/x86_64/ \
-                         -e s/armv7.*/arm32/ -e s/armv8.*/arm64/)
+                         -e s/armv7.*/arm32/ -e s/armv8.*/arm64/ \
+                         -e s/aarch64/arm64/)
 
 XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
 XEN_OS              ?= $(shell uname -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 Oct 25 08:56:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:56: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 1VZdBa-0006FP-IN; Fri, 25 Oct 2013 08:56: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 1VZdBY-0006Ex-2o
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:00 +0000
Received: from [85.158.143.35:17596] by server-1.bemta-4.messagelabs.com id
	A3/A9-17304-F123A625; Fri, 25 Oct 2013 08:55:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1382691357!325882!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31652 invoked from network); 25 Oct 2013 08:55:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:55:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBV-0002MR-NY
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBV-0007Fj-KV
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:55:57 +0000
Date: Fri, 25 Oct 2013 08:55:57 +0000
Message-Id: <E1VZdBV-0007Fj-KV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: correct XEN_COMPILE_ARCH
	autodetection for arm64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit badd47de999561ac31b7b6b7b2c3b34ef0476dad
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Oct 22 17:12:14 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:16:49 2013 +0100

    xen: arm: correct XEN_COMPILE_ARCH autodetection for arm64
    
    At least on aarch64 openSUSE running with qemu-user-aarch64 "uname -m" reports
    "aarch64" and not "armv8" so include that in the seddery. There's no harm
    leaving the existing armv8 rune too so do so.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 Config.mk |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1879454..7f3d8c7 100644
--- a/Config.mk
+++ b/Config.mk
@@ -24,7 +24,8 @@ coverage ?= n
 
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
                          -e s/i86pc/x86_32/ -e s/amd64/x86_64/ \
-                         -e s/armv7.*/arm32/ -e s/armv8.*/arm64/)
+                         -e s/armv7.*/arm32/ -e s/armv8.*/arm64/ \
+                         -e s/aarch64/arm64/)
 
 XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
 XEN_OS              ?= $(shell uname -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 Oct 25 08:56:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:56: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 1VZdBk-0006IN-N8; Fri, 25 Oct 2013 08:56:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBi-0006I3-LC
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:10 +0000
Received: from [85.158.137.68:32766] by server-12.bemta-3.messagelabs.com id
	A9/20-23139-9223A625; Fri, 25 Oct 2013 08:56:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1382691368!3699838!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1556 invoked from network); 25 Oct 2013 08:56:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:56:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBf-0002N0-TT
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBf-0007GL-RD
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:07 +0000
Date: Fri, 25 Oct 2013 08:56:07 +0000
Message-Id: <E1VZdBf-0007GL-RD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: fix usage of bootargs for
	Xen.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a067a9b960f6328e6bff620f7ab24096427bcc14
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Oct 21 10:21:23 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:17:47 2013 +0100

    xen: arm: fix usage of bootargs for Xen.
    
    The chosen node's bootargs property should be used for Xen if there is a dom0
    kernel multiboot module with a command line, not just if xen,dom0-bootargs is
    present.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.linaro.org>
---
 docs/misc/arm/device-tree/booting.txt |    2 ++
 xen/common/device_tree.c              |   10 ++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
index 08ed775..8da1e0b 100644
--- a/docs/misc/arm/device-tree/booting.txt
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -39,6 +39,8 @@ lines for Xen and Dom0. The logic is the following:
  - If xen,dom0-bootargs is present, it will be used for Dom0.
  - If xen,xen-bootargs is _not_ present, but xen,dom0-bootargs is,
    bootargs will be used for Xen.
+ - If a kernel boot module is present and has a bootargs property then
+   the top-level bootargs will used for Xen.
  - If no Xen specific properties are present, bootargs is for Dom0.
  - If xen,xen-bootargs is present, but xen,dom0-bootargs is missing,
    bootargs will be used for Dom0.
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index af0fb04..f7d0215 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -240,7 +240,7 @@ static int __init device_tree_for_each_node(const void *fdt,
  */
 const char *device_tree_bootargs(const void *fdt)
 {
-    int node; 
+    int node;
     const struct fdt_property *prop;
 
     node = fdt_path_offset(fdt, "/chosen");
@@ -250,7 +250,13 @@ const char *device_tree_bootargs(const void *fdt)
     prop = fdt_get_property(fdt, node, "xen,xen-bootargs", NULL);
     if ( prop == NULL )
     {
-        if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL))
+        struct dt_mb_module *dom0_mod = NULL;
+
+        if ( early_info.modules.nr_mods >= MOD_KERNEL )
+            dom0_mod = &early_info.modules.module[MOD_KERNEL];
+
+        if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL) ||
+            ( dom0_mod && dom0_mod->cmdline[0] ) )
             prop = fdt_get_property(fdt, node, "bootargs", NULL);
     }
     if ( prop == 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 Fri Oct 25 08:56:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:56: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 1VZdBk-0006IN-N8; Fri, 25 Oct 2013 08:56:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBi-0006I3-LC
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:10 +0000
Received: from [85.158.137.68:32766] by server-12.bemta-3.messagelabs.com id
	A9/20-23139-9223A625; Fri, 25 Oct 2013 08:56:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1382691368!3699838!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1556 invoked from network); 25 Oct 2013 08:56:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:56:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBf-0002N0-TT
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBf-0007GL-RD
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:07 +0000
Date: Fri, 25 Oct 2013 08:56:07 +0000
Message-Id: <E1VZdBf-0007GL-RD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: fix usage of bootargs for
	Xen.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a067a9b960f6328e6bff620f7ab24096427bcc14
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Oct 21 10:21:23 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:17:47 2013 +0100

    xen: arm: fix usage of bootargs for Xen.
    
    The chosen node's bootargs property should be used for Xen if there is a dom0
    kernel multiboot module with a command line, not just if xen,dom0-bootargs is
    present.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.linaro.org>
---
 docs/misc/arm/device-tree/booting.txt |    2 ++
 xen/common/device_tree.c              |   10 ++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
index 08ed775..8da1e0b 100644
--- a/docs/misc/arm/device-tree/booting.txt
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -39,6 +39,8 @@ lines for Xen and Dom0. The logic is the following:
  - If xen,dom0-bootargs is present, it will be used for Dom0.
  - If xen,xen-bootargs is _not_ present, but xen,dom0-bootargs is,
    bootargs will be used for Xen.
+ - If a kernel boot module is present and has a bootargs property then
+   the top-level bootargs will used for Xen.
  - If no Xen specific properties are present, bootargs is for Dom0.
  - If xen,xen-bootargs is present, but xen,dom0-bootargs is missing,
    bootargs will be used for Dom0.
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index af0fb04..f7d0215 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -240,7 +240,7 @@ static int __init device_tree_for_each_node(const void *fdt,
  */
 const char *device_tree_bootargs(const void *fdt)
 {
-    int node; 
+    int node;
     const struct fdt_property *prop;
 
     node = fdt_path_offset(fdt, "/chosen");
@@ -250,7 +250,13 @@ const char *device_tree_bootargs(const void *fdt)
     prop = fdt_get_property(fdt, node, "xen,xen-bootargs", NULL);
     if ( prop == NULL )
     {
-        if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL))
+        struct dt_mb_module *dom0_mod = NULL;
+
+        if ( early_info.modules.nr_mods >= MOD_KERNEL )
+            dom0_mod = &early_info.modules.module[MOD_KERNEL];
+
+        if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL) ||
+            ( dom0_mod && dom0_mod->cmdline[0] ) )
             prop = fdt_get_property(fdt, node, "bootargs", NULL);
     }
     if ( prop == 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 Fri Oct 25 08:56:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:56: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 1VZdBu-0006KC-Qw; Fri, 25 Oct 2013 08:56:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBs-0006Jm-Ls
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:20 +0000
Received: from [193.109.254.147:48630] by server-13.bemta-14.messagelabs.com
	id FF/3E-25247-3323A625; Fri, 25 Oct 2013 08:56:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1382691378!586153!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18678 invoked from network); 25 Oct 2013 08:56:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:56:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBq-0002N6-5Q
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBq-0007HS-27
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:18 +0000
Date: Fri, 25 Oct 2013 08:56:18 +0000
Message-Id: <E1VZdBq-0007HS-27@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: correct xenheap_bits after "xen:
	support RAM at addresses 0 and 4096"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e4d7c89e34bf62eda5118d61caef9858c38cdf57
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 15:43:40 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:23:20 2013 +0100

    xen: correct xenheap_bits after "xen: support RAM at addresses 0 and 4096"
    
    This is incorrect after commit 1aac966e24e which shuffled the zones up by one.
    I've observed failures on arm64 systems with RAM at 0x8,00000000-0x8,7fffffff
    since xenheap_bits ends up as 35 instead of 36 (which is the zone with all the
    RAM).
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
---
 xen/common/page_alloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index fb8187b..4c17fbd 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1364,7 +1364,7 @@ static unsigned int __read_mostly xenheap_bits;
 
 void __init xenheap_max_mfn(unsigned long mfn)
 {
-    xenheap_bits = fls(mfn) + PAGE_SHIFT - 1;
+    xenheap_bits = fls(mfn) + PAGE_SHIFT;
 }
 
 void init_xenheap_pages(paddr_t ps, paddr_t pe)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 25 08:56:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:56: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 1VZdBu-0006KC-Qw; Fri, 25 Oct 2013 08:56:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBs-0006Jm-Ls
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:20 +0000
Received: from [193.109.254.147:48630] by server-13.bemta-14.messagelabs.com
	id FF/3E-25247-3323A625; Fri, 25 Oct 2013 08:56:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1382691378!586153!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18678 invoked from network); 25 Oct 2013 08:56:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:56:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBq-0002N6-5Q
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdBq-0007HS-27
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:18 +0000
Date: Fri, 25 Oct 2013 08:56:18 +0000
Message-Id: <E1VZdBq-0007HS-27@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: correct xenheap_bits after "xen:
	support RAM at addresses 0 and 4096"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e4d7c89e34bf62eda5118d61caef9858c38cdf57
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 15:43:40 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:23:20 2013 +0100

    xen: correct xenheap_bits after "xen: support RAM at addresses 0 and 4096"
    
    This is incorrect after commit 1aac966e24e which shuffled the zones up by one.
    I've observed failures on arm64 systems with RAM at 0x8,00000000-0x8,7fffffff
    since xenheap_bits ends up as 35 instead of 36 (which is the zone with all the
    RAM).
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
---
 xen/common/page_alloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index fb8187b..4c17fbd 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1364,7 +1364,7 @@ static unsigned int __read_mostly xenheap_bits;
 
 void __init xenheap_max_mfn(unsigned long mfn)
 {
-    xenheap_bits = fls(mfn) + PAGE_SHIFT - 1;
+    xenheap_bits = fls(mfn) + PAGE_SHIFT;
 }
 
 void init_xenheap_pages(paddr_t ps, paddr_t pe)
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 25 08:56:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:56: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 1VZdC3-0006M5-Vo; Fri, 25 Oct 2013 08: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 1VZdC2-0006Lu-Ti
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:31 +0000
Received: from [85.158.137.68:26689] by server-6.bemta-3.messagelabs.com id
	02/66-23777-E323A625; Fri, 25 Oct 2013 08:56:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1382691388!3707474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11772 invoked from network); 25 Oct 2013 08:56:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:56:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdC0-0002NE-CR
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdC0-0007Ho-9p
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:28 +0000
Date: Fri, 25 Oct 2013 08:56:28 +0000
Message-Id: <E1VZdC0-0007Ho-9p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Enable 40 bit addressing in
	VTCR for arm64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 50257e96b77c51b3eeb06ab68e7bd48ba2a8752b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 15:43:41 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:23:36 2013 +0100

    xen: arm: Enable 40 bit addressing in VTCR for arm64
    
    This requires setting the v8 specific VTCR_EL2.PS field. These bits are
    UNK/SBZP on v7.
    
    Also the TS0SZ field is described slightly differently for v8, so update the
    comment to reflect this.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/mm.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index eaeb0c3..1773ffe 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -369,9 +369,16 @@ void __cpuinit setup_virt_paging(void)
     /* Setup Stage 2 address translation */
     /* SH0=00, ORGN0=IRGN0=01
      * SL0=01 (Level-1)
-     * T0SZ=(1)1000 = -8 (40 bit physical addresses)
+     * ARVv7: T0SZ=(1)1000 = -8 (32-(-8) = 40 bit physical addresses)
+     * ARMv8: T0SZ=01 1000 = 24 (64-24   = 40 bit physical addresses)
+     *        PS=010 == 40 bits
      */
-    WRITE_SYSREG32(0x80002558, VTCR_EL2); isb();
+#ifdef CONFIG_ARM_32
+    WRITE_SYSREG32(0x80002558, VTCR_EL2);
+#else
+    WRITE_SYSREG32(0x80022558, VTCR_EL2);
+#endif
+    isb();
 }
 
 static inline lpae_t pte_of_xenaddr(vaddr_t 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 Fri Oct 25 08:56:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:56: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 1VZdC3-0006M5-Vo; Fri, 25 Oct 2013 08: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 1VZdC2-0006Lu-Ti
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:31 +0000
Received: from [85.158.137.68:26689] by server-6.bemta-3.messagelabs.com id
	02/66-23777-E323A625; Fri, 25 Oct 2013 08:56:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1382691388!3707474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11772 invoked from network); 25 Oct 2013 08:56:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:56:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdC0-0002NE-CR
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdC0-0007Ho-9p
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:28 +0000
Date: Fri, 25 Oct 2013 08:56:28 +0000
Message-Id: <E1VZdC0-0007Ho-9p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Enable 40 bit addressing in
	VTCR for arm64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 50257e96b77c51b3eeb06ab68e7bd48ba2a8752b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 15:43:41 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:23:36 2013 +0100

    xen: arm: Enable 40 bit addressing in VTCR for arm64
    
    This requires setting the v8 specific VTCR_EL2.PS field. These bits are
    UNK/SBZP on v7.
    
    Also the TS0SZ field is described slightly differently for v8, so update the
    comment to reflect this.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/mm.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index eaeb0c3..1773ffe 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -369,9 +369,16 @@ void __cpuinit setup_virt_paging(void)
     /* Setup Stage 2 address translation */
     /* SH0=00, ORGN0=IRGN0=01
      * SL0=01 (Level-1)
-     * T0SZ=(1)1000 = -8 (40 bit physical addresses)
+     * ARVv7: T0SZ=(1)1000 = -8 (32-(-8) = 40 bit physical addresses)
+     * ARMv8: T0SZ=01 1000 = 24 (64-24   = 40 bit physical addresses)
+     *        PS=010 == 40 bits
      */
-    WRITE_SYSREG32(0x80002558, VTCR_EL2); isb();
+#ifdef CONFIG_ARM_32
+    WRITE_SYSREG32(0x80002558, VTCR_EL2);
+#else
+    WRITE_SYSREG32(0x80022558, VTCR_EL2);
+#endif
+    isb();
 }
 
 static inline lpae_t pte_of_xenaddr(vaddr_t 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 Fri Oct 25 08:56:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08: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 1VZdCE-0006Nz-2X; Fri, 25 Oct 2013 08:56: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 1VZdCD-0006Nl-3k
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:41 +0000
Received: from [193.109.254.147:35497] by server-7.bemta-14.messagelabs.com id
	E8/A7-26234-8423A625; Fri, 25 Oct 2013 08:56:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1382691398!586284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22101 invoked from network); 25 Oct 2013 08:56:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:56:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCA-0002NK-IQ
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCA-0007IF-Gg
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:38 +0000
Date: Fri, 25 Oct 2013 08:56:38 +0000
Message-Id: <E1VZdCA-0007IF-Gg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: map entire memory banks on
	arm64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d2766bee0f1f0fc1c4dbf30dcc9a43b91d5f19ce
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 15:43:42 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:23:56 2013 +0100

    xen: arm: map entire memory banks on arm64
    
    Currently we only map regions which are not part of boot modules. However we
    subsequently free at least some of those modules to the heaps in
    discard_initial_modules and if we were unluckly with sizing/location we might
    end up adding unmapped pages to the heap.
    
    The heaps on 64-bit use 1GB mappings, so in practice this is probably pretty
    unlikely and I've not actually seen it.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/setup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 7d6e596..1081b43 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -520,6 +520,8 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 
         xenheap_pages += (bank_size >> PAGE_SHIFT);
 
+        setup_xenheap_mappings(bank_start>>PAGE_SHIFT, bank_size>>PAGE_SHIFT);
+
         /* XXX we assume that the ram regions are ordered */
         s = bank_start;
         while ( s < bank_end )
@@ -536,8 +538,6 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
             if ( e > bank_end )
                 e = bank_end;
 
-            setup_xenheap_mappings(s>>PAGE_SHIFT, (e-s)>>PAGE_SHIFT);
-
             xenheap_mfn_end = e;
 
             dt_unreserved_regions(s, e, init_boot_pages, 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 Fri Oct 25 08:56:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08: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 1VZdCE-0006Nz-2X; Fri, 25 Oct 2013 08:56: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 1VZdCD-0006Nl-3k
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:41 +0000
Received: from [193.109.254.147:35497] by server-7.bemta-14.messagelabs.com id
	E8/A7-26234-8423A625; Fri, 25 Oct 2013 08:56:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1382691398!586284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22101 invoked from network); 25 Oct 2013 08:56:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:56:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCA-0002NK-IQ
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCA-0007IF-Gg
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:38 +0000
Date: Fri, 25 Oct 2013 08:56:38 +0000
Message-Id: <E1VZdCA-0007IF-Gg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: map entire memory banks on
	arm64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d2766bee0f1f0fc1c4dbf30dcc9a43b91d5f19ce
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 15:43:42 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:23:56 2013 +0100

    xen: arm: map entire memory banks on arm64
    
    Currently we only map regions which are not part of boot modules. However we
    subsequently free at least some of those modules to the heaps in
    discard_initial_modules and if we were unluckly with sizing/location we might
    end up adding unmapped pages to the heap.
    
    The heaps on 64-bit use 1GB mappings, so in practice this is probably pretty
    unlikely and I've not actually seen it.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/setup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 7d6e596..1081b43 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -520,6 +520,8 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 
         xenheap_pages += (bank_size >> PAGE_SHIFT);
 
+        setup_xenheap_mappings(bank_start>>PAGE_SHIFT, bank_size>>PAGE_SHIFT);
+
         /* XXX we assume that the ram regions are ordered */
         s = bank_start;
         while ( s < bank_end )
@@ -536,8 +538,6 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
             if ( e > bank_end )
                 e = bank_end;
 
-            setup_xenheap_mappings(s>>PAGE_SHIFT, (e-s)>>PAGE_SHIFT);
-
             xenheap_mfn_end = e;
 
             dt_unreserved_regions(s, e, init_boot_pages, 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 Fri Oct 25 08:56:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08: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 1VZdCO-0006QA-AR; Fri, 25 Oct 2013 08:56: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 1VZdCN-0006Q1-Kt
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:51 +0000
Received: from [85.158.137.68:34625] by server-10.bemta-3.messagelabs.com id
	09/9A-17212-2523A625; Fri, 25 Oct 2013 08:56:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1382691408!3693806!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7340 invoked from network); 25 Oct 2013 08:56:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:56:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCK-0002NS-Nd
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCK-0007Ib-Lo
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:48 +0000
Date: Fri, 25 Oct 2013 08:56:48 +0000
Message-Id: <E1VZdCK-0007Ib-Lo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: make sure pagetable mask
	macros have appropriate size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e782d0191d260c1a143f081fa0a30c2a4182aee
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 15:43:43 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:24:15 2013 +0100

    xen: arm: make sure pagetable mask macros have appropriate size
    
    {ZEROETH,FIRST,SECOND,THIRD}_MASK are used with physical addresses which may
    be larger than 32 bits. Therefore ensure that they are wide enough by casting
    to paddr_t otherwise we may truncate addresses on 32-bit.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/include/asm-arm/page.h |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 3d0f8a9..d468418 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -323,17 +323,17 @@ static inline int gva_to_ipa(vaddr_t va, paddr_t *paddr)
 #define LPAE_ENTRIES    (1u << LPAE_SHIFT)
 #define LPAE_ENTRY_MASK (LPAE_ENTRIES - 1)
 
-#define THIRD_SHIFT  PAGE_SHIFT
-#define THIRD_SIZE   (1u << THIRD_SHIFT)
-#define THIRD_MASK   (~(THIRD_SIZE - 1))
-#define SECOND_SHIFT (THIRD_SHIFT + LPAE_SHIFT)
-#define SECOND_SIZE  (1u << SECOND_SHIFT)
-#define SECOND_MASK  (~(SECOND_SIZE - 1))
-#define FIRST_SHIFT  (SECOND_SHIFT + LPAE_SHIFT)
-#define FIRST_SIZE   (1u << FIRST_SHIFT)
-#define FIRST_MASK   (~(FIRST_SIZE - 1))
+#define THIRD_SHIFT    (PAGE_SHIFT)
+#define THIRD_SIZE     ((paddr_t)1 << THIRD_SHIFT)
+#define THIRD_MASK     (~(THIRD_SIZE - 1))
+#define SECOND_SHIFT   (THIRD_SHIFT + LPAE_SHIFT)
+#define SECOND_SIZE    ((paddr_t)1 << SECOND_SHIFT)
+#define SECOND_MASK    (~(SECOND_SIZE - 1))
+#define FIRST_SHIFT    (SECOND_SHIFT + LPAE_SHIFT)
+#define FIRST_SIZE     ((paddr_t)1 << FIRST_SHIFT)
+#define FIRST_MASK     (~(FIRST_SIZE - 1))
 #define ZEROETH_SHIFT  (FIRST_SHIFT + LPAE_SHIFT)
-#define ZEROETH_SIZE   (1u << ZEROETH_SHIFT)
+#define ZEROETH_SIZE   ((paddr_t)1 << ZEROETH_SHIFT)
 #define ZEROETH_MASK   (~(ZEROETH_SIZE - 1))
 
 /* Calculate the offsets into the pagetables for a given 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 Fri Oct 25 08:56:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08: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 1VZdCO-0006QA-AR; Fri, 25 Oct 2013 08:56: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 1VZdCN-0006Q1-Kt
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:51 +0000
Received: from [85.158.137.68:34625] by server-10.bemta-3.messagelabs.com id
	09/9A-17212-2523A625; Fri, 25 Oct 2013 08:56:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1382691408!3693806!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: INFO: max file limit 5000
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7340 invoked from network); 25 Oct 2013 08:56:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:56:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCK-0002NS-Nd
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCK-0007Ib-Lo
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:48 +0000
Date: Fri, 25 Oct 2013 08:56:48 +0000
Message-Id: <E1VZdCK-0007Ib-Lo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: make sure pagetable mask
	macros have appropriate size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e782d0191d260c1a143f081fa0a30c2a4182aee
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 15:43:43 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:24:15 2013 +0100

    xen: arm: make sure pagetable mask macros have appropriate size
    
    {ZEROETH,FIRST,SECOND,THIRD}_MASK are used with physical addresses which may
    be larger than 32 bits. Therefore ensure that they are wide enough by casting
    to paddr_t otherwise we may truncate addresses on 32-bit.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/include/asm-arm/page.h |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 3d0f8a9..d468418 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -323,17 +323,17 @@ static inline int gva_to_ipa(vaddr_t va, paddr_t *paddr)
 #define LPAE_ENTRIES    (1u << LPAE_SHIFT)
 #define LPAE_ENTRY_MASK (LPAE_ENTRIES - 1)
 
-#define THIRD_SHIFT  PAGE_SHIFT
-#define THIRD_SIZE   (1u << THIRD_SHIFT)
-#define THIRD_MASK   (~(THIRD_SIZE - 1))
-#define SECOND_SHIFT (THIRD_SHIFT + LPAE_SHIFT)
-#define SECOND_SIZE  (1u << SECOND_SHIFT)
-#define SECOND_MASK  (~(SECOND_SIZE - 1))
-#define FIRST_SHIFT  (SECOND_SHIFT + LPAE_SHIFT)
-#define FIRST_SIZE   (1u << FIRST_SHIFT)
-#define FIRST_MASK   (~(FIRST_SIZE - 1))
+#define THIRD_SHIFT    (PAGE_SHIFT)
+#define THIRD_SIZE     ((paddr_t)1 << THIRD_SHIFT)
+#define THIRD_MASK     (~(THIRD_SIZE - 1))
+#define SECOND_SHIFT   (THIRD_SHIFT + LPAE_SHIFT)
+#define SECOND_SIZE    ((paddr_t)1 << SECOND_SHIFT)
+#define SECOND_MASK    (~(SECOND_SIZE - 1))
+#define FIRST_SHIFT    (SECOND_SHIFT + LPAE_SHIFT)
+#define FIRST_SIZE     ((paddr_t)1 << FIRST_SHIFT)
+#define FIRST_MASK     (~(FIRST_SIZE - 1))
 #define ZEROETH_SHIFT  (FIRST_SHIFT + LPAE_SHIFT)
-#define ZEROETH_SIZE   (1u << ZEROETH_SHIFT)
+#define ZEROETH_SIZE   ((paddr_t)1 << ZEROETH_SHIFT)
 #define ZEROETH_MASK   (~(ZEROETH_SIZE - 1))
 
 /* Calculate the offsets into the pagetables for a given 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 Fri Oct 25 08:57:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:57: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 1VZdCZ-0006SJ-F7; Fri, 25 Oct 2013 08:57:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCX-0006S2-6D
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:01 +0000
Received: from [85.158.143.35:28285] by server-1.bemta-4.messagelabs.com id
	5E/4B-17304-C523A625; Fri, 25 Oct 2013 08:57:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1382691419!329652!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6889 invoked from network); 25 Oct 2013 08:57:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:57:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCU-0002Ng-TJ
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCU-0007Ix-RB
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:58 +0000
Date: Fri, 25 Oct 2013 08:56:58 +0000
Message-Id: <E1VZdCU-0007Ix-RB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: correctly round down MFN to
	1GB boundary make sure pagetable mask macros as physaddr size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 80a7e7eaa177af948b1f4cc954bf2d39ee182724
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 15:43:44 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:24:37 2013 +0100

    xen: arm: correctly round down MFN to 1GB boundary make sure pagetable mask macros as physaddr size
    
    ~FIRST_MASK is nothing like correct for rounding down an MFN. It is the
    inverse *and* an address not a framenumber so wrong in every dimension! We
    cannot use FIRST_MASK since that would mask off any zeroeth level bits.
    Instead calculate the correct value from FIRST_SIZE.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/mm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 1773ffe..123280e 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -639,7 +639,7 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
     end_mfn = base_mfn + nr_mfns;
 
     /* Align to previous 1GB boundary */
-    base_mfn &= ~FIRST_MASK;
+    base_mfn &= ~((FIRST_SIZE>>PAGE_SHIFT)-1);
 
     offset = base_mfn - xenheap_mfn_start;
     vaddr = DIRECTMAP_VIRT_START + offset*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 Fri Oct 25 08:57:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:57: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 1VZdCZ-0006SJ-F7; Fri, 25 Oct 2013 08:57:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCX-0006S2-6D
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:01 +0000
Received: from [85.158.143.35:28285] by server-1.bemta-4.messagelabs.com id
	5E/4B-17304-C523A625; Fri, 25 Oct 2013 08:57:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1382691419!329652!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6889 invoked from network); 25 Oct 2013 08:57:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:57:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCU-0002Ng-TJ
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCU-0007Ix-RB
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:56:58 +0000
Date: Fri, 25 Oct 2013 08:56:58 +0000
Message-Id: <E1VZdCU-0007Ix-RB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: correctly round down MFN to
	1GB boundary make sure pagetable mask macros as physaddr size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 80a7e7eaa177af948b1f4cc954bf2d39ee182724
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 15:43:44 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:24:37 2013 +0100

    xen: arm: correctly round down MFN to 1GB boundary make sure pagetable mask macros as physaddr size
    
    ~FIRST_MASK is nothing like correct for rounding down an MFN. It is the
    inverse *and* an address not a framenumber so wrong in every dimension! We
    cannot use FIRST_MASK since that would mask off any zeroeth level bits.
    Instead calculate the correct value from FIRST_SIZE.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/mm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 1773ffe..123280e 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -639,7 +639,7 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
     end_mfn = base_mfn + nr_mfns;
 
     /* Align to previous 1GB boundary */
-    base_mfn &= ~FIRST_MASK;
+    base_mfn &= ~((FIRST_SIZE>>PAGE_SHIFT)-1);
 
     offset = base_mfn - xenheap_mfn_start;
     vaddr = DIRECTMAP_VIRT_START + offset*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 Fri Oct 25 08:57:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:57: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 1VZdCi-0006U3-JY; Fri, 25 Oct 2013 08:57: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 1VZdCh-0006Tt-Dy
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:11 +0000
Received: from [85.158.143.35:61626] by server-3.bemta-4.messagelabs.com id
	29/F4-21600-6623A625; Fri, 25 Oct 2013 08:57:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1382691429!327629!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21812 invoked from network); 25 Oct 2013 08:57:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:57:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCf-0002OD-2g
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCf-0007Jz-1D
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:09 +0000
Date: Fri, 25 Oct 2013 08:57:09 +0000
Message-Id: <E1VZdCf-0007Jz-1D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Ensure HCR_EL2.RW is set
	correctly when building 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 b3cbe129d07ac9a41175491fdd3c882641588350
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 15:43:45 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:25:11 2013 +0100

    xen: arm: Ensure HCR_EL2.RW is set correctly when building dom0
    
    copy_to_user and friends rely on this, since the address transalation
    functions (guest VA -> MFN) will truncate VA to the appropriate size.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 4e1badf..c644be2 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -955,6 +955,13 @@ int construct_dom0(struct domain *d)
 
     /* The following loads use the domain's p2m */
     p2m_load_VTTBR(d);
+#ifdef CONFIG_ARM_64
+    d->arch.type = kinfo.type;
+    if ( is_pv32_domain(d) )
+        WRITE_SYSREG(READ_SYSREG(HCR_EL2) & ~HCR_RW, HCR_EL2);
+    else
+        WRITE_SYSREG(READ_SYSREG(HCR_EL2) | HCR_RW, HCR_EL2);
+#endif
 
     kernel_load(&kinfo);
     /* initrd_load will fix up the fdt, so call it before dtb_load */
@@ -970,9 +977,6 @@ int construct_dom0(struct domain *d)
 
     regs->pc = (register_t)kinfo.entry;
 
-#ifdef CONFIG_ARM_64
-    d->arch.type = kinfo.type;
-#endif
 
     if ( is_pv32_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 Fri Oct 25 08:57:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:57: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 1VZdCi-0006U3-JY; Fri, 25 Oct 2013 08:57: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 1VZdCh-0006Tt-Dy
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:11 +0000
Received: from [85.158.143.35:61626] by server-3.bemta-4.messagelabs.com id
	29/F4-21600-6623A625; Fri, 25 Oct 2013 08:57:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1382691429!327629!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21812 invoked from network); 25 Oct 2013 08:57:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:57:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCf-0002OD-2g
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCf-0007Jz-1D
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:09 +0000
Date: Fri, 25 Oct 2013 08:57:09 +0000
Message-Id: <E1VZdCf-0007Jz-1D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Ensure HCR_EL2.RW is set
	correctly when building 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 b3cbe129d07ac9a41175491fdd3c882641588350
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 15:43:45 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 14:25:11 2013 +0100

    xen: arm: Ensure HCR_EL2.RW is set correctly when building dom0
    
    copy_to_user and friends rely on this, since the address transalation
    functions (guest VA -> MFN) will truncate VA to the appropriate size.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 4e1badf..c644be2 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -955,6 +955,13 @@ int construct_dom0(struct domain *d)
 
     /* The following loads use the domain's p2m */
     p2m_load_VTTBR(d);
+#ifdef CONFIG_ARM_64
+    d->arch.type = kinfo.type;
+    if ( is_pv32_domain(d) )
+        WRITE_SYSREG(READ_SYSREG(HCR_EL2) & ~HCR_RW, HCR_EL2);
+    else
+        WRITE_SYSREG(READ_SYSREG(HCR_EL2) | HCR_RW, HCR_EL2);
+#endif
 
     kernel_load(&kinfo);
     /* initrd_load will fix up the fdt, so call it before dtb_load */
@@ -970,9 +977,6 @@ int construct_dom0(struct domain *d)
 
     regs->pc = (register_t)kinfo.entry;
 
-#ifdef CONFIG_ARM_64
-    d->arch.type = kinfo.type;
-#endif
 
     if ( is_pv32_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 Fri Oct 25 08:57:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:57: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 1VZdCs-0006Vm-MH; Fri, 25 Oct 2013 08:57:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCr-0006Va-Kx
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:21 +0000
Received: from [85.158.143.35:30460] by server-1.bemta-4.messagelabs.com id
	55/DB-17304-0723A625; Fri, 25 Oct 2013 08:57:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1382691439!330315!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29360 invoked from network); 25 Oct 2013 08:57:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:57:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCp-0002OL-8B
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCp-0007KQ-65
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:19 +0000
Date: Fri, 25 Oct 2013 08:57:19 +0000
Message-Id: <E1VZdCp-0007KQ-65@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenctx: fix typo in arm64 output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 85c891961bf63943fc975b971f25fb90c25def0a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Oct 7 17:39:53 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 22:46:20 2013 +0100

    xenctx: fix typo in arm64 output
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 tools/xentrace/xenctx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 1214185..4b774af 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -497,7 +497,7 @@ static void print_ctx_64(vcpu_guest_context_t *ctx)
     print_symbol(regs->pc64);
     printf("\n");
 
-    printf("LR:       %016"PRIx64"zn", regs->x30);
+    printf("LR:       %016"PRIx64"\n", regs->x30);
     printf("ELR_EL1:  %016"PRIx64"\n", regs->elr_el1);
 
     printf("CPSR:     %08"PRIx32"\n", regs->cpsr);
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 25 08:57:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 25 Oct 2013 08:57: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 1VZdCs-0006Vm-MH; Fri, 25 Oct 2013 08:57:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCr-0006Va-Kx
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:21 +0000
Received: from [85.158.143.35:30460] by server-1.bemta-4.messagelabs.com id
	55/DB-17304-0723A625; Fri, 25 Oct 2013 08:57:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1382691439!330315!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29360 invoked from network); 25 Oct 2013 08:57:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Oct 2013 08:57:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCp-0002OL-8B
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VZdCp-0007KQ-65
	for xen-changelog@lists.xensource.com; Fri, 25 Oct 2013 08:57:19 +0000
Date: Fri, 25 Oct 2013 08:57:19 +0000
Message-Id: <E1VZdCp-0007KQ-65@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenctx: fix typo in arm64 output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 85c891961bf63943fc975b971f25fb90c25def0a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Oct 7 17:39:53 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Oct 24 22:46:20 2013 +0100

    xenctx: fix typo in arm64 output
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 tools/xentrace/xenctx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 1214185..4b774af 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -497,7 +497,7 @@ static void print_ctx_64(vcpu_guest_context_t *ctx)
     print_symbol(regs->pc64);
     printf("\n");
 
-    printf("LR:       %016"PRIx64"zn", regs->x30);
+    printf("LR:       %016"PRIx64"\n", regs->x30);
     printf("ELR_EL1:  %016"PRIx64"\n", regs->elr_el1);
 
     printf("CPSR:     %08"PRIx32"\n", regs->cpsr);
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 28 21:22:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:22:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VauGG-0000FY-7u; Mon, 28 Oct 2013 21: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 1VauGF-0000FQ-3o
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:07 +0000
Received: from [193.109.254.147:61886] by server-3.bemta-14.messagelabs.com id
	37/80-03488-E75DE625; Mon, 28 Oct 2013 21:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1382995324!1205308!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14736 invoked from network); 28 Oct 2013 21:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:22:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGC-0005bI-BZ
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGB-0002Md-Ua
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:04 +0000
Date: Mon, 28 Oct 2013 21:22:03 +0000
Message-Id: <E1VauGB-0002Md-Ua@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/idle: Fix
	get_cpu_idle_time()'s interaction with offline pcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bb3e0cc28ba3d519ca78a4ce19ff6493b496aeee
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 22 12:03:03 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 12:03:03 2013 +0200

    x86/idle: Fix get_cpu_idle_time()'s interaction with offline pcpus
    
    Checking for "idle_vcpu[cpu] != NULL" is insufficient protection against
    offline pcpus.  From a hypercall, vcpu_runstate_get() will determine "v !=
    current", and try to take the vcpu_schedule_lock().  This will try to look up
    per_cpu(schedule_data, v->processor) and promptly suffer a NULL structure
    deference as v->processors' __per_cpu_offset is INVALID_PERCPU_AREA.
    
    One example might look like this:
    
    ...
    Xen call trace:
       [<ffff82c4c0126ddb>] vcpu_runstate_get+0x50/0x113
       [<ffff82c4c0126ec6>] get_cpu_idle_time+0x28/0x2e
       [<ffff82c4c012b5cb>] do_sysctl+0x3db/0xeb8
       [<ffff82c4c023280d>] compat_hypercall+0xbd/0x116
    
    Pagetable walk from 0000000000000040:
     L4[0x000] = 0000000186df8027 0000000000028207
     L3[0x000] = 0000000188e36027 00000000000261c9
     L2[0x000] = 0000000000000000 ffffffffffffffff
    
    ****************************************
    Panic on CPU 11:
    ...
    
    get_cpu_idle_time() has been updated to correctly deal with offline pcpus
    itself by returning 0, in the same way as it would if it was missing the
    idle_vcpu[] pointer.
    
    In doing so, XENPF_getidletime needed updating to correctly retain its
    described behaviour of clearing bits in the cpumap for offline pcpus.
    
    As this crash can only be triggered with toolstack hypercalls, it is not a
    security issue and just a simple bug.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 0aa27ce3351f7eb09d13e863a1d5f303086aa32a
    master date: 2013-10-04 12:23:23 +0200
---
 xen/arch/x86/platform_hypercall.c |    8 ++++++--
 xen/common/schedule.c             |    9 ++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 88880b0..96895a3 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -388,10 +388,14 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op)
 
         for_each_cpu ( cpu, cpumap )
         {
-            if ( idle_vcpu[cpu] == NULL )
-                cpumask_clear_cpu(cpu, cpumap);
             idletime = get_cpu_idle_time(cpu);
 
+            if ( !idletime )
+            {
+                cpumask_clear_cpu(cpu, cpumap);
+                continue;
+            }
+
             if ( copy_to_guest_offset(idletimes, cpu, &idletime, 1) )
             {
                 ret = -EFAULT;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 7f298d8..3f7d463 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -175,13 +175,12 @@ void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate)
 
 uint64_t get_cpu_idle_time(unsigned int cpu)
 {
-    struct vcpu_runstate_info state;
-    struct vcpu *v;
+    struct vcpu_runstate_info state = { 0 };
+    struct vcpu *v = idle_vcpu[cpu];
 
-    if ( (v = idle_vcpu[cpu]) == NULL )
-        return 0;
+    if ( cpu_online(cpu) && v )
+        vcpu_runstate_get(v, &state);
 
-    vcpu_runstate_get(v, &state);
     return state.time[RUNSTATE_running];
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:22:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:22:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VauGG-0000FY-7u; Mon, 28 Oct 2013 21: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 1VauGF-0000FQ-3o
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:07 +0000
Received: from [193.109.254.147:61886] by server-3.bemta-14.messagelabs.com id
	37/80-03488-E75DE625; Mon, 28 Oct 2013 21:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1382995324!1205308!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14736 invoked from network); 28 Oct 2013 21:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:22:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGC-0005bI-BZ
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGB-0002Md-Ua
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:04 +0000
Date: Mon, 28 Oct 2013 21:22:03 +0000
Message-Id: <E1VauGB-0002Md-Ua@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/idle: Fix
	get_cpu_idle_time()'s interaction with offline pcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bb3e0cc28ba3d519ca78a4ce19ff6493b496aeee
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 22 12:03:03 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 12:03:03 2013 +0200

    x86/idle: Fix get_cpu_idle_time()'s interaction with offline pcpus
    
    Checking for "idle_vcpu[cpu] != NULL" is insufficient protection against
    offline pcpus.  From a hypercall, vcpu_runstate_get() will determine "v !=
    current", and try to take the vcpu_schedule_lock().  This will try to look up
    per_cpu(schedule_data, v->processor) and promptly suffer a NULL structure
    deference as v->processors' __per_cpu_offset is INVALID_PERCPU_AREA.
    
    One example might look like this:
    
    ...
    Xen call trace:
       [<ffff82c4c0126ddb>] vcpu_runstate_get+0x50/0x113
       [<ffff82c4c0126ec6>] get_cpu_idle_time+0x28/0x2e
       [<ffff82c4c012b5cb>] do_sysctl+0x3db/0xeb8
       [<ffff82c4c023280d>] compat_hypercall+0xbd/0x116
    
    Pagetable walk from 0000000000000040:
     L4[0x000] = 0000000186df8027 0000000000028207
     L3[0x000] = 0000000188e36027 00000000000261c9
     L2[0x000] = 0000000000000000 ffffffffffffffff
    
    ****************************************
    Panic on CPU 11:
    ...
    
    get_cpu_idle_time() has been updated to correctly deal with offline pcpus
    itself by returning 0, in the same way as it would if it was missing the
    idle_vcpu[] pointer.
    
    In doing so, XENPF_getidletime needed updating to correctly retain its
    described behaviour of clearing bits in the cpumap for offline pcpus.
    
    As this crash can only be triggered with toolstack hypercalls, it is not a
    security issue and just a simple bug.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 0aa27ce3351f7eb09d13e863a1d5f303086aa32a
    master date: 2013-10-04 12:23:23 +0200
---
 xen/arch/x86/platform_hypercall.c |    8 ++++++--
 xen/common/schedule.c             |    9 ++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 88880b0..96895a3 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -388,10 +388,14 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op)
 
         for_each_cpu ( cpu, cpumap )
         {
-            if ( idle_vcpu[cpu] == NULL )
-                cpumask_clear_cpu(cpu, cpumap);
             idletime = get_cpu_idle_time(cpu);
 
+            if ( !idletime )
+            {
+                cpumask_clear_cpu(cpu, cpumap);
+                continue;
+            }
+
             if ( copy_to_guest_offset(idletimes, cpu, &idletime, 1) )
             {
                 ret = -EFAULT;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 7f298d8..3f7d463 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -175,13 +175,12 @@ void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate)
 
 uint64_t get_cpu_idle_time(unsigned int cpu)
 {
-    struct vcpu_runstate_info state;
-    struct vcpu *v;
+    struct vcpu_runstate_info state = { 0 };
+    struct vcpu *v = idle_vcpu[cpu];
 
-    if ( (v = idle_vcpu[cpu]) == NULL )
-        return 0;
+    if ( cpu_online(cpu) && v )
+        vcpu_runstate_get(v, &state);
 
-    vcpu_runstate_get(v, &state);
     return state.time[RUNSTATE_running];
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:22:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VauGR-0000GG-BH; Mon, 28 Oct 2013 21:22: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 1VauGP-0000G3-Jc
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:17 +0000
Received: from [193.109.254.147:62218] by server-12.bemta-14.messagelabs.com
	id BA/90-25062-985DE625; Mon, 28 Oct 2013 21:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1382995335!1193872!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4552 invoked from network); 28 Oct 2013 21:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:22:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGN-0005bL-1s
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGM-0002N8-Hm
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:14 +0000
Date: Mon, 28 Oct 2013 21:22:14 +0000
Message-Id: <E1VauGM-0002N8-Hm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/percpu: Force
	INVALID_PERCPU_AREA into the non-canonical address region
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 707aec94c54127ebfda7d0f8455ecbb332ee49f0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 22 12:04:01 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 12:04:01 2013 +0200

    x86/percpu: Force INVALID_PERCPU_AREA into the non-canonical address region
    
    This causes accidental uses of per_cpu() on a pcpu with an INVALID_PERCPU_AREA
    to result in a #GF for attempting to access the middle of the non-canonical
    virtual address region.
    
    This is preferable to the current behaviour, where incorrect use of per_cpu()
    will result in an effective NULL structure dereference which has security
    implication in the context of PV guests.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 7cfb0053629c4dd1a6f01dc43cca7c0c25b8b7bf
    master date: 2013-10-04 12:24:34 +0200
---
 xen/arch/x86/percpu.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index e545024..1c1dad9 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -6,7 +6,14 @@
 #include <xen/rcupdate.h>
 
 unsigned long __per_cpu_offset[NR_CPUS];
-#define INVALID_PERCPU_AREA (-(long)__per_cpu_start)
+
+/*
+ * Force uses of per_cpu() with an invalid area to attempt to access the
+ * middle of the non-canonical address space resulting in a #GP, rather than a
+ * possible #PF at (NULL + a little) which has security implications in the
+ * context of PV guests.
+ */
+#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
 #define PERCPU_ORDER (get_order_from_bytes(__per_cpu_data_end-__per_cpu_start))
 
 void __init percpu_init_areas(void)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:22:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VauGR-0000GG-BH; Mon, 28 Oct 2013 21:22: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 1VauGP-0000G3-Jc
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:17 +0000
Received: from [193.109.254.147:62218] by server-12.bemta-14.messagelabs.com
	id BA/90-25062-985DE625; Mon, 28 Oct 2013 21:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1382995335!1193872!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4552 invoked from network); 28 Oct 2013 21:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:22:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGN-0005bL-1s
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGM-0002N8-Hm
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:14 +0000
Date: Mon, 28 Oct 2013 21:22:14 +0000
Message-Id: <E1VauGM-0002N8-Hm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/percpu: Force
	INVALID_PERCPU_AREA into the non-canonical address region
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 707aec94c54127ebfda7d0f8455ecbb332ee49f0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 22 12:04:01 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 12:04:01 2013 +0200

    x86/percpu: Force INVALID_PERCPU_AREA into the non-canonical address region
    
    This causes accidental uses of per_cpu() on a pcpu with an INVALID_PERCPU_AREA
    to result in a #GF for attempting to access the middle of the non-canonical
    virtual address region.
    
    This is preferable to the current behaviour, where incorrect use of per_cpu()
    will result in an effective NULL structure dereference which has security
    implication in the context of PV guests.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 7cfb0053629c4dd1a6f01dc43cca7c0c25b8b7bf
    master date: 2013-10-04 12:24:34 +0200
---
 xen/arch/x86/percpu.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index e545024..1c1dad9 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -6,7 +6,14 @@
 #include <xen/rcupdate.h>
 
 unsigned long __per_cpu_offset[NR_CPUS];
-#define INVALID_PERCPU_AREA (-(long)__per_cpu_start)
+
+/*
+ * Force uses of per_cpu() with an invalid area to attempt to access the
+ * middle of the non-canonical address space resulting in a #GP, rather than a
+ * possible #PF at (NULL + a little) which has security implications in the
+ * context of PV guests.
+ */
+#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
 #define PERCPU_ORDER (get_order_from_bytes(__per_cpu_data_end-__per_cpu_start))
 
 void __init percpu_init_areas(void)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:22:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:22: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 1VauGb-0000Gz-HS; Mon, 28 Oct 2013 21:22:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGa-0000Ga-8U
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:28 +0000
Received: from [85.158.137.68:35233] by server-3.bemta-3.messagelabs.com id
	9D/77-03862-395DE625; Mon, 28 Oct 2013 21:22:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1382995345!195868!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18321 invoked from network); 28 Oct 2013 21:22:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:22:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGX-0005bR-AS
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGX-0002NU-6I
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:25 +0000
Date: Mon, 28 Oct 2013 21:22:25 +0000
Message-Id: <E1VauGX-0002NU-6I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] forbid PV guest console reads
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 29de283bdb3f547030012c4a4486e59e3d53fa27
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue Oct 22 12:04:43 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 12:04:43 2013 +0200

    forbid PV guest console reads
    
    The CONSOLEIO_read operation was incorrectly allowed to PV guests if the
    hypervisor was compiled in debug mode (with VERBOSE defined).
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 65ba631bcb62c79eb33ebfde8a0471fd012c37a8
    master date: 2013-10-04 12:51:44 +0200
---
 xen/drivers/char/console.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index e10bed5..ef24f63 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -363,11 +363,14 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE(char) buffer)
     long rc;
     unsigned int idx, len;
 
-#ifndef VERBOSE
-    /* Only domain 0 may access the emergency console. */
     if ( current->domain->domain_id != 0 )
-        return -EPERM;
+#ifndef VERBOSE
+        /* Only domain 0 may access the emergency console. */
+#else
+        /* Only console writes are permitted for other than Dom0. */
+        if ( cmd != CONSOLEIO_write )
 #endif
+            return -EPERM;
 
     rc = xsm_console_io(current->domain, cmd);
     if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:22:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:22: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 1VauGb-0000Gz-HS; Mon, 28 Oct 2013 21:22:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGa-0000Ga-8U
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:28 +0000
Received: from [85.158.137.68:35233] by server-3.bemta-3.messagelabs.com id
	9D/77-03862-395DE625; Mon, 28 Oct 2013 21:22:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1382995345!195868!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18321 invoked from network); 28 Oct 2013 21:22:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:22:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGX-0005bR-AS
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGX-0002NU-6I
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:25 +0000
Date: Mon, 28 Oct 2013 21:22:25 +0000
Message-Id: <E1VauGX-0002NU-6I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] forbid PV guest console reads
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 29de283bdb3f547030012c4a4486e59e3d53fa27
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue Oct 22 12:04:43 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 12:04:43 2013 +0200

    forbid PV guest console reads
    
    The CONSOLEIO_read operation was incorrectly allowed to PV guests if the
    hypervisor was compiled in debug mode (with VERBOSE defined).
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    master commit: 65ba631bcb62c79eb33ebfde8a0471fd012c37a8
    master date: 2013-10-04 12:51:44 +0200
---
 xen/drivers/char/console.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index e10bed5..ef24f63 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -363,11 +363,14 @@ long do_console_io(int cmd, int count, XEN_GUEST_HANDLE(char) buffer)
     long rc;
     unsigned int idx, len;
 
-#ifndef VERBOSE
-    /* Only domain 0 may access the emergency console. */
     if ( current->domain->domain_id != 0 )
-        return -EPERM;
+#ifndef VERBOSE
+        /* Only domain 0 may access the emergency console. */
+#else
+        /* Only console writes are permitted for other than Dom0. */
+        if ( cmd != CONSOLEIO_write )
 #endif
+            return -EPERM;
 
     rc = xsm_console_io(current->domain, cmd);
     if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:22:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:22: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 1VauGm-0000I1-KW; Mon, 28 Oct 2013 21:22: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 1VauGk-0000Hq-HY
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:38 +0000
Received: from [193.109.254.147:31764] by server-15.bemta-14.messagelabs.com
	id 5B/CA-06807-D95DE625; Mon, 28 Oct 2013 21:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1382995355!1203508!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20425 invoked from network); 28 Oct 2013 21:22:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:22:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGh-0005bZ-HI
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGh-0002Nu-El
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:35 +0000
Date: Mon, 28 Oct 2013 21:22:35 +0000
Message-Id: <E1VauGh-0002Nu-El@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: correct LDT 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 0f72e5d7608e01a79f26a8601a3ea289fa52589f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 22 12:05:45 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 12:05:45 2013 +0200

    x86: correct LDT checks
    
    - MMUEXT_SET_LDT should behave as similarly to the LLDT instruction as
      possible: fail only if the base address is non-canonical
    - instead LDT descriptor accesses should fault if the descriptor
      address ends up being non-canonical (by ensuring this we at once
      avoid reading an entry from the mach-to-phys table and consider it a
      page table entry)
    - fault propagation on using LDT selectors must distinguish #PF and #GP
      (the latter must be raised for a non-canonical descriptor address,
      which also applies to several other uses of propagate_page_fault(),
      and hence the problem is being fixed there)
    - map_ldt_shadow_page() should properly wrap addresses for 32-bit VMs
    
    At once remove the odd invokation of map_ldt_shadow_page() from the
    MMUEXT_SET_LDT handler: There's nothing really telling us that the
    first LDT page is going to be preferred over others.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 40d66baa46ca8a9ffa6df3e063a967d08ec92bcf
    master date: 2013-10-11 09:28:26 +0200
---
 xen/arch/x86/domain.c                |   20 ++++++--------------
 xen/arch/x86/mm.c                    |    9 ++++-----
 xen/arch/x86/traps.c                 |   29 ++++++++++++++++++++++++-----
 xen/include/asm-x86/mm.h             |    2 +-
 xen/include/asm-x86/paging.h         |    3 ++-
 xen/include/asm-x86/x86_32/uaccess.h |    1 +
 6 files changed, 38 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 89dd3cb..68c435e 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -779,12 +779,7 @@ int arch_set_info_guest(
                 fixup_guest_code_selector(d, c.nat->trap_ctxt[i].cs);
             }
 
-            /* LDT safety checks. */
-            if ( ((c.nat->ldt_base & (PAGE_SIZE-1)) != 0) ||
-                 (c.nat->ldt_ents > 8192) ||
-                 !array_access_ok(c.nat->ldt_base,
-                                  c.nat->ldt_ents,
-                                  LDT_ENTRY_SIZE) )
+            if ( !__addr_ok(c.nat->ldt_base) )
                 return -EINVAL;
         }
 #ifdef CONFIG_COMPAT
@@ -798,16 +793,13 @@ int arch_set_info_guest(
 
             for ( i = 0; i < 256; i++ )
                 fixup_guest_code_selector(d, c.cmp->trap_ctxt[i].cs);
-
-            /* LDT safety checks. */
-            if ( ((c.cmp->ldt_base & (PAGE_SIZE-1)) != 0) ||
-                 (c.cmp->ldt_ents > 8192) ||
-                 !compat_array_access_ok(c.cmp->ldt_base,
-                                         c.cmp->ldt_ents,
-                                         LDT_ENTRY_SIZE) )
-                return -EINVAL;
         }
 #endif
+
+        /* LDT safety checks. */
+        if ( ((c(ldt_base) & (PAGE_SIZE - 1)) != 0) ||
+             (c(ldt_ents) > 8192) )
+            return -EINVAL;
     }
 
     v->fpu_initialised = !!(flags & VGCF_I387_VALID);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fcd7939..df687af 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -660,6 +660,8 @@ int map_ldt_shadow_page(unsigned int off)
 
     BUG_ON(unlikely(in_irq()));
 
+    if ( is_pv_32bit_domain(d) )
+        gva = (u32)gva;
     guest_get_eff_kern_l1e(v, gva, &l1e);
     if ( unlikely(!(l1e_get_flags(l1e) & _PAGE_PRESENT)) )
         return 0;
@@ -3495,9 +3497,8 @@ long do_mmuext_op(
                 MEM_LOG("ignoring SET_LDT hypercall from external domain");
                 okay = 0;
             }
-            else if ( ((ptr & (PAGE_SIZE-1)) != 0) || 
-                      (ents > 8192) ||
-                      !array_access_ok(ptr, ents, LDT_ENTRY_SIZE) )
+            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);
@@ -3510,8 +3511,6 @@ long do_mmuext_op(
                 curr->arch.pv_vcpu.ldt_base = ptr;
                 curr->arch.pv_vcpu.ldt_ents = ents;
                 load_LDT(curr);
-                if ( ents != 0 )
-                    (void)map_ldt_shadow_page(0);
             }
             break;
         }
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 2fc9927..fd8bd8c 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1107,12 +1107,26 @@ static void reserved_bit_page_fault(
     show_execution_state(regs);
 }
 
-void propagate_page_fault(unsigned long addr, u16 error_code)
+struct trap_bounce *propagate_page_fault(unsigned long addr, u16 error_code)
 {
     struct trap_info *ti;
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.pv_vcpu.trap_bounce;
 
+#ifdef __x86_64__
+    if ( unlikely(!is_canonical_address(addr)) )
+    {
+        ti = &v->arch.pv_vcpu.trap_ctxt[TRAP_gp_fault];
+        tb->flags      = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE;
+        tb->error_code = 0;
+        tb->cs         = ti->cs;
+        tb->eip        = ti->address;
+        if ( TI_GET_IF(ti) )
+            tb->flags |= TBF_INTERRUPT;
+        return tb;
+    }
+#endif
+
     v->arch.pv_vcpu.ctrlreg[2] = addr;
     arch_set_cr2(v, addr);
 
@@ -1139,6 +1153,8 @@ void propagate_page_fault(unsigned long addr, u16 error_code)
 
     if ( unlikely(error_code & PFEC_reserved_bit) )
         reserved_bit_page_fault(addr, guest_cpu_user_regs());
+
+    return NULL;
 }
 
 static int handle_gdt_ldt_mapping_fault(
@@ -1172,13 +1188,16 @@ static int handle_gdt_ldt_mapping_fault(
         }
         else
         {
+            struct trap_bounce *tb;
+
             /* In hypervisor mode? Leave it to the #PF handler to fix up. */
             if ( !guest_mode(regs) )
                 return 0;
-            /* In guest mode? Propagate #PF to guest, with adjusted %cr2. */
-            propagate_page_fault(
-                curr->arch.pv_vcpu.ldt_base + offset,
-                regs->error_code);
+            /* In guest mode? Propagate fault to guest, with adjusted %cr2. */
+            tb = propagate_page_fault(curr->arch.pv_vcpu.ldt_base + offset,
+                                      regs->error_code);
+            if ( tb )
+                tb->error_code = ((u16)offset & ~3) | 4;
         }
     }
     else
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index e783d8a..10a543e 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -602,7 +602,7 @@ int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
 int vcpu_destroy_pagetables(struct vcpu *);
-void propagate_page_fault(unsigned long addr, u16 error_code);
+struct trap_bounce *propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
 int __sync_local_execstate(void);
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index c432a97..ee35dff 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -408,7 +408,8 @@ guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
     if ( likely(!paging_mode_translate(v->domain)) )
     {
         ASSERT(!paging_mode_external(v->domain));
-        if ( __copy_from_user(eff_l1e, 
+        if ( !__addr_ok(addr) ||
+             __copy_from_user(eff_l1e,
                               &__linear_l1_table[l1_linear_offset(addr)],
                               sizeof(l1_pgentry_t)) != 0 )
             *(l1_pgentry_t *)eff_l1e = l1e_empty();
diff --git a/xen/include/asm-x86/x86_32/uaccess.h b/xen/include/asm-x86/x86_32/uaccess.h
index d6a5230..9ac21c4 100644
--- a/xen/include/asm-x86/x86_32/uaccess.h
+++ b/xen/include/asm-x86/x86_32/uaccess.h
@@ -15,6 +15,7 @@
 		:"1" (addr),"g" ((int)(size)),"r" (HYPERVISOR_VIRT_START)); \
 	flag; })
 
+#define __addr_ok(addr) (likely((unsigned long)(addr) < HYPERVISOR_VIRT_START))
 #define access_ok(addr,size) (likely(__range_not_ok(addr,size) == 0))
 
 #define array_access_ok(addr,count,size) \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:22:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:22: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 1VauGm-0000I1-KW; Mon, 28 Oct 2013 21:22: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 1VauGk-0000Hq-HY
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:38 +0000
Received: from [193.109.254.147:31764] by server-15.bemta-14.messagelabs.com
	id 5B/CA-06807-D95DE625; Mon, 28 Oct 2013 21:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1382995355!1203508!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20425 invoked from network); 28 Oct 2013 21:22:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:22:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGh-0005bZ-HI
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGh-0002Nu-El
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:35 +0000
Date: Mon, 28 Oct 2013 21:22:35 +0000
Message-Id: <E1VauGh-0002Nu-El@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: correct LDT 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 0f72e5d7608e01a79f26a8601a3ea289fa52589f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 22 12:05:45 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 12:05:45 2013 +0200

    x86: correct LDT checks
    
    - MMUEXT_SET_LDT should behave as similarly to the LLDT instruction as
      possible: fail only if the base address is non-canonical
    - instead LDT descriptor accesses should fault if the descriptor
      address ends up being non-canonical (by ensuring this we at once
      avoid reading an entry from the mach-to-phys table and consider it a
      page table entry)
    - fault propagation on using LDT selectors must distinguish #PF and #GP
      (the latter must be raised for a non-canonical descriptor address,
      which also applies to several other uses of propagate_page_fault(),
      and hence the problem is being fixed there)
    - map_ldt_shadow_page() should properly wrap addresses for 32-bit VMs
    
    At once remove the odd invokation of map_ldt_shadow_page() from the
    MMUEXT_SET_LDT handler: There's nothing really telling us that the
    first LDT page is going to be preferred over others.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 40d66baa46ca8a9ffa6df3e063a967d08ec92bcf
    master date: 2013-10-11 09:28:26 +0200
---
 xen/arch/x86/domain.c                |   20 ++++++--------------
 xen/arch/x86/mm.c                    |    9 ++++-----
 xen/arch/x86/traps.c                 |   29 ++++++++++++++++++++++++-----
 xen/include/asm-x86/mm.h             |    2 +-
 xen/include/asm-x86/paging.h         |    3 ++-
 xen/include/asm-x86/x86_32/uaccess.h |    1 +
 6 files changed, 38 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 89dd3cb..68c435e 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -779,12 +779,7 @@ int arch_set_info_guest(
                 fixup_guest_code_selector(d, c.nat->trap_ctxt[i].cs);
             }
 
-            /* LDT safety checks. */
-            if ( ((c.nat->ldt_base & (PAGE_SIZE-1)) != 0) ||
-                 (c.nat->ldt_ents > 8192) ||
-                 !array_access_ok(c.nat->ldt_base,
-                                  c.nat->ldt_ents,
-                                  LDT_ENTRY_SIZE) )
+            if ( !__addr_ok(c.nat->ldt_base) )
                 return -EINVAL;
         }
 #ifdef CONFIG_COMPAT
@@ -798,16 +793,13 @@ int arch_set_info_guest(
 
             for ( i = 0; i < 256; i++ )
                 fixup_guest_code_selector(d, c.cmp->trap_ctxt[i].cs);
-
-            /* LDT safety checks. */
-            if ( ((c.cmp->ldt_base & (PAGE_SIZE-1)) != 0) ||
-                 (c.cmp->ldt_ents > 8192) ||
-                 !compat_array_access_ok(c.cmp->ldt_base,
-                                         c.cmp->ldt_ents,
-                                         LDT_ENTRY_SIZE) )
-                return -EINVAL;
         }
 #endif
+
+        /* LDT safety checks. */
+        if ( ((c(ldt_base) & (PAGE_SIZE - 1)) != 0) ||
+             (c(ldt_ents) > 8192) )
+            return -EINVAL;
     }
 
     v->fpu_initialised = !!(flags & VGCF_I387_VALID);
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fcd7939..df687af 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -660,6 +660,8 @@ int map_ldt_shadow_page(unsigned int off)
 
     BUG_ON(unlikely(in_irq()));
 
+    if ( is_pv_32bit_domain(d) )
+        gva = (u32)gva;
     guest_get_eff_kern_l1e(v, gva, &l1e);
     if ( unlikely(!(l1e_get_flags(l1e) & _PAGE_PRESENT)) )
         return 0;
@@ -3495,9 +3497,8 @@ long do_mmuext_op(
                 MEM_LOG("ignoring SET_LDT hypercall from external domain");
                 okay = 0;
             }
-            else if ( ((ptr & (PAGE_SIZE-1)) != 0) || 
-                      (ents > 8192) ||
-                      !array_access_ok(ptr, ents, LDT_ENTRY_SIZE) )
+            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);
@@ -3510,8 +3511,6 @@ long do_mmuext_op(
                 curr->arch.pv_vcpu.ldt_base = ptr;
                 curr->arch.pv_vcpu.ldt_ents = ents;
                 load_LDT(curr);
-                if ( ents != 0 )
-                    (void)map_ldt_shadow_page(0);
             }
             break;
         }
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 2fc9927..fd8bd8c 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1107,12 +1107,26 @@ static void reserved_bit_page_fault(
     show_execution_state(regs);
 }
 
-void propagate_page_fault(unsigned long addr, u16 error_code)
+struct trap_bounce *propagate_page_fault(unsigned long addr, u16 error_code)
 {
     struct trap_info *ti;
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.pv_vcpu.trap_bounce;
 
+#ifdef __x86_64__
+    if ( unlikely(!is_canonical_address(addr)) )
+    {
+        ti = &v->arch.pv_vcpu.trap_ctxt[TRAP_gp_fault];
+        tb->flags      = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE;
+        tb->error_code = 0;
+        tb->cs         = ti->cs;
+        tb->eip        = ti->address;
+        if ( TI_GET_IF(ti) )
+            tb->flags |= TBF_INTERRUPT;
+        return tb;
+    }
+#endif
+
     v->arch.pv_vcpu.ctrlreg[2] = addr;
     arch_set_cr2(v, addr);
 
@@ -1139,6 +1153,8 @@ void propagate_page_fault(unsigned long addr, u16 error_code)
 
     if ( unlikely(error_code & PFEC_reserved_bit) )
         reserved_bit_page_fault(addr, guest_cpu_user_regs());
+
+    return NULL;
 }
 
 static int handle_gdt_ldt_mapping_fault(
@@ -1172,13 +1188,16 @@ static int handle_gdt_ldt_mapping_fault(
         }
         else
         {
+            struct trap_bounce *tb;
+
             /* In hypervisor mode? Leave it to the #PF handler to fix up. */
             if ( !guest_mode(regs) )
                 return 0;
-            /* In guest mode? Propagate #PF to guest, with adjusted %cr2. */
-            propagate_page_fault(
-                curr->arch.pv_vcpu.ldt_base + offset,
-                regs->error_code);
+            /* In guest mode? Propagate fault to guest, with adjusted %cr2. */
+            tb = propagate_page_fault(curr->arch.pv_vcpu.ldt_base + offset,
+                                      regs->error_code);
+            if ( tb )
+                tb->error_code = ((u16)offset & ~3) | 4;
         }
     }
     else
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index e783d8a..10a543e 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -602,7 +602,7 @@ int new_guest_cr3(unsigned long pfn);
 void make_cr3(struct vcpu *v, unsigned long mfn);
 void update_cr3(struct vcpu *v);
 int vcpu_destroy_pagetables(struct vcpu *);
-void propagate_page_fault(unsigned long addr, u16 error_code);
+struct trap_bounce *propagate_page_fault(unsigned long addr, u16 error_code);
 void *do_page_walk(struct vcpu *v, unsigned long addr);
 
 int __sync_local_execstate(void);
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index c432a97..ee35dff 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -408,7 +408,8 @@ guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
     if ( likely(!paging_mode_translate(v->domain)) )
     {
         ASSERT(!paging_mode_external(v->domain));
-        if ( __copy_from_user(eff_l1e, 
+        if ( !__addr_ok(addr) ||
+             __copy_from_user(eff_l1e,
                               &__linear_l1_table[l1_linear_offset(addr)],
                               sizeof(l1_pgentry_t)) != 0 )
             *(l1_pgentry_t *)eff_l1e = l1e_empty();
diff --git a/xen/include/asm-x86/x86_32/uaccess.h b/xen/include/asm-x86/x86_32/uaccess.h
index d6a5230..9ac21c4 100644
--- a/xen/include/asm-x86/x86_32/uaccess.h
+++ b/xen/include/asm-x86/x86_32/uaccess.h
@@ -15,6 +15,7 @@
 		:"1" (addr),"g" ((int)(size)),"r" (HYPERVISOR_VIRT_START)); \
 	flag; })
 
+#define __addr_ok(addr) (likely((unsigned long)(addr) < HYPERVISOR_VIRT_START))
 #define access_ok(addr,size) (likely(__range_not_ok(addr,size) == 0))
 
 #define array_access_ok(addr,count,size) \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:22:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:22: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 1VauGv-0000JE-Nq; Mon, 28 Oct 2013 21:22: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 1VauGu-0000Iu-Aj
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:48 +0000
Received: from [85.158.143.35:48608] by server-1.bemta-4.messagelabs.com id
	85/AB-17304-7A5DE625; Mon, 28 Oct 2013 21:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1382995366!982410!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28774 invoked from network); 28 Oct 2013 21:22:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:22:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGr-0005bf-R4
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGr-0002P5-Mw
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:45 +0000
Date: Mon, 28 Oct 2013 21:22:45 +0000
Message-Id: <E1VauGr-0002P5-Mw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: add address validity check to
	guest_map_l1e()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f17eab34ef3d53920816771f4ab5f907160e6ca6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 22 12:06:43 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 12:06:43 2013 +0200

    x86: add address validity check to guest_map_l1e()
    
    Just like for guest_get_eff_l1e() this prevents accessing as page
    tables (and with the wrong memory attribute) internal data inside Xen
    happening to be mapped with 1Gb pages.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: d06a0d715ec1423b6c42141ab1b0ff69a3effb56
    master date: 2013-10-11 09:29:43 +0200
---
 xen/include/asm-x86/paging.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index ee35dff..60335ed 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -382,7 +382,8 @@ guest_map_l1e(struct vcpu *v, unsigned long addr, unsigned long *gl1mfn)
         return paging_get_hostmode(v)->guest_map_l1e(v, addr, gl1mfn);
 
     /* Find this l1e and its enclosing l1mfn in the linear map */
-    if ( __copy_from_user(&l2e, 
+    if ( !__addr_ok(addr) ||
+         __copy_from_user(&l2e,
                           &__linear_l2_table[l2_linear_offset(addr)],
                           sizeof(l2_pgentry_t)) != 0 )
         return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:22:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:22: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 1VauGv-0000JE-Nq; Mon, 28 Oct 2013 21:22: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 1VauGu-0000Iu-Aj
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:48 +0000
Received: from [85.158.143.35:48608] by server-1.bemta-4.messagelabs.com id
	85/AB-17304-7A5DE625; Mon, 28 Oct 2013 21:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1382995366!982410!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28774 invoked from network); 28 Oct 2013 21:22:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:22:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGr-0005bf-R4
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauGr-0002P5-Mw
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:45 +0000
Date: Mon, 28 Oct 2013 21:22:45 +0000
Message-Id: <E1VauGr-0002P5-Mw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: add address validity check to
	guest_map_l1e()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f17eab34ef3d53920816771f4ab5f907160e6ca6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 22 12:06:43 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 12:06:43 2013 +0200

    x86: add address validity check to guest_map_l1e()
    
    Just like for guest_get_eff_l1e() this prevents accessing as page
    tables (and with the wrong memory attribute) internal data inside Xen
    happening to be mapped with 1Gb pages.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: d06a0d715ec1423b6c42141ab1b0ff69a3effb56
    master date: 2013-10-11 09:29:43 +0200
---
 xen/include/asm-x86/paging.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index ee35dff..60335ed 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -382,7 +382,8 @@ guest_map_l1e(struct vcpu *v, unsigned long addr, unsigned long *gl1mfn)
         return paging_get_hostmode(v)->guest_map_l1e(v, addr, gl1mfn);
 
     /* Find this l1e and its enclosing l1mfn in the linear map */
-    if ( __copy_from_user(&l2e, 
+    if ( !__addr_ok(addr) ||
+         __copy_from_user(&l2e,
                           &__linear_l2_table[l2_linear_offset(addr)],
                           sizeof(l2_pgentry_t)) != 0 )
         return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:23:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:23: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 1VauH5-0000L0-R4; Mon, 28 Oct 2013 21:22: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 1VauH4-0000Kc-Ix
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:58 +0000
Received: from [193.109.254.147:63646] by server-11.bemta-14.messagelabs.com
	id 11/79-08419-1B5DE625; Mon, 28 Oct 2013 21:22:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1382995376!1198262!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2833 invoked from network); 28 Oct 2013 21:22:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:22:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauH2-0005br-1f
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauH1-0002PX-VC
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:56 +0000
Date: Mon, 28 Oct 2013 21:22:55 +0000
Message-Id: <E1VauH1-0002PX-VC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86-64: check for canonical
	address before doing page walks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a489633284ce1e7d6e48011f198e71351213ecb2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 22 12:07:40 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 12:07:40 2013 +0200

    x86-64: check for canonical address before doing page walks
    
    ... as there doesn't really exists any valid mapping for them.
    
    Particularly in the case of do_page_walk() this also avoids returning
    non-NULL for such invalid input.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 6fd9b0361e2eb5a7f12bdd5cbf7e42c0d1937d26
    master date: 2013-10-11 09:31:16 +0200
---
 xen/arch/x86/x86_64/mm.c    |    2 +-
 xen/arch/x86/x86_64/traps.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 635a499..02cb7a9 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -145,7 +145,7 @@ void *do_page_walk(struct vcpu *v, unsigned long addr)
     l2_pgentry_t l2e, *l2t;
     l1_pgentry_t l1e, *l1t;
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_vcpu(v) || !is_canonical_address(addr) )
         return NULL;
 
     l4t = mfn_to_virt(mfn);
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 00bee9b..d20e528 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -169,6 +169,8 @@ void show_page_walk(unsigned long addr)
     l1_pgentry_t l1e, *l1t;
 
     printk("Pagetable walk from %016lx:\n", addr);
+    if ( !is_canonical_address(addr) )
+        return;
 
     l4t = mfn_to_virt(mfn);
     l4e = l4t[l4_table_offset(addr)];
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:23:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:23: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 1VauH5-0000L0-R4; Mon, 28 Oct 2013 21:22: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 1VauH4-0000Kc-Ix
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:58 +0000
Received: from [193.109.254.147:63646] by server-11.bemta-14.messagelabs.com
	id 11/79-08419-1B5DE625; Mon, 28 Oct 2013 21:22:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1382995376!1198262!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2833 invoked from network); 28 Oct 2013 21:22:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:22:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauH2-0005br-1f
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauH1-0002PX-VC
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:22:56 +0000
Date: Mon, 28 Oct 2013 21:22:55 +0000
Message-Id: <E1VauH1-0002PX-VC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86-64: check for canonical
	address before doing page walks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a489633284ce1e7d6e48011f198e71351213ecb2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 22 12:07:40 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 22 12:07:40 2013 +0200

    x86-64: check for canonical address before doing page walks
    
    ... as there doesn't really exists any valid mapping for them.
    
    Particularly in the case of do_page_walk() this also avoids returning
    non-NULL for such invalid input.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 6fd9b0361e2eb5a7f12bdd5cbf7e42c0d1937d26
    master date: 2013-10-11 09:31:16 +0200
---
 xen/arch/x86/x86_64/mm.c    |    2 +-
 xen/arch/x86/x86_64/traps.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 635a499..02cb7a9 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -145,7 +145,7 @@ void *do_page_walk(struct vcpu *v, unsigned long addr)
     l2_pgentry_t l2e, *l2t;
     l1_pgentry_t l1e, *l1t;
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_vcpu(v) || !is_canonical_address(addr) )
         return NULL;
 
     l4t = mfn_to_virt(mfn);
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 00bee9b..d20e528 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -169,6 +169,8 @@ void show_page_walk(unsigned long addr)
     l1_pgentry_t l1e, *l1t;
 
     printk("Pagetable walk from %016lx:\n", addr);
+    if ( !is_canonical_address(addr) )
+        return;
 
     l4t = mfn_to_virt(mfn);
     l4e = l4t[l4_table_offset(addr)];
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:23:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:23: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 1VauHE-0000N2-Vv; Mon, 28 Oct 2013 21:23: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 1VauHE-0000Mk-DA
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:23:08 +0000
Received: from [85.158.143.35:49283] by server-2.bemta-4.messagelabs.com id
	35/5F-06473-BB5DE625; Mon, 28 Oct 2013 21:23:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1382995386!973933!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32221 invoked from network); 28 Oct 2013 21:23:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:23:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauHC-0005cR-6l
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:23:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauHC-0002QF-53
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:23:06 +0000
Date: Mon, 28 Oct 2013 21:23:06 +0000
Message-Id: <E1VauHC-0002QF-53@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] Revert "x86/percpu: Force
	INVALID_PERCPU_AREA into the non-canonical address region"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b2be780f326f7e36c844d17ad94dda2e240ca11a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 28 11:03:54 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 28 11:03:54 2013 +0100

    Revert "x86/percpu: Force INVALID_PERCPU_AREA into the non-canonical address region"
    
    This reverts commit 707aec94c54127ebfda7d0f8455ecbb332ee49f0.
    It needs the 32-bit case to be taken into account.
---
 xen/arch/x86/percpu.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index 1c1dad9..e545024 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -6,14 +6,7 @@
 #include <xen/rcupdate.h>
 
 unsigned long __per_cpu_offset[NR_CPUS];
-
-/*
- * Force uses of per_cpu() with an invalid area to attempt to access the
- * middle of the non-canonical address space resulting in a #GP, rather than a
- * possible #PF at (NULL + a little) which has security implications in the
- * context of PV guests.
- */
-#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
+#define INVALID_PERCPU_AREA (-(long)__per_cpu_start)
 #define PERCPU_ORDER (get_order_from_bytes(__per_cpu_data_end-__per_cpu_start))
 
 void __init percpu_init_areas(void)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 21:23:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 21:23: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 1VauHE-0000N2-Vv; Mon, 28 Oct 2013 21:23: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 1VauHE-0000Mk-DA
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:23:08 +0000
Received: from [85.158.143.35:49283] by server-2.bemta-4.messagelabs.com id
	35/5F-06473-BB5DE625; Mon, 28 Oct 2013 21:23:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1382995386!973933!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32221 invoked from network); 28 Oct 2013 21:23:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 21:23:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauHC-0005cR-6l
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:23:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VauHC-0002QF-53
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 21:23:06 +0000
Date: Mon, 28 Oct 2013 21:23:06 +0000
Message-Id: <E1VauHC-0002QF-53@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] Revert "x86/percpu: Force
	INVALID_PERCPU_AREA into the non-canonical address region"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b2be780f326f7e36c844d17ad94dda2e240ca11a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 28 11:03:54 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 28 11:03:54 2013 +0100

    Revert "x86/percpu: Force INVALID_PERCPU_AREA into the non-canonical address region"
    
    This reverts commit 707aec94c54127ebfda7d0f8455ecbb332ee49f0.
    It needs the 32-bit case to be taken into account.
---
 xen/arch/x86/percpu.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/percpu.c b/xen/arch/x86/percpu.c
index 1c1dad9..e545024 100644
--- a/xen/arch/x86/percpu.c
+++ b/xen/arch/x86/percpu.c
@@ -6,14 +6,7 @@
 #include <xen/rcupdate.h>
 
 unsigned long __per_cpu_offset[NR_CPUS];
-
-/*
- * Force uses of per_cpu() with an invalid area to attempt to access the
- * middle of the non-canonical address space resulting in a #GP, rather than a
- * possible #PF at (NULL + a little) which has security implications in the
- * context of PV guests.
- */
-#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
+#define INVALID_PERCPU_AREA (-(long)__per_cpu_start)
 #define PERCPU_ORDER (get_order_from_bytes(__per_cpu_data_end-__per_cpu_start))
 
 void __init percpu_init_areas(void)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 22:22:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 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 1VavCI-0001Dh-Py; Mon, 28 Oct 2013 22:22:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCH-0001Da-Sw
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:06 +0000
Received: from [85.158.143.35:63877] by server-1.bemta-4.messagelabs.com id
	CC/63-17304-D83EE625; Mon, 28 Oct 2013 22:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1382998923!978402!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13397 invoked from network); 28 Oct 2013 22:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 22:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCF-0006G3-AC
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCF-0004AI-6F
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:03 +0000
Date: Mon, 28 Oct 2013 22:22:03 +0000
Message-Id: <E1VavCF-0004AI-6F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/initcall: extern linker symbols
	with correct types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1c7964a1ea4b2f46958fdc716c7b9a06f5514fab
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 28 11:58:44 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 28 11:58:44 2013 +0100

    common/initcall: extern linker symbols with correct types
    
    Coverity IDs 1054956, 1054957
    
    Coverity pointed out that we applying array operations based on an expression
    which yielded singleton pointers.  The problem is actually that the externs
    were typed incorrectly.
    
    Correct the extern declaration to prevent straying into undefined behaviour,
    and relying on the lenience of GCC to work.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/kernel.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index b8707d9..4ca50c4 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -196,19 +196,20 @@ void add_taint(unsigned flag)
     tainted |= flag;
 }
 
-extern initcall_t __initcall_start, __presmp_initcall_end, __initcall_end;
+extern const initcall_t __initcall_start[], __presmp_initcall_end[],
+    __initcall_end[];
 
 void __init do_presmp_initcalls(void)
 {
-    initcall_t *call;
-    for ( call = &__initcall_start; call < &__presmp_initcall_end; call++ )
+    const initcall_t *call;
+    for ( call = __initcall_start; call < __presmp_initcall_end; call++ )
         (*call)();
 }
 
 void __init do_initcalls(void)
 {
-    initcall_t *call;
-    for ( call = &__presmp_initcall_end; call < &__initcall_end; call++ )
+    const initcall_t *call;
+    for ( call = __presmp_initcall_end; call < __initcall_end; call++ )
         (*call)();
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 28 22:22:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 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 1VavCI-0001Dh-Py; Mon, 28 Oct 2013 22:22:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCH-0001Da-Sw
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:06 +0000
Received: from [85.158.143.35:63877] by server-1.bemta-4.messagelabs.com id
	CC/63-17304-D83EE625; Mon, 28 Oct 2013 22:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1382998923!978402!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13397 invoked from network); 28 Oct 2013 22:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 22:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCF-0006G3-AC
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCF-0004AI-6F
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:03 +0000
Date: Mon, 28 Oct 2013 22:22:03 +0000
Message-Id: <E1VavCF-0004AI-6F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/initcall: extern linker symbols
	with correct types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1c7964a1ea4b2f46958fdc716c7b9a06f5514fab
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 28 11:58:44 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 28 11:58:44 2013 +0100

    common/initcall: extern linker symbols with correct types
    
    Coverity IDs 1054956, 1054957
    
    Coverity pointed out that we applying array operations based on an expression
    which yielded singleton pointers.  The problem is actually that the externs
    were typed incorrectly.
    
    Correct the extern declaration to prevent straying into undefined behaviour,
    and relying on the lenience of GCC to work.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/kernel.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index b8707d9..4ca50c4 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -196,19 +196,20 @@ void add_taint(unsigned flag)
     tainted |= flag;
 }
 
-extern initcall_t __initcall_start, __presmp_initcall_end, __initcall_end;
+extern const initcall_t __initcall_start[], __presmp_initcall_end[],
+    __initcall_end[];
 
 void __init do_presmp_initcalls(void)
 {
-    initcall_t *call;
-    for ( call = &__initcall_start; call < &__presmp_initcall_end; call++ )
+    const initcall_t *call;
+    for ( call = __initcall_start; call < __presmp_initcall_end; call++ )
         (*call)();
 }
 
 void __init do_initcalls(void)
 {
-    initcall_t *call;
-    for ( call = &__presmp_initcall_end; call < &__initcall_end; call++ )
+    const initcall_t *call;
+    for ( call = __presmp_initcall_end; call < __initcall_end; call++ )
         (*call)();
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Oct 28 22:22:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 22:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VavCS-0001EV-TD; Mon, 28 Oct 2013 22:22:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCS-0001EM-0t
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:16 +0000
Received: from [85.158.143.35:64253] by server-3.bemta-4.messagelabs.com id
	2C/9A-21600-793EE625; Mon, 28 Oct 2013 22:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1382998933!984401!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10596 invoked from network); 28 Oct 2013 22:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 22:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCP-0006G6-Gu
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCP-0004Ag-En
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:13 +0000
Date: Mon, 28 Oct 2013 22:22:13 +0000
Message-Id: <E1VavCP-0004Ag-En@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: refine address validity checks
	before accessing page tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 343cad8c70585c4dba8afc75e1ec1b7610605ab2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 28 12:00:36 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 28 12:00:36 2013 +0100

    x86: refine address validity checks before accessing page tables
    
    In commit 40d66baa ("x86: correct LDT checks") and d06a0d71 ("x86: add
    address validity check to guest_map_l1e()") I didn't really pay
    attention to the fact that these checks would better be done before the
    paging_mode_translate() ones, as there's also no equivalent check down
    the shadow code paths involved here (at least not up to the first use
    of the address), and such generic checks shouldn't really be done by
    particular backend functions anyway.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/include/asm-x86/paging.h |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index e957b2f..cd7ee3b 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -356,12 +356,14 @@ guest_map_l1e(struct vcpu *v, unsigned long addr, unsigned long *gl1mfn)
 {
     l2_pgentry_t l2e;
 
+    if ( unlikely(!__addr_ok(addr)) )
+        return NULL;
+
     if ( unlikely(paging_mode_translate(v->domain)) )
         return paging_get_hostmode(v)->guest_map_l1e(v, addr, gl1mfn);
 
     /* Find this l1e and its enclosing l1mfn in the linear map */
-    if ( !__addr_ok(addr) ||
-         __copy_from_user(&l2e,
+    if ( __copy_from_user(&l2e,
                           &__linear_l2_table[l2_linear_offset(addr)],
                           sizeof(l2_pgentry_t)) != 0 )
         return NULL;
@@ -382,16 +384,21 @@ guest_unmap_l1e(struct vcpu *v, void *p)
 
 /* Read the guest's l1e that maps this address. */
 static inline void
-guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
+guest_get_eff_l1e(struct vcpu *v, unsigned long addr, l1_pgentry_t *eff_l1e)
 {
+    if ( unlikely(!__addr_ok(addr)) )
+    {
+        *eff_l1e = l1e_empty();
+        return;
+    }
+
     if ( likely(!paging_mode_translate(v->domain)) )
     {
         ASSERT(!paging_mode_external(v->domain));
-        if ( !__addr_ok(addr) ||
-             __copy_from_user(eff_l1e,
+        if ( __copy_from_user(eff_l1e,
                               &__linear_l1_table[l1_linear_offset(addr)],
                               sizeof(l1_pgentry_t)) != 0 )
-            *(l1_pgentry_t *)eff_l1e = l1e_empty();
+            *eff_l1e = l1e_empty();
         return;
     }
         
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 22:22:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 22:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VavCS-0001EV-TD; Mon, 28 Oct 2013 22:22:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCS-0001EM-0t
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:16 +0000
Received: from [85.158.143.35:64253] by server-3.bemta-4.messagelabs.com id
	2C/9A-21600-793EE625; Mon, 28 Oct 2013 22:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1382998933!984401!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10596 invoked from network); 28 Oct 2013 22:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 22:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCP-0006G6-Gu
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCP-0004Ag-En
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:13 +0000
Date: Mon, 28 Oct 2013 22:22:13 +0000
Message-Id: <E1VavCP-0004Ag-En@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: refine address validity checks
	before accessing page tables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 343cad8c70585c4dba8afc75e1ec1b7610605ab2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 28 12:00:36 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 28 12:00:36 2013 +0100

    x86: refine address validity checks before accessing page tables
    
    In commit 40d66baa ("x86: correct LDT checks") and d06a0d71 ("x86: add
    address validity check to guest_map_l1e()") I didn't really pay
    attention to the fact that these checks would better be done before the
    paging_mode_translate() ones, as there's also no equivalent check down
    the shadow code paths involved here (at least not up to the first use
    of the address), and such generic checks shouldn't really be done by
    particular backend functions anyway.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/include/asm-x86/paging.h |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index e957b2f..cd7ee3b 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -356,12 +356,14 @@ guest_map_l1e(struct vcpu *v, unsigned long addr, unsigned long *gl1mfn)
 {
     l2_pgentry_t l2e;
 
+    if ( unlikely(!__addr_ok(addr)) )
+        return NULL;
+
     if ( unlikely(paging_mode_translate(v->domain)) )
         return paging_get_hostmode(v)->guest_map_l1e(v, addr, gl1mfn);
 
     /* Find this l1e and its enclosing l1mfn in the linear map */
-    if ( !__addr_ok(addr) ||
-         __copy_from_user(&l2e,
+    if ( __copy_from_user(&l2e,
                           &__linear_l2_table[l2_linear_offset(addr)],
                           sizeof(l2_pgentry_t)) != 0 )
         return NULL;
@@ -382,16 +384,21 @@ guest_unmap_l1e(struct vcpu *v, void *p)
 
 /* Read the guest's l1e that maps this address. */
 static inline void
-guest_get_eff_l1e(struct vcpu *v, unsigned long addr, void *eff_l1e)
+guest_get_eff_l1e(struct vcpu *v, unsigned long addr, l1_pgentry_t *eff_l1e)
 {
+    if ( unlikely(!__addr_ok(addr)) )
+    {
+        *eff_l1e = l1e_empty();
+        return;
+    }
+
     if ( likely(!paging_mode_translate(v->domain)) )
     {
         ASSERT(!paging_mode_external(v->domain));
-        if ( !__addr_ok(addr) ||
-             __copy_from_user(eff_l1e,
+        if ( __copy_from_user(eff_l1e,
                               &__linear_l1_table[l1_linear_offset(addr)],
                               sizeof(l1_pgentry_t)) != 0 )
-            *(l1_pgentry_t *)eff_l1e = l1e_empty();
+            *eff_l1e = l1e_empty();
         return;
     }
         
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Oct 28 22:22:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 22: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 1VavCc-0001FR-W7; Mon, 28 Oct 2013 22:22:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCc-0001F4-4d
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:26 +0000
Received: from [85.158.139.211:59037] by server-12.bemta-5.messagelabs.com id
	20/5A-15833-1A3EE625; Mon, 28 Oct 2013 22:22:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1382998943!196889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 380 invoked from network); 28 Oct 2013 22:22:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 22:22:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCZ-0006GC-M4
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCZ-0004B2-K0
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:23 +0000
Date: Mon, 28 Oct 2013 22:22:23 +0000
Message-Id: <E1VavCZ-0004B2-K0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/irq: print direct vector mappings
	in the 'i' debug key
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8f5a051507537aa01995dd0a97a50d1c96fcc2b4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 28 12:01:19 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 28 12:01:19 2013 +0100

    x86/irq: print direct vector mappings in the 'i' debug key
    
    Also adjust the initial print message, as the IRQ loop has contained
    non-guest interrutps for a while now.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/irq.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 53fe9e3..a984bda 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2228,7 +2228,7 @@ static void dump_irqs(unsigned char key)
     unsigned long flags;
     char *ssid;
 
-    printk("Guest interrupt information:\n");
+    printk("IRQ information:\n");
 
     for ( irq = 0; irq < nr_irqs; irq++ )
     {
@@ -2285,6 +2285,14 @@ static void dump_irqs(unsigned char key)
         xfree(ssid);
     }
 
+    printk("Direct vector information:\n");
+    for ( i = FIRST_DYNAMIC_VECTOR; i < NR_VECTORS; ++i )
+        if ( direct_apic_vector[i] )
+        {
+            printk("   %#02x -> ", i);
+            print_symbol("%s\n", (unsigned long)direct_apic_vector[i]);
+        }
+
     dump_ioapic_irq_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 Mon Oct 28 22:22:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 28 Oct 2013 22: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 1VavCc-0001FR-W7; Mon, 28 Oct 2013 22:22:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCc-0001F4-4d
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:26 +0000
Received: from [85.158.139.211:59037] by server-12.bemta-5.messagelabs.com id
	20/5A-15833-1A3EE625; Mon, 28 Oct 2013 22:22:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1382998943!196889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 380 invoked from network); 28 Oct 2013 22:22:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Oct 2013 22:22:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCZ-0006GC-M4
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VavCZ-0004B2-K0
	for xen-changelog@lists.xensource.com; Mon, 28 Oct 2013 22:22:23 +0000
Date: Mon, 28 Oct 2013 22:22:23 +0000
Message-Id: <E1VavCZ-0004B2-K0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/irq: print direct vector mappings
	in the 'i' debug key
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8f5a051507537aa01995dd0a97a50d1c96fcc2b4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 28 12:01:19 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 28 12:01:19 2013 +0100

    x86/irq: print direct vector mappings in the 'i' debug key
    
    Also adjust the initial print message, as the IRQ loop has contained
    non-guest interrutps for a while now.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/irq.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 53fe9e3..a984bda 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2228,7 +2228,7 @@ static void dump_irqs(unsigned char key)
     unsigned long flags;
     char *ssid;
 
-    printk("Guest interrupt information:\n");
+    printk("IRQ information:\n");
 
     for ( irq = 0; irq < nr_irqs; irq++ )
     {
@@ -2285,6 +2285,14 @@ static void dump_irqs(unsigned char key)
         xfree(ssid);
     }
 
+    printk("Direct vector information:\n");
+    for ( i = FIRST_DYNAMIC_VECTOR; i < NR_VECTORS; ++i )
+        if ( direct_apic_vector[i] )
+        {
+            printk("   %#02x -> ", i);
+            print_symbol("%s\n", (unsigned long)direct_apic_vector[i]);
+        }
+
     dump_ioapic_irq_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 Wed Oct 30 01:44:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Oct 2013 01:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VbKpL-0003z4-1G; Wed, 30 Oct 2013 01:44:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbKpJ-0003yx-Sd
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 01:44:06 +0000
Received: from [85.158.137.68:52492] by server-2.bemta-3.messagelabs.com id
	79/92-29572-56460725; Wed, 30 Oct 2013 01:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1383097443!463021!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17292 invoked from network); 30 Oct 2013 01:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2013 01:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbKpG-00059X-WB
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 01:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbKpG-0001RR-Ry
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 01:44:02 +0000
Date: Wed, 30 Oct 2013 01:44:02 +0000
Message-Id: <E1VbKpG-0001RR-Ry@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools: xenstored: if the reply is
	too big then send E2BIG error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d88ac91ef2f0a93ea9359a8133405dbd78abc89b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Oct 29 15:45:53 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 29 16:02:14 2013 +0000

    tools: xenstored: if the reply is too big then send E2BIG error
    
    This fixes the issue for both C and ocaml xenstored, however only the ocaml
    xenstored is vulnerable in its default configuration.
    
    Adding a new error appears to be safe, since bit libxenstore and the Linux
    driver at least treat an unknown error code as EINVAL.
    
    This is XSA-72 / CVE-2013-4416.
    
    Original ocaml patch by Jerome Maloberti <jerome.maloberti@citrix.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
    (cherry picked from commit 8b2c441a1b53a43a38b3c517e28f239da3349872)
---
 tools/ocaml/xenstored/connection.ml |   11 ++++++++++-
 tools/xenstore/xenstored_core.c     |    5 +++++
 xen/include/public/io/xs_wire.h     |    3 ++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 273fe4d..47695f8 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -18,6 +18,8 @@ exception End_of_file
 
 open Stdext
 
+let xenstore_payload_max = 4096 (* xen/include/public/io/xs_wire.h *)
+
 type watch = {
 	con: t;
 	token: string;
@@ -112,8 +114,15 @@ let restrict con domid =
 let set_target con target_domid =
 	con.perm <- Perms.Connection.set_target (get_perm con) ~perms:[Perms.READ; Perms.WRITE] target_domid
 
+let is_backend_mmap con = match con.xb.Xenbus.Xb.backend with
+	| Xenbus.Xb.Xenmmap _ -> true
+	| _ -> false
+
 let send_reply con tid rid ty data =
-	Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid ty data)
+	if (String.length data) > xenstore_payload_max && (is_backend_mmap con) then
+		Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid Xenbus.Xb.Op.Error "E2BIG\000")
+	else
+		Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid ty data)
 
 let send_error con tid rid err = send_reply con tid rid Xenbus.Xb.Op.Error (err ^ "\000")
 let send_ack con tid rid ty = send_reply con tid rid ty "OK\000"
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index a2cf2a6..3792d79 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -627,6 +627,11 @@ void send_reply(struct connection *conn, enum xsd_sockmsg_type type,
 {
 	struct buffered_data *bdata;
 
+	if ( len > XENSTORE_PAYLOAD_MAX ) {
+		send_error(conn, E2BIG);
+		return;
+	}
+
 	/* Message is a child of the connection context for auto-cleanup. */
 	bdata = new_buffer(conn);
 	bdata->buffer = talloc_array(bdata, char, len);
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index 99d24e3..585f0c8 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -83,7 +83,8 @@ __attribute__((unused))
     XSD_ERROR(EROFS),
     XSD_ERROR(EBUSY),
     XSD_ERROR(EAGAIN),
-    XSD_ERROR(EISCONN)
+    XSD_ERROR(EISCONN),
+    XSD_ERROR(E2BIG)
 };
 #endif
 
--
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 Wed Oct 30 01:44:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Oct 2013 01:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VbKpL-0003z4-1G; Wed, 30 Oct 2013 01:44:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbKpJ-0003yx-Sd
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 01:44:06 +0000
Received: from [85.158.137.68:52492] by server-2.bemta-3.messagelabs.com id
	79/92-29572-56460725; Wed, 30 Oct 2013 01:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1383097443!463021!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17292 invoked from network); 30 Oct 2013 01:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2013 01:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbKpG-00059X-WB
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 01:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbKpG-0001RR-Ry
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 01:44:02 +0000
Date: Wed, 30 Oct 2013 01:44:02 +0000
Message-Id: <E1VbKpG-0001RR-Ry@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools: xenstored: if the reply is
	too big then send E2BIG error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d88ac91ef2f0a93ea9359a8133405dbd78abc89b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Oct 29 15:45:53 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 29 16:02:14 2013 +0000

    tools: xenstored: if the reply is too big then send E2BIG error
    
    This fixes the issue for both C and ocaml xenstored, however only the ocaml
    xenstored is vulnerable in its default configuration.
    
    Adding a new error appears to be safe, since bit libxenstore and the Linux
    driver at least treat an unknown error code as EINVAL.
    
    This is XSA-72 / CVE-2013-4416.
    
    Original ocaml patch by Jerome Maloberti <jerome.maloberti@citrix.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
    (cherry picked from commit 8b2c441a1b53a43a38b3c517e28f239da3349872)
---
 tools/ocaml/xenstored/connection.ml |   11 ++++++++++-
 tools/xenstore/xenstored_core.c     |    5 +++++
 xen/include/public/io/xs_wire.h     |    3 ++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 273fe4d..47695f8 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -18,6 +18,8 @@ exception End_of_file
 
 open Stdext
 
+let xenstore_payload_max = 4096 (* xen/include/public/io/xs_wire.h *)
+
 type watch = {
 	con: t;
 	token: string;
@@ -112,8 +114,15 @@ let restrict con domid =
 let set_target con target_domid =
 	con.perm <- Perms.Connection.set_target (get_perm con) ~perms:[Perms.READ; Perms.WRITE] target_domid
 
+let is_backend_mmap con = match con.xb.Xenbus.Xb.backend with
+	| Xenbus.Xb.Xenmmap _ -> true
+	| _ -> false
+
 let send_reply con tid rid ty data =
-	Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid ty data)
+	if (String.length data) > xenstore_payload_max && (is_backend_mmap con) then
+		Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid Xenbus.Xb.Op.Error "E2BIG\000")
+	else
+		Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid ty data)
 
 let send_error con tid rid err = send_reply con tid rid Xenbus.Xb.Op.Error (err ^ "\000")
 let send_ack con tid rid ty = send_reply con tid rid ty "OK\000"
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index a2cf2a6..3792d79 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -627,6 +627,11 @@ void send_reply(struct connection *conn, enum xsd_sockmsg_type type,
 {
 	struct buffered_data *bdata;
 
+	if ( len > XENSTORE_PAYLOAD_MAX ) {
+		send_error(conn, E2BIG);
+		return;
+	}
+
 	/* Message is a child of the connection context for auto-cleanup. */
 	bdata = new_buffer(conn);
 	bdata->buffer = talloc_array(bdata, char, len);
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index 99d24e3..585f0c8 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -83,7 +83,8 @@ __attribute__((unused))
     XSD_ERROR(EROFS),
     XSD_ERROR(EBUSY),
     XSD_ERROR(EAGAIN),
-    XSD_ERROR(EISCONN)
+    XSD_ERROR(EISCONN),
+    XSD_ERROR(E2BIG)
 };
 #endif
 
--
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 Wed Oct 30 03:22:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Oct 2013 03: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 1VbMMC-0004rw-Py; Wed, 30 Oct 2013 03: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 1VbMMA-0004ro-Lf
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 03:22:06 +0000
Received: from [85.158.137.68:33703] by server-2.bemta-3.messagelabs.com id
	1C/3C-29572-D5B70725; Wed, 30 Oct 2013 03:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1383103323!466448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26755 invoked from network); 30 Oct 2013 03:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2013 03:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbMM7-0006Yw-NK
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 03:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbMM7-00044Z-B0
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 03:22:03 +0000
Date: Wed, 30 Oct 2013 03:22:03 +0000
Message-Id: <E1VbMM7-00044Z-B0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools: xenstored: if the reply is
	too big then send E2BIG error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a2b1b99d74c7729b8346eeef23508be7e3d6fdca
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Oct 29 15:45:53 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 29 16:02:36 2013 +0000

    tools: xenstored: if the reply is too big then send E2BIG error
    
    This fixes the issue for both C and ocaml xenstored, however only the ocaml
    xenstored is vulnerable in its default configuration.
    
    Adding a new error appears to be safe, since bit libxenstore and the Linux
    driver at least treat an unknown error code as EINVAL.
    
    This is XSA-72 / CVE-2013-4416.
    
    Original ocaml patch by Jerome Maloberti <jerome.maloberti@citrix.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
    (cherry picked from commit 8b2c441a1b53a43a38b3c517e28f239da3349872)
    (cherry picked from commit d88ac91ef2f0a93ea9359a8133405dbd78abc89b)
---
 tools/ocaml/xenstored/connection.ml |   11 ++++++++++-
 tools/xenstore/xenstored_core.c     |    5 +++++
 xen/include/public/io/xs_wire.h     |    3 ++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 273fe4d..47695f8 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -18,6 +18,8 @@ exception End_of_file
 
 open Stdext
 
+let xenstore_payload_max = 4096 (* xen/include/public/io/xs_wire.h *)
+
 type watch = {
 	con: t;
 	token: string;
@@ -112,8 +114,15 @@ let restrict con domid =
 let set_target con target_domid =
 	con.perm <- Perms.Connection.set_target (get_perm con) ~perms:[Perms.READ; Perms.WRITE] target_domid
 
+let is_backend_mmap con = match con.xb.Xenbus.Xb.backend with
+	| Xenbus.Xb.Xenmmap _ -> true
+	| _ -> false
+
 let send_reply con tid rid ty data =
-	Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid ty data)
+	if (String.length data) > xenstore_payload_max && (is_backend_mmap con) then
+		Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid Xenbus.Xb.Op.Error "E2BIG\000")
+	else
+		Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid ty data)
 
 let send_error con tid rid err = send_reply con tid rid Xenbus.Xb.Op.Error (err ^ "\000")
 let send_ack con tid rid ty = send_reply con tid rid ty "OK\000"
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index bd44645..07338b5 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -599,6 +599,11 @@ void send_reply(struct connection *conn, enum xsd_sockmsg_type type,
 {
 	struct buffered_data *bdata;
 
+	if ( len > XENSTORE_PAYLOAD_MAX ) {
+		send_error(conn, E2BIG);
+		return;
+	}
+
 	/* Message is a child of the connection context for auto-cleanup. */
 	bdata = new_buffer(conn);
 	bdata->buffer = talloc_array(bdata, char, len);
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index 7e454c4..70a048a 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -83,7 +83,8 @@ __attribute__((unused))
     XSD_ERROR(EROFS),
     XSD_ERROR(EBUSY),
     XSD_ERROR(EAGAIN),
-    XSD_ERROR(EISCONN)
+    XSD_ERROR(EISCONN),
+    XSD_ERROR(E2BIG)
 };
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Wed Oct 30 03:22:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Oct 2013 03: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 1VbMMC-0004rw-Py; Wed, 30 Oct 2013 03: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 1VbMMA-0004ro-Lf
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 03:22:06 +0000
Received: from [85.158.137.68:33703] by server-2.bemta-3.messagelabs.com id
	1C/3C-29572-D5B70725; Wed, 30 Oct 2013 03:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1383103323!466448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26755 invoked from network); 30 Oct 2013 03:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2013 03:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbMM7-0006Yw-NK
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 03:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbMM7-00044Z-B0
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 03:22:03 +0000
Date: Wed, 30 Oct 2013 03:22:03 +0000
Message-Id: <E1VbMM7-00044Z-B0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools: xenstored: if the reply is
	too big then send E2BIG error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a2b1b99d74c7729b8346eeef23508be7e3d6fdca
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Oct 29 15:45:53 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 29 16:02:36 2013 +0000

    tools: xenstored: if the reply is too big then send E2BIG error
    
    This fixes the issue for both C and ocaml xenstored, however only the ocaml
    xenstored is vulnerable in its default configuration.
    
    Adding a new error appears to be safe, since bit libxenstore and the Linux
    driver at least treat an unknown error code as EINVAL.
    
    This is XSA-72 / CVE-2013-4416.
    
    Original ocaml patch by Jerome Maloberti <jerome.maloberti@citrix.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
    (cherry picked from commit 8b2c441a1b53a43a38b3c517e28f239da3349872)
    (cherry picked from commit d88ac91ef2f0a93ea9359a8133405dbd78abc89b)
---
 tools/ocaml/xenstored/connection.ml |   11 ++++++++++-
 tools/xenstore/xenstored_core.c     |    5 +++++
 xen/include/public/io/xs_wire.h     |    3 ++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 273fe4d..47695f8 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -18,6 +18,8 @@ exception End_of_file
 
 open Stdext
 
+let xenstore_payload_max = 4096 (* xen/include/public/io/xs_wire.h *)
+
 type watch = {
 	con: t;
 	token: string;
@@ -112,8 +114,15 @@ let restrict con domid =
 let set_target con target_domid =
 	con.perm <- Perms.Connection.set_target (get_perm con) ~perms:[Perms.READ; Perms.WRITE] target_domid
 
+let is_backend_mmap con = match con.xb.Xenbus.Xb.backend with
+	| Xenbus.Xb.Xenmmap _ -> true
+	| _ -> false
+
 let send_reply con tid rid ty data =
-	Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid ty data)
+	if (String.length data) > xenstore_payload_max && (is_backend_mmap con) then
+		Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid Xenbus.Xb.Op.Error "E2BIG\000")
+	else
+		Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid ty data)
 
 let send_error con tid rid err = send_reply con tid rid Xenbus.Xb.Op.Error (err ^ "\000")
 let send_ack con tid rid ty = send_reply con tid rid ty "OK\000"
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index bd44645..07338b5 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -599,6 +599,11 @@ void send_reply(struct connection *conn, enum xsd_sockmsg_type type,
 {
 	struct buffered_data *bdata;
 
+	if ( len > XENSTORE_PAYLOAD_MAX ) {
+		send_error(conn, E2BIG);
+		return;
+	}
+
 	/* Message is a child of the connection context for auto-cleanup. */
 	bdata = new_buffer(conn);
 	bdata->buffer = talloc_array(bdata, char, len);
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index 7e454c4..70a048a 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -83,7 +83,8 @@ __attribute__((unused))
     XSD_ERROR(EROFS),
     XSD_ERROR(EBUSY),
     XSD_ERROR(EAGAIN),
-    XSD_ERROR(EISCONN)
+    XSD_ERROR(EISCONN),
+    XSD_ERROR(E2BIG)
 };
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Wed Oct 30 15:55:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Oct 2013 15:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VbY70-0006VR-JN; Wed, 30 Oct 2013 15:55:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbY6z-0006VE-EF
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 15:55:13 +0000
Received: from [85.158.137.68:12927] by server-2.bemta-3.messagelabs.com id
	AB/9A-29572-0EB21725; Wed, 30 Oct 2013 15:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1383148510!632571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27909 invoked from network); 30 Oct 2013 15:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2013 15:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbY6r-0006mt-9s
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 15:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbY6q-0008Uy-Ko
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 15:55:04 +0000
Date: Wed, 30 Oct 2013 15:55:04 +0000
Message-Id: <E1VbY6q-0008Uy-Ko@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] tools: xenstored: if the reply is
	too big then send E2BIG error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5cd1c730438c3c2cf164dd99a93627d3bcef2b9f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Oct 30 09:52:30 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 30 09:52:30 2013 +0100

    tools: xenstored: if the reply is too big then send E2BIG error
    
    This fixes the issue for both C and ocaml xenstored, however only the ocaml
    xenstored is vulnerable in its default configuration.
    
    Adding a new error appears to be safe, since bit libxenstore and the Linux
    driver at least treat an unknown error code as EINVAL.
    
    This is XSA-72 / CVE-2013-4416.
    
    Original ocaml patch by Jerome Maloberti <jerome.maloberti@citrix.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
    master commit: 8b2c441a1b53a43a38b3c517e28f239da3349872
    master date: 2013-10-29 15:45:53 +0000
---
 tools/ocaml/xenstored/connection.ml |   11 ++++++++++-
 tools/xenstore/xenstored_core.c     |    5 +++++
 xen/include/public/io/xs_wire.h     |    3 ++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index c15595b..6506dea 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -18,6 +18,8 @@ exception End_of_file
 
 open Stdext
 
+let xenstore_payload_max = 4096 (* xen/include/public/io/xs_wire.h *)
+
 type watch = {
 	con: t;
 	token: string;
@@ -112,8 +114,15 @@ let restrict con domid =
 let set_target con target_domid =
 	con.perm <- Perms.Connection.set_target (get_perm con) ~perms:[Perms.READ; Perms.WRITE] target_domid
 
+let is_backend_mmap con = match con.xb.Xenbus.Xb.backend with
+	| Xenbus.Xb.Xenmmap _ -> true
+	| _ -> false
+
 let send_reply con tid rid ty data =
-	Xb.queue con.xb (Xb.Packet.create tid rid ty data)
+	if (String.length data) > xenstore_payload_max && (is_backend_mmap con) then
+		Xb.queue con.xb (Xb.Packet.create tid rid Xb.Op.Error "E2BIG\000")
+	else
+		Xb.queue con.xb (Xb.Packet.create tid rid ty data)
 
 let send_error con tid rid err = send_reply con tid rid Xb.Op.Error (err ^ "\000")
 let send_ack con tid rid ty = send_reply con tid rid ty "OK\000"
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 1749740..0707ef6 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -600,6 +600,11 @@ void send_reply(struct connection *conn, enum xsd_sockmsg_type type,
 {
 	struct buffered_data *bdata;
 
+	if ( len > XENSTORE_PAYLOAD_MAX ) {
+		send_error(conn, E2BIG);
+		return;
+	}
+
 	/* Message is a child of the connection context for auto-cleanup. */
 	bdata = new_buffer(conn);
 	bdata->buffer = talloc_array(bdata, char, len);
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index e1debce..f10ccd0 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -82,7 +82,8 @@ __attribute__((unused))
     XSD_ERROR(EROFS),
     XSD_ERROR(EBUSY),
     XSD_ERROR(EAGAIN),
-    XSD_ERROR(EISCONN)
+    XSD_ERROR(EISCONN),
+    XSD_ERROR(E2BIG)
 };
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Wed Oct 30 15:55:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 30 Oct 2013 15:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VbY70-0006VR-JN; Wed, 30 Oct 2013 15:55:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbY6z-0006VE-EF
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 15:55:13 +0000
Received: from [85.158.137.68:12927] by server-2.bemta-3.messagelabs.com id
	AB/9A-29572-0EB21725; Wed, 30 Oct 2013 15:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1383148510!632571!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27909 invoked from network); 30 Oct 2013 15:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Oct 2013 15:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbY6r-0006mt-9s
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 15:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbY6q-0008Uy-Ko
	for xen-changelog@lists.xensource.com; Wed, 30 Oct 2013 15:55:04 +0000
Date: Wed, 30 Oct 2013 15:55:04 +0000
Message-Id: <E1VbY6q-0008Uy-Ko@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] tools: xenstored: if the reply is
	too big then send E2BIG error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5cd1c730438c3c2cf164dd99a93627d3bcef2b9f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Oct 30 09:52:30 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 30 09:52:30 2013 +0100

    tools: xenstored: if the reply is too big then send E2BIG error
    
    This fixes the issue for both C and ocaml xenstored, however only the ocaml
    xenstored is vulnerable in its default configuration.
    
    Adding a new error appears to be safe, since bit libxenstore and the Linux
    driver at least treat an unknown error code as EINVAL.
    
    This is XSA-72 / CVE-2013-4416.
    
    Original ocaml patch by Jerome Maloberti <jerome.maloberti@citrix.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
    master commit: 8b2c441a1b53a43a38b3c517e28f239da3349872
    master date: 2013-10-29 15:45:53 +0000
---
 tools/ocaml/xenstored/connection.ml |   11 ++++++++++-
 tools/xenstore/xenstored_core.c     |    5 +++++
 xen/include/public/io/xs_wire.h     |    3 ++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index c15595b..6506dea 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -18,6 +18,8 @@ exception End_of_file
 
 open Stdext
 
+let xenstore_payload_max = 4096 (* xen/include/public/io/xs_wire.h *)
+
 type watch = {
 	con: t;
 	token: string;
@@ -112,8 +114,15 @@ let restrict con domid =
 let set_target con target_domid =
 	con.perm <- Perms.Connection.set_target (get_perm con) ~perms:[Perms.READ; Perms.WRITE] target_domid
 
+let is_backend_mmap con = match con.xb.Xenbus.Xb.backend with
+	| Xenbus.Xb.Xenmmap _ -> true
+	| _ -> false
+
 let send_reply con tid rid ty data =
-	Xb.queue con.xb (Xb.Packet.create tid rid ty data)
+	if (String.length data) > xenstore_payload_max && (is_backend_mmap con) then
+		Xb.queue con.xb (Xb.Packet.create tid rid Xb.Op.Error "E2BIG\000")
+	else
+		Xb.queue con.xb (Xb.Packet.create tid rid ty data)
 
 let send_error con tid rid err = send_reply con tid rid Xb.Op.Error (err ^ "\000")
 let send_ack con tid rid ty = send_reply con tid rid ty "OK\000"
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 1749740..0707ef6 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -600,6 +600,11 @@ void send_reply(struct connection *conn, enum xsd_sockmsg_type type,
 {
 	struct buffered_data *bdata;
 
+	if ( len > XENSTORE_PAYLOAD_MAX ) {
+		send_error(conn, E2BIG);
+		return;
+	}
+
 	/* Message is a child of the connection context for auto-cleanup. */
 	bdata = new_buffer(conn);
 	bdata->buffer = talloc_array(bdata, char, len);
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index e1debce..f10ccd0 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -82,7 +82,8 @@ __attribute__((unused))
     XSD_ERROR(EROFS),
     XSD_ERROR(EBUSY),
     XSD_ERROR(EAGAIN),
-    XSD_ERROR(EISCONN)
+    XSD_ERROR(EISCONN),
+    XSD_ERROR(E2BIG)
 };
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 05:11:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VbkXD-0007Le-CC; Thu, 31 Oct 2013 05: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 1VbkXC-0007LY-3N
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:06 +0000
Received: from [85.158.143.35:39632] by server-1.bemta-4.messagelabs.com id
	BA/52-17304-966E1725; Thu, 31 Oct 2013 05:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1383196263!1565962!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11804 invoked from network); 31 Oct 2013 05:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkX9-0006Io-Lw
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkX9-00054F-EH
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:03 +0000
Date: Thu, 31 Oct 2013 05:11:03 +0000
Message-Id: <E1VbkX9-00054F-EH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libelf: improve errors in
	elf_xen_note_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 e6564c634863680f6541e07ce2f77f17d45ce52e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 28 11:30:35 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 28 14:49:31 2013 +0000

    libelf: improve errors in elf_xen_note_check()
    
    I recently debugged an isolated failure to boot, with no information other
    than the logs.
    
    The "Will only load images built for the generic loader or Linux images"
    string was missing a newline, leading to the subsequent error being appended
    to this line, rather than having its own line with correctly identified
    function.
    
    Furthermore, error messages which state "param containing $FOO is not $BAR" is
    fairly useless for debugging without identifying which bad $FOO caused the
    failure.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen/common/libelf/libelf-dominfo.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index 25dd892..6120dd4 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -374,7 +374,9 @@ static elf_errorstatus elf_xen_note_check(struct elf_binary *elf,
           strncmp(parms->guest_os, "linux", 5)) )
     {
         elf_err(elf, "%s: ERROR: Will only load images built for the generic "
-                "loader or Linux images", __FUNCTION__);
+                "loader or Linux images (Not '%.*s' and '%.*s')\n",
+                __FUNCTION__, (int)sizeof(parms->loader), parms->loader,
+                (int)sizeof(parms->guest_os), parms->guest_os);
         return -1;
     }
 
@@ -382,7 +384,8 @@ static elf_errorstatus elf_xen_note_check(struct elf_binary *elf,
          strncmp(parms->xen_ver, "xen-3.0", 7) )
     {
         elf_err(elf, "%s: ERROR: Xen will only load images built "
-                "for Xen v3.0\n", __FUNCTION__);
+                "for Xen v3.0 (Not '%.*s')\n", __FUNCTION__,
+                (int)sizeof(parms->xen_ver), parms->xen_ver);
         return -1;
     }
     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 Oct 31 05:11:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VbkXD-0007Le-CC; Thu, 31 Oct 2013 05: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 1VbkXC-0007LY-3N
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:06 +0000
Received: from [85.158.143.35:39632] by server-1.bemta-4.messagelabs.com id
	BA/52-17304-966E1725; Thu, 31 Oct 2013 05:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1383196263!1565962!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11804 invoked from network); 31 Oct 2013 05:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkX9-0006Io-Lw
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkX9-00054F-EH
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:03 +0000
Date: Thu, 31 Oct 2013 05:11:03 +0000
Message-Id: <E1VbkX9-00054F-EH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libelf: improve errors in
	elf_xen_note_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 e6564c634863680f6541e07ce2f77f17d45ce52e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 28 11:30:35 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 28 14:49:31 2013 +0000

    libelf: improve errors in elf_xen_note_check()
    
    I recently debugged an isolated failure to boot, with no information other
    than the logs.
    
    The "Will only load images built for the generic loader or Linux images"
    string was missing a newline, leading to the subsequent error being appended
    to this line, rather than having its own line with correctly identified
    function.
    
    Furthermore, error messages which state "param containing $FOO is not $BAR" is
    fairly useless for debugging without identifying which bad $FOO caused the
    failure.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen/common/libelf/libelf-dominfo.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index 25dd892..6120dd4 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -374,7 +374,9 @@ static elf_errorstatus elf_xen_note_check(struct elf_binary *elf,
           strncmp(parms->guest_os, "linux", 5)) )
     {
         elf_err(elf, "%s: ERROR: Will only load images built for the generic "
-                "loader or Linux images", __FUNCTION__);
+                "loader or Linux images (Not '%.*s' and '%.*s')\n",
+                __FUNCTION__, (int)sizeof(parms->loader), parms->loader,
+                (int)sizeof(parms->guest_os), parms->guest_os);
         return -1;
     }
 
@@ -382,7 +384,8 @@ static elf_errorstatus elf_xen_note_check(struct elf_binary *elf,
          strncmp(parms->xen_ver, "xen-3.0", 7) )
     {
         elf_err(elf, "%s: ERROR: Xen will only load images built "
-                "for Xen v3.0\n", __FUNCTION__);
+                "for Xen v3.0 (Not '%.*s')\n", __FUNCTION__,
+                (int)sizeof(parms->xen_ver), parms->xen_ver);
         return -1;
     }
     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 Oct 31 05:11:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:11: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 1VbkXO-0007MP-F2; Thu, 31 Oct 2013 05:11: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 1VbkXM-0007MF-LR
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:16 +0000
Received: from [193.109.254.147:24038] by server-5.bemta-14.messagelabs.com id
	34/C5-13525-376E1725; Thu, 31 Oct 2013 05:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1383196274!1749369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29038 invoked from network); 31 Oct 2013 05:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXK-0006Ir-5W
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXJ-00055M-R0
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:13 +0000
Date: Thu, 31 Oct 2013 05:11:13 +0000
Message-Id: <E1VbkXJ-00055M-R0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: remove spurious newline from
	LOG() message
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc19afbad9319b00474951d4218a37c072a6570b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 25 08:47:24 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 28 15:26:43 2013 +0000

    libxl: remove spurious newline from LOG() message
    
    The macro already includes this.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_dom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 356f920..1873459 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -345,7 +345,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
         return ERROR_FAIL;
     }
 
-    LOG(DEBUG, "pv kernel mapped %d path %s\n", state->pv_kernel.mapped, state->pv_kernel.path);
+    LOG(DEBUG, "pv kernel mapped %d path %s", state->pv_kernel.mapped, state->pv_kernel.path);
     if (state->pv_kernel.mapped) {
         ret = xc_dom_kernel_mem(dom,
                                 state->pv_kernel.data,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 05:11:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:11: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 1VbkXO-0007MP-F2; Thu, 31 Oct 2013 05:11: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 1VbkXM-0007MF-LR
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:16 +0000
Received: from [193.109.254.147:24038] by server-5.bemta-14.messagelabs.com id
	34/C5-13525-376E1725; Thu, 31 Oct 2013 05:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1383196274!1749369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29038 invoked from network); 31 Oct 2013 05:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXK-0006Ir-5W
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXJ-00055M-R0
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:13 +0000
Date: Thu, 31 Oct 2013 05:11:13 +0000
Message-Id: <E1VbkXJ-00055M-R0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: remove spurious newline from
	LOG() message
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc19afbad9319b00474951d4218a37c072a6570b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 25 08:47:24 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 28 15:26:43 2013 +0000

    libxl: remove spurious newline from LOG() message
    
    The macro already includes this.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_dom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 356f920..1873459 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -345,7 +345,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
         return ERROR_FAIL;
     }
 
-    LOG(DEBUG, "pv kernel mapped %d path %s\n", state->pv_kernel.mapped, state->pv_kernel.path);
+    LOG(DEBUG, "pv kernel mapped %d path %s", state->pv_kernel.mapped, state->pv_kernel.path);
     if (state->pv_kernel.mapped) {
         ret = xc_dom_kernel_mem(dom,
                                 state->pv_kernel.data,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 05:11:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:11: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 1VbkXY-0007N8-IG; Thu, 31 Oct 2013 05:11: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 1VbkXX-0007Mk-07
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:27 +0000
Received: from [193.109.254.147:44664] by server-2.bemta-14.messagelabs.com id
	AD/E8-08076-E76E1725; Thu, 31 Oct 2013 05:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1383196284!1764129!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29329 invoked from network); 31 Oct 2013 05:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXU-0006Ix-CS
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXU-00055i-9O
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:24 +0000
Date: Thu, 31 Oct 2013 05:11:24 +0000
Message-Id: <E1VbkXU-00055i-9O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxenstore: Use PTHREAD_STACK_MIN
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 35e874b1d5d56dd2098313364b879c637fa56844
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 25 08:47:35 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 28 15:33:04 2013 +0000

    libxenstore: Use PTHREAD_STACK_MIN
    
    The existing value of 16K is smaller than the arm64 minimum stack size, which
    is 128K. PTHREAD_STACK_MIN appears to be standard
    http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_setstacksize.html
    
    Consindered setting a lower bound but the stack requirements of the watcher
    thread are pretty minimal (tens of bytes from the looks of it) and unlikely to
    blow PTHREAD_STACK_MIN on any useful platform.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstore/xs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index b1e6820..261b841 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -723,7 +723,7 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)
 	struct iovec iov[2];
 
 #ifdef USE_PTHREAD
-#define READ_THREAD_STACKSIZE (16 * 1024)
+#define READ_THREAD_STACKSIZE PTHREAD_STACK_MIN
 
 	/* We dynamically create a reader thread on demand. */
 	mutex_lock(&h->request_mutex);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 05:11:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:11: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 1VbkXY-0007N8-IG; Thu, 31 Oct 2013 05:11: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 1VbkXX-0007Mk-07
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:27 +0000
Received: from [193.109.254.147:44664] by server-2.bemta-14.messagelabs.com id
	AD/E8-08076-E76E1725; Thu, 31 Oct 2013 05:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1383196284!1764129!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29329 invoked from network); 31 Oct 2013 05:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXU-0006Ix-CS
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXU-00055i-9O
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:24 +0000
Date: Thu, 31 Oct 2013 05:11:24 +0000
Message-Id: <E1VbkXU-00055i-9O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxenstore: Use PTHREAD_STACK_MIN
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 35e874b1d5d56dd2098313364b879c637fa56844
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 25 08:47:35 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 28 15:33:04 2013 +0000

    libxenstore: Use PTHREAD_STACK_MIN
    
    The existing value of 16K is smaller than the arm64 minimum stack size, which
    is 128K. PTHREAD_STACK_MIN appears to be standard
    http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_setstacksize.html
    
    Consindered setting a lower bound but the stack requirements of the watcher
    thread are pretty minimal (tens of bytes from the looks of it) and unlikely to
    blow PTHREAD_STACK_MIN on any useful platform.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstore/xs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index b1e6820..261b841 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -723,7 +723,7 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)
 	struct iovec iov[2];
 
 #ifdef USE_PTHREAD
-#define READ_THREAD_STACKSIZE (16 * 1024)
+#define READ_THREAD_STACKSIZE PTHREAD_STACK_MIN
 
 	/* We dynamically create a reader thread on demand. */
 	mutex_lock(&h->request_mutex);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 05:11:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:11:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VbkXi-0007O5-LC; Thu, 31 Oct 2013 05:11: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 1VbkXh-0007Nw-9T
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:37 +0000
Received: from [85.158.139.211:3481] by server-2.bemta-5.messagelabs.com id
	DE/88-14533-886E1725; Thu, 31 Oct 2013 05:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1383196294!713314!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27857 invoked from network); 31 Oct 2013 05:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:11:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXe-0006J5-K6
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXe-000569-GA
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:34 +0000
Date: Thu, 31 Oct 2013 05:11:34 +0000
Message-Id: <E1VbkXe-000569-GA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: don't emit misleading daemon pid
	message
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2cd1f418feb215c379b6737576b53bba6f70c1a6
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Sun Oct 27 19:49:14 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 28 15:54:45 2013 +0000

    xl: don't emit misleading daemon pid message
    
    After creating a domain, xl forks off a process to handle domain events
    (shutdown, disk eject, ...). It prints out the pid of the process
    created by the fork to stdout. However, the newly forked process soon
    after calls daemon(), which itself forks once more (and exit()s the
    original process). This means that the pid printed out is not the pid of
    the actual process which remains in the background after all is said and
    done, instead it is the pid of the transient process that exists between
    xl's fork() and the fork'd process's daemon() call.
    
    We could resolve this by printing the correct pid, ie. by open-coding
    daemon() (we already do most of the heavy lifting it does ourselves by
    fiddling with the standard fds). However, since no-one seems to be
    complaining about the misleading message to begin with, and since it
    seems like a pointless message anyway, just remove it outright instead.
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index a8261be..fddaa80 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2140,8 +2140,6 @@ start:
 
         child1 = xl_fork(child_waitdaemon);
         if (child1) {
-            printf("Daemon running with PID %d\n", child1);
-
             for (;;) {
                 got_child = xl_waitpid(child_waitdaemon, &status, 0);
                 if (got_child == child1) 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 Oct 31 05:11:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:11:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VbkXi-0007O5-LC; Thu, 31 Oct 2013 05:11: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 1VbkXh-0007Nw-9T
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:37 +0000
Received: from [85.158.139.211:3481] by server-2.bemta-5.messagelabs.com id
	DE/88-14533-886E1725; Thu, 31 Oct 2013 05:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1383196294!713314!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27857 invoked from network); 31 Oct 2013 05:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:11:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXe-0006J5-K6
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXe-000569-GA
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:34 +0000
Date: Thu, 31 Oct 2013 05:11:34 +0000
Message-Id: <E1VbkXe-000569-GA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: don't emit misleading daemon pid
	message
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2cd1f418feb215c379b6737576b53bba6f70c1a6
Author:     Matthew Daley <mattjd@gmail.com>
AuthorDate: Sun Oct 27 19:49:14 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Oct 28 15:54:45 2013 +0000

    xl: don't emit misleading daemon pid message
    
    After creating a domain, xl forks off a process to handle domain events
    (shutdown, disk eject, ...). It prints out the pid of the process
    created by the fork to stdout. However, the newly forked process soon
    after calls daemon(), which itself forks once more (and exit()s the
    original process). This means that the pid printed out is not the pid of
    the actual process which remains in the background after all is said and
    done, instead it is the pid of the transient process that exists between
    xl's fork() and the fork'd process's daemon() call.
    
    We could resolve this by printing the correct pid, ie. by open-coding
    daemon() (we already do most of the heavy lifting it does ourselves by
    fiddling with the standard fds). However, since no-one seems to be
    complaining about the misleading message to begin with, and since it
    seems like a pointless message anyway, just remove it outright instead.
    
    Signed-off-by: Matthew Daley <mattjd@gmail.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index a8261be..fddaa80 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2140,8 +2140,6 @@ start:
 
         child1 = xl_fork(child_waitdaemon);
         if (child1) {
-            printf("Daemon running with PID %d\n", child1);
-
             for (;;) {
                 got_child = xl_waitpid(child_waitdaemon, &status, 0);
                 if (got_child == child1) 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 Oct 31 05:11:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:11: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 1VbkXs-0007PS-OJ; Thu, 31 Oct 2013 05:11: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 1VbkXr-0007PB-A4
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:47 +0000
Received: from [193.109.254.147:25031] by server-7.bemta-14.messagelabs.com id
	E4/00-14870-296E1725; Thu, 31 Oct 2013 05:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1383196304!386442!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29024 invoked from network); 31 Oct 2013 05:11:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:11:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXo-0006JC-Q6
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXo-00056V-OO
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:44 +0000
Date: Thu, 31 Oct 2013 05:11:44 +0000
Message-Id: <E1VbkXo-00056V-OO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: Eliminate cr3 store/load vmexit
	when UG 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 c9efe34c119418a5ac776e5d91aeefcce4576518
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Tue Oct 29 09:55:23 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 29 09:55:23 2013 +0100

    VMX: Eliminate cr3 store/load vmexit when UG enabled
    
    With the feature of unrestricted guest, Xen should not cause
    vmexits for cr3 accesses in non-paging mode.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 9ca8632..502caa3 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1086,7 +1086,7 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             uint32_t cr3_ctls = (CPU_BASED_CR3_LOAD_EXITING |
                                  CPU_BASED_CR3_STORE_EXITING);
             v->arch.hvm_vmx.exec_control &= ~cr3_ctls;
-            if ( !hvm_paging_enabled(v) )
+            if ( !hvm_paging_enabled(v) && !vmx_unrestricted_guest(v) )
                 v->arch.hvm_vmx.exec_control |= cr3_ctls;
 
             /* Trap CR3 updates if CR3 memory events are enabled. */
@@ -1156,7 +1156,7 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
     case 3:
         if ( paging_mode_hap(v->domain) )
         {
-            if ( !hvm_paging_enabled(v) )
+            if ( !hvm_paging_enabled(v) && !vmx_unrestricted_guest(v) )
                 v->arch.hvm_vcpu.hw_cr[3] =
                     v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT];
             vmx_load_pdptrs(v);
@@ -2408,7 +2408,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
     hvm_invalidate_regs_fields(regs);
 
-    if ( paging_mode_hap(v->domain) && hvm_paging_enabled(v) )
+    if ( paging_mode_hap(v->domain) )
     {
         __vmread(GUEST_CR3, &v->arch.hvm_vcpu.hw_cr[3]);
         v->arch.hvm_vcpu.guest_cr[3] = v->arch.hvm_vcpu.hw_cr[3];
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 05:11:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:11: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 1VbkXs-0007PS-OJ; Thu, 31 Oct 2013 05:11: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 1VbkXr-0007PB-A4
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:47 +0000
Received: from [193.109.254.147:25031] by server-7.bemta-14.messagelabs.com id
	E4/00-14870-296E1725; Thu, 31 Oct 2013 05:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1383196304!386442!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29024 invoked from network); 31 Oct 2013 05:11:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:11:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXo-0006JC-Q6
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXo-00056V-OO
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:44 +0000
Date: Thu, 31 Oct 2013 05:11:44 +0000
Message-Id: <E1VbkXo-00056V-OO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: Eliminate cr3 store/load vmexit
	when UG 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 c9efe34c119418a5ac776e5d91aeefcce4576518
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Tue Oct 29 09:55:23 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 29 09:55:23 2013 +0100

    VMX: Eliminate cr3 store/load vmexit when UG enabled
    
    With the feature of unrestricted guest, Xen should not cause
    vmexits for cr3 accesses in non-paging mode.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 9ca8632..502caa3 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1086,7 +1086,7 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             uint32_t cr3_ctls = (CPU_BASED_CR3_LOAD_EXITING |
                                  CPU_BASED_CR3_STORE_EXITING);
             v->arch.hvm_vmx.exec_control &= ~cr3_ctls;
-            if ( !hvm_paging_enabled(v) )
+            if ( !hvm_paging_enabled(v) && !vmx_unrestricted_guest(v) )
                 v->arch.hvm_vmx.exec_control |= cr3_ctls;
 
             /* Trap CR3 updates if CR3 memory events are enabled. */
@@ -1156,7 +1156,7 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
     case 3:
         if ( paging_mode_hap(v->domain) )
         {
-            if ( !hvm_paging_enabled(v) )
+            if ( !hvm_paging_enabled(v) && !vmx_unrestricted_guest(v) )
                 v->arch.hvm_vcpu.hw_cr[3] =
                     v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT];
             vmx_load_pdptrs(v);
@@ -2408,7 +2408,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
     hvm_invalidate_regs_fields(regs);
 
-    if ( paging_mode_hap(v->domain) && hvm_paging_enabled(v) )
+    if ( paging_mode_hap(v->domain) )
     {
         __vmread(GUEST_CR3, &v->arch.hvm_vcpu.hw_cr[3]);
         v->arch.hvm_vcpu.guest_cr[3] = v->arch.hvm_vcpu.hw_cr[3];
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 05:12:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:12: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 1VbkY2-0007R3-RG; Thu, 31 Oct 2013 05:11:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkY1-0007Qo-Ph
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:57 +0000
Received: from [193.109.254.147:50889] by server-14.bemta-14.messagelabs.com
	id 16/A0-25733-D96E1725; Thu, 31 Oct 2013 05:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1383196315!1766793!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6325 invoked from network); 31 Oct 2013 05:11:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:11:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXz-0006JK-3d
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXy-00056v-U0
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:55 +0000
Date: Thu, 31 Oct 2013 05:11:54 +0000
Message-Id: <E1VbkXy-00056v-U0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix locking in cpu_disable_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 41a0cc9e26160a89245c9ba3233e3f70bf9cd4b4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 29 09:57:14 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 29 09:57:14 2013 +0100

    fix locking in cpu_disable_scheduler()
    
    So commit eedd6039 ("scheduler: adjust internal locking interface")
    uncovered - by now using proper spin lock constructs - a bug after all:
    When bringing down a CPU, cpu_disable_scheduler() gets called with
    interrupts disabled, and hence the use of vcpu_schedule_lock_irq() was
    never really correct (i.e. the caller ended up with interrupts enabled
    despite having disabled them explicitly).
    
    Fixing this however surfaced another problem: The call path
    vcpu_migrate() -> evtchn_move_pirqs() wants to acquire the event lock,
    which however is a non-IRQ-safe once, and hence check_lock() doesn't
    like this lock to be acquired when interrupts are already off. As we're
    in stop-machine context here, getting things wrong wrt interrupt state
    management during lock acquire/release is out of question though, so
    the simple solution to this appears to be to just suppress spin lock
    debugging for the period of time while the stop machine callback gets
    run.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/schedule.c     |    9 ++++-----
 xen/common/stop_machine.c |    2 ++
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index bfa6bee..0f45f07 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -601,7 +601,8 @@ int cpu_disable_scheduler(unsigned int cpu)
     {
         for_each_vcpu ( d, v )
         {
-            spinlock_t *lock = vcpu_schedule_lock_irq(v);
+            unsigned long flags;
+            spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags);
 
             cpumask_and(&online_affinity, v->cpu_affinity, c->cpu_valid);
             if ( cpumask_empty(&online_affinity) &&
@@ -622,14 +623,12 @@ int cpu_disable_scheduler(unsigned int cpu)
             if ( v->processor == cpu )
             {
                 set_bit(_VPF_migrating, &v->pause_flags);
-                vcpu_schedule_unlock_irq(lock, v);
+                vcpu_schedule_unlock_irqrestore(lock, flags, v);
                 vcpu_sleep_nosync(v);
                 vcpu_migrate(v);
             }
             else
-            {
-                vcpu_schedule_unlock_irq(lock, v);
-            }
+                vcpu_schedule_unlock_irqrestore(lock, flags, v);
 
             /*
              * A vcpu active in the hypervisor will not be migratable.
diff --git a/xen/common/stop_machine.c b/xen/common/stop_machine.c
index 0590504..932e5a7 100644
--- a/xen/common/stop_machine.c
+++ b/xen/common/stop_machine.c
@@ -110,6 +110,7 @@ int stop_machine_run(int (*fn)(void *), void *data, unsigned int cpu)
     local_irq_disable();
     stopmachine_set_state(STOPMACHINE_DISABLE_IRQ);
     stopmachine_wait_state();
+    spin_debug_disable();
 
     stopmachine_set_state(STOPMACHINE_INVOKE);
     if ( (cpu == smp_processor_id()) || (cpu == NR_CPUS) )
@@ -117,6 +118,7 @@ int stop_machine_run(int (*fn)(void *), void *data, unsigned int cpu)
     stopmachine_wait_state();
     ret = stopmachine_data.fn_result;
 
+    spin_debug_enable();
     stopmachine_set_state(STOPMACHINE_EXIT);
     stopmachine_wait_state();
     local_irq_enable();
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 05:12:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:12: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 1VbkY2-0007R3-RG; Thu, 31 Oct 2013 05:11:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkY1-0007Qo-Ph
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:57 +0000
Received: from [193.109.254.147:50889] by server-14.bemta-14.messagelabs.com
	id 16/A0-25733-D96E1725; Thu, 31 Oct 2013 05:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1383196315!1766793!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6325 invoked from network); 31 Oct 2013 05:11:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:11:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXz-0006JK-3d
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkXy-00056v-U0
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:11:55 +0000
Date: Thu, 31 Oct 2013 05:11:54 +0000
Message-Id: <E1VbkXy-00056v-U0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix locking in cpu_disable_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 41a0cc9e26160a89245c9ba3233e3f70bf9cd4b4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 29 09:57:14 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 29 09:57:14 2013 +0100

    fix locking in cpu_disable_scheduler()
    
    So commit eedd6039 ("scheduler: adjust internal locking interface")
    uncovered - by now using proper spin lock constructs - a bug after all:
    When bringing down a CPU, cpu_disable_scheduler() gets called with
    interrupts disabled, and hence the use of vcpu_schedule_lock_irq() was
    never really correct (i.e. the caller ended up with interrupts enabled
    despite having disabled them explicitly).
    
    Fixing this however surfaced another problem: The call path
    vcpu_migrate() -> evtchn_move_pirqs() wants to acquire the event lock,
    which however is a non-IRQ-safe once, and hence check_lock() doesn't
    like this lock to be acquired when interrupts are already off. As we're
    in stop-machine context here, getting things wrong wrt interrupt state
    management during lock acquire/release is out of question though, so
    the simple solution to this appears to be to just suppress spin lock
    debugging for the period of time while the stop machine callback gets
    run.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/schedule.c     |    9 ++++-----
 xen/common/stop_machine.c |    2 ++
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index bfa6bee..0f45f07 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -601,7 +601,8 @@ int cpu_disable_scheduler(unsigned int cpu)
     {
         for_each_vcpu ( d, v )
         {
-            spinlock_t *lock = vcpu_schedule_lock_irq(v);
+            unsigned long flags;
+            spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags);
 
             cpumask_and(&online_affinity, v->cpu_affinity, c->cpu_valid);
             if ( cpumask_empty(&online_affinity) &&
@@ -622,14 +623,12 @@ int cpu_disable_scheduler(unsigned int cpu)
             if ( v->processor == cpu )
             {
                 set_bit(_VPF_migrating, &v->pause_flags);
-                vcpu_schedule_unlock_irq(lock, v);
+                vcpu_schedule_unlock_irqrestore(lock, flags, v);
                 vcpu_sleep_nosync(v);
                 vcpu_migrate(v);
             }
             else
-            {
-                vcpu_schedule_unlock_irq(lock, v);
-            }
+                vcpu_schedule_unlock_irqrestore(lock, flags, v);
 
             /*
              * A vcpu active in the hypervisor will not be migratable.
diff --git a/xen/common/stop_machine.c b/xen/common/stop_machine.c
index 0590504..932e5a7 100644
--- a/xen/common/stop_machine.c
+++ b/xen/common/stop_machine.c
@@ -110,6 +110,7 @@ int stop_machine_run(int (*fn)(void *), void *data, unsigned int cpu)
     local_irq_disable();
     stopmachine_set_state(STOPMACHINE_DISABLE_IRQ);
     stopmachine_wait_state();
+    spin_debug_disable();
 
     stopmachine_set_state(STOPMACHINE_INVOKE);
     if ( (cpu == smp_processor_id()) || (cpu == NR_CPUS) )
@@ -117,6 +118,7 @@ int stop_machine_run(int (*fn)(void *), void *data, unsigned int cpu)
     stopmachine_wait_state();
     ret = stopmachine_data.fn_result;
 
+    spin_debug_enable();
     stopmachine_set_state(STOPMACHINE_EXIT);
     stopmachine_wait_state();
     local_irq_enable();
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 05:12:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:12: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 1VbkYD-0007T4-0u; Thu, 31 Oct 2013 05:12: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 1VbkYB-0007Sa-NO
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:12:07 +0000
Received: from [193.109.254.147:51217] by server-6.bemta-14.messagelabs.com id
	F5/7E-19621-6A6E1725; Thu, 31 Oct 2013 05:12:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1383196325!384693!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7642 invoked from network); 31 Oct 2013 05:12:06 -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;
	31 Oct 2013 05:12:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkY9-0006Jz-96
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkY9-00057X-6p
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:12:05 +0000
Date: Thu, 31 Oct 2013 05:12:05 +0000
Message-Id: <E1VbkY9-00057X-6p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: xenstored: if the reply is too
	big then send E2BIG error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b2c441a1b53a43a38b3c517e28f239da3349872
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Oct 29 15:45:53 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 29 15:45:53 2013 +0000

    tools: xenstored: if the reply is too big then send E2BIG error
    
    This fixes the issue for both C and ocaml xenstored, however only the ocaml
    xenstored is vulnerable in its default configuration.
    
    Adding a new error appears to be safe, since bit libxenstore and the Linux
    driver at least treat an unknown error code as EINVAL.
    
    This is XSA-72 / CVE-2013-4416.
    
    Original ocaml patch by Jerome Maloberti <jerome.maloberti@citrix.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
---
 tools/ocaml/xenstored/connection.ml |   11 ++++++++++-
 tools/xenstore/xenstored_core.c     |    5 +++++
 xen/include/public/io/xs_wire.h     |    3 ++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 273fe4d..47695f8 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -18,6 +18,8 @@ exception End_of_file
 
 open Stdext
 
+let xenstore_payload_max = 4096 (* xen/include/public/io/xs_wire.h *)
+
 type watch = {
 	con: t;
 	token: string;
@@ -112,8 +114,15 @@ let restrict con domid =
 let set_target con target_domid =
 	con.perm <- Perms.Connection.set_target (get_perm con) ~perms:[Perms.READ; Perms.WRITE] target_domid
 
+let is_backend_mmap con = match con.xb.Xenbus.Xb.backend with
+	| Xenbus.Xb.Xenmmap _ -> true
+	| _ -> false
+
 let send_reply con tid rid ty data =
-	Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid ty data)
+	if (String.length data) > xenstore_payload_max && (is_backend_mmap con) then
+		Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid Xenbus.Xb.Op.Error "E2BIG\000")
+	else
+		Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid ty data)
 
 let send_error con tid rid err = send_reply con tid rid Xenbus.Xb.Op.Error (err ^ "\000")
 let send_ack con tid rid ty = send_reply con tid rid ty "OK\000"
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 0f8ba64..ccfdaa3 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -629,6 +629,11 @@ void send_reply(struct connection *conn, enum xsd_sockmsg_type type,
 {
 	struct buffered_data *bdata;
 
+	if ( len > XENSTORE_PAYLOAD_MAX ) {
+		send_error(conn, E2BIG);
+		return;
+	}
+
 	/* Message is a child of the connection context for auto-cleanup. */
 	bdata = new_buffer(conn);
 	bdata->buffer = talloc_array(bdata, char, len);
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index 99d24e3..585f0c8 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -83,7 +83,8 @@ __attribute__((unused))
     XSD_ERROR(EROFS),
     XSD_ERROR(EBUSY),
     XSD_ERROR(EAGAIN),
-    XSD_ERROR(EISCONN)
+    XSD_ERROR(EISCONN),
+    XSD_ERROR(E2BIG)
 };
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 05:12:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:12: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 1VbkYD-0007T4-0u; Thu, 31 Oct 2013 05:12: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 1VbkYB-0007Sa-NO
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:12:07 +0000
Received: from [193.109.254.147:51217] by server-6.bemta-14.messagelabs.com id
	F5/7E-19621-6A6E1725; Thu, 31 Oct 2013 05:12:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1383196325!384693!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7642 invoked from network); 31 Oct 2013 05:12:06 -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;
	31 Oct 2013 05:12:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkY9-0006Jz-96
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkY9-00057X-6p
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:12:05 +0000
Date: Thu, 31 Oct 2013 05:12:05 +0000
Message-Id: <E1VbkY9-00057X-6p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: xenstored: if the reply is too
	big then send E2BIG error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b2c441a1b53a43a38b3c517e28f239da3349872
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Oct 29 15:45:53 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Oct 29 15:45:53 2013 +0000

    tools: xenstored: if the reply is too big then send E2BIG error
    
    This fixes the issue for both C and ocaml xenstored, however only the ocaml
    xenstored is vulnerable in its default configuration.
    
    Adding a new error appears to be safe, since bit libxenstore and the Linux
    driver at least treat an unknown error code as EINVAL.
    
    This is XSA-72 / CVE-2013-4416.
    
    Original ocaml patch by Jerome Maloberti <jerome.maloberti@citrix.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
---
 tools/ocaml/xenstored/connection.ml |   11 ++++++++++-
 tools/xenstore/xenstored_core.c     |    5 +++++
 xen/include/public/io/xs_wire.h     |    3 ++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
index 273fe4d..47695f8 100644
--- a/tools/ocaml/xenstored/connection.ml
+++ b/tools/ocaml/xenstored/connection.ml
@@ -18,6 +18,8 @@ exception End_of_file
 
 open Stdext
 
+let xenstore_payload_max = 4096 (* xen/include/public/io/xs_wire.h *)
+
 type watch = {
 	con: t;
 	token: string;
@@ -112,8 +114,15 @@ let restrict con domid =
 let set_target con target_domid =
 	con.perm <- Perms.Connection.set_target (get_perm con) ~perms:[Perms.READ; Perms.WRITE] target_domid
 
+let is_backend_mmap con = match con.xb.Xenbus.Xb.backend with
+	| Xenbus.Xb.Xenmmap _ -> true
+	| _ -> false
+
 let send_reply con tid rid ty data =
-	Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid ty data)
+	if (String.length data) > xenstore_payload_max && (is_backend_mmap con) then
+		Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid Xenbus.Xb.Op.Error "E2BIG\000")
+	else
+		Xenbus.Xb.queue con.xb (Xenbus.Xb.Packet.create tid rid ty data)
 
 let send_error con tid rid err = send_reply con tid rid Xenbus.Xb.Op.Error (err ^ "\000")
 let send_ack con tid rid ty = send_reply con tid rid ty "OK\000"
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 0f8ba64..ccfdaa3 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -629,6 +629,11 @@ void send_reply(struct connection *conn, enum xsd_sockmsg_type type,
 {
 	struct buffered_data *bdata;
 
+	if ( len > XENSTORE_PAYLOAD_MAX ) {
+		send_error(conn, E2BIG);
+		return;
+	}
+
 	/* Message is a child of the connection context for auto-cleanup. */
 	bdata = new_buffer(conn);
 	bdata->buffer = talloc_array(bdata, char, len);
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index 99d24e3..585f0c8 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -83,7 +83,8 @@ __attribute__((unused))
     XSD_ERROR(EROFS),
     XSD_ERROR(EBUSY),
     XSD_ERROR(EAGAIN),
-    XSD_ERROR(EISCONN)
+    XSD_ERROR(EISCONN),
+    XSD_ERROR(E2BIG)
 };
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 05:12:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:12: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 1VbkYP-0007VV-4O; Thu, 31 Oct 2013 05:12:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkYN-0007VF-Gt
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:12:19 +0000
Received: from [85.158.139.211:56866] by server-15.bemta-5.messagelabs.com id
	C2/06-17574-2B6E1725; Thu, 31 Oct 2013 05:12:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1383196335!713775!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12264 invoked from network); 31 Oct 2013 05:12:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:12:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkYJ-0006K5-GB
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:12:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkYJ-00058R-Dc
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:12:15 +0000
Date: Thu, 31 Oct 2013 05:12:15 +0000
Message-Id: <E1VbkYJ-00058R-Dc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "VMX: Eliminate cr3 store/load
	vmexit when UG 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 1e2bf05ec37cf04b0e01585eae524509179f165e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 30 16:20:29 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 30 16:20:29 2013 +0100

    Revert "VMX: Eliminate cr3 store/load vmexit when UG enabled"
    
    This reverts commit c9efe34c119418a5ac776e5d91aeefcce4576518. It
    doesn't work right on non-UG hardware.
---
 xen/arch/x86/hvm/vmx/vmx.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 502caa3..9ca8632 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1086,7 +1086,7 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             uint32_t cr3_ctls = (CPU_BASED_CR3_LOAD_EXITING |
                                  CPU_BASED_CR3_STORE_EXITING);
             v->arch.hvm_vmx.exec_control &= ~cr3_ctls;
-            if ( !hvm_paging_enabled(v) && !vmx_unrestricted_guest(v) )
+            if ( !hvm_paging_enabled(v) )
                 v->arch.hvm_vmx.exec_control |= cr3_ctls;
 
             /* Trap CR3 updates if CR3 memory events are enabled. */
@@ -1156,7 +1156,7 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
     case 3:
         if ( paging_mode_hap(v->domain) )
         {
-            if ( !hvm_paging_enabled(v) && !vmx_unrestricted_guest(v) )
+            if ( !hvm_paging_enabled(v) )
                 v->arch.hvm_vcpu.hw_cr[3] =
                     v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT];
             vmx_load_pdptrs(v);
@@ -2408,7 +2408,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
     hvm_invalidate_regs_fields(regs);
 
-    if ( paging_mode_hap(v->domain) )
+    if ( paging_mode_hap(v->domain) && hvm_paging_enabled(v) )
     {
         __vmread(GUEST_CR3, &v->arch.hvm_vcpu.hw_cr[3]);
         v->arch.hvm_vcpu.guest_cr[3] = v->arch.hvm_vcpu.hw_cr[3];
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 05:12:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 05:12: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 1VbkYP-0007VV-4O; Thu, 31 Oct 2013 05:12:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkYN-0007VF-Gt
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:12:19 +0000
Received: from [85.158.139.211:56866] by server-15.bemta-5.messagelabs.com id
	C2/06-17574-2B6E1725; Thu, 31 Oct 2013 05:12:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1383196335!713775!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12264 invoked from network); 31 Oct 2013 05:12:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 05:12:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkYJ-0006K5-GB
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:12:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VbkYJ-00058R-Dc
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 05:12:15 +0000
Date: Thu, 31 Oct 2013 05:12:15 +0000
Message-Id: <E1VbkYJ-00058R-Dc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "VMX: Eliminate cr3 store/load
	vmexit when UG 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 1e2bf05ec37cf04b0e01585eae524509179f165e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 30 16:20:29 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 30 16:20:29 2013 +0100

    Revert "VMX: Eliminate cr3 store/load vmexit when UG enabled"
    
    This reverts commit c9efe34c119418a5ac776e5d91aeefcce4576518. It
    doesn't work right on non-UG hardware.
---
 xen/arch/x86/hvm/vmx/vmx.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 502caa3..9ca8632 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1086,7 +1086,7 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             uint32_t cr3_ctls = (CPU_BASED_CR3_LOAD_EXITING |
                                  CPU_BASED_CR3_STORE_EXITING);
             v->arch.hvm_vmx.exec_control &= ~cr3_ctls;
-            if ( !hvm_paging_enabled(v) && !vmx_unrestricted_guest(v) )
+            if ( !hvm_paging_enabled(v) )
                 v->arch.hvm_vmx.exec_control |= cr3_ctls;
 
             /* Trap CR3 updates if CR3 memory events are enabled. */
@@ -1156,7 +1156,7 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
     case 3:
         if ( paging_mode_hap(v->domain) )
         {
-            if ( !hvm_paging_enabled(v) && !vmx_unrestricted_guest(v) )
+            if ( !hvm_paging_enabled(v) )
                 v->arch.hvm_vcpu.hw_cr[3] =
                     v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT];
             vmx_load_pdptrs(v);
@@ -2408,7 +2408,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
     hvm_invalidate_regs_fields(regs);
 
-    if ( paging_mode_hap(v->domain) )
+    if ( paging_mode_hap(v->domain) && hvm_paging_enabled(v) )
     {
         __vmread(GUEST_CR3, &v->arch.hvm_vcpu.hw_cr[3]);
         v->arch.hvm_vcpu.guest_cr[3] = v->arch.hvm_vcpu.hw_cr[3];
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 06:22:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 06:22: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 1Vbldu-0008Ik-W4; Thu, 31 Oct 2013 06:22: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 1Vbldt-0008If-E6
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 06:22:05 +0000
Received: from [85.158.143.35:48746] by server-3.bemta-4.messagelabs.com id
	E7/B9-19578-C07F1725; Thu, 31 Oct 2013 06:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1383200523!1572624!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 486 invoked from network); 31 Oct 2013 06:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 06:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vbldq-00076A-Rn
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 06:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vbldq-00078J-HK
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 06:22:02 +0000
Date: Thu, 31 Oct 2013 06:22:02 +0000
Message-Id: <E1Vbldq-00078J-HK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] update Xen version to 4.3.1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4e8e0bdef96859e6f428af74be6f4a3bc7fd11f3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 30 09:18:28 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 30 09:18:28 2013 +0100

    update Xen version to 4.3.1
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1ca446e..e4f3424 100644
--- a/Config.mk
+++ b/Config.mk
@@ -212,7 +212,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.3-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.1-rc2
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.1
 SEABIOS_UPSTREAM_TAG ?= 3a28511b46f0c2af5fae1b6ed2b0c19d7913cee3
 # Wed Jun 26 16:30:45 2013 +0100
 # xen: Don't perform SMP setup.
@@ -224,7 +224,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.3.1-rc2
+QEMU_TAG ?= xen-4.3.1
 # Thu Jul 25 08:11:55 2013 +0000
 # passthrough: Correctly expose PCH ISA bridge for IGD passthrough
 
diff --git a/xen/Makefile b/xen/Makefile
index 5f698c8..c5ba629 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 3
-export XEN_EXTRAVERSION ?= .1-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Oct 31 06:22:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 31 Oct 2013 06:22: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 1Vbldu-0008Ik-W4; Thu, 31 Oct 2013 06:22: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 1Vbldt-0008If-E6
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 06:22:05 +0000
Received: from [85.158.143.35:48746] by server-3.bemta-4.messagelabs.com id
	E7/B9-19578-C07F1725; Thu, 31 Oct 2013 06:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1383200523!1572624!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.9.12; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 486 invoked from network); 31 Oct 2013 06:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Oct 2013 06:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vbldq-00076A-Rn
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 06:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vbldq-00078J-HK
	for xen-changelog@lists.xensource.com; Thu, 31 Oct 2013 06:22:02 +0000
Date: Thu, 31 Oct 2013 06:22:02 +0000
Message-Id: <E1Vbldq-00078J-HK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] update Xen version to 4.3.1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4e8e0bdef96859e6f428af74be6f4a3bc7fd11f3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 30 09:18:28 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 30 09:18:28 2013 +0100

    update Xen version to 4.3.1
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1ca446e..e4f3424 100644
--- a/Config.mk
+++ b/Config.mk
@@ -212,7 +212,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.3-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.1-rc2
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.3.1
 SEABIOS_UPSTREAM_TAG ?= 3a28511b46f0c2af5fae1b6ed2b0c19d7913cee3
 # Wed Jun 26 16:30:45 2013 +0100
 # xen: Don't perform SMP setup.
@@ -224,7 +224,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.3.1-rc2
+QEMU_TAG ?= xen-4.3.1
 # Thu Jul 25 08:11:55 2013 +0000
 # passthrough: Correctly expose PCH ISA bridge for IGD passthrough
 
diff --git a/xen/Makefile b/xen/Makefile
index 5f698c8..c5ba629 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 3
-export XEN_EXTRAVERSION ?= .1-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

